Skip to content

fix(genesis): use a deterministic configured timestamp - #75

Merged
shu-unifra merged 1 commit into
dogeos-v0.3.0-developfrom
fix/deterministic-genesis-timestamp
Oct 9, 2026
Merged

shu-unifra merged 1 commit into
dogeos-v0.3.0-developfrom
fix/deterministic-genesis-timestamp

Conversation

@shu-unifra

Copy link
Copy Markdown

The genesis generator currently writes vm.unixTime() / 1000 into the block header. Running it in a different second changes the genesis hash even when all deployment inputs are identical.

Read a fixed Unix timestamp from genesis.TIMESTAMP instead. The template uses 0, and older configs without the field also default to 0. Explicit timestamps are accepted up to uint64::MAX; negative, malformed, and overflowing inputs fail. Keep deployment salt, other configuration, and build versions fixed when reproducing a genesis.

Changing from a previously generated timestamp changes the genesis hash. Regenerate the Reth mainnet genesis JSON, DOGEOS_MAINNET_GENESIS_HASH and its test, the rollup-node chain spec, and matching release images/tag together with the other pending mainnet genesis fixes. This change does not update an initialized network.

Validation:

  • forge test --evm-version cancun: 560 passed, 0 failed, including timestamp defaults, explicit zero/nonzero values, the uint64 boundary, invalid inputs, and JSON serialization.
  • python3 scripts/integration/test-eip2935.py --genesis-only: checks an explicit nonzero timestamp through the real gen-configs.sh entrypoint, then repeats generation in a later wall-clock second and compares the entire genesis YAML byte-for-byte. This check already runs in CI.
  • RPC smoke-check regression tests: 5 passed.
  • Prettier and git diff --check: passed.

@shu-unifra
shu-unifra merged commit be94674 into dogeos-v0.3.0-develop Oct 9, 2026
7 checks passed
@shu-unifra
shu-unifra deleted the fix/deterministic-genesis-timestamp branch October 13, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant