Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

Conversation

@Farukest
Copy link

@Farukest Farukest commented Jan 14, 2026

Summary

Implements the --rpc.admin-state CLI flag functionality that was defined but never implemented.

When a file path is provided via --rpc.admin-state, the node will:

  1. Load persisted admin state on startup (if file exists)
  2. Save state changes whenever admin API modifies sequencer state

Changes

  • Add AdminState struct: Serializable struct containing sequencer_active and recovery_mode fields
  • Add AdminStatePersistence helper: Provides load() and save() methods for JSON file persistence
  • Update SequencerActor: Add admin_state_persistence field to handle persistence
  • Persist on state changes: Save state in start_sequencer, stop_sequencer, and set_recovery_mode
  • Load on startup: Read persisted state in node.rs when initializing the sequencer

Persisted State

{
  "sequencer_active": true,
  "recovery_mode": false
}

Test plan

  • Unit tests for AdminState serialization
  • Unit tests for AdminStatePersistence (load/save/disabled scenarios)
  • All existing tests pass (108/108)

Closes #3124

Implement the rpc.admin-state CLI flag functionality to persist admin API
state changes (sequencer active/stopped, recovery mode) across node restarts.

- Add AdminState struct with serde serialization support
- Add AdminStatePersistence helper for loading/saving state to disk
- Add admin_state_persistence field to SequencerActor
- Persist state on start_sequencer, stop_sequencer, set_recovery_mode calls
- Load persisted state on node startup if configured

When --rpc.admin-state is set to a file path, the node will:
1. Load saved state on startup (if file exists)
2. Save state changes whenever admin API modifies sequencer state

Closes op-rs#3124
@wiz-b4c72f16a4
Copy link

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities 4 Low
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Supply Chain Finding Software Supply Chain Findings -
Total 4 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(admin/rpc): implement the rpc.admin-state CLI flag.

1 participant