Remove id field
This commit is contained in:
@ -3517,11 +3517,7 @@ impl Bank {
|
|||||||
inactive.insert(*feature_id);
|
inactive.insert(*feature_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.feature_set = Arc::new(FeatureSet {
|
self.feature_set = Arc::new(FeatureSet { active, inactive });
|
||||||
id: self.feature_set.id,
|
|
||||||
active,
|
|
||||||
inactive,
|
|
||||||
});
|
|
||||||
newly_activated
|
newly_activated
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ pub mod secp256k1_program_enabled {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
|
/// Map of feature identifiers to user-visible description
|
||||||
pub static ref FEATURE_NAMES: HashMap<Pubkey, &'static str> = [
|
pub static ref FEATURE_NAMES: HashMap<Pubkey, &'static str> = [
|
||||||
(instructions_sysvar_enabled::id(), "instructions sysvar"),
|
(instructions_sysvar_enabled::id(), "instructions sysvar"),
|
||||||
(secp256k1_program_enabled::id(), "secp256k1 program")
|
(secp256k1_program_enabled::id(), "secp256k1 program")
|
||||||
@ -23,7 +24,8 @@ lazy_static! {
|
|||||||
.cloned()
|
.cloned()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
static ref ID: Hash = {
|
/// Unique identifier of the current software's feature set
|
||||||
|
pub static ref ID: Hash = {
|
||||||
let mut hasher = Hasher::default();
|
let mut hasher = Hasher::default();
|
||||||
let mut feature_ids = FEATURE_NAMES.keys().collect::<Vec<_>>();
|
let mut feature_ids = FEATURE_NAMES.keys().collect::<Vec<_>>();
|
||||||
feature_ids.sort();
|
feature_ids.sort();
|
||||||
@ -34,16 +36,10 @@ lazy_static! {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The `FeatureSet` struct tracks the set of available and currently active runtime features
|
/// `FeatureSet` holds the set of currently active/inactive runtime features
|
||||||
#[derive(AbiExample)]
|
#[derive(AbiExample)]
|
||||||
pub struct FeatureSet {
|
pub struct FeatureSet {
|
||||||
/// Unique identifier of this feature set
|
|
||||||
pub id: Hash,
|
|
||||||
|
|
||||||
/// Features that are currently active
|
|
||||||
pub active: HashSet<Pubkey>,
|
pub active: HashSet<Pubkey>,
|
||||||
|
|
||||||
/// Features that are currently inactive
|
|
||||||
pub inactive: HashSet<Pubkey>,
|
pub inactive: HashSet<Pubkey>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,10 +50,9 @@ impl FeatureSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Default for FeatureSet {
|
impl Default for FeatureSet {
|
||||||
// By default all features are disabled
|
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
|
// All features disabled
|
||||||
Self {
|
Self {
|
||||||
id: *ID,
|
|
||||||
active: HashSet::new(),
|
active: HashSet::new(),
|
||||||
inactive: FEATURE_NAMES.keys().cloned().collect(),
|
inactive: FEATURE_NAMES.keys().cloned().collect(),
|
||||||
}
|
}
|
||||||
@ -67,7 +62,6 @@ impl Default for FeatureSet {
|
|||||||
impl FeatureSet {
|
impl FeatureSet {
|
||||||
pub fn enabled() -> Self {
|
pub fn enabled() -> Self {
|
||||||
Self {
|
Self {
|
||||||
id: *ID,
|
|
||||||
active: FEATURE_NAMES.keys().cloned().collect(),
|
active: FEATURE_NAMES.keys().cloned().collect(),
|
||||||
inactive: HashSet::new(),
|
inactive: HashSet::new(),
|
||||||
}
|
}
|
||||||
|
@ -51,9 +51,7 @@ fn compute_commit(sha1: Option<&'static str>) -> Option<u32> {
|
|||||||
impl Default for Version {
|
impl Default for Version {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
let feature_set = u32::from_le_bytes(
|
let feature_set = u32::from_le_bytes(
|
||||||
solana_runtime::feature_set::FeatureSet::default()
|
solana_runtime::feature_set::ID.as_ref()[..4]
|
||||||
.id
|
|
||||||
.as_ref()[..4]
|
|
||||||
.try_into()
|
.try_into()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user