Repository navigation
Description
Background
morph-l2/go-ethereum#332 proposes switching L2 block time from second-resolution to millisecond-resolution. To stay byte-for-byte interoperable with morph-geth, morph-reth must mirror the same encoding decisions everywhere Header.timestamp, payload-attributes timestamps, and RPC time-related fields are touched.
⚠️ Upstream spec is not yet finalized (morph-l2/go-ethereum#332, assigned to @SegueII). This issue stages the work so we can move quickly once the spec lands; concrete encoding/activation choices below are placeholders to be tightened against geth's implementation PR.
Open Questions for Upstream Spec
- Encoding strategy: keep
Header.timestampasu64seconds and add a separatetimestamp_ms_offsetfield, OR redefineHeader.timestampto mean milliseconds wholesale, OR packseconds * 1000 + msinto the existingu64? - Activation: gate behind a new hardfork (e.g.
MorphHardfork::Onyx) or piggy-back on an existing planned fork (Jade)? - RPC compatibility: do
eth_getBlockBy*/eth_blockNumber/eth_getLogskeep returning seconds for backward compat, with millisecond access via a newmorph_*RPC, or break compat at the fork? - Hardfork activation predicates:
is_*_active_at_timestampcurrently take seconds; do they switch to ms, or do we keep seconds-domain everywhere except block production? - Genesis timestamp semantics: still seconds, with the ms component starting at fork activation?
Functional Description
Once the encoding is final, mirror it in morph-reth so block production, validation, payload assembly, and RPC all agree with morph-geth to the millisecond.
Touch points (reth side)
The following crates / files will need adaptation. Exact changes depend on the chosen encoding:
morph-primitives—MorphHeader.timestampfield type / encoding;MorphBlockround-trip with the new layout; RLP equivalence with go-ethereummorph-chainspecis_morph203_active_at_timestamp,is_viridian_active_at_timestamp,is_emerald_active_at_timestamp,is_jade_active_at_timestamppredicates — pick a single timestamp domain (s or ms) and stick with it- genesis timestamp parsing
- if a new hardfork (
Onyx?) gates the switch: register inMorphHardfork, addFrom<SpecId>mapping, populate mainnet / hoodiextra_fields
morph-payload-typesExecutableL2Data.timestampandSafeL2Data.timestampJSON encodingMorphPayloadAttributesbuilder
morph-payload-builder- block assembly: timestamp slot in header
- parent timestamp delta enforcement (
block_timemath)
morph-evmMorphBlockAssembler::extra_datais unaffected, but verifyBlockEnv.timestampplumbing matches what EVM opcodeTIMESTAMPshould return (geth historically returns seconds — confirm post-fork behavior)
morph-engine-apiengine_assembleL2Block/engine_newL2Block/engine_validateL2Block/engine_newSafeL2Blockargument shapes
morph-rpceth_getBlockBy*JSON output — backward-compat decision lives here- any
morph_*namespace addition for sub-second access
morph-consensus- header timestamp validation rules (monotonic, parent+1 minimum, future-bounding)
morph-engine-tree-ext- if a new fork gates the switch and triggers state-root behavior changes, the gate predicate may move there too
Scope
- Wait for / align with go-ethereum spec PR (linked from #332 once filed)
- Pick encoding strategy in lock-step with geth
- If gated by a new hardfork, register
MorphHardfork::<X>+ activation timestamps in mainnet.json / hoodi.json - Implement timestamp encoding everywhere listed under Touch Points
- Update tests + e2e
- Add cross-client conformance test (block produced on one client, validated by the other)
Acceptance Criteria
- morph-reth-built block hashes are byte-identical to morph-geth-built blocks at the same height across the fork boundary
-
cargo nextest run --workspacepasses -
cargo nextest run -p morph-node --features test-utils -E 'binary(it)'passes - Existing pre-fork blocks still validate without re-encoding
- RPC backward-compat decision is documented and tested (whichever way it goes)
References
- Upstream issue: Change block time to milliseconds go-ethereum#332
- Parent Initiative: https://github.com/morph-l2/internal-tracker/issues/6 (Reth client online)
- Sibling sequencer mirror: feat(sequencer): mirror centralized sequencer changes from go-ethereum#331 #122
Activity
perf(reference-index): bound reorg to finalized, simplify read gate, …
refactor(reference-index): replace ExEx with canonical cursor runtime (…