Skip to content

fix(node): restore validator flag compatibility#1003

Merged
curryxbo merged 4 commits into
mainfrom
corey/compat-validator-flag
Jun 23, 2026
Merged

fix(node): restore validator flag compatibility#1003
curryxbo merged 4 commits into
mainfrom
corey/compat-validator-flag

Conversation

@curryxbo

@curryxbo curryxbo commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Restore --validator as a deprecated compatibility alias.
  • Resolve legacy validator mode to --derivation.verify-mode=layer1 so existing validator configs keep working after binary upgrade.
  • Add verify-mode tests for the legacy alias and explicit override behavior.

Test plan

  • go test ./node/derivation

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Added --validator CLI flag as a deprecated compatibility alias for verify-mode configuration
  • Tests

    • Added tests for legacy validator mode resolution and explicit mode override scenarios

Map the deprecated --validator flag to layer1 verification so existing validator deployments can upgrade binaries without config changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@curryxbo curryxbo requested a review from a team as a code owner June 23, 2026 06:38
@curryxbo curryxbo requested review from secmgt and removed request for a team June 23, 2026 06:38
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@curryxbo, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 33 minutes and 45 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4c3fed13-f2de-4a5d-9476-fce214aab62c

📥 Commits

Reviewing files that changed from the base of the PR and between 9f85db2 and 40b465b.

📒 Files selected for processing (2)
  • node/derivation/config.go
  • node/derivation/config_test.go
📝 Walkthrough

Walkthrough

A deprecated --validator CLI flag (MORPH_NODE_VALIDATOR) is added as a compatibility alias for --derivation.verify-mode=layer1. A new resolveVerifyMode helper centralizes verify-mode precedence logic in Config.SetCliContext, and two unit tests cover the alias and explicit-override cases.

Changes

Legacy Validator Mode Alias

Layer / File(s) Summary
LegacyValidatorMode CLI flag
node/flags/flags.go
Defines and registers the --validator boolean CLI flag with MORPH_NODE_VALIDATOR env var, marked as a deprecated alias for --derivation.verify-mode=layer1.
resolveVerifyMode helper, SetCliContext wiring, and tests
node/derivation/config.go, node/derivation/config_test.go
Adds resolveVerifyMode with explicit-set → legacy-validator → current-default precedence, updates Config.SetCliContext to call it, and adds two unit tests asserting the alias resolves to VerifyModeLayer1 and that an explicit --derivation.verify-mode overrides the alias.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop along, old --validator friend,
A legacy alias, born to descend —
layer1 it whispers beneath the new name,
But explicit flags always win the game.
The rabbit checks precedence, neat and bright,
And routes each config to its proper light! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'fix(node): restore validator flag compatibility' directly and clearly summarizes the main change: restoring backward compatibility for the deprecated --validator flag.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch corey/compat-validator-flag

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.

corey and others added 3 commits June 23, 2026 14:43
Inline the legacy validator alias handling in derivation config so the precedence is obvious at the call site.

Co-authored-by: Cursor <cursoragent@cursor.com>
Warn operators when --validator is used or overridden by an explicit derivation verify mode.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep only the deprecation warning for --validator while preserving direct verify-mode override behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
@curryxbo curryxbo merged commit 13dcf82 into main Jun 23, 2026
13 checks passed
@curryxbo curryxbo deleted the corey/compat-validator-flag branch June 23, 2026 07:14
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