Skip to content

Conversation

@rakita
Copy link
Member

@rakita rakita commented Oct 9, 2025

Implementation of EIP-7928

This breaks the EvmState serde as it introduces an additional field for Account an original_info. Original info is used to calculate BAL. Discussion pending, maybe it is fine, but adding custom serde serialisation could work here.

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 9, 2025

CodSpeed Performance Report

Merging #3070 will degrade performances by 4.09%

Comparing rakita/bal (fbcb862) with main (b397fd1)

Summary

⚡ 2 improvements
❌ 5 regressions
✅ 166 untouched

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
CALL_50 109 µs 105.4 µs +3.36%
CREATE_50 424.8 µs 441.4 µs -3.76%
DELEGATECALL_50 101 µs 97.2 µs +3.97%
transact_1000tx_commit_inner_every_40 3 ms 3.1 ms -4.09%
transfer_finalize 18.1 µs 18.8 µs -3.7%
EXTCODESIZE_50 45 µs 46.9 µs -4%
EXTCODEHASH_50 45.4 µs 47.2 µs -3.74%

@rakita rakita changed the title WIP BAL WIP BAL EIP-7928 Oct 9, 2025
@rakita rakita force-pushed the rakita/bal branch 2 times, most recently from 8317dff to a2d66df Compare October 16, 2025 20:30
* fix: bal binary search cases

* nit(test): generalize BAL binary search test for any threshold

* code cleanup

---------

Co-authored-by: rakita <dragan0rakita@gmail.com>
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

unsure why this integrating bal support on the State type requires changes to the trait.

this now also has a bunch of additional overhead I think, hence the degraded codspeed values
and we wont get this any time soon.

the bal type conversion could be a bit costly, to fully remove this I think we'd also need encode+decode support on this bal type?

how do we validate the bal for execution only without also having to build it?

@rakita rakita requested review from klkvr and mattsse December 16, 2025 19:52
@rakita rakita dismissed mattsse’s stale review December 18, 2025 10:16

Had a call to discuss usage of storage_id and perf was worked on and improved in few last commits

@rakita
Copy link
Member Author

rakita commented Dec 18, 2025

CI fail on test stable is CI problem, it passed for nightly variant.

@rakita rakita merged commit 2306559 into main Dec 18, 2025
29 of 31 checks passed
@rakita rakita deleted the rakita/bal branch December 18, 2025 10:35
@github-actions github-actions bot mentioned this pull request Dec 18, 2025
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 21, 2026
* BAL

* WIP

* bal wip

* bal followup

* Database::bal and Bal IndexMap for accounts

* bal builder and integration with databases

* chore: bump eest tests v5.3.0

* bump bal for caller/beneficiary

* bal builder from state on commit, alloy included

* cleanup

* bal integration in btests

* wip sys call

* fix few bugs, propagate error

* remove bal panic from btest

* error handling

* cleanup bal tests

* skip touching beneficiary if reward is 0

* handle local selfdestruct

* feat: dont load access list immediatly

* nits fmt

* bump output as accounts now have original account info

* BalDatabase

* nit, rm clone

* bump tests, add missing imports, cleanup

* reause indexmap from alloy with default hasher

* typos

* add missing serde propagation

* dont skip test

* Create BalState and add it inside State so that we dont need to use BalDatabase

* nits, and deserialization for Account without original info

* propagate feature

* fix: add bal_builder.commit to state, small cleanup

* fix: bal binary search cases (bluealloy/revm#3139)

* fix: bal binary search cases

* nit(test): generalize BAL binary search test for any threshold

* code cleanup

---------

Co-authored-by: rakita <dragan0rakita@gmail.com>

* compile tests

* Rename BalDatabaseError to EvmDatabaseError

* throw error if bal exist but account/storage not

* rename storage_id to account_id

* rm println

* use alloy main, clippy/typo fixes

* ark the bytecode

* typo

* add statis default for Bytecode

* use oncelock

* try with oncelock

* box original acc info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants