Skip to content

Conversation

@gap-editor
Copy link

Description

Adds comprehensive CLI configuration validation that runs before node services start. This prevents invalid or dangerous configurations from causing runtime failures or consensus issues.

Key Changes

Added Cli::validate() method that performs critical checks:

  • Prevents zero values for grandpa_justification_period and kate_max_cells_size
  • Enforces upper bounds on kate_max_cells_size (≤10,000) to prevent resource exhaustion
  • Blocks --unsafe-da-sync + --validator combination (critical for consensus safety)
  • Warns when Kate RPC metrics are enabled without Kate RPC

Integrated validation into startup flow (command.rs):

  • Validation runs immediately after CLI parsing, before any services initialize
  • Provides clear, actionable error messages for misconfigurations
  • Fails fast to prevent silent operational failures

Why This Matters

Previously, invalid configurations could:

  • Cause validators to skip data availability checks (consensus violation)
  • Lead to finalization failures from zero-value parameters
  • Enable DoS attacks via oversized RPC requests
  • Produce errors hours after startup, making debugging difficult

Adds validation for CLI parameters to catch configuration errors early.
Added validation for command line arguments to ensure configuration is correct before starting services.
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.

1 participant