Skip to content

execution/chain: remove TestChainConfig alias#20299

Merged
yperbasis merged 21 commits intomainfrom
yperbasis/TestChainConfig
Apr 8, 2026
Merged

execution/chain: remove TestChainConfig alias#20299
yperbasis merged 21 commits intomainfrom
yperbasis/TestChainConfig

Conversation

@yperbasis
Copy link
Copy Markdown
Member

Summary

  • Remove the TestChainConfig alias (which was just TestChainBerlinConfig)
  • Replace most references with AllProtocolChanges (the latest config with all protocol changes enabled)
  • Tests that rely on pre-London behavior (no EIP-1559 base fee) use TestChainBerlinConfig directly instead

Test plan

  • make erigon integration builds successfully
  • make lint passes
  • All affected test packages pass with -short

🤖 Generated with Claude Code

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>
@yperbasis yperbasis changed the title chain: remove TestChainConfig alias execution/chain: remove TestChainConfig alias Apr 2, 2026
@yperbasis yperbasis marked this pull request as ready for review April 2, 2026 20:45
@yperbasis yperbasis enabled auto-merge April 2, 2026 20:54
Copy link
Copy Markdown
Collaborator

@Giulio2002 Giulio2002 left a comment

Choose a reason for hiding this comment

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

LGTM — straightforward mechanical cleanup removing the TestChainConfig alias and updating tests/helpers to use the intended explicit configs.

info@weblogix.biz and others added 8 commits April 5, 2026 14:05
…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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 TestChainConfig alias and migrated call sites to AllProtocolChanges or TestChainBerlinConfig.
  • 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.

Comment thread execution/tracing/tracers/logger/logger2_test.go
Comment thread rpc/jsonrpc/eth_callMany_test.go
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>
yperbasis and others added 7 commits April 7, 2026 16:20
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>
@yperbasis yperbasis added this pull request to the merge queue Apr 7, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 7, 2026
@yperbasis
Copy link
Copy Markdown
Member Author

Race-test flakiness: TestExecutionSpecBlockchainDevnet/.../test_exact_coinbase_fee_simple_sstore

This test passed on the first CI run and failed on the third — the only code changes between runs were in blockchain_test.go and block_validator_test.go (completely separate packages from eest_devnet).

Failure: expects blockGasUsed=112704, gets 75136. Difference is exactly 37568 = 32 × 1174 — one SSTORE state gas charge under EIP-8037. The state gas dimension is not being counted.

Investigation: traced the full execution path — BlockGasUsed = max(BlockRegular, BlockState)BlockState only populated when rules.IsAmsterdam → rules computed once per block from config → config is testforks.Forks["Amsterdam"] with AmsterdamTime: 0. All code paths are deterministic and single-threaded per block execution. No shared mutable state found.

Conclusion: pre-existing flaky race-test, not caused by this PR.

@yperbasis yperbasis added this pull request to the merge queue Apr 8, 2026
Merged via the queue into main with commit 5fdb4a9 Apr 8, 2026
35 checks passed
@yperbasis yperbasis deleted the yperbasis/TestChainConfig branch April 8, 2026 07:52
awskii added a commit that referenced this pull request Apr 16, 2026
Fixes build failure in genesis-consolidation PR (#20441): commit_genesis_test.go
referenced chain.TestChainConfig which was removed in PR #20299. Using the
replacement alias AllProtocolChanges as recommended by PR #20299 itself.

This one-line change unblocks Ubuntu/macOS/Windows/Race/Bench CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants