From c9510be3ef92373da7c9834146b6985f2df81f6a Mon Sep 17 00:00:00 2001 From: Marvin Jones Date: Fri, 14 Aug 2026 16:53:36 -0400 Subject: [PATCH] fix(lee): fix post-rebase fallout after rebasing onto marvin/program-as-account-3-1 chained_call_forwarder.rs and the deploy tests in sequencer_core were added on top of the pre-migration ProgramId-typed ChainedCall/Message/ ProgramInput/ProgramOutput API and didn't conflict during the rebase since they're new code, so they needed the same field rename/.into() treatment already applied everywhere else on -3-1. --- .../src/validated_state_diff/mod.rs | 6 ++---- lez/sequencer/core/src/tests.rs | 20 ++++++++++--------- .../guest/src/bin/chained_call_forwarder.rs | 10 +++++----- test_programs/src/lib.rs | 4 +++- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/lee/state_machine/src/validated_state_diff/mod.rs b/lee/state_machine/src/validated_state_diff/mod.rs index b1a6677ab..25d1dbf5a 100644 --- a/lee/state_machine/src/validated_state_diff/mod.rs +++ b/lee/state_machine/src/validated_state_diff/mod.rs @@ -158,10 +158,8 @@ impl ValidatedStateDiff { else { return Err(LeeError::InvalidInput("Unknown program".into())); }; - let program = Program::new_unchecked( - program_id, - Cow::Owned(program_account.data.to_vec()), - ); + let program = + Program::new_unchecked(program_id, Cow::Owned(program_account.data.to_vec())); program.execute( caller_data.caller_account_id, &chained_call.pre_states, diff --git a/lez/sequencer/core/src/tests.rs b/lez/sequencer/core/src/tests.rs index 30b6fe88a..ed7ff39ff 100644 --- a/lez/sequencer/core/src/tests.rs +++ b/lez/sequencer/core/src/tests.rs @@ -3669,7 +3669,7 @@ fn the_bootstrap_sequencer_can_request_an_unstake_of_its_genesis_stake() { fn deploy_transaction(target: AccountId, bytecode: Vec) -> PublicTransaction { let loader_id: ProgramId = RESERVED_DEPLOYMENT_PROGRAM_ACCOUNT_ID.into(); let message = lee::public_transaction::Message::try_new( - loader_id, + loader_id.into(), vec![target], vec![], loader_core::Instruction::Deploy { bytecode }, @@ -3778,7 +3778,7 @@ fn loader_rejects_wrong_number_of_accounts() { let extra = AccountId::new([9; 32]); let message = lee::public_transaction::Message::try_new( - loader_id, + loader_id.into(), vec![target, extra], vec![], loader_core::Instruction::Deploy { bytecode }, @@ -3812,15 +3812,14 @@ fn loader_deploys_program_via_chained_call() { let image_id: ProgramId = risc0_binfmt::compute_image_id(&bytecode).unwrap().into(); let target = loader_core::deploy_account_id(loader_id, image_id, 0, AccountId::default()); - let inner_instruction_data = lee::program::Program::serialize_instruction( - loader_core::Instruction::Deploy { + let inner_instruction_data = + lee::program::Program::serialize_instruction(loader_core::Instruction::Deploy { bytecode: bytecode.clone(), - }, - ) - .unwrap(); + }) + .unwrap(); let message = lee::public_transaction::Message::try_new( - forwarder.id(), + forwarder.id().into(), vec![target], vec![], (loader_id, inner_instruction_data), @@ -3834,7 +3833,10 @@ fn loader_deploys_program_via_chained_call() { .expect("Deploy via chained call should succeed"); let deployed = state.get_account_by_id(target); - assert_eq!(deployed.program_owner, RESERVED_DEPLOYMENT_PROGRAM_ACCOUNT_ID); + assert_eq!( + deployed.program_owner, + RESERVED_DEPLOYMENT_PROGRAM_ACCOUNT_ID + ); let program_data = loader_core::ProgramData::try_from(&deployed.data) .expect("deployed account data should decode as ProgramData"); diff --git a/test_programs/guest/src/bin/chained_call_forwarder.rs b/test_programs/guest/src/bin/chained_call_forwarder.rs index 23ceb8baf..b04fcf1ae 100644 --- a/test_programs/guest/src/bin/chained_call_forwarder.rs +++ b/test_programs/guest/src/bin/chained_call_forwarder.rs @@ -13,8 +13,8 @@ type Instruction = (ProgramId, Vec); fn main() { let ( ProgramInput { - self_program_id, - caller_program_id, + self_account_id, + caller_account_id, pre_states, instruction: (target_program_id, instruction_data), }, @@ -27,15 +27,15 @@ fn main() { .collect(); let chained_call = ChainedCall { - program_id: target_program_id, + program_account_id: target_program_id.into(), instruction_data, pre_states: pre_states.clone(), pda_seeds: vec![], }; ProgramOutput::new( - self_program_id, - caller_program_id, + self_account_id, + caller_account_id, instruction_words, pre_states, post_states, diff --git a/test_programs/src/lib.rs b/test_programs/src/lib.rs index b70557e74..6dc1a262a 100644 --- a/test_programs/src/lib.rs +++ b/test_programs/src/lib.rs @@ -69,7 +69,9 @@ pub const fn pda_spend_proxy() -> Program { #[must_use] #[inline] pub const fn chained_call_forwarder() -> Program { - use guests::{CHAINED_CALL_FORWARDER_ELF, CHAINED_CALL_FORWARDER_ID, CHAINED_CALL_FORWARDER_PATH}; + use guests::{ + CHAINED_CALL_FORWARDER_ELF, CHAINED_CALL_FORWARDER_ID, CHAINED_CALL_FORWARDER_PATH, + }; let _unused = CHAINED_CALL_FORWARDER_PATH;