refactor(lee): migrate ChainedCall/Message program reference from ProgramId to AccountId

Chained-call and public-transaction dispatch now address the target
program directly by AccountId instead of routing through ProgramId and
converting internally, closing the gap that blocked PDA-addressed
program invocation. The field is named program_account_id (not
account_id) to stay unambiguous next to the account_ids list it sits
beside in the same structs.

Execution/PDA-derivation logic that fundamentally needs the RISC0 image
id (self_program_id, caller_program_id, env::verify, PDA seed
derivation) stays ProgramId-typed, recovering it from the dispatched
AccountId via the existing bijection where needed.
This commit is contained in:
Marvin Jones
2026-08-22 16:58:27 -04:00
parent b9168967cc
commit b9152f58c0
80 changed files with 355 additions and 311 deletions
@@ -53,7 +53,8 @@ async fn main() {
// `run_hello_world_with_authorization` on how to use them.
let nonces = vec![];
let signing_keys = [];
let message = Message::try_new(program.id(), vec![account_id], nonces, greeting).unwrap();
let message =
Message::try_new(program.id().into(), vec![account_id], nonces, greeting).unwrap();
let witness_set = WitnessSet::for_message(&message, &signing_keys);
let tx = PublicTransaction::new(message, witness_set);
@@ -48,8 +48,13 @@ async fn main() {
let instruction_data = ();
let nonces = vec![];
let signing_keys = [];
let message =
Message::try_new(program.id(), vec![account_id], nonces, instruction_data).unwrap();
let message = Message::try_new(
program.id().into(),
vec![account_id],
nonces,
instruction_data,
)
.unwrap();
let witness_set = WitnessSet::for_message(&message, &signing_keys);
let tx = PublicTransaction::new(message, witness_set);
@@ -65,7 +65,8 @@ async fn main() {
.await
.expect("Node should be reachable to query account data");
let signing_keys = [&signing_key];
let message = Message::try_new(program.id(), vec![account_id], nonces, greeting).unwrap();
let message =
Message::try_new(program.id().into(), vec![account_id], nonces, greeting).unwrap();
// Pass the signing key to sign the message. This will be used by the node
// to flag the pre_state as `is_authorized` when executing the program
let witness_set = WitnessSet::for_message(&message, &signing_keys);
@@ -51,7 +51,8 @@ async fn main() {
let instruction_data = ();
let nonces = vec![];
let signing_keys = [];
let message = Message::try_new(program.id(), account_ids, nonces, instruction_data).unwrap();
let message =
Message::try_new(program.id().into(), account_ids, nonces, instruction_data).unwrap();
let witness_set = WitnessSet::for_message(&message, &signing_keys);
let tx = PublicTransaction::new(message, witness_set);
@@ -77,7 +77,7 @@ async fn main() {
let account_id = account_id.parse().unwrap();
let nonces = vec![];
let message = public_transaction::Message::try_new(
program.id(),
program.id().into(),
vec![account_id],
nonces,
instruction,
@@ -116,7 +116,7 @@ async fn main() {
let to = to.parse().unwrap();
let nonces = vec![];
let message = public_transaction::Message::try_new(
program.id(),
program.id().into(),
vec![from, to],
nonces,
instruction,