hardfork: fix fork-slot computation for Mesa preforks (fixes #18980)#18987
Open
dkijania wants to merge 2 commits into
Open
hardfork: fix fork-slot computation for Mesa preforks (fixes #18980)#18987dkijania wants to merge 2 commits into
dkijania wants to merge 2 commits into
Conversation
…time create_runtime_config.sh recomputed proof.fork.global_slot_since_genesis from the wall-clock genesis window divided by a hard-coded 180 s/slot. That is the Berkeley slot time; Mesa runs at 90 s/slot, so a mesa -> mesa fork under-counted the slot span by 2x (e.g. 456780 instead of the real 458220). Take the fork slot verbatim from the fork config's proof.fork.global_slot_since_genesis -- the same authoritative source the script already reads state_hash and blockchain_length from -- and drop the wall-clock-to-slots recompute entirely. This removes the slot-time constant that differed between Berkeley and Mesa. Adds buildkite/scripts/tests/hardfork/create-runtime-config-tests.sh, wired into AutoHardforkTest, which reproduces the #18980 window (prefork slot 455340, 3-day window) and asserts the output slot is the fork config's 458220 -- independent of SECONDS_PER_SLOT, so a reintroduced recompute is caught. Fixes #18980. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
!ci-build-me |
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.
Summary
Fixes #18980.
scripts/hardfork/create_runtime_config.shrecomputedproof.fork.global_slot_since_genesisfrom the wall-clock genesis window divided by a hard-coded 180 s/slot. That is the Berkeley slot time; Mesa runs at 90 s/slot, so amesa → mesafork under-counted the slot span by exactly 2× — e.g. it produced456780instead of the real458220.Fix
Take the fork slot verbatim from the fork config's
proof.fork.global_slot_since_genesis— the same authoritative source the script already readsstate_hashandblockchain_lengthfrom — and drop the wall-clock-to-slots recompute entirely. This removes the slot-time constant that differed between Berkeley (180 s) and Mesa (90 s).Test coverage
New
buildkite/scripts/tests/hardfork/create-runtime-config-tests.sh(wired into the existingAutoHardforkTestjob, which already gates oncreate_runtime_config.sh). It reproduces the failing-run window (prefork slot455340, 3-day / 259200 s window, fork config slot458220) and asserts:458220— not the456780a 180 s/slot recompute would give;SECONDS_PER_SLOT(180 vs 90), so a reintroduced wall-clock recompute is caught;state_hash/blockchain_lengthpass through, the genesis timestamp is patched, and ledger hashes come from the hashes file.Scope
Fixes the fork-slot axis only (per the issue). Independent of the Berkeley→Mesa vesting-conversion defect (#18981) and the automode self-boot crash.
🤖 Generated with Claude Code