Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: add feature revoke #4361

Merged
merged 3 commits into from
Jan 16, 2025
Merged

Conversation

buffalojoec
Copy link

@buffalojoec buffalojoec commented Jan 9, 2025

Problem

The new Feature Gate Core BPF program is live at Feature111111... on both testnet and devnet, and will soon be on mainnet-beta.

With this new program, we can revoke features that are pending activation. The program has only one instruction, RevokePendingActivation, which simply "closes" a newly created feature account by:

  • Deallocating its data
  • Burning its lamports
  • Reassigning it to System

However, core contributors who wish to use this new capability have no way of doing so from the CLI.

Summary of Changes

Add a new command to the solana feature CLI that invokes the RevokePendingActivation instruction on the Feature Gate program to revoke a pending activation.

For more information about this instruction, see the program's instruction source. However, in summary, once a feature is activated with solana feature activate, it can be revoked at any time before the epoch rollover, while the state is still zeroed. Once the epoch concludes and the feature is activated by the runtime, the account is bestowed with valid Feature state and thus can no longer be revoked.

@buffalojoec buffalojoec force-pushed the feature-revoke-cli branch 2 times, most recently from 1a272e0 to 8e73a3b Compare January 15, 2025 03:19
@buffalojoec buffalojoec requested a review from joncinque January 15, 2025 07:23
@buffalojoec buffalojoec marked this pull request as ready for review January 15, 2025 07:23
Copy link

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Just a nit, the rest looks great! Also, can you add a changelog entry for this?

cli/src/feature.rs Outdated Show resolved Hide resolved
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1056507c534839b5cd1b1010ffedb9e8c92313269786fb5066ff53b30326dc3"
dependencies = [
"borsh 0.10.3",

Choose a reason for hiding this comment

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

Outside the scope of this PR, but the generated client should be compatible with borsh v1 if it's upgraded.

@@ -14,6 +14,9 @@ use {
input_validators::*, keypair::*,
},
solana_cli_output::{cli_version::CliVersion, QuietDisplay, VerboseDisplay},
solana_feature_gate_client::{
errors::SolanaFeatureGateError, instructions::RevokePendingActivation,

Choose a reason for hiding this comment

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

nit: Outside the scope of this PR, but FeatureGateError would be a better name for the type

Copy link

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks great!

@buffalojoec buffalojoec merged commit 91d0d0c into anza-xyz:master Jan 16, 2025
58 checks passed
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