Skip to content

fix(node): restore layer1-verify validator startup defaults#1022

Merged
curryxbo merged 2 commits into
mainfrom
fix/validator-layer1-defaults
Jul 17, 2026
Merged

fix(node): restore layer1-verify validator startup defaults#1022
curryxbo merged 2 commits into
mainfrom
fix/validator-layer1-defaults

Conversation

@curryxbo

@curryxbo curryxbo commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Problem

A from-scratch layer1-verify validator panics on startup:

panic: open /opt/data/data/write-file-atomic-...: no such file or directory
  privval.(*FilePVLastSignState).Save
  privval.LoadOrGenFilePV
  main.L2NodeMain  (node/cmd/node/main.go:134)

Two behaviors regressed when PR #966 (centralized sequencer) merged the old if isValidator { ... } else { ... } split into one unified startup path:

  1. LoadOrGenFilePV became 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, so LoadOrGenFilePVSave()write-file-atomic fails to create its temp file and panics.
  2. derivation.confirmations default changed from finalized (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

  • main.go: load the derivation config before the priv-validator step; only LoadOrGenFilePV when the node will actually start Tendermint (i.e. VerifyMode != layer1). Layer1 validators hand the executor a nil pubkey — both NewExecutor (executor.go:92-94) and the sequencer-set check tolerate nil, and a layer1 validator is correctly never matched as a sequencer.
  • config.go: for VerifyMode == layer1, default Confirmations back to rpc.FinalizedBlockNumberunless the operator explicitly set --derivation.confirmations. Consensus fullnodes keep the latest-N default and the reorg detector.

Scope / compatibility

  • Only affects layer1-verify (validator) nodes. Sequencer and local-verify fullnodes are unchanged.
  • Explicit --derivation.confirmations still wins.
  • No new <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

    • Added Layer 1 verification support that skips unnecessary validator initialization.
    • Layer 1 verification now defaults to finalized block confirmations when no custom confirmation setting is provided.
  • Bug Fixes

    • Preserved the ability to override the default confirmation behavior with an explicit configuration.

corey and others added 2 commits July 17, 2026 10:43
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>
@curryxbo
curryxbo requested a review from a team as a code owner July 17, 2026 02:44
@curryxbo
curryxbo requested review from dylanCai9 and removed request for a team July 17, 2026 02:44

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ebe34bd7-eeea-46a1-b057-b6c630f0df90

📥 Commits

Reviewing files that changed from the base of the PR and between 21d05b9 and e8653e1.

📒 Files selected for processing (2)
  • node/cmd/node/main.go
  • node/derivation/config.go

📝 Walkthrough

Walkthrough

Changes

Derivation and validator startup

Layer / File(s) Summary
Layer1 confirmation default
node/derivation/config.go
Layer1 verification uses rpc.FinalizedBlockNumber unless derivation confirmations were explicitly set.
Conditional validator initialization
node/cmd/node/main.go
Derivation configuration loads before startup mode selection, and Tendermint private-validator loading and public-key extraction are skipped in Layer1 verify mode.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: dylancai9, fletcherman, tomatoishealthy

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: restoring layer1-verify validator startup defaults.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/validator-layer1-defaults

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@curryxbo
curryxbo merged commit 60a7515 into main Jul 17, 2026
13 checks passed
@curryxbo
curryxbo deleted the fix/validator-layer1-defaults branch July 17, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants