Open
Conversation
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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"