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,3 +1,5 @@
//! Methods for working with `Feature` accounts.
use crate::account::{AccountSharedData, ReadableAccount, WritableAccount};
pub use solana_program::feature::*;

View File

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