execution/chain: remove TestChainConfig alias#20299
Conversation
Remove the TestChainConfig alias (which pointed to TestChainBerlinConfig) and replace references with AllProtocolChanges where possible. Tests that rely on pre-London behavior (no EIP-1559 base fee) use TestChainBerlinConfig instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Giulio2002
left a comment
There was a problem hiding this comment.
LGTM — straightforward mechanical cleanup removing the TestChainConfig alias and updating tests/helpers to use the intended explicit configs.
…needed Several tests assumed pre-London (no EIP-1559 base fee) behavior. Switching them to AllProtocolChanges introduced base fee validation panics and gas price mismatches. Use TestChainBerlinConfig to preserve the original semantics. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR removes the chain.TestChainConfig alias and updates tests/utilities to explicitly use either chain.AllProtocolChanges (latest “all forks enabled” config) or chain.TestChainBerlinConfig for pre-London behavior.
Changes:
- Deleted the
TestChainConfigalias and migrated call sites toAllProtocolChangesorTestChainBerlinConfig. - Updated multiple unit tests/benchmarks/fuzz tests to run under the intended fork rules (post-forks vs pre-London).
- Adjusted several genesis/spec/test helper defaults to use explicit configs.
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| txnprovider/txpool/txpool_grpc_server_test.go | Use AllProtocolChanges when constructing the txpool in gRPC server tests. |
| txnprovider/txpool/pool_test.go | Switch txpool tests to AllProtocolChanges config. |
| txnprovider/txpool/pool_fuzz_test.go | Switch txpool fuzz tests to AllProtocolChanges config. |
| rpc/jsonrpc/receipts/handler_test.go | Use TestChainBerlinConfig for receipt tests requiring pre-London semantics. |
| rpc/jsonrpc/eth_system_test.go | Use TestChainBerlinConfig for gas price/system tests requiring pre-London semantics. |
| rpc/jsonrpc/eth_callMany_test.go | Update genesis config to AllProtocolChanges in eth_callMany tests. |
| rpc/jsonrpc/eth_call_test.go | Use TestChainBerlinConfig in call tests requiring pre-London behavior. |
| rpc/jsonrpc/erigon_receipts_test.go | Use TestChainBerlinConfig in receipts tests requiring pre-London behavior. |
| rpc/gasprice/gasprice_test.go | Mix of Berlin vs AllProtocolChanges updates for oracle tests and mock backend. |
| rpc/gasprice/bench_test.go | Benchmarks now use AllProtocolChanges. |
| execution/vm/instructions_test.go | EVM instruction tests now run under AllProtocolChanges. |
| execution/vm/gas_table_test.go | Use TestChainBerlinConfig in gas table tests that expect pre-London rules. |
| execution/types/block_test.go | Block tests now use LatestSigner(AllProtocolChanges). |
| execution/tracing/tracers/logger/logger2_test.go | Update (commented) example to refer to “AllProtocolChanges”. |
| execution/tracing/tracers/logger/logger_test.go | Logger tracer tests now use AllProtocolChanges. |
| execution/tracing/tracers/js/tracer_test.go | JS tracer tests now use AllProtocolChanges. |
| execution/tests/blockgen/chain_makers.go | Default nil config in chain generation now becomes AllProtocolChanges. |
| execution/tests/blockchain_test.go | Various execution tests now use explicit configs (mostly AllProtocolChanges, one Berlin). |
| execution/tests/block_validator_test.go | Header validation tests now use AllProtocolChanges. |
| execution/state/database_test.go | Use TestChainBerlinConfig where pre-London behavior is required. |
| execution/stagedsync/stage_senders_test.go | Stage senders tests now use AllProtocolChanges. |
| execution/protocol/misc/eip1559_test.go | EIP-1559 tests now derive from AllProtocolChanges. |
| execution/execmodule/moduleutil/grpc_test.go | Use LatestSigner(AllProtocolChanges) in grpc module util tests. |
| execution/execmodule/execmoduletester/exec_module_tester.go | Default tester config is now explicitly TestChainBerlinConfig (was alias). |
| execution/chain/spec/genesis.go | Test genesis now explicitly uses TestChainBerlinConfig. |
| execution/chain/spec/config.go | Test network spec now explicitly uses TestChainBerlinConfig. |
| execution/chain/chain_config.go | Remove the TestChainConfig alias. |
| execution/abi/bind/util_test.go | Bind util tests now use MakeSigner(AllProtocolChanges, ...). |
| execution/abi/bind/backends/simulated.go | Simulated backend now explicitly uses TestChainBerlinConfig (was alias). |
| execution/abi/bind/backends/simulated_test.go | Simulated backend tests updated to expect Berlin config explicitly. |
| db/snapshotsync/freezeblocks/dump_test.go | Dump tests now use AllProtocolChanges where applicable. |
| cmd/rpcdaemon/rpcdaemontest/test_util.go | rpcdaemon test utils now explicitly use TestChainBerlinConfig. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The test uses legacy transactions with zero fee cap, which panics with AllProtocolChanges because EIP-1559 enforces a base fee. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
NewSimulatedBackend was ignoring gspec.Config and hardcoding TestChainBerlinConfig. Use NewSimulatedBackendWithConfig so the backend's chain config matches the genesis spec. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The test explicitly references BerlinBlock, so using TestChainBerlinConfig is more consistent with the intent than AllProtocolChanges. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TestCallMany deploys contracts via the simulated backend which uses bind.NewKeyedTransactorWithChainID. With AllProtocolChanges, Cancun is active and buyGas dereferences a nil MaxFeePerBlobGas on non-blob txns. Use TestChainBerlinConfig and the default NewSimulatedBackend. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests that previously used TestChainConfig (alias for TestChainBerlinConfig) were incorrectly changed to AllProtocolChanges, which activates London/EIP-1559 and introduces a base fee of 875M wei. These tests create transactions with gas price 1, causing panics. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Same issue as previous commit — AllProtocolChanges enables Cancun which requires blob header fields that PoW block generation doesn't set. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Race-test flakiness:
|
Summary
TestChainConfigalias (which was justTestChainBerlinConfig)AllProtocolChanges(the latest config with all protocol changes enabled)TestChainBerlinConfigdirectly insteadTest plan
make erigon integrationbuilds successfullymake lintpasses-short🤖 Generated with Claude Code