feat(node): layer1 verify-mode skips tendermint + own metrics server#974
Conversation
- Layer1 verify mode: skip tendermint setup for fullnodes (derivation alone reconstructs the chain from L1 batches/blobs). Sequencer mode (signer != nil) still starts tendermint as before. - Single Prometheus endpoint owned by main.go, sourced from tmCfg.Instrumentation.PrometheusListenAddr (config.toml). Tendermint's own listener is force-disabled so the node never exposes two /metrics URLs serving the same DefaultGatherer set. - Drop --metrics-server-enable / --metrics-hostname / --metrics-port flags and the Config.Metrics* fields; ops only needs config.toml's instrumentation block now. - DefaultConfig.Confirmations: rpc.SafeBlockNumber -> 10. Pairs with the always-on L1 reorg detector (SPEC-005 §4.7.6) so a deeper reorg is still recoverable, while keeping derivation lag low. - Drop the dead L1Confirmations branch in derivation.SetCliContext (sync still owns that flag); DerivationConfirmations remains the only override path for derivation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
verify-mode is a derivation knob; combining it with a sequencer signer is a misconfig, not a state to defend against. Letting the layer1 branch match unconditionally surfaces the mistake as "tendermint never started" instead of silently ignoring the flag and pretending nothing's wrong. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
All nodes (node-0/1/2/3, sentry-node-0/1) now require MORPH_NODE_L1_SEQUENCER_CONTRACT environment variable to initialize the L1 sequencer verifier component. This is required by the new sequencer verification logic in PR 974 which uses the L1Sequencer contract to verify block proposer identity during consensus. Tested: All nodes start successfully and metrics endpoints are working. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…seHeight default - Extract Confirmations=10 as a named const so the value lives next to the comment that explains it instead of being a magic number in DefaultConfig. - Bump DefaultFetchBlockRange 100 -> 500 on the derivation path (sync.DefaultFetchBlockRange stays 100). The derivation eth_getLogs filter is just CommitBatch events, so a 500-block window stays small on the wire while cutting round-trips 5x during catch-up. - Default baseHeight to the current L2 head when unset. baseHeight is the height below which stateRoot checks are skipped; pinning it to the live head means a fresh node only verifies blocks it derives from this point forward, instead of re-checking historical blocks against an empty rollup cursor. - Drop the unused L1ChainID flag (no consumer in morphnode; the ops/l2-genesis copy is a separate package). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tmCfg.Instrumentation.Prometheus is overloaded inside tendermint: DefaultMetricsProvider returns NopMetrics() when it's false, so cs/p2p/sm/proxy collectors never register to prometheus.DefaultRegisterer. The previous "Prometheus=false" approach silently dropped every tendermint_consensus/p2p/state/proxy series from our unified endpoint — not just the duplicate :26660 binding it was meant to suppress. Switch to clearing PrometheusListenAddr instead. node.OnStart's HTTP-bind guard (`Prometheus && addr != ""`) trips on the empty addr, but DefaultMetricsProvider keeps the real Prometheus collectors. Capture the operator's configured addr first so our top-level startMetricsServer still serves on it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Walk back the global tmCfg.Instrumentation override. Local / sequencer / mock paths inherit tendermint's :26660 listener exactly as upstream configured it; only the layer1 fullnode path (where tmnode never starts) brings up its own promhttp listener on the same address from config.toml. Trades the "single mechanism in all modes" symmetry for a much smaller blast radius: no risk of subtly altering what tendermint registers to DefaultRegisterer in the modes that actually run consensus. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
In layer1 mode tendermint never starts, so its Instrumentation.Prometheus flag has no semantic anchor — it gates a listener that doesn't exist here. Let startMetricsServer's empty-addr fast-path be the single off switch. Operators who want metrics off either leave the addr empty or clear it explicitly; they shouldn't have to also flip a tendermint flag that's otherwise irrelevant to this code path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Mode matrix
Operator-visible changes
```
[instrumentation]
prometheus = true
prometheus_listen_addr = ":26660"
```
Test plan
🤖 Generated with Claude Code