Skip to content

Commit 1bec947

Browse files
yoavGrsclaude
andauthored
blockifier: add CallInfo::get_visited_contract_addresses (#14101)
Mirrors the Python state-selector walk that drives the OS contracts-trie input set. Yields the call's own storage_address, its code_address when set (delegate-style calls), and the contents of storage_access_tracker.accessed_contract_addresses. No new field is added — the data is derived from existing CallEntryPoint and StorageAccessTracker fields. Inner calls are not traversed by this method — use CallInfo::iter to walk the tree. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ec3cbda commit 1bec947

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

crates/blockifier/src/execution/call_info.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,17 @@ impl CallInfo {
585585
.map(move |key| (storage_address, *key))
586586
}
587587

588+
/// Contract addresses whose contracts-trie leaf the OS needs to replay this call: the call's
589+
/// own `storage_address` (always read at dispatch), the `code_address` of delegate-style calls
590+
/// when set (covers the deprecated `delegate_call` target), and any address queried via
591+
/// `get_class_hash_at` (mirrored by `storage_access_tracker.accessed_contract_addresses`).
592+
/// Inner calls are not traversed — use `CallInfo::iter` to walk the tree.
593+
pub fn get_visited_contract_addresses(&self) -> impl Iterator<Item = ContractAddress> + '_ {
594+
std::iter::once(self.call.storage_address)
595+
.chain(self.call.code_address)
596+
.chain(self.storage_access_tracker.accessed_contract_addresses.iter().copied())
597+
}
598+
588599
/// Returns a vector of Starknet Event objects collected during the execution, sorted by the
589600
/// order in which they were emitted.
590601
pub fn get_sorted_events(&self) -> Vec<Event> {

0 commit comments

Comments
 (0)