diff --git a/sdk/program/src/feature.rs b/sdk/program/src/feature.rs index 7586157c50..e754b64b18 100644 --- a/sdk/program/src/feature.rs +++ b/sdk/program/src/feature.rs @@ -1,12 +1,16 @@ -/// Runtime features. -/// -/// Feature activation is accomplished by: -/// 1. Activation is requested by the feature authority, who issues a transaction to create the -/// feature account. The newly created feature account will have the value of -/// `Feature::default()` -/// 2. When the next epoch is entered the runtime will check for new activation requests and -/// active them. When this occurs, the activation slot is recorded in the feature account -/// +//! Runtime features. +//! +//! Runtime features provide a mechanism for features to be simultaneously activated across the +//! network. Since validators may choose when to upgrade, features must remain dormant until a +//! sufficient majority of the network is running a version that would support a given feature. +//! +//! Feature activation is accomplished by: +//! 1. Activation is requested by the feature authority, who issues a transaction to create the +//! feature account. The newly created feature account will have the value of +//! `Feature::default()` +//! 2. When the next epoch is entered the runtime will check for new activation requests and +//! active them. When this occurs, the activation slot is recorded in the feature account + use crate::{ account_info::AccountInfo, clock::Slot, instruction::Instruction, program_error::ProgramError, pubkey::Pubkey, rent::Rent, system_instruction, diff --git a/sdk/src/feature.rs b/sdk/src/feature.rs index 78517f5d6b..bca42e7bb6 100644 --- a/sdk/src/feature.rs +++ b/sdk/src/feature.rs @@ -1,3 +1,5 @@ +//! Methods for working with `Feature` accounts. + use crate::account::{AccountSharedData, ReadableAccount, WritableAccount}; pub use solana_program::feature::*; diff --git a/sdk/src/feature_set.rs b/sdk/src/feature_set.rs index 5cf8d90f0a..51bad76255 100644 --- a/sdk/src/feature_set.rs +++ b/sdk/src/feature_set.rs @@ -1,3 +1,23 @@ +//! Collection of all runtime features. +//! +//! Steps to add a new feature are outlined below. Note that these steps only cover +//! the process of getting a feature into the core Solana code. +//! - For features that are unambiguously good (ie bug fixes), these steps are sufficient. +//! - For features that should go up for community vote (ie fee structure changes), more +//! information on the additional steps to follow can be found at: +//! https://spl.solana.com/feature-proposal#feature-proposal-life-cycle +//! +//! 1. Generate a new keypair with `solana-keygen new --outfile feature.json --no-passphrase` +//! - Keypairs should be held by core contributors only. If you're a non-core contirbutor going +//! through these steps, the PR process will facilitate a keypair holder being picked. That +//! person will generate the keypair, provide pubkey for PR, and ultimately enable the feature. +//! 2. Add a public module for the feature, specifying keypair pubkey as the id with +//! `solana_sdk::declare_id!()` within the module. +//! Additionally, add an entry to `FEATURE_NAMES` map. +//! 3. Add desired logic to check for and switch on feature availability. +//! +//! For more information on how features are picked up, see comments for `Feature`. + use lazy_static::lazy_static; use solana_sdk::{ clock::Slot,