Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

- Optimize storage layer for block execution by reducing lock contention and allocations [#6207](https://github.com/lambdaclass/ethrex/pull/6207)

### 2026-02-11

- Replace BTreeMap/BTreeSet with FxHashMap/FxHashSet for EVM accessed storage slots [#6185](https://github.com/lambdaclass/ethrex/pull/6185)
Comment thread
iovoid marked this conversation as resolved.

### 2026-02-06

- Defer KZG blob proof verification from P2P to mempool insertion [#6150](https://github.com/lambdaclass/ethrex/pull/6150)
Expand Down
4 changes: 2 additions & 2 deletions crates/vm/levm/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ impl Substate {
/// Returns all accessed storage slots for a given address.
/// Used by SELFDESTRUCT to record storage reads in BAL per EIP-7928:
/// "SELFDESTRUCT: Include modified/read storage keys as storage_read"
pub fn get_accessed_storage_slots(&self, address: &Address) -> BTreeSet<H256> {
let mut slots = BTreeSet::new();
pub fn get_accessed_storage_slots(&self, address: &Address) -> FxHashSet<H256> {
let mut slots = FxHashSet::default();
Comment on lines 266 to +270
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return type change breaks callers

get_accessed_storage_slots now returns FxHashSet<H256> (was BTreeSet<H256>). Any caller that relied on deterministic ordering (common for receipts/tracing/encoding) will now see non-deterministic iteration order. If the result is later serialized/hashed/compared, this can cause flaky tests or consensus-sensitive differences. Consider either keeping the public API ordered (return BTreeSet/sorted Vec) or sorting at the call site(s) where determinism is required.

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/vm/levm/src/vm.rs
Line: 252:256

Comment:
**Return type change breaks callers**

`get_accessed_storage_slots` now returns `FxHashSet<H256>` (was `BTreeSet<H256>`). Any caller that relied on deterministic ordering (common for receipts/tracing/encoding) will now see non-deterministic iteration order. If the result is later serialized/hashed/compared, this can cause flaky tests or consensus-sensitive differences. Consider either keeping the public API ordered (return `BTreeSet`/sorted `Vec`) or sorting at the call site(s) where determinism is required.

How can I resolve this? If you propose a fix, please make it concise.


// Collect from current substate
if let Some(slot_set) = self.accessed_storage_slots.get(address) {
Expand Down