diff --git a/consensus/types/src/beacon_block_body.rs b/consensus/types/src/beacon_block_body.rs index 73aeb2c025..8f975fc5cf 100644 --- a/consensus/types/src/beacon_block_body.rs +++ b/consensus/types/src/beacon_block_body.rs @@ -68,7 +68,7 @@ pub struct BeaconBlockBody = FullPay pub attestations: VariableList, E::MaxAttestations>, pub deposits: VariableList, pub voluntary_exits: VariableList, - #[superstruct(feature(SyncCommittees))] + #[superstruct(feature(Altair))] pub sync_aggregate: SyncAggregate, // We flatten the execution payload so that serde can use the name of the inner type, // either `execution_payload` for full payloads, or `execution_payload_header` for blinded @@ -85,10 +85,10 @@ pub struct BeaconBlockBody = FullPay #[superstruct(only(Electra), partial_getter(rename = "execution_payload_electra"))] #[serde(flatten)] pub execution_payload: Payload::Electra, - #[superstruct(feature(Withdrawals))] + #[superstruct(feature(Capella))] pub bls_to_execution_changes: VariableList, - #[superstruct(feature(Blobs))] + #[superstruct(feature(Deneb))] pub blob_kzg_commitments: KzgCommitments, #[superstruct(feature(not(Merge)))] #[ssz(skip_serializing, skip_deserializing)] diff --git a/consensus/types/src/beacon_state.rs b/consensus/types/src/beacon_state.rs index 88aec16126..4fc685e081 100644 --- a/consensus/types/src/beacon_state.rs +++ b/consensus/types/src/beacon_state.rs @@ -269,15 +269,15 @@ where pub slashings: FixedVector, // Attestations (genesis fork only) - #[superstruct(feature(not(SyncCommittees)))] + #[superstruct(feature(not(Altair)))] pub previous_epoch_attestations: VariableList, E::MaxPendingAttestations>, - #[superstruct(feature(not(SyncCommittees)))] + #[superstruct(feature(not(Altair)))] pub current_epoch_attestations: VariableList, E::MaxPendingAttestations>, // Participation (Altair and later) - #[superstruct(feature(SyncCommittees))] + #[superstruct(feature(Altair))] pub previous_epoch_participation: VariableList, - #[superstruct(feature(SyncCommittees))] + #[superstruct(feature(Altair))] pub current_epoch_participation: VariableList, // Finality @@ -292,13 +292,13 @@ where // Inactivity #[serde(with = "ssz_types::serde_utils::quoted_u64_var_list")] - #[superstruct(feature(SyncCommittees))] + #[superstruct(feature(Altair))] pub inactivity_scores: VariableList, // Light-client sync committees - #[superstruct(feature(SyncCommittees))] + #[superstruct(feature(Altair))] pub current_sync_committee: Arc>, - #[superstruct(feature(SyncCommittees))] + #[superstruct(feature(Altair))] pub next_sync_committee: Arc>, // Execution @@ -324,14 +324,14 @@ where pub latest_execution_payload_header: ExecutionPayloadHeaderElectra, // Capella - #[superstruct(feature(Withdrawals), partial_getter(copy))] + #[superstruct(feature(Capella), partial_getter(copy))] #[serde(with = "serde_utils::quoted_u64")] pub next_withdrawal_index: u64, - #[superstruct(feature(Withdrawals), partial_getter(copy))] + #[superstruct(feature(Capella), partial_getter(copy))] #[serde(with = "serde_utils::quoted_u64")] pub next_withdrawal_validator_index: u64, // Deep history valid from Capella onwards. - #[superstruct(feature(Withdrawals))] + #[superstruct(feature(Capella))] pub historical_summaries: VariableList, // Caching (not in the spec) diff --git a/consensus/types/src/feature_name.rs b/consensus/types/src/feature_name.rs index 3bee5798bf..aab2353681 100644 --- a/consensus/types/src/feature_name.rs +++ b/consensus/types/src/feature_name.rs @@ -1,12 +1,25 @@ +// A list of all individual features that are available. +// We can gate parts of the code behind checks that ensure a feature is active. +// +// For now, older Forks have a single "super-feature" which contains all features associated with +// that Fork. It may be worth splitting these up at a later time. pub enum FeatureName { // Altair. - SyncCommittees, + Altair, // Bellatrix. Merge, // Capella. - Withdrawals, + Capella, // Deneb. - Blobs, + Deneb, // Electra. + // + // Supply deposits on chain. EIP6110, + // EL triggerable exits. + EIP7002, + // Increase MAX_EFFECTIVE_BALANCE. + EIP7251, + // Committee index outside Attestation. + EIP7549, } diff --git a/consensus/types/src/fork_order.rs b/consensus/types/src/fork_order.rs index e1bd7cd1d9..220f4ed7a7 100644 --- a/consensus/types/src/fork_order.rs +++ b/consensus/types/src/fork_order.rs @@ -4,19 +4,19 @@ use superstruct::superstruct; #[superstruct(variants_and_features_decl = "FORK_ORDER")] pub const FORK_ORDER: &[(ForkName, &[FeatureName])] = &[ (ForkName::Base, &[]), - (ForkName::Altair, &[FeatureName::SyncCommittees]), + (ForkName::Altair, &[FeatureName::Altair]), (ForkName::Merge, &[FeatureName::Merge]), - (ForkName::Capella, &[FeatureName::Withdrawals]), - (ForkName::Deneb, &[FeatureName::Blobs]), + (ForkName::Capella, &[FeatureName::Capella]), + (ForkName::Deneb, &[FeatureName::Deneb]), (ForkName::Electra, &[]), ]; #[superstruct(feature_dependencies_decl = "FEATURE_DEPENDENCIES")] pub const FEATURE_DEPENDENCIES: &[(FeatureName, &[FeatureName])] = &[ - (FeatureName::SyncCommittees, &[]), - (FeatureName::Merge, &[FeatureName::SyncCommittees]), - (FeatureName::Withdrawals, &[FeatureName::Merge]), - (FeatureName::Blobs, &[FeatureName::Withdrawals]), + (FeatureName::Altair, &[]), + (FeatureName::Merge, &[FeatureName::Altair]), + (FeatureName::Capella, &[FeatureName::Merge]), + (FeatureName::Deneb, &[FeatureName::Capella]), ]; #[cfg(test)]