Skip to content

Initialize morph#1

Merged
FletcherMan merged 4 commits intomainfrom
init
Jan 12, 2024
Merged

Initialize morph#1
FletcherMan merged 4 commits intomainfrom
init

Conversation

@chengwenxi
Copy link
Copy Markdown
Collaborator

@chengwenxi chengwenxi commented Jan 12, 2024

Initialize morph

@chengwenxi chengwenxi requested review from FletcherMan and anylots and removed request for anylots January 12, 2024 02:48
@chengwenxi chengwenxi added contracts Contracts update bindings Bindings update node Node update prover Prover update tx-submitter Tx-submitter update labels Jan 12, 2024
@chengwenxi chengwenxi force-pushed the init branch 11 times, most recently from 225d60a to 70439c3 Compare January 12, 2024 03:37
@FletcherMan FletcherMan merged commit 7f2f887 into main Jan 12, 2024
@chengwenxi chengwenxi deleted the init branch January 12, 2024 07:21
anylots added a commit that referenced this pull request Jan 7, 2026
curryxbo pushed a commit that referenced this pull request May 9, 2026
…ed head anchors

Per morph-specs SPEC-005 §6.2 task table:

  #5  Drive derivation main loop on L1 safe; reorg detection unconditional
  #6  Persist safe_head anchor after each verified batch (+ metric)
  #6b finalized_head tracker advances at the tail of every iteration

Changes:

- node/derivation/config.go
  Default `Confirmations` flips from FinalizedBlockNumber to SafeBlockNumber,
  matching SPEC-005 §3.1 step 1. Operators may still override via
  `--derivation.confirmations`.

- node/derivation/derivation.go
  - Step 1: drop the `confirmations != Finalized` guard around detectReorg —
    reorg detection now runs every loop on the safe segment, per SPEC-005 §3.2.
  - After verifyBatchRoots success, write a HeadAnchor (L2 last block + L1
    commit block) as the new safe_head and update SafeHeadL2Number metric.
  - End of loop: invoke advanceFinalizedHead from the new finalized tracker.

- node/derivation/finalized_tracker.go (new)
  advanceFinalizedHead implements SPEC-005 §3.1 step 4. Two paths:
    cheap path:    safe_head.L1Number ≤ L1 finalized → ratchet to safe_head.
    steady-state:  walk commit-batch logs in (currentFinalized, L1 finalized],
                   decode-light the latest one, anchor finalized_head at its
                   L2 last block. Calldata-only — never fetches blob data.
  Monotonicity is enforced; any regression attempt halts the node.

- node/derivation/dual_channel.go
  Update header comment now that the main loop and finalized tracker are
  wired into both cursors.

Out of scope (per spec §6.2 / §8 and per project decision to leave full
rollback for the rollback-executor PR):
  - L1 anchor window depth tuning (#7 / §8 #1)
  - Path B implementation (#10) — skeleton stays
  - Rollback executor (#12) — skeleton stays in verify.go
  - Sequencer mutex wiring (#11) — skeleton stays
  - Admin RPC auth (#13 / §8 #2) — skeleton stays
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bindings Bindings update contracts Contracts update node Node update prover Prover update tx-submitter Tx-submitter update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants