Add comments on how to add a new feature switch (#18686)

This commit is contained in:
steviez
2021-07-18 12:48:09 -05:00
committed by GitHub
parent 8da261cf5c
commit b9dc85a934
3 changed files with 35 additions and 9 deletions

View File

@ -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,