Skip to content

Instantly share code, notes, and snippets.

@jwasinger
jwasinger / Makefile
Created December 1, 2025 22:11
Configuration for reproducing Geth/Besu chainsplit with local bal devnet
ENCLAVE_NAME := bals
ETHEREUM_PACKAGE := github.com/ethpandaops/ethereum-package
CONFIG_FILE := kurtosis.config
.PHONY: run
run:
kurtosis run $(ETHEREUM_PACKAGE) --enclave $(ENCLAVE_NAME) --args-file ./$(CONFIG_FILE).local.yaml --image-download always
.PHONY: run-registry
run-registry:
@jwasinger
jwasinger / bal-block-processing-breakdown.csv
Created August 25, 2025 11:41
Geth Benchmarks (BAL and master)
Time commit account hash account commit storage commit snapshot commit triedb commit block preprocessing block execution block post-processing state-root calculation block preprocessing state loading block preprocessing state diff
2025-08-21 21:44:18
2025-08-21 21:44:20
2025-08-21 21:44:22
2025-08-21 21:44:24
2025-08-21 21:44:26
2025-08-21 21:44:28
2025-08-21 21:44:30
2025-08-21 21:44:32
2025-08-21 21:44:34
@jwasinger
jwasinger / instructions.md
Last active September 23, 2025 06:10
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).

## Geth (bal branch, not executing BALs)
```
INFO [07-31|07:08:46.778] Imported new chain segment number=20,253,256 hash=b67837..f8c2f4 blocks=0 txs=2834 mgas=301.171 elapsed=8.789s mgasps=34.266 age=1y4w23h triediffs=31.98MiB triedirty=0.00B
INFO [07-31|07:08:54.829] Imported new chain segment number=20,253,279 hash=3e8cc0..68fd55 blocks=0 txs=3263 mgas=352.028 elapsed=8.050s mgasps=43.728 age=1y4w23h triediffs=71.16MiB triedirty=0.00B
INFO [07-31|07:09:03.322] Imported new chain segment number=20,253,325 hash=880503..fca55b blocks=0 txs=6893 mgas=687.291 elapsed=8.492s mgasps=80.925 age=1y4w23h triediffs=144.46MiB triedirty=0.00B
INFO [07-31|07:09:12.011] Imported new chain segment number=20,253,355 hash=720f93..538282 blocks=0 txs=4120 mgas=472.091 elapsed=8.689s mgasps=54.331 age=1y4w22h triediffs=193.63MiB triedirty=0.00B
INFO [07-31|07:09:20.037] Imported new chain segment number=20,253,392 hash=6e2558..1ecbcf blocks=0 txs=5
@jwasinger
jwasinger / modexp_upper_bounds.json
Last active June 3, 2025 16:42
modexp test case failure
./cmd/evm/evm statetest --run "tests/osaka/eip7823_modexp_upper_bounds/test_modexp_upper_bounds.py::test_modexp_upper_bounds.*max_length.*" --statetest.fork Osaka --trace ./fixtures/state_tests/osaka/eip7823_modexp_upper_bounds/modexp_upper_bounds/modexp_upper_bounds.json
{"pc":0,"op":54,"gas":"0xa812503","gasCost":"0x2","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"CALLDATASIZE"}
{"pc":1,"op":96,"gas":"0xa812501","gasCost":"0x3","memSize":0,"stack":["0xc60"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":3,"op":96,"gas":"0xa8124fe","gasCost":"0x3","memSize":0,"stack":["0xc60","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":5,"op":55,"gas":"0xa8124fb","gasCost":"0x268","memSize":0,"stack":["0xc60","0x0","0x0"],"depth":1,"refund":0,"opName":"CALLDATACOPY"}
{"pc":6,"op":96,"gas":"0xa812293","gasCost":"0x3","memSize":3168,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":8,"op":96,"gas":"0xa812290","gasCost":"0x3","memSize":3168,"stack":["0x0"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":10,"op
### Keybase proof
I hereby claim:
* I am jwasinger on github.
* I am jwasingeralt (https://keybase.io/jwasingeralt) on keybase.
* I have a public key ASCuN_81BhrkVZYeAKmnBtFSPUyg15GigM4v5USQ62zC7go
To claim this, I am signing this object:
{
"config": {
"chainId": 1337,
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
@jwasinger
jwasinger / benchmark-output.txt
Last active December 9, 2024 14:47
EIP-2537 Geth Repricing Performance
goos: darwin
goarch: arm64
pkg: github.com/ethereum/go-ethereum/core/vm
BenchmarkPrecompiledBLS12381G1Add/matter_g1_add_0-Gas=375 399669 3024 ns/op 375.0 gas/op 124.0 mgas/s 320 B/op 3 allocs/op
BenchmarkPrecompiledBLS12381G1Add/matter_g1_add_1-Gas=375 391653 3003 ns/op 375.0 gas/op 124.8 mgas/s 320 B/op 3 allocs/op
BenchmarkPrecompiledBLS12381G1Add/matter_g1_add_2-Gas=375 400021 3063 ns/op 375.0 gas/op 122.4 mgas/s 320 B/op 3 allocs/op
BenchmarkPrecompiledBLS12381G1Add/matter_g1_add_3-Gas=375 392281 3046 ns/op 375.0 gas/op 123.1 mgas/s 320 B/op 3 allocs/op
BenchmarkPrecompiledBLS12381G1Mul/matter_g1_mul_0-Gas=12000 9206 125033 ns/op 12000 gas/op 95.97 mgas/s 1088 B/op 14 allocs/op
BenchmarkPrecompiledBLS12381G1Mul/matter_g1_mul_1-Gas=12000 9118 125131 ns/op 12000 gas/op 95.8
@jwasinger
jwasinger / explainer.md
Last active December 2, 2024 08:42
V2 Leaner API

We had some methods to call/transact:

// Transact creates and submits a transaction to the bound contract instance
// using the provided abi-encoded input (or nil).
func Transact(instance *ContractInstance, opts *bind.TransactOpts, input []byte) (*types.Transaction, error) {
	var (
		addr    = instance.Address
		backend = instance.Backend
	)
goroutine 5495 [chan send, 1471 minutes]:
github.com/ethereum/go-ethereum/core/state.(*subfetcher).schedule(0xc045913b00, {0xc0113d7ab0, 0x1, 0x40?})
github.com/ethereum/go-ethereum/core/state/trie_prefetcher.go:243 +0x17d
github.com/ethereum/go-ethereum/core/state.(*triePrefetcher).prefetch(0xc00f26edd0, {0xab, 0x14, 0xd6, 0x88, 0x2, 0xa7, 0x63, 0xf7, 0xdb, ...}, ...)
github.com/ethereum/go-ethereum/core/state/trie_prefetcher.go:148 +0x29c
github.com/ethereum/go-ethereum/core/state.(*stateObject).GetCommittedState(0xc0158a3420, {0x9, 0xe8, 0xfb, 0x6, 0x58, 0x45, 0x2e, 0xee, 0xdd, ...})
github.com/ethereum/go-ethereum/core/state/state_object.go:209 +0x49c
github.com/ethereum/go-ethereum/core/state.(*stateObject).GetState(...)
github.com/ethereum/go-ethereum/core/state/state_object.go:166
github.com/ethereum/go-ethereum/core/state.(*StateDB).GetState(0xc0113d7cb8?, {0xda, 0xc1, 0x7f, 0x95, 0x8d, 0x2e, 0xe5, 0x23, 0xa2, ...}, ...)