chore!: Populate the headers field in the ExecutionWitness when calling debug_executionWitness (#15608)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
kevaundray
2025-04-11 08:49:45 +01:00
committed by GitHub
parent 58fe204ff2
commit 33ddc2861b
3 changed files with 53 additions and 6 deletions

View File

@@ -19,6 +19,14 @@ pub struct ExecutionWitnessRecord {
///
/// `keccak(address|slot) => address|slot`
pub keys: Vec<Bytes>,
/// The lowest block number referenced by any BLOCKHASH opcode call during transaction
/// execution.
///
/// This helps determine which ancestor block headers must be included in the
/// `ExecutionWitness`.
///
/// `None` - when the BLOCKHASH opcode was not called during execution
pub lowest_block_number: Option<u64>,
}
impl ExecutionWitnessRecord {
@@ -62,6 +70,8 @@ impl ExecutionWitnessRecord {
}
}
}
// BTreeMap keys are ordered, so the first key is the smallest
self.lowest_block_number = statedb.block_hashes.keys().next().copied()
}
/// Creates the record from the state after execution.