mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-08-26 20:01:16 +00:00
fix(lee,lez): derive PDAs from AccountId instead of ProgramId
CallerData and the PDA derivation primitives keyed authorization off a program's image id (ProgramId), so two deployments of identical bytecode with different update_auth collided on the same PDA. Switch derivation, wire fields, and comparisons to the program's real dispatch AccountId throughout the host, guest, and test-harness code, including the privacy-circuit test harness's default dispatch address and the wrapped_token/ping_receiver governance-authorization check, which compared against the wrong address via the legacy bijection.
This commit is contained in:
@@ -9,6 +9,7 @@ workspace = true
|
||||
|
||||
[dependencies]
|
||||
lee_core.workspace = true
|
||||
program_loader_core.workspace = true
|
||||
|
||||
hex.workspace = true
|
||||
bytemuck.workspace = true
|
||||
|
||||
@@ -48,7 +48,9 @@ fn main() {
|
||||
let chained_call_greeting: Vec<u8> = b"Hello from tail call".to_vec();
|
||||
let chained_call_instruction_data = risc0_zkvm::serde::to_vec(&chained_call_greeting).unwrap();
|
||||
let chained_call = ChainedCall {
|
||||
program_account_id: hello_world_program_id().into(),
|
||||
program_account_id: program_loader_core::immutable_deploy_account_id(
|
||||
hello_world_program_id(),
|
||||
),
|
||||
instruction_data: chained_call_instruction_data,
|
||||
pre_states,
|
||||
pda_seeds: vec![],
|
||||
|
||||
@@ -60,7 +60,9 @@ fn main() {
|
||||
this
|
||||
};
|
||||
let chained_call = ChainedCall {
|
||||
program_account_id: hello_world_program_id().into(),
|
||||
program_account_id: program_loader_core::immutable_deploy_account_id(
|
||||
hello_world_program_id(),
|
||||
),
|
||||
instruction_data: chained_call_instruction_data,
|
||||
pre_states: vec![pre_state_for_chained_call],
|
||||
pda_seeds: vec![PDA_SEED],
|
||||
|
||||
Reference in New Issue
Block a user