diff --git a/artifacts/lee/privacy_preserving_circuit/privacy_preserving_circuit.bin b/artifacts/lee/privacy_preserving_circuit/privacy_preserving_circuit.bin index bdb7c684b..2614be0e3 100644 Binary files a/artifacts/lee/privacy_preserving_circuit/privacy_preserving_circuit.bin and b/artifacts/lee/privacy_preserving_circuit/privacy_preserving_circuit.bin differ diff --git a/artifacts/lez/programs/amm.bin b/artifacts/lez/programs/amm.bin index 5908e7e35..6cbdc8c68 100644 Binary files a/artifacts/lez/programs/amm.bin and b/artifacts/lez/programs/amm.bin differ diff --git a/artifacts/lez/programs/associated_token_account.bin b/artifacts/lez/programs/associated_token_account.bin index 27ce81da7..e576bc7a3 100644 Binary files a/artifacts/lez/programs/associated_token_account.bin and b/artifacts/lez/programs/associated_token_account.bin differ diff --git a/artifacts/lez/programs/authenticated_transfer.bin b/artifacts/lez/programs/authenticated_transfer.bin index b203abed2..40ced1907 100644 Binary files a/artifacts/lez/programs/authenticated_transfer.bin and b/artifacts/lez/programs/authenticated_transfer.bin differ diff --git a/artifacts/lez/programs/bridge.bin b/artifacts/lez/programs/bridge.bin index 8740f78c9..2ddb3dd3b 100644 Binary files a/artifacts/lez/programs/bridge.bin and b/artifacts/lez/programs/bridge.bin differ diff --git a/artifacts/lez/programs/bridge_lock.bin b/artifacts/lez/programs/bridge_lock.bin index 6639f16b3..effe92f68 100644 Binary files a/artifacts/lez/programs/bridge_lock.bin and b/artifacts/lez/programs/bridge_lock.bin differ diff --git a/artifacts/lez/programs/clock.bin b/artifacts/lez/programs/clock.bin index 59d14a880..58e64b6d3 100644 Binary files a/artifacts/lez/programs/clock.bin and b/artifacts/lez/programs/clock.bin differ diff --git a/artifacts/lez/programs/cross_zone_inbox.bin b/artifacts/lez/programs/cross_zone_inbox.bin index 343a18bc5..4d7b97a41 100644 Binary files a/artifacts/lez/programs/cross_zone_inbox.bin and b/artifacts/lez/programs/cross_zone_inbox.bin differ diff --git a/artifacts/lez/programs/cross_zone_outbox.bin b/artifacts/lez/programs/cross_zone_outbox.bin index 95e647aac..a3fd9f2db 100644 Binary files a/artifacts/lez/programs/cross_zone_outbox.bin and b/artifacts/lez/programs/cross_zone_outbox.bin differ diff --git a/artifacts/lez/programs/faucet.bin b/artifacts/lez/programs/faucet.bin index cbe6c3100..e7194b8d3 100644 Binary files a/artifacts/lez/programs/faucet.bin and b/artifacts/lez/programs/faucet.bin differ diff --git a/artifacts/lez/programs/pinata.bin b/artifacts/lez/programs/pinata.bin index 6850d7532..ce25ce22f 100644 Binary files a/artifacts/lez/programs/pinata.bin and b/artifacts/lez/programs/pinata.bin differ diff --git a/artifacts/lez/programs/pinata_token.bin b/artifacts/lez/programs/pinata_token.bin index 62d1fe279..1730a32c2 100644 Binary files a/artifacts/lez/programs/pinata_token.bin and b/artifacts/lez/programs/pinata_token.bin differ diff --git a/artifacts/lez/programs/ping_receiver.bin b/artifacts/lez/programs/ping_receiver.bin index 60b71e942..6f7a169cc 100644 Binary files a/artifacts/lez/programs/ping_receiver.bin and b/artifacts/lez/programs/ping_receiver.bin differ diff --git a/artifacts/lez/programs/ping_sender.bin b/artifacts/lez/programs/ping_sender.bin index 6a75873ac..6560b736d 100644 Binary files a/artifacts/lez/programs/ping_sender.bin and b/artifacts/lez/programs/ping_sender.bin differ diff --git a/artifacts/lez/programs/sequencer_stake.bin b/artifacts/lez/programs/sequencer_stake.bin index 314e927b0..7a213c845 100644 Binary files a/artifacts/lez/programs/sequencer_stake.bin and b/artifacts/lez/programs/sequencer_stake.bin differ diff --git a/artifacts/lez/programs/token.bin b/artifacts/lez/programs/token.bin index d5205c4c0..d46f3c8b0 100644 Binary files a/artifacts/lez/programs/token.bin and b/artifacts/lez/programs/token.bin differ diff --git a/artifacts/lez/programs/vault.bin b/artifacts/lez/programs/vault.bin index a1bd960f5..e2b77a09d 100644 Binary files a/artifacts/lez/programs/vault.bin and b/artifacts/lez/programs/vault.bin differ diff --git a/artifacts/lez/programs/wrapped_token.bin b/artifacts/lez/programs/wrapped_token.bin index 4bad6b150..0a14583ee 100644 Binary files a/artifacts/lez/programs/wrapped_token.bin and b/artifacts/lez/programs/wrapped_token.bin differ diff --git a/lee/state_machine/core/src/circuit_io.rs b/lee/state_machine/core/src/circuit_io.rs index f26dff475..f620b8f48 100644 --- a/lee/state_machine/core/src/circuit_io.rs +++ b/lee/state_machine/core/src/circuit_io.rs @@ -270,9 +270,10 @@ mod tests { timestamp_validity_window: TimestampValidityWindow::new_unbounded(), }; let bytes = output.to_bytes(); - let decoded: PrivacyPreservingCircuitOutput = - borsh::from_slice(crate::from_frame(&bytes).expect("self-produced frame is well-formed")) - .unwrap(); + let decoded: PrivacyPreservingCircuitOutput = borsh::from_slice( + crate::from_frame(&bytes).expect("self-produced frame is well-formed"), + ) + .unwrap(); assert_eq!(output, decoded); } } diff --git a/lee/state_machine/src/privacy_preserving_transaction/circuit/mod.rs b/lee/state_machine/src/privacy_preserving_transaction/circuit/mod.rs index 3a446d545..31fbcce94 100644 --- a/lee/state_machine/src/privacy_preserving_transaction/circuit/mod.rs +++ b/lee/state_machine/src/privacy_preserving_transaction/circuit/mod.rs @@ -117,14 +117,13 @@ pub fn execute_and_prove_with_padded_inputs( &chained_call.instruction_data, )?; - let program_output: ProgramOutput = borsh::from_slice( - from_frame(&inner_receipt.journal.bytes).ok_or_else(|| { + let program_output: ProgramOutput = + borsh::from_slice(from_frame(&inner_receipt.journal.bytes).ok_or_else(|| { LeeError::ProgramOutputDeserializationError( "malformed inner-receipt journal frame".to_owned(), ) - })?, - ) - .map_err(|e| LeeError::ProgramOutputDeserializationError(e.to_string()))?; + })?) + .map_err(|e| LeeError::ProgramOutputDeserializationError(e.to_string()))?; // TODO: remove clone program_outputs.push(program_output.clone()); diff --git a/lee/state_machine/src/program/mod.rs b/lee/state_machine/src/program/mod.rs index d34c6e724..4e13c96ee 100644 --- a/lee/state_machine/src/program/mod.rs +++ b/lee/state_machine/src/program/mod.rs @@ -81,8 +81,8 @@ impl Program { let framed = from_frame(&session_info.journal.bytes).ok_or_else(|| { LeeError::ProgramExecutionFailed("malformed program journal frame".to_owned()) })?; - let program_output = - borsh::from_slice(framed).map_err(|e| LeeError::ProgramExecutionFailed(e.to_string()))?; + let program_output = borsh::from_slice(framed) + .map_err(|e| LeeError::ProgramExecutionFailed(e.to_string()))?; Ok(program_output) } diff --git a/lee/state_machine/test_methods/guest/src/bin/chain_caller.rs b/lee/state_machine/test_methods/guest/src/bin/chain_caller.rs index 9bc5b4cbf..d3d3f0661 100644 --- a/lee/state_machine/test_methods/guest/src/bin/chain_caller.rs +++ b/lee/state_machine/test_methods/guest/src/bin/chain_caller.rs @@ -1,7 +1,7 @@ +use borsh::to_vec; use lee_core::program::{ AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }; -use borsh::to_vec; type Instruction = (u128, ProgramId, u32, Option); diff --git a/lee/state_machine/test_methods/guest/src/bin/flash_swap_callback.rs b/lee/state_machine/test_methods/guest/src/bin/flash_swap_callback.rs index 94fcf9d37..3f0df10f6 100644 --- a/lee/state_machine/test_methods/guest/src/bin/flash_swap_callback.rs +++ b/lee/state_machine/test_methods/guest/src/bin/flash_swap_callback.rs @@ -61,8 +61,8 @@ fn main() { // Mark the receiver as authorized since it will be PDA-authorized in this chained call. let mut receiver_authorized = receiver_pre.clone(); receiver_authorized.is_authorized = true; - let transfer_instruction = borsh::to_vec(&instruction.amount) - .expect("transfer instruction serialization"); + let transfer_instruction = + borsh::to_vec(&instruction.amount).expect("transfer instruction serialization"); chained_calls.push(ChainedCall { program_id: instruction.token_program_id, diff --git a/lee/state_machine/test_methods/guest/src/bin/flash_swap_initiator.rs b/lee/state_machine/test_methods/guest/src/bin/flash_swap_initiator.rs index 242ae116c..01d6e2117 100644 --- a/lee/state_machine/test_methods/guest/src/bin/flash_swap_initiator.rs +++ b/lee/state_machine/test_methods/guest/src/bin/flash_swap_initiator.rs @@ -146,10 +146,8 @@ fn main() { // min_vault_balance and this call will panic, rolling back the entire // transaction. let invariant_instruction = - borsh::to_vec(&FlashSwapInstruction::InvariantCheck { - min_vault_balance, - }) - .expect("invariant instruction serialization"); + borsh::to_vec(&FlashSwapInstruction::InvariantCheck { min_vault_balance }) + .expect("invariant instruction serialization"); let call_3 = ChainedCall { program_id: self_program_id, // self-referential chained call pre_states: vec![vault_after_callback], diff --git a/lee/state_machine/test_methods/guest/src/bin/malicious_authorization_changer.rs b/lee/state_machine/test_methods/guest/src/bin/malicious_authorization_changer.rs index 420a2cbf1..3d26dfa89 100644 --- a/lee/state_machine/test_methods/guest/src/bin/malicious_authorization_changer.rs +++ b/lee/state_machine/test_methods/guest/src/bin/malicious_authorization_changer.rs @@ -1,10 +1,10 @@ +use borsh::to_vec; use lee_core::{ account::AccountWithMetadata, program::{ AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }, }; -use borsh::to_vec; type Instruction = (u128, ProgramId); diff --git a/lee/state_machine/test_methods/guest/src/bin/malicious_injector.rs b/lee/state_machine/test_methods/guest/src/bin/malicious_injector.rs index 35bf692f6..e375a940c 100644 --- a/lee/state_machine/test_methods/guest/src/bin/malicious_injector.rs +++ b/lee/state_machine/test_methods/guest/src/bin/malicious_injector.rs @@ -85,8 +85,8 @@ fn main() { }; // Forward auth_transfer_id and amount to P2 so it can call authenticated_transfer. - let p2_instruction = borsh::to_vec(&(auth_transfer_id, amount)) - .expect("serialization is infallible"); + let p2_instruction = + borsh::to_vec(&(auth_transfer_id, amount)).expect("serialization is infallible"); ProgramOutput::new( self_program_id, diff --git a/lee/state_machine/test_methods/guest/src/bin/malicious_launderer.rs b/lee/state_machine/test_methods/guest/src/bin/malicious_launderer.rs index afc7824dc..c76b9a17a 100644 --- a/lee/state_machine/test_methods/guest/src/bin/malicious_launderer.rs +++ b/lee/state_machine/test_methods/guest/src/bin/malicious_launderer.rs @@ -22,8 +22,7 @@ fn main() { // chained_call.pre_states (this call's inputs, set by P1), which contains // victim(is_authorized=true). So authorized_accounts = {victim}, and the // subsequent check passes. - let auth_transfer_instruction = - borsh::to_vec(&amount).expect("serialization is infallible"); + let auth_transfer_instruction = borsh::to_vec(&amount).expect("serialization is infallible"); ProgramOutput::new( self_program_id, diff --git a/lee/state_machine/test_methods/guest/src/bin/pda_spend_proxy.rs b/lee/state_machine/test_methods/guest/src/bin/pda_spend_proxy.rs index 5f08cdf85..f47292848 100644 --- a/lee/state_machine/test_methods/guest/src/bin/pda_spend_proxy.rs +++ b/lee/state_machine/test_methods/guest/src/bin/pda_spend_proxy.rs @@ -1,7 +1,7 @@ +use borsh::to_vec; use lee_core::program::{ AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }; -use borsh::to_vec; /// Proxy for spending from a private PDA via `simple_transfer`. /// diff --git a/lee/state_machine/test_methods/guest/src/bin/private_pda_delegator.rs b/lee/state_machine/test_methods/guest/src/bin/private_pda_delegator.rs index 14028b402..652e02be7 100644 --- a/lee/state_machine/test_methods/guest/src/bin/private_pda_delegator.rs +++ b/lee/state_machine/test_methods/guest/src/bin/private_pda_delegator.rs @@ -1,8 +1,8 @@ +use borsh::to_vec; use lee_core::program::{ AccountPostState, ChainedCall, Claim, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }; -use borsh::to_vec; /// Claims the sole `pre_state` as a PDA with `claim_seed`, then chains to `callee_program_id` /// delegating authorization with `delegated_seed` in `pda_seeds`. When `claim_seed == diff --git a/lee/state_machine/test_methods/guest/src/bin/selective_pda_delegator.rs b/lee/state_machine/test_methods/guest/src/bin/selective_pda_delegator.rs index fb49b4cb6..289efcc8d 100644 --- a/lee/state_machine/test_methods/guest/src/bin/selective_pda_delegator.rs +++ b/lee/state_machine/test_methods/guest/src/bin/selective_pda_delegator.rs @@ -1,8 +1,8 @@ +use borsh::to_vec; use lee_core::program::{ AccountPostState, ChainedCall, Claim, InstructionData, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }; -use borsh::to_vec; type Instruction = ( PdaSeed, diff --git a/lee/state_machine/test_methods/guest/src/bin/undeclaring_pda_delegator.rs b/lee/state_machine/test_methods/guest/src/bin/undeclaring_pda_delegator.rs index 514f913fb..1137fb18e 100644 --- a/lee/state_machine/test_methods/guest/src/bin/undeclaring_pda_delegator.rs +++ b/lee/state_machine/test_methods/guest/src/bin/undeclaring_pda_delegator.rs @@ -1,7 +1,7 @@ +use borsh::to_vec; use lee_core::program::{ ChainedCall, InstructionData, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }; -use borsh::to_vec; type Instruction = ( Option, diff --git a/lee/state_machine/test_methods/guest/src/bin/validity_window_chain_caller.rs b/lee/state_machine/test_methods/guest/src/bin/validity_window_chain_caller.rs index 556184f3d..7bc2990dc 100644 --- a/lee/state_machine/test_methods/guest/src/bin/validity_window_chain_caller.rs +++ b/lee/state_machine/test_methods/guest/src/bin/validity_window_chain_caller.rs @@ -1,8 +1,8 @@ +use borsh::to_vec; use lee_core::program::{ AccountPostState, BlockValidityWindow, ChainedCall, ProgramId, ProgramInput, ProgramOutput, TimestampValidityWindow, read_lee_inputs, }; -use borsh::to_vec; /// A program that sets a block validity window on its output and chains to another program with a /// potentially different block validity window. diff --git a/lez/indexer/core/src/cross_zone_verifier.rs b/lez/indexer/core/src/cross_zone_verifier.rs index eab002893..d8f9a6898 100644 --- a/lez/indexer/core/src/cross_zone_verifier.rs +++ b/lez/indexer/core/src/cross_zone_verifier.rs @@ -802,9 +802,7 @@ impl CrossZoneVerifier { if public_tx.message().program_id != programs::cross_zone_inbox().id() { return None; } - match borsh::from_slice::( - &public_tx.message().instruction_data, - ) { + match borsh::from_slice::(&public_tx.message().instruction_data) { Ok(InboxInstruction::Dispatch(msg)) => Some(msg), // Only a dispatch carries a cross-zone message to re-derive; a genesis // `InitConfig` is not verifier-relevant. diff --git a/lez/programs/sequencer_stake/core/src/lib.rs b/lez/programs/sequencer_stake/core/src/lib.rs index a2cbe5f33..8fa3c638f 100644 --- a/lez/programs/sequencer_stake/core/src/lib.rs +++ b/lez/programs/sequencer_stake/core/src/lib.rs @@ -65,14 +65,7 @@ impl borsh::BorshDeserialize for SequencerKey { } } -#[derive( - Clone, - Debug, - PartialEq, - Eq, - borsh::BorshSerialize, - borsh::BorshDeserialize, -)] +#[derive(Clone, Debug, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)] pub enum Instruction { /// Locks `amount` into the ownership account for `sequencer_key`. First /// use claims the account; later calls top up the same account. diff --git a/lez/sequencer/core/src/lib.rs b/lez/sequencer/core/src/lib.rs index fb8291650..b870eaa6a 100644 --- a/lez/sequencer/core/src/lib.rs +++ b/lez/sequencer/core/src/lib.rs @@ -2194,9 +2194,7 @@ fn finalize_unstake_ownership_account(tx: &LeeTransaction) -> Option return None; } - match borsh::from_slice::( - &message.instruction_data, - ) { + match borsh::from_slice::(&message.instruction_data) { Ok(sequencer_stake_core::Instruction::FinalizeUnstake) => { message.account_ids.first().copied() } @@ -2275,9 +2273,7 @@ fn extract_cross_zone_dispatch(tx: &LeeTransaction) -> Option return None; } - match borsh::from_slice::( - &message.instruction_data, - ) { + match borsh::from_slice::(&message.instruction_data) { Ok(cross_zone_inbox_core::Instruction::Dispatch(msg)) => Some(msg), Ok(cross_zone_inbox_core::Instruction::InitConfig(_)) | Err(_) => None, } @@ -2384,8 +2380,7 @@ fn extract_bridge_deposit_id(tx: &LeeTransaction) -> Option { } let instruction = - borsh::from_slice::(&message.instruction_data) - .ok()?; + borsh::from_slice::(&message.instruction_data).ok()?; match instruction { bridge_core::Instruction::Deposit { @@ -2407,8 +2402,7 @@ fn extract_bridge_withdraw_data(tx: &LeeTransaction) -> Option { } let instruction = - borsh::from_slice::(&message.instruction_data) - .ok()?; + borsh::from_slice::(&message.instruction_data).ok()?; let bridge_core::Instruction::Withdraw { amount, diff --git a/test_fixtures/fixtures/prebuilt_sequencer_db.dump b/test_fixtures/fixtures/prebuilt_sequencer_db.dump index cd30b391d..b58dacfdf 100644 Binary files a/test_fixtures/fixtures/prebuilt_sequencer_db.dump and b/test_fixtures/fixtures/prebuilt_sequencer_db.dump differ diff --git a/test_programs/guest/src/bin/chain_caller.rs b/test_programs/guest/src/bin/chain_caller.rs index 65b0daf84..58992b944 100644 --- a/test_programs/guest/src/bin/chain_caller.rs +++ b/test_programs/guest/src/bin/chain_caller.rs @@ -1,8 +1,8 @@ use authenticated_transfer_core::Instruction as AuthTransferInstruction; +use borsh::to_vec; use lee_core::program::{ AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }; -use borsh::to_vec; type Instruction = (u128, ProgramId, u32, Option); diff --git a/test_programs/guest/src/bin/clock_chain_caller.rs b/test_programs/guest/src/bin/clock_chain_caller.rs index 322b05964..ec8bf2bce 100644 --- a/test_programs/guest/src/bin/clock_chain_caller.rs +++ b/test_programs/guest/src/bin/clock_chain_caller.rs @@ -1,10 +1,10 @@ +use borsh::to_vec; use lee_core::{ Timestamp, program::{ AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }, }; -use borsh::to_vec; type Instruction = (ProgramId, Timestamp); // (clock_program_id, timestamp) diff --git a/test_programs/guest/src/bin/faucet_chain_caller.rs b/test_programs/guest/src/bin/faucet_chain_caller.rs index 2366d02aa..74fa86495 100644 --- a/test_programs/guest/src/bin/faucet_chain_caller.rs +++ b/test_programs/guest/src/bin/faucet_chain_caller.rs @@ -1,10 +1,10 @@ +use borsh::to_vec; use lee_core::{ account::AccountId, program::{ AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }, }; -use borsh::to_vec; type Instruction = (ProgramId, ProgramId, AccountId, u128); // (faucet_program_id, vault_program_id, recipient_id, amount) diff --git a/test_programs/guest/src/bin/pda_spend_proxy.rs b/test_programs/guest/src/bin/pda_spend_proxy.rs index e494b5260..61eb7ec6e 100644 --- a/test_programs/guest/src/bin/pda_spend_proxy.rs +++ b/test_programs/guest/src/bin/pda_spend_proxy.rs @@ -1,7 +1,7 @@ +use borsh::to_vec; use lee_core::program::{ AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs, }; -use borsh::to_vec; /// Proxy for spending from a private PDA via `auth_transfer`. /// diff --git a/tools/cross_zone_chat/src/main.rs b/tools/cross_zone_chat/src/main.rs index 9cb47770d..d87dc09b2 100644 --- a/tools/cross_zone_chat/src/main.rs +++ b/tools/cross_zone_chat/src/main.rs @@ -534,7 +534,8 @@ fn decode_send_ordinal(instruction_data: &[u8]) -> Option { /// Decodes a `ping_receiver::Record` payload (borsh bytes) to text. fn decode_payload(payload: &[u8]) -> Option { - let instruction: ReceiverInstruction = borsh::from_slice::(payload).ok()?; + let instruction: ReceiverInstruction = + borsh::from_slice::(payload).ok()?; let ReceiverInstruction::Record { payload: bytes } = instruction else { return None; }; diff --git a/tools/cycle_bench/src/ppe/ppe_impl.rs b/tools/cycle_bench/src/ppe/ppe_impl.rs index 197aaee3e..a21e8186e 100644 --- a/tools/cycle_bench/src/ppe/ppe_impl.rs +++ b/tools/cycle_bench/src/ppe/ppe_impl.rs @@ -5,6 +5,7 @@ use std::{collections::HashMap, time::Instant}; +use borsh::to_vec; use lee::{ execute_and_prove, privacy_preserving_transaction::circuit::{ProgramWithDependencies, Proof}, @@ -13,7 +14,6 @@ use lee_core::{ InputAccountIdentity, PrivacyPreservingCircuitOutput, account::{Account, AccountId, AccountWithMetadata}, }; -use borsh::to_vec; use super::PpeBenchResult;