Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Oct 8, 2026
gzliudan
requested review from
AnilChinchawale,
anunay-xin,
benjamin202410,
liam-lai and
wanwiset25
October 8, 2026 17:27
gzliudan
force-pushed
the
feat-amsterdam-fork-switch
branch
from
October 8, 2026 23:30
d87657e to
6ccfa44
Compare
gzliudan
force-pushed
the
feat-amsterdam-fork-switch
branch
from
October 8, 2026 23:39
6ccfa44 to
6cb61c3
Compare
gzliudan
force-pushed
the
feat-amsterdam-fork-switch
branch
2 times, most recently
from
October 9, 2026 00:07
18b3721 to
7cdb30c
Compare
gzliudan
force-pushed
the
feat-amsterdam-fork-switch
branch
from
October 9, 2026 01:59
7cdb30c to
f820186
Compare
This was referenced Oct 9, 2026
gzliudan
force-pushed
the
feat-amsterdam-fork-switch
branch
4 times, most recently
from
October 9, 2026 04:59
0df2d82 to
cbb82e9
Compare
Amsterdam is the fork upstream go-ethereum gives the EIPs that did not land in Osaka, and this chain has no switch to hang them on: params.ChainConfig stops at OsakaBlock and nothing selects amsterdamInstructionSet, which core/vm/jump_table.go builds but no fork ever reaches, so the table built by EIP-8024 is dead code. Add AmsterdamBlock as a block-number fork, the way every other fork here is expressed, together with IsAmsterdam, Rules.IsAmsterdam and the fork order entry that keeps it after Osaka, and select the table from NewEVM and LookupInstructionSet. Amsterdam is Osaka plus the rules that did not land there, so scheduling it without Osaka would execute rules the chain never switched on. The linear order check cannot catch that on its own: it compares two forks only when both are set. CheckConfigForkOrder gains a fork-order special case that requires Osaka to be set before Amsterdam, and the case table pins it with an amsterdam-without-osaka case beside the amsterdam-before-osaka one. No network schedules it: XDCMainnetChainConfig, MainnetChainConfig, TestnetChainConfig, DevnetChainConfig and LocalnetChainConfig leave amsterdamBlock unset, and Osaka is unset on all of them, so Amsterdam cannot be scheduled first. The dev and test configs that run every fork from block zero schedule Amsterdam with Osaka. The table stays Osaka plus EIP-8024. EIP-7843 needs a slot number this chain has no source for, and EIP-8037 and EIP-8038 replace the single-value gas ledger with a two-dimensional one, so enabling them means porting that ledger first. newAmsterdamInstructionSet records that they are missing. Bump chainConfigDigestVersion: the canonical encoding covers one more fork field, so digests from an older binary stop matching the fast path and chainConfigJSONEqual falls back to field-level comparison until both sides are re-encoded. The pinned vectors in core/chainconfig_equal_test.go move with it. Ref: XinFinOrg#2730
gzliudan
force-pushed
the
feat-amsterdam-fork-switch
branch
from
October 10, 2026 14:32
cbb82e9 to
d36a2b9
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
amsterdamInstructionSetis built but nothing selects it, so the table EIP-8024 landed in (#2268) is dead code: no fork reaches it and the only way in isvm.Config.ExtraEips. This adds the Amsterdam fork switch and wires the two selection points.The fork is a block number, like every other fork here, not a timestamp as it is upstream. Amsterdam is where the EIPs that did not land in Osaka go; this PR is only the switch, and it schedules nothing.
Summary
The table and its two selection points:
The fork itself is one entry in the generated source plus the places that name it:
params/ ├── config_backfill_fields.json # source of truth; drives `go generate ./params/` │ ├── OsakaBlock (forkOrder 29) + │ └── AmsterdamBlock (forkOrder 30) ├── config.go # struct field, String, Description, ActiveForks ├── config_forks.go # IsAmsterdam, Rules.IsAmsterdam └── forks/forks.go # Fork enum, forkToStringThe table stays incomplete on purpose. It is Osaka plus EIP-8024 only. EIP-7843 needs a slot number this chain has no source for, having no beacon chain, and EIP-8037 with EIP-8038 reprice state access and replace the single-value gas ledger with a two-dimensional one, so enabling them means porting that ledger first.
newAmsterdamInstructionSetrecords which upstream EIPs are missing and why. They stay with #2730.No network schedules Amsterdam.
XDCMainnetChainConfig,MainnetChainConfig,TestnetChainConfig,DevnetChainConfigandLocalnetChainConfigleaveamsterdamBlockunset, and all of them leaveosakaBlockunset too, so Amsterdam cannot be scheduled first. The dev and test configs that run every fork from block zero schedule it with Osaka.chainConfigDigestVersiongoes 2 to 3: the canonical semantic encoding covers one more fork field, so digests from an older binary stop matching the fast path andchainConfigJSONEqualfalls back to field-level semantic comparison, which still answers correctly, until both sides are re-encoded.Ref: #2730
Evidence
Every reference to the table, before and after:
Adding a fork field also moves the chain config digest and reaches every place that enumerates forks, so the tests pinning the digest, the tests asserting fork field order, and the tests that push forks out to a future block to keep them off were updated to cover Amsterdam the way they cover Osaka.
The fork-count bookkeeping moves with it too:
ActiveForkspre-allocates for the fork it now appends, andparams/config_networks_test.gogains the matching Amsterdam entries - the mock config asserts the fork is declared at genesis, and the live-network table asserts it is left unset, which is the guard for the claim that no network schedules Amsterdam.Several more places needed the same treatment and are in this commit.
ActiveForksbuilds its list in alphabetical order and a test asserts it that way, so Amsterdam is appended first rather than next to Osaka, and that test's fixture now declares the fork so the ordering is pinned. TheCheckConfigForkOrdercase table gains anamsterdam before osakacase, andTestChainConfigStringIncludesAllFieldsgains the field and its label so the newStringbranch is covered.params/config_forks_test.goenumerates the forks twice - once asserting an empty config answersfalsefor everyIs*helper, once assertingDescriptionprints a line for every field - so both lists take Amsterdam. Five fixtures that cleared onlyosakaBlockon a full test config -core/vm/contracts_kzg_stub_test.go,core/blockchain_pruned_ancestors_test.go,core/state_processor_test.go,eth/downloader/testchain_test.goandeth/filters/filter_test.go- now clearamsterdamBlockwith it, because clearing Osaka no longer leaves the rules below it. The benchmark-only mirroractiveForksLegacyMapSortgains the Amsterdam entry as well, so thelegacy_map_sortcomparison keeps enumerating the same forks as the list it benchmarks.CheckConfigForkOrderenforces the ordering the fork is introduced with. The linear check only compares forks that are both set, so abeforeRequiredfork-order special case - next to the existing Gas50x constraints - rejects a config that schedulesamsterdamBlockwhile leavingosakaBlockunset; the case table covers it with anamsterdam without osakacase.Merge Danger
Door: two-way
No network schedules Amsterdam, so nothing on a live chain reads the new field and reverting restores the previous state, digest version included. It stops being reversible once a network schedules Amsterdam and produces blocks under it, which is a separate decision.
Blast Radius: chain config
The only cross-version effect is the digest: a node on this build and one on the previous build comparing chain configs fall back from the digest fast path to field-level comparison, which reports equality correctly. Wire format, header layout, storage layout and the RPC surface are untouched. Within the build the table is selected wherever Amsterdam is scheduled, which today is the dev and test configs.
Types of changes
Impacted Components
Checklist
The three network-facing items are not applicable: no network schedules Amsterdam and every live network also leaves
osakaBlockunset, so there is no chain to run from genesis, no epoch to observe, and no end-to-end plan to give. Backwards compatibility and cross-version coexistence are argued under Merge Danger and covered by the field-level fallback rather than by a network run.Documentation is a separate PR, #2758, so that this one stays a code change:
docs/solidity.mddocuments the EVM versions a contract can target, and Amsterdam is not a target this chain can serve yet, since the table is missing EIP-7843, EIP-8037 and EIP-8038. It also states the EIP-7954 code and initcode limits, which move with Amsterdam rather than with Osaka, and the tiered gas price floor moves from there to the upgrade notes. The rest of #2730 - SLOTNUM, the 2D gas ledger and the compiler-facing vectors - stays with the issue.