fix(node): restore layer1-verify validator startup defaults#1022
Conversation
PR #966 merged the validator path into the unified startup flow, making LoadOrGenFilePV run unconditionally. A from-scratch layer1-verify validator never starts the Tendermint consensus node, so it has no <home>/data/ directory; LoadOrGenFilePV generates and Save()s a FilePV into that missing dir and panics (write-file-atomic: no such file or directory). Load the derivation config before the priv-validator step and only load the FilePV when the node will actually start Tendermint (i.e. not layer1). The executor is handed a nil pubkey in that case -- NewExecutor and the sequencer-set check both tolerate nil, and a layer1 validator is correctly never matched as a sequencer. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Before PR #966 the derivation default was rpc.FinalizedBlockNumber; the centralized-sequencer work changed it to a fixed latest-10 depth paired with the reorg detector. That is the right default for consensus fullnodes but changes long-standing validator behavior. Restore finalized for layer1-verify validators only: when VerifyMode is layer1 and the operator has not explicitly set --derivation.confirmations, default to finalized. Consensus fullnodes keep the latest-N default. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.
Tip: disable this comment in your organization's Code Review settings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChangesDerivation and validator startup
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. 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 |
Problem
A from-scratch layer1-verify validator panics on startup:
Two behaviors regressed when PR #966 (centralized sequencer) merged the old
if isValidator { ... } else { ... }split into one unified startup path:LoadOrGenFilePVbecame unconditional. Pre-Feat: Sequencer Final PR #966, layer1 validators ran the derivation path and never touched Tendermint priv-validator. Now every node calls it — but a layer1 validator never starts Tendermint and has no<home>/data/dir, soLoadOrGenFilePV→Save()→write-file-atomicfails to create its temp file and panics.derivation.confirmationsdefault changed fromfinalized(pre-Feat: Sequencer Final PR #966) to a fixed latest-10 depth. That's the intended default for consensus fullnodes (paired with the reorg detector), but it silently changed validator behavior.Fix
LoadOrGenFilePVwhen the node will actually start Tendermint (i.e.VerifyMode != layer1). Layer1 validators hand the executor anilpubkey — bothNewExecutor(executor.go:92-94) and the sequencer-set check tolerate nil, and a layer1 validator is correctly never matched as a sequencer.VerifyMode == layer1, defaultConfirmationsback torpc.FinalizedBlockNumber— unless the operator explicitly set--derivation.confirmations. Consensus fullnodes keep the latest-N default and the reorg detector.Scope / compatibility
--derivation.confirmationsstill wins.<home>/data/requirement for validators — restores pre-Feat: Sequencer Final PR #966 behavior.Test
go build ./cmd/... ./derivation/...✅go vet ./derivation/✅🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes