Skip to content

Update README.md#2

Merged
chengwenxi merged 1 commit intomainfrom
README-for-basic-informations-of-monorepo
Jan 12, 2024
Merged

Update README.md#2
chengwenxi merged 1 commit intomainfrom
README-for-basic-informations-of-monorepo

Conversation

@RedHorse823
Copy link
Copy Markdown
Contributor

Add description for morph monorepo

Add description for morph monorepo
Copy link
Copy Markdown
Collaborator

@chengwenxi chengwenxi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you! ❤️

@chengwenxi chengwenxi added the documentation Improvements or additions to documentation label Jan 12, 2024
@chengwenxi chengwenxi merged commit 23195b2 into main Jan 12, 2024
@chengwenxi chengwenxi deleted the README-for-basic-informations-of-monorepo branch January 12, 2024 06:37
anylots pushed a commit that referenced this pull request Jan 7, 2026
* add workflows

* cargo fmt

* fix clippy

* fix tests

---------

Co-authored-by: chengwenxi <22697326+chengwenxi@users.noreply.github.com>
curryxbo pushed a commit that referenced this pull request May 8, 2026
…C / mutex skeletons

Adds non-runtime skeletons for the four pieces of SPEC-005 work that are
gated on pending blocking decisions (tech-design §8). All four files are
self-contained and compile, but none are wired into the main derivation
loop yet — switching them on requires the corresponding §8 decisions to
land. Each TODO is annotated with the specific blocking item.

What this commit adds:

- node/derivation/verify_path_b.go (SPEC-005 §3.3 path B):
    Eligibility check (last_block ≤ safe_head + locally present) and
    trigger condition matching tech-design §3.2.2. Stub returns
    errPathBUnavailable; the actual blob-rebuild encoder is left as a
    TODO pending confirmation that we should reuse tx-submitter helpers
    rather than duplicate them (open question §8 #3).

- node/derivation/verify.go::rollbackLocalChain (SPEC-005 §5.2):
    Replaces the previous stub message with the formal 8-step atomic
    ordering, plus a checkRollbackBoundary helper that enforces the
    finalized_head boundary (SPEC-005 §3.6). The actual SetHead call is
    still TODO and depends on §8 #4 (go-ethereum hash-matched SetHead).

- node/derivation/sequencer_mutex.go (SPEC-005 §3.6 / §4):
    SequencerMutex primitive (RWMutex-based for now) with public
    Acquire/Release Production / Rollback methods. Granularity (global
    stop-the-world vs interval lock) intentionally hidden behind the
    method API so §8 #5 can switch implementation without churning
    callers.

- node/derivation/admin_rpc.go (SPEC-005 §5.1):
    AdminAPI.SetL2Head(number, hash) skeleton. Hash-matched per
    tech-design §3.3 and rejects targets below finalized_head before
    delegating to the rollback executor. Authentication wiring blocked
    on §8 #2.

No call sites are modified; runtime behaviour is unchanged. P3 unblocks
parallel work on §8 decisions: while operators decide on auth /
mutex granularity / SetHead semantics, downstream developers can build
tests against these signatures.

Refs: morph-l2/morph-specs SPEC-005 §3.3 / §3.6 / §4 / §5 / §8
Co-authored-by: Cursor <cursoragent@cursor.com>
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

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants