Skip to content

Comments

CLI: Admin for removal#252

Open
aoikurokawa wants to merge 4 commits intomasterfrom
ak/surgery
Open

CLI: Admin for removal#252
aoikurokawa wants to merge 4 commits intomasterfrom
ak/surgery

Conversation

@aoikurokawa
Copy link
Collaborator

@aoikurokawa aoikurokawa commented Dec 29, 2025

Vote Account: FWxdBnWZ13m3CqNuKBH2KQWkF6EFF1Utja5Cy7iqG2nE      Stake Account: 4oXeHax2gsmzqfS29boC2qgpLj3DCseDFVcWSkFxfaoV     Active Balance: ◎2.432428512    Transient Stake Account: G2jeoN6hfe7rcgYgm4yZHG1Hy3WimbThQSC5ehFCMbGv   Transient Balance: ◎0.022263440 Last Update Epoch: 884 [UPDATE REQUIRED]
Vote Account: FzUNgBRnVxawDytN9GM7BFwxFfekuMs7BcAGybn4AmMk      Stake Account: Ebwi7d5zWtcWitpvWwFQjJcoRmsFTqjXvBtq4eHPUY6p     Active Balance: ◎0.003282880    Transient Stake Account: 8u2fa3pJGpRniJobVKTZZ6drETiNFNZRJAAkFMe1JtaM   Transient Balance: ◎0.000000000 Last Update Epoch: 884 [UPDATE REQUIRED]
Vote Account: JCUKND3QDkPxD65ec3nZ5MtvsETRnkyKLusjrUoAyPNk      Stake Account: EAkUJjRJS1ucocRjFcpypWPNWPpodJJ6KJ22sBiAvNsR     Active Balance: ◎0.000000000    Transient Stake Account: CX39m5hpDZdtwJFHTRwAtVr7fMB1pfFqZ2ZsDGSMDyhY   Transient Balance: ◎0.000000000 Last Update Epoch: 884 [UPDATE REQUIRED]
Vote Account: Htb4sd3szKxKt1KZzX9ydGnGRi2TTcSku4qswt48P2hv      Stake Account: B98YBdgazjTw81VH3eYao9mvrv2dMALs6roYwv95equd     Active Balance: ◎0.003282880    Transient Stake Account: J61wRhzbNvNCZ7s9QUhfCLhxs6pCV3RdBX51G3dJ6ibo   Transient Balance: ◎0.000000000 Last Update Epoch: 884 [UPDATE REQUIRED]

1

./target/release/steward-cli \
     --json-rpc-url  https://api.testnet.solana.com \
    admin-mark-for-removal \
    --steward-config 5pZmpk3ktweGZW9xFknpEHhQoWeAKTzSGwnCUyVdiye \
    --authority-keypair-path ~/.config/solana/id.json \
    --mark-for-removal \
    --immediate \
    --validator-vote-account "FWxdBnWZ13m3CqNuKBH2KQWkF6EFF1Utja5Cy7iqG2nE"

2

./target/release/steward-cli \
     --json-rpc-url  https://api.testnet.solana.com \
    admin-mark-for-removal \
    --steward-config 5pZmpk3ktweGZW9xFknpEHhQoWeAKTzSGwnCUyVdiye \
    --authority-keypair-path ~/.config/solana/id.json \
    --mark-for-removal \
    --immediate \
    --validator-vote-account "FzUNgBRnVxawDytN9GM7BFwxFfekuMs7BcAGybn4AmMk"

3

./target/release/steward-cli \
     --json-rpc-url  https://api.testnet.solana.com \
    admin-mark-for-removal \
    --steward-config 5pZmpk3ktweGZW9xFknpEHhQoWeAKTzSGwnCUyVdiye \
    --authority-keypair-path ~/.config/solana/id.json \
    --mark-for-removal \
    --immediate \
    --validator-vote-account "JCUKND3QDkPxD65ec3nZ5MtvsETRnkyKLusjrUoAyPNk"

4

./target/release/steward-cli \
     --json-rpc-url  https://api.testnet.solana.com \
    admin-mark-for-removal \
    --steward-config 5pZmpk3ktweGZW9xFknpEHhQoWeAKTzSGwnCUyVdiye \
    --authority-keypair-path ~/.config/solana/id.json \
    --mark-for-removal \
    --immediate \
    --validator-vote-account "Htb4sd3szKxKt1KZzX9ydGnGRi2TTcSku4qswt48P2hv"

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the admin mark for removal functionality in the steward CLI by replacing the generic "Surgery" command with a more specific "AdminMarkForRemoval" command. The changes improve the CLI's usability by accepting a validator vote account address directly instead of requiring a manual index lookup, and enhance error handling.

  • Refactored the surgery command to a more descriptive AdminMarkForRemoval command with clearer semantics
  • Changed the validator identification method from requiring a manual index to accepting a vote account address, with automatic index lookup
  • Improved error handling by using proper error propagation instead of expect() calls
  • Added config PDA display to the validator-history-cli view config command

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
utils/validator-history-cli/src/main.rs Added display of config PDA address in the view config output
utils/steward-cli/src/main.rs Added import and command handler for the new AdminMarkForRemoval command
utils/steward-cli/src/commands/command_args.rs Added AdminMarkForRemoval variant to the Commands enum and corresponding import
utils/steward-cli/src/commands/actions/mod.rs Added module declaration for admin_mark_for_removal
utils/steward-cli/src/commands/actions/admin_mark_for_removal.rs Refactored from Surgery to AdminMarkForRemoval with improved parameter handling, error messages, and automatic validator index lookup by vote account
Comments suppressed due to low confidence (2)

utils/steward-cli/src/commands/actions/admin_mark_for_removal.rs:23

  • The description in the command attribute says "Mark the correct validator for removal" but should say "Mark a validator for removal" or "Mark the specified validator for removal". The word "correct" is confusing here as it implies there is an incorrect validator that needs to be identified, when in reality this command marks any specified validator for removal.
    utils/steward-cli/src/commands/actions/admin_mark_for_removal.rs:80
  • The duplicate reference to the "anyhow" macro is redundant. Line 80 uses "anyhow::anyhow!" when "anyhow!" would suffice since "anyhow" is already imported via "use anyhow::{anyhow, Result};" at line 4. This creates unnecessary verbosity.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aoikurokawa aoikurokawa marked this pull request as ready for review December 30, 2025 00:57
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