Skip to content

Conversation

@mattsse
Copy link
Collaborator

@mattsse mattsse commented Jan 21, 2026

Demonstrates EIP-7928 Block Access List usage:

  • Phase 1: Build BAL by executing transactions with with_bal_builder()
  • Phase 2: Use built BAL for re-execution with with_bal()

The example uses a simple counter contract to show how storage writes are captured and indexed by transaction in the BAL.

Example output

=== Block Access List (BAL) Example ===

--- Phase 1: Building BAL ---
  TX 1: Counter incremented (0 -> 1), gas used: 43126
         Returned value: 1
  TX 2: Counter incremented (1 -> 2), gas used: 26026
         Returned value: 2

  Built BAL with 3 accounts tracked

=== Block Access List (BAL) ===
...
  Storage:
    Total slots: 1
    Slot: 0x0
      Writes:
        [1] -> 1
        [2] -> 2
...

--- Phase 2: Re-executing with BAL ---
  TX 1 replayed with BAL, gas used: 43126
         Returned value: 1
  TX 2 replayed with BAL, gas used: 26026
         Returned value: 2

=== BAL Example Complete ===

Demonstrates EIP-7928 Block Access List usage:
- Phase 1: Build BAL by executing transactions with with_bal_builder()
- Phase 2: Use built BAL for re-execution with with_bal()

The example uses a simple counter contract to show how storage
writes are captured and indexed by transaction in the BAL.

Amp-Thread-ID: https://ampcode.com/threads/T-019be006-e325-74af-8ccb-51f1a1e3e93d
Co-authored-by: Amp <amp@ampcode.com>
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 21, 2026

Merging this PR will not alter performance

✅ 173 untouched benchmarks


Comparing mattsse:feat/bal-example (9d288d8) with main (26785fc)

Open in CodSpeed

Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

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

fmt pending

@mattsse mattsse merged commit 69083f1 into bluealloy:main Jan 21, 2026
31 checks passed
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.

2 participants