From 066491f8d5f5f2fa20bd6025fa10652be5c30349 Mon Sep 17 00:00:00 2001 From: Manik Jain Date: Wed, 17 Sep 2025 16:28:29 +0000 Subject: [PATCH] instr: add logs to effects --- src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 83f428d17..ef29b858f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -484,6 +484,7 @@ pub struct InstrEffects { pub modified_accounts: Vec<(Pubkey, Account)>, pub cu_avail: u64, pub return_data: Vec, + pub log: Vec, } impl From for proto::InstrEffects { @@ -509,6 +510,7 @@ impl From for proto::InstrEffects { .collect(), cu_avail: val.cu_avail, return_data: val.return_data, + log: val.log, } } } @@ -941,6 +943,13 @@ fn execute_instr(mut input: InstrContext) -> Option { .process_instruction(&mut compute_units_consumed, &mut ExecuteTimings::default()) }; + let log = invoke_context + .get_log_collector()? + .borrow() + .get_recorded_content() + .join("\n") + .into_bytes(); + #[cfg(feature = "core-bpf-conformance")] // To keep alignment with a builtin run, deduct only the CUs the builtin // version would have consumed, so the fixture realizes the same CU @@ -1073,6 +1082,7 @@ fn execute_instr(mut input: InstrContext) -> Option { .collect(), cu_avail, return_data, + log, }) }