Skip to content

Block access list changes - BAL construction, execution and validation #32263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

jwasinger
Copy link
Contributor

@jwasinger jwasinger commented Jul 23, 2025

WIP. currently passes blockchain spec tests (tests that make use of balances >16 bytes are excluded).

Change summary:

  • when --experimentalbal is enabled:
    • insertion of post-Cancun blocks which don't contain access lists will cause them to be created during block execution and embedded into the block body.
    • Insertion of post-cancun blocks that contain access lists will perform transaction execution and post-state root calculation in parallel using the state diffs provided in the access list. The state diffs produced by execution are validated against the entries in the BAL.
  • Introduced new modified blockchain suite test runner which first imports the test chain (generating BALs), and then re-inserts the access-list-containing blocks.

Deviations from EIP-7928:

  • Use RLP for the encoding format instead of SSZ.
  • Modify BAL format to accomodate pre/post-tx execution state changes:
    • entries with txindex=0 correspond to state reads/changes which occur from system contract execution before transactions.
    • entries with txindx=1..len(block.transactions) correspond to state reads/changes occurring for each transaction.
    • entries with txindex=len(block.transactions)+1 correspond to the post-block system contracts and EIP-4895 withdrawals.

TODO:

  • validation of BAL account/storage reads (it's somewhat likely that these will be removed from the spec, so I'm holding off for now).

@jwasinger
Copy link
Contributor Author

A lot of the comments in the code are straight-up wrong/misleading. There's a lot of notes/reminders I made as I was implementing this, and not all of them have been removed/corrected at this point.

@jwasinger
Copy link
Contributor Author

jwasinger commented Jul 29, 2025

I've pushed parallel execution changes here.

Still failing 2 tests (other than modexp repricing ones which will be fixed with a rebase on master):

--- FAIL: TestExecutionSpecBlocktestsBAL/prague/eip7251_consolidations/consolidations_during_fork/consolidation_requests_during_fork.json (0.03s)
        block_test.go:233: test with config {snapshotter:false, scheme:path} failed: mismatch between BAl value and computed value
    --- FAIL: TestExecutionSpecBlocktestsBAL/prague/eip7002_el_triggerable_withdrawals/withdrawal_requests_during_fork/withdrawal_requests_during_fork.json (0.02s)
        block_test.go:233: test with config {snapshotter:false, scheme:path} failed: mismatch between BAl value and computed value

I've been trying to debug these but it's proving to be exceedingly difficult with the parallel execution enabled. The tests seem to relate to behavior of some system contracts on the fork boundaries, so I will just proceed with gathering numbers on mainnet performance for the meantime.

…hen enabled, post-Cancun blocks which lack access lists will have them constructed on execution during import. When importing blocks which contain access lists, transaction execution and state root calculation is performed in parallel.
@jwasinger jwasinger marked this pull request as ready for review August 4, 2025 10:13
@jwasinger
Copy link
Contributor Author

INFO [08-04|13:21:15.227] Imported new chain segment number=23,051,616 hash=228379..13abd2 blocks=0 txs=10783 mgas=1137.280 elapsed=8.072s mgasps=140.878 age=2d6h46m triediffs=271.84MiB triedirty=112.48MiB

Broke the block count on the insertion log statement here. Will try to fix tomorrow.

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.

1 participant