Skip to content

Instantly share code, notes, and snippets.

@jwasinger
Last active September 23, 2025 06:10
Show Gist options
  • Select an option

  • Save jwasinger/d522fbdfaf4764a742028455a935d8c3 to your computer and use it in GitHub Desktop.

Select an option

Save jwasinger/d522fbdfaf4764a742028455a935d8c3 to your computer and use it in GitHub Desktop.
BAL Benchmarking Instructions

Geth Branch: https://github.com/jwasinger/go-ethereum/tree/bal-execution

  1. Download a post-Cancun state snapshot (https://ethpandaops.io/data/snapshots/) and unzip the snapshot into the directory where you will have your datadir.

  2. Full-sync as many blocks as you want, building the BALs for them (enable the --experimentalbal flag)

  3. Use geth export to extract the blocks (with BALs embedded).

  4. Reset the datadir back to the snapshot block (or just delete it, unpack the snapshot archive back to that target location).

  5. (Assuming you are on a cloud VM with a burstable disk) Set up to use a cgroup which will limit the IO throughput of geth:

# Create a new cgroup
sudo mkdir -p /sys/fs/cgroup/io_limit_group

# Set I/O limits (example: 9000 write operations per second)
echo "8:0 wiops=9000" | sudo tee /sys/fs/cgroup/io_limit_group/io.max
  1. Import the block range and collect metrics:
command_to_run="/path/to/go-ethereum/build/bin/geth \
        --datadir /path/to/your/datadir \
        --metrics \
        --metrics.influxdb \
        --metrics.influxdb.database=geth --metrics.influxdb.endpoint={{influxendpoint}} \
        --metrics.influxdb.username=geth --metrics.influxdb.password={{influxpassword}} \
        --metrics.influxdb.tags=host={{unique-host-name}} \
        --experimentalbal \
        import blocks_with_bals.rlp"

# Run the command with nohup, redirect output, run in background
nohup $command_to_run > import_output_bal.log 2>&1 &

# Capture the PID
pid=$!


# add pid to cgroup which will throttle the io reads to 9000 (prevent burstable disk from tainting the results)
echo $pid | sudo tee /sys/fs/cgroup/io_limit_group/cgroup.procs
@dajuguan
Copy link

dajuguan commented Sep 23, 2025

Nice summary! Actually, --experimentalbal isn’t required during full sync; it only needs to be enabled when running geth export, right? The following cmd is more clear?
geth --experimentalbal --datadir ./xx export blocks_with_bals.rlp start+1 end

@jwasinger
Copy link
Author

access lists are only constructed when a block is executed, whether that be via geth import or when the client is following the tip of the chain. Only enabling --experimentalbal for export wont't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment