perf(lee): extend the caller set for the child authorization scope

This commit is contained in:
Artem Gureev
2026-08-17 17:29:56 +00:00
parent 49a8d00260
commit f83cf9b300
2 changed files with 11 additions and 16 deletions
@@ -492,11 +492,9 @@ impl ExecutionState {
post_states_entry.insert_entry(post.into_account());
}
caller
.authorized_accounts
.into_iter()
.chain(authorized_output_accounts)
.collect()
let mut authorized_accounts = caller.authorized_accounts;
authorized_accounts.extend(authorized_output_accounts);
authorized_accounts
}
/// Consume self and yield the validity windows, the per-position PDA seed/program map
@@ -264,17 +264,14 @@ impl ValidatedStateDiff {
// Union with the caller's authorized set so that authorization is monotonically
// growing: once an account is authorized at any point in the chain it remains
// authorized for all subsequent calls.
let authorized_accounts: HashSet<_> = caller_data
.authorized_accounts
.into_iter()
.chain(
program_output
.pre_states
.iter()
.filter(|pre| pre.is_authorized)
.map(|pre| pre.account_id),
)
.collect();
let mut authorized_accounts = caller_data.authorized_accounts;
authorized_accounts.extend(
program_output
.pre_states
.iter()
.filter(|pre| pre.is_authorized)
.map(|pre| pre.account_id),
);
for new_call in program_output.chained_calls.into_iter().rev() {
chained_calls.push_front((
new_call,