mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 12:47:05 +00:00
Heze fork
This commit is contained in:
@@ -397,8 +397,8 @@ pub fn get_heze_find_head_vote_transition_test_definition() -> ForkChoiceTestDef
|
||||
}
|
||||
|
||||
/// CL attestation weight overrides payload preference tiebreaker.
|
||||
pub fn get_heze_weight_priority_over_payload_preference_test_definition()
|
||||
-> ForkChoiceTestDefinition {
|
||||
pub fn get_heze_weight_priority_over_payload_preference_test_definition() -> ForkChoiceTestDefinition
|
||||
{
|
||||
let mut ops = vec![];
|
||||
|
||||
// Build two branches where one child extends payload (Full) and the other doesn't (Empty).
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
use std::mem;
|
||||
use types::{
|
||||
BeaconState, BeaconStateError as Error, BeaconStateHeze, ChainSpec, EthSpec, Fork,
|
||||
};
|
||||
use types::{BeaconState, BeaconStateError as Error, BeaconStateHeze, ChainSpec, EthSpec, Fork};
|
||||
|
||||
/// Transform a `Gloas` state into a `Heze` state.
|
||||
pub fn upgrade_to_heze<E: EthSpec>(
|
||||
|
||||
@@ -21,8 +21,7 @@ use crate::{
|
||||
BeaconBlockBodyAltair, BeaconBlockBodyBase, BeaconBlockBodyBellatrix,
|
||||
BeaconBlockBodyCapella, BeaconBlockBodyDeneb, BeaconBlockBodyElectra, BeaconBlockBodyFulu,
|
||||
BeaconBlockBodyGloas, BeaconBlockBodyHeze, BeaconBlockBodyRef, BeaconBlockBodyRefMut,
|
||||
BeaconBlockHeader,
|
||||
SignedBeaconBlock, SignedBeaconBlockHeader,
|
||||
BeaconBlockHeader, SignedBeaconBlock, SignedBeaconBlockHeader,
|
||||
},
|
||||
core::{ChainSpec, Domain, Epoch, EthSpec, Graffiti, Hash256, SignedRoot, Slot},
|
||||
deposit::{Deposit, DepositData},
|
||||
|
||||
@@ -13,16 +13,14 @@ pub use beacon_block_body::{
|
||||
BLOB_KZG_COMMITMENTS_INDEX, BeaconBlockBody, BeaconBlockBodyAltair, BeaconBlockBodyBase,
|
||||
BeaconBlockBodyBellatrix, BeaconBlockBodyCapella, BeaconBlockBodyDeneb, BeaconBlockBodyElectra,
|
||||
BeaconBlockBodyFulu, BeaconBlockBodyGloas, BeaconBlockBodyHeze, BeaconBlockBodyRef,
|
||||
BeaconBlockBodyRefMut,
|
||||
NUM_BEACON_BLOCK_BODY_HASH_TREE_ROOT_LEAVES,
|
||||
BeaconBlockBodyRefMut, NUM_BEACON_BLOCK_BODY_HASH_TREE_ROOT_LEAVES,
|
||||
};
|
||||
pub use beacon_block_header::BeaconBlockHeader;
|
||||
|
||||
pub use signed_beacon_block::{
|
||||
SignedBeaconBlock, SignedBeaconBlockAltair, SignedBeaconBlockBase, SignedBeaconBlockBellatrix,
|
||||
SignedBeaconBlockCapella, SignedBeaconBlockDeneb, SignedBeaconBlockElectra,
|
||||
SignedBeaconBlockFulu, SignedBeaconBlockGloas, SignedBeaconBlockHeze, SignedBeaconBlockHash,
|
||||
SignedBlindedBeaconBlock,
|
||||
ssz_tagged_signed_beacon_block, ssz_tagged_signed_beacon_block_arc,
|
||||
SignedBeaconBlockFulu, SignedBeaconBlockGloas, SignedBeaconBlockHash, SignedBeaconBlockHeze,
|
||||
SignedBlindedBeaconBlock, ssz_tagged_signed_beacon_block, ssz_tagged_signed_beacon_block_arc,
|
||||
};
|
||||
pub use signed_beacon_block_header::SignedBeaconBlockHeader;
|
||||
|
||||
@@ -19,9 +19,8 @@ use crate::{
|
||||
BLOB_KZG_COMMITMENTS_INDEX, BeaconBlock, BeaconBlockAltair, BeaconBlockBase,
|
||||
BeaconBlockBellatrix, BeaconBlockBodyBellatrix, BeaconBlockBodyCapella,
|
||||
BeaconBlockBodyDeneb, BeaconBlockBodyElectra, BeaconBlockBodyFulu, BeaconBlockCapella,
|
||||
BeaconBlockDeneb, BeaconBlockElectra, BeaconBlockFulu, BeaconBlockGloas, BeaconBlockHeze,
|
||||
BeaconBlockHeader,
|
||||
BeaconBlockRef, BeaconBlockRefMut, SignedBeaconBlockHeader,
|
||||
BeaconBlockDeneb, BeaconBlockElectra, BeaconBlockFulu, BeaconBlockGloas, BeaconBlockHeader,
|
||||
BeaconBlockHeze, BeaconBlockRef, BeaconBlockRefMut, SignedBeaconBlockHeader,
|
||||
},
|
||||
core::{ChainSpec, Domain, Epoch, EthSpec, Hash256, SignedRoot, SigningData, Slot},
|
||||
execution::{
|
||||
|
||||
@@ -1453,7 +1453,8 @@ impl ChainSpec {
|
||||
.expect("calculation does not overflow"),
|
||||
max_per_epoch_activation_churn_limit_gloas: option_wrapper(|| {
|
||||
u64::checked_pow(2, 7)?.checked_mul(u64::checked_pow(10, 9)?)
|
||||
}).expect("calculation does not overflow"),
|
||||
})
|
||||
.expect("calculation does not overflow"),
|
||||
// Heze
|
||||
heze_fork_version: [0x08, 0x00, 0x00, 0x01],
|
||||
heze_fork_epoch: None,
|
||||
|
||||
@@ -44,7 +44,7 @@ pub struct DataColumnsByRootIdentifier<E: EthSpec> {
|
||||
pub type DataColumnSidecarList<E> = Vec<Arc<DataColumnSidecar<E>>>;
|
||||
|
||||
#[superstruct(
|
||||
variants(Fulu, Gloas, Heze),
|
||||
variants(Fulu, Gloas),
|
||||
variant_attributes(
|
||||
derive(
|
||||
Debug,
|
||||
@@ -95,9 +95,9 @@ pub struct DataColumnSidecar<E: EthSpec> {
|
||||
/// An inclusion proof, proving the inclusion of `blob_kzg_commitments` in `BeaconBlockBody`.
|
||||
#[superstruct(only(Fulu))]
|
||||
pub kzg_commitments_inclusion_proof: FixedVector<Hash256, E::KzgCommitmentsInclusionProofDepth>,
|
||||
#[superstruct(only(Gloas, Heze), partial_getter(rename = "slot_gloas"))]
|
||||
#[superstruct(only(Gloas), partial_getter(rename = "slot_gloas"))]
|
||||
pub slot: Slot,
|
||||
#[superstruct(only(Gloas, Heze))]
|
||||
#[superstruct(only(Gloas))]
|
||||
pub beacon_block_root: Hash256,
|
||||
}
|
||||
|
||||
@@ -106,7 +106,6 @@ impl<E: EthSpec> DataColumnSidecar<E> {
|
||||
match self {
|
||||
DataColumnSidecar::Fulu(column) => column.slot(),
|
||||
DataColumnSidecar::Gloas(column) => column.slot,
|
||||
DataColumnSidecar::Heze(column) => column.slot,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +117,6 @@ impl<E: EthSpec> DataColumnSidecar<E> {
|
||||
match self {
|
||||
DataColumnSidecar::Fulu(column) => column.block_root(),
|
||||
DataColumnSidecar::Gloas(column) => column.beacon_block_root,
|
||||
DataColumnSidecar::Heze(column) => column.beacon_block_root,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,12 +135,9 @@ impl<E: EthSpec> DataColumnSidecar<E> {
|
||||
ForkName::Fulu => Ok(DataColumnSidecar::Fulu(
|
||||
DataColumnSidecarFulu::from_ssz_bytes(bytes)?,
|
||||
)),
|
||||
ForkName::Gloas => Ok(DataColumnSidecar::Gloas(
|
||||
ForkName::Gloas | ForkName::Heze => Ok(DataColumnSidecar::Gloas(
|
||||
DataColumnSidecarGloas::from_ssz_bytes(bytes)?,
|
||||
)),
|
||||
ForkName::Heze => Ok(DataColumnSidecar::Heze(
|
||||
DataColumnSidecarHeze::from_ssz_bytes(bytes)?,
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,33 +310,6 @@ impl<E: EthSpec> DataColumnSidecarGloas<E> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: EthSpec> DataColumnSidecarHeze<E> {
|
||||
pub fn min_size() -> usize {
|
||||
// min size is one cell
|
||||
Self {
|
||||
index: 0,
|
||||
column: VariableList::new(vec![Cell::<E>::default()]).unwrap(),
|
||||
kzg_proofs: VariableList::new(vec![KzgProof::empty()]).unwrap(),
|
||||
slot: Slot::new(0),
|
||||
beacon_block_root: Hash256::ZERO,
|
||||
}
|
||||
.as_ssz_bytes()
|
||||
.len()
|
||||
}
|
||||
|
||||
pub fn max_size(max_blobs_per_block: usize) -> usize {
|
||||
Self {
|
||||
index: 0,
|
||||
column: VariableList::new(vec![Cell::<E>::default(); max_blobs_per_block]).unwrap(),
|
||||
kzg_proofs: VariableList::new(vec![KzgProof::empty(); max_blobs_per_block]).unwrap(),
|
||||
slot: Slot::new(0),
|
||||
beacon_block_root: Hash256::ZERO,
|
||||
}
|
||||
.as_ssz_bytes()
|
||||
.len()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum DataColumnSidecarError {
|
||||
ArithError(ArithError),
|
||||
|
||||
@@ -14,7 +14,7 @@ pub use data_column_custody_group::{
|
||||
};
|
||||
pub use data_column_sidecar::{
|
||||
Cell, ColumnIndex, DataColumn, DataColumnSidecar, DataColumnSidecarError,
|
||||
DataColumnSidecarFulu, DataColumnSidecarGloas, DataColumnSidecarHeze, DataColumnSidecarList,
|
||||
DataColumnSidecarFulu, DataColumnSidecarGloas, DataColumnSidecarList,
|
||||
DataColumnsByRootIdentifier,
|
||||
};
|
||||
pub use data_column_subnet_id::{DataColumnSubnetId, all_data_column_sidecar_subnets_from_spec};
|
||||
|
||||
@@ -140,7 +140,9 @@ impl<E: EthSpec> LightClientBootstrap<E> {
|
||||
ForkName::Electra => <LightClientBootstrapElectra<E> as Encode>::ssz_fixed_len(),
|
||||
ForkName::Fulu => <LightClientBootstrapFulu<E> as Encode>::ssz_fixed_len(),
|
||||
// TODO(gloas): implement Gloas light client
|
||||
ForkName::Gloas | ForkName::Heze => <LightClientBootstrapAltair<E> as Encode>::ssz_fixed_len(),
|
||||
ForkName::Gloas | ForkName::Heze => {
|
||||
<LightClientBootstrapAltair<E> as Encode>::ssz_fixed_len()
|
||||
}
|
||||
};
|
||||
fixed_len + LightClientHeader::<E>::ssz_max_var_len_for_fork(fork_name)
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ pub use balance::Balance;
|
||||
pub use beacon_state::{
|
||||
BeaconState, BeaconStateAltair, BeaconStateBase, BeaconStateBellatrix, BeaconStateCapella,
|
||||
BeaconStateDeneb, BeaconStateElectra, BeaconStateError, BeaconStateFulu, BeaconStateGloas,
|
||||
BeaconStateHash, BeaconStateHeze, BeaconStateRef, CACHED_EPOCHS,
|
||||
DEFAULT_PRE_ELECTRA_WS_PERIOD, Validators,
|
||||
BeaconStateHash, BeaconStateHeze, BeaconStateRef, CACHED_EPOCHS, DEFAULT_PRE_ELECTRA_WS_PERIOD,
|
||||
Validators,
|
||||
};
|
||||
pub use committee_cache::{
|
||||
CommitteeCache, compute_committee_index_in_epoch, compute_committee_range_in_epoch,
|
||||
|
||||
Reference in New Issue
Block a user