mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
Add PeerDAS presets and configs. (#6127)
* Add PeerDAS presets and configs. * Update default value for `max_request_data_column_sidecars`.
This commit is contained in:
@@ -137,3 +137,7 @@ MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 16384
|
|||||||
# `6`
|
# `6`
|
||||||
BLOB_SIDECAR_SUBNET_COUNT: 6
|
BLOB_SIDECAR_SUBNET_COUNT: 6
|
||||||
|
|
||||||
|
# DAS
|
||||||
|
CUSTODY_REQUIREMENT: 1
|
||||||
|
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
|
||||||
|
NUMBER_OF_COLUMNS: 128
|
||||||
@@ -119,3 +119,8 @@ MAX_REQUEST_BLOB_SIDECARS: 768
|
|||||||
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 16384
|
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 16384
|
||||||
# `6`
|
# `6`
|
||||||
BLOB_SIDECAR_SUBNET_COUNT: 6
|
BLOB_SIDECAR_SUBNET_COUNT: 6
|
||||||
|
|
||||||
|
# DAS
|
||||||
|
CUSTODY_REQUIREMENT: 1
|
||||||
|
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
|
||||||
|
NUMBER_OF_COLUMNS: 128
|
||||||
@@ -123,3 +123,8 @@ MAX_REQUEST_BLOB_SIDECARS: 768
|
|||||||
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
|
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
|
||||||
# `6`
|
# `6`
|
||||||
BLOB_SIDECAR_SUBNET_COUNT: 6
|
BLOB_SIDECAR_SUBNET_COUNT: 6
|
||||||
|
|
||||||
|
# DAS
|
||||||
|
CUSTODY_REQUIREMENT: 1
|
||||||
|
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
|
||||||
|
NUMBER_OF_COLUMNS: 128
|
||||||
@@ -53,6 +53,8 @@ DENEB_FORK_EPOCH: 269568 # March 13, 2024, 01:55:35pm UTC
|
|||||||
# Electra
|
# Electra
|
||||||
ELECTRA_FORK_VERSION: 0x05000000
|
ELECTRA_FORK_VERSION: 0x05000000
|
||||||
ELECTRA_FORK_EPOCH: 18446744073709551615
|
ELECTRA_FORK_EPOCH: 18446744073709551615
|
||||||
|
# PeerDAS
|
||||||
|
EIP7594_FORK_EPOCH: 18446744073709551615
|
||||||
|
|
||||||
|
|
||||||
# Time parameters
|
# Time parameters
|
||||||
@@ -143,3 +145,8 @@ MAX_REQUEST_BLOB_SIDECARS: 768
|
|||||||
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
|
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
|
||||||
# `6`
|
# `6`
|
||||||
BLOB_SIDECAR_SUBNET_COUNT: 6
|
BLOB_SIDECAR_SUBNET_COUNT: 6
|
||||||
|
|
||||||
|
# DAS
|
||||||
|
CUSTODY_REQUIREMENT: 1
|
||||||
|
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
|
||||||
|
NUMBER_OF_COLUMNS: 128
|
||||||
@@ -119,3 +119,8 @@ MAX_REQUEST_BLOB_SIDECARS: 768
|
|||||||
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
|
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
|
||||||
# `6`
|
# `6`
|
||||||
BLOB_SIDECAR_SUBNET_COUNT: 6
|
BLOB_SIDECAR_SUBNET_COUNT: 6
|
||||||
|
|
||||||
|
# DAS
|
||||||
|
CUSTODY_REQUIREMENT: 1
|
||||||
|
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
|
||||||
|
NUMBER_OF_COLUMNS: 128
|
||||||
10
consensus/types/presets/gnosis/eip7594.yaml
Normal file
10
consensus/types/presets/gnosis/eip7594.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Mainnet preset - EIP7594
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
# ---------------------------------------------------------------
|
||||||
|
# `uint64(2**6)` (= 64)
|
||||||
|
FIELD_ELEMENTS_PER_CELL: 64
|
||||||
|
# `uint64(2 * 4096)` (= 8192)
|
||||||
|
FIELD_ELEMENTS_PER_EXT_BLOB: 8192
|
||||||
|
# uint64(floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments'))
|
||||||
|
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4
|
||||||
10
consensus/types/presets/mainnet/eip7594.yaml
Normal file
10
consensus/types/presets/mainnet/eip7594.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Mainnet preset - EIP7594
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
# ---------------------------------------------------------------
|
||||||
|
# `uint64(2**6)` (= 64)
|
||||||
|
FIELD_ELEMENTS_PER_CELL: 64
|
||||||
|
# `uint64(2 * 4096)` (= 8192)
|
||||||
|
FIELD_ELEMENTS_PER_EXT_BLOB: 8192
|
||||||
|
# uint64(floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments'))
|
||||||
|
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4
|
||||||
10
consensus/types/presets/minimal/eip7594.yaml
Normal file
10
consensus/types/presets/minimal/eip7594.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Minimal preset - EIP7594
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
# ---------------------------------------------------------------
|
||||||
|
# `uint64(2**6)` (= 64)
|
||||||
|
FIELD_ELEMENTS_PER_CELL: 64
|
||||||
|
# `uint64(2 * 4096)` (= 8192)
|
||||||
|
FIELD_ELEMENTS_PER_EXT_BLOB: 8192
|
||||||
|
# uint64(floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments'))
|
||||||
|
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
use crate::application_domain::{ApplicationDomain, APPLICATION_DOMAIN_BUILDER};
|
use crate::application_domain::{ApplicationDomain, APPLICATION_DOMAIN_BUILDER};
|
||||||
use crate::blob_sidecar::BlobIdentifier;
|
use crate::blob_sidecar::BlobIdentifier;
|
||||||
|
use crate::data_column_sidecar::DataColumnIdentifier;
|
||||||
use crate::*;
|
use crate::*;
|
||||||
use int_to_bytes::int_to_bytes4;
|
use int_to_bytes::int_to_bytes4;
|
||||||
use safe_arith::{ArithError, SafeArith};
|
use safe_arith::{ArithError, SafeArith};
|
||||||
@@ -193,6 +194,9 @@ pub struct ChainSpec {
|
|||||||
/*
|
/*
|
||||||
* DAS params
|
* DAS params
|
||||||
*/
|
*/
|
||||||
|
pub eip7594_fork_epoch: Option<Epoch>,
|
||||||
|
pub custody_requirement: u64,
|
||||||
|
pub data_column_sidecar_subnet_count: u64,
|
||||||
pub number_of_columns: usize,
|
pub number_of_columns: usize,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -223,6 +227,7 @@ pub struct ChainSpec {
|
|||||||
*/
|
*/
|
||||||
pub max_request_blocks_deneb: u64,
|
pub max_request_blocks_deneb: u64,
|
||||||
pub max_request_blob_sidecars: u64,
|
pub max_request_blob_sidecars: u64,
|
||||||
|
pub max_request_data_column_sidecars: u64,
|
||||||
pub min_epochs_for_blob_sidecars_requests: u64,
|
pub min_epochs_for_blob_sidecars_requests: u64,
|
||||||
pub blob_sidecar_subnet_count: u64,
|
pub blob_sidecar_subnet_count: u64,
|
||||||
|
|
||||||
@@ -234,6 +239,7 @@ pub struct ChainSpec {
|
|||||||
pub max_blocks_by_root_request: usize,
|
pub max_blocks_by_root_request: usize,
|
||||||
pub max_blocks_by_root_request_deneb: usize,
|
pub max_blocks_by_root_request_deneb: usize,
|
||||||
pub max_blobs_by_root_request: usize,
|
pub max_blobs_by_root_request: usize,
|
||||||
|
pub max_data_columns_by_root_request: usize,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Application params
|
* Application params
|
||||||
@@ -413,6 +419,13 @@ impl ChainSpec {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns true if the given epoch is greater than or equal to the `EIP7594_FORK_EPOCH`.
|
||||||
|
pub fn is_peer_das_enabled_for_epoch(&self, block_epoch: Epoch) -> bool {
|
||||||
|
self.eip7594_fork_epoch.map_or(false, |eip7594_fork_epoch| {
|
||||||
|
block_epoch >= eip7594_fork_epoch
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns a full `Fork` struct for a given epoch.
|
/// Returns a full `Fork` struct for a given epoch.
|
||||||
pub fn fork_at_epoch(&self, epoch: Epoch) -> Fork {
|
pub fn fork_at_epoch(&self, epoch: Epoch) -> Fork {
|
||||||
let current_fork_name = self.fork_name_at_epoch(epoch);
|
let current_fork_name = self.fork_name_at_epoch(epoch);
|
||||||
@@ -587,6 +600,12 @@ impl ChainSpec {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn data_columns_per_subnet(&self) -> usize {
|
||||||
|
self.number_of_columns
|
||||||
|
.safe_div(self.data_column_sidecar_subnet_count as usize)
|
||||||
|
.expect("Subnet count must be greater than 0")
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns a `ChainSpec` compatible with the Ethereum Foundation specification.
|
/// Returns a `ChainSpec` compatible with the Ethereum Foundation specification.
|
||||||
pub fn mainnet() -> Self {
|
pub fn mainnet() -> Self {
|
||||||
Self {
|
Self {
|
||||||
@@ -777,6 +796,12 @@ impl ChainSpec {
|
|||||||
})
|
})
|
||||||
.expect("calculation does not overflow"),
|
.expect("calculation does not overflow"),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DAS params
|
||||||
|
*/
|
||||||
|
eip7594_fork_epoch: None,
|
||||||
|
custody_requirement: 1,
|
||||||
|
data_column_sidecar_subnet_count: 32,
|
||||||
number_of_columns: 128,
|
number_of_columns: 128,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -808,6 +833,7 @@ impl ChainSpec {
|
|||||||
*/
|
*/
|
||||||
max_request_blocks_deneb: default_max_request_blocks_deneb(),
|
max_request_blocks_deneb: default_max_request_blocks_deneb(),
|
||||||
max_request_blob_sidecars: default_max_request_blob_sidecars(),
|
max_request_blob_sidecars: default_max_request_blob_sidecars(),
|
||||||
|
max_request_data_column_sidecars: default_max_request_data_column_sidecars(),
|
||||||
min_epochs_for_blob_sidecars_requests: default_min_epochs_for_blob_sidecars_requests(),
|
min_epochs_for_blob_sidecars_requests: default_min_epochs_for_blob_sidecars_requests(),
|
||||||
blob_sidecar_subnet_count: default_blob_sidecar_subnet_count(),
|
blob_sidecar_subnet_count: default_blob_sidecar_subnet_count(),
|
||||||
|
|
||||||
@@ -817,6 +843,7 @@ impl ChainSpec {
|
|||||||
max_blocks_by_root_request: default_max_blocks_by_root_request(),
|
max_blocks_by_root_request: default_max_blocks_by_root_request(),
|
||||||
max_blocks_by_root_request_deneb: default_max_blocks_by_root_request_deneb(),
|
max_blocks_by_root_request_deneb: default_max_blocks_by_root_request_deneb(),
|
||||||
max_blobs_by_root_request: default_max_blobs_by_root_request(),
|
max_blobs_by_root_request: default_max_blobs_by_root_request(),
|
||||||
|
max_data_columns_by_root_request: default_data_columns_by_root_request(),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Application specific
|
* Application specific
|
||||||
@@ -888,6 +915,8 @@ impl ChainSpec {
|
|||||||
u64::checked_pow(2, 7)?.checked_mul(u64::checked_pow(10, 9)?)
|
u64::checked_pow(2, 7)?.checked_mul(u64::checked_pow(10, 9)?)
|
||||||
})
|
})
|
||||||
.expect("calculation does not overflow"),
|
.expect("calculation does not overflow"),
|
||||||
|
// PeerDAS
|
||||||
|
eip7594_fork_epoch: None,
|
||||||
// Other
|
// Other
|
||||||
network_id: 2, // lighthouse testnet network id
|
network_id: 2, // lighthouse testnet network id
|
||||||
deposit_chain_id: 5,
|
deposit_chain_id: 5,
|
||||||
@@ -1089,8 +1118,13 @@ impl ChainSpec {
|
|||||||
})
|
})
|
||||||
.expect("calculation does not overflow"),
|
.expect("calculation does not overflow"),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DAS params
|
||||||
|
*/
|
||||||
|
eip7594_fork_epoch: None,
|
||||||
|
custody_requirement: 1,
|
||||||
|
data_column_sidecar_subnet_count: 32,
|
||||||
number_of_columns: 128,
|
number_of_columns: 128,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Network specific
|
* Network specific
|
||||||
*/
|
*/
|
||||||
@@ -1120,6 +1154,7 @@ impl ChainSpec {
|
|||||||
*/
|
*/
|
||||||
max_request_blocks_deneb: default_max_request_blocks_deneb(),
|
max_request_blocks_deneb: default_max_request_blocks_deneb(),
|
||||||
max_request_blob_sidecars: default_max_request_blob_sidecars(),
|
max_request_blob_sidecars: default_max_request_blob_sidecars(),
|
||||||
|
max_request_data_column_sidecars: default_max_request_data_column_sidecars(),
|
||||||
min_epochs_for_blob_sidecars_requests: 16384,
|
min_epochs_for_blob_sidecars_requests: 16384,
|
||||||
blob_sidecar_subnet_count: default_blob_sidecar_subnet_count(),
|
blob_sidecar_subnet_count: default_blob_sidecar_subnet_count(),
|
||||||
|
|
||||||
@@ -1129,6 +1164,7 @@ impl ChainSpec {
|
|||||||
max_blocks_by_root_request: default_max_blocks_by_root_request(),
|
max_blocks_by_root_request: default_max_blocks_by_root_request(),
|
||||||
max_blocks_by_root_request_deneb: default_max_blocks_by_root_request_deneb(),
|
max_blocks_by_root_request_deneb: default_max_blocks_by_root_request_deneb(),
|
||||||
max_blobs_by_root_request: default_max_blobs_by_root_request(),
|
max_blobs_by_root_request: default_max_blobs_by_root_request(),
|
||||||
|
max_data_columns_by_root_request: default_data_columns_by_root_request(),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Application specific
|
* Application specific
|
||||||
@@ -1222,6 +1258,11 @@ pub struct Config {
|
|||||||
#[serde(deserialize_with = "deserialize_fork_epoch")]
|
#[serde(deserialize_with = "deserialize_fork_epoch")]
|
||||||
pub electra_fork_epoch: Option<MaybeQuoted<Epoch>>,
|
pub electra_fork_epoch: Option<MaybeQuoted<Epoch>>,
|
||||||
|
|
||||||
|
#[serde(default)]
|
||||||
|
#[serde(serialize_with = "serialize_fork_epoch")]
|
||||||
|
#[serde(deserialize_with = "deserialize_fork_epoch")]
|
||||||
|
pub eip7594_fork_epoch: Option<MaybeQuoted<Epoch>>,
|
||||||
|
|
||||||
#[serde(with = "serde_utils::quoted_u64")]
|
#[serde(with = "serde_utils::quoted_u64")]
|
||||||
seconds_per_slot: u64,
|
seconds_per_slot: u64,
|
||||||
#[serde(with = "serde_utils::quoted_u64")]
|
#[serde(with = "serde_utils::quoted_u64")]
|
||||||
@@ -1307,6 +1348,9 @@ pub struct Config {
|
|||||||
#[serde(default = "default_max_request_blob_sidecars")]
|
#[serde(default = "default_max_request_blob_sidecars")]
|
||||||
#[serde(with = "serde_utils::quoted_u64")]
|
#[serde(with = "serde_utils::quoted_u64")]
|
||||||
max_request_blob_sidecars: u64,
|
max_request_blob_sidecars: u64,
|
||||||
|
#[serde(default = "default_max_request_data_column_sidecars")]
|
||||||
|
#[serde(with = "serde_utils::quoted_u64")]
|
||||||
|
max_request_data_column_sidecars: u64,
|
||||||
#[serde(default = "default_min_epochs_for_blob_sidecars_requests")]
|
#[serde(default = "default_min_epochs_for_blob_sidecars_requests")]
|
||||||
#[serde(with = "serde_utils::quoted_u64")]
|
#[serde(with = "serde_utils::quoted_u64")]
|
||||||
min_epochs_for_blob_sidecars_requests: u64,
|
min_epochs_for_blob_sidecars_requests: u64,
|
||||||
@@ -1320,6 +1364,13 @@ pub struct Config {
|
|||||||
#[serde(default = "default_max_per_epoch_activation_exit_churn_limit")]
|
#[serde(default = "default_max_per_epoch_activation_exit_churn_limit")]
|
||||||
#[serde(with = "serde_utils::quoted_u64")]
|
#[serde(with = "serde_utils::quoted_u64")]
|
||||||
max_per_epoch_activation_exit_churn_limit: u64,
|
max_per_epoch_activation_exit_churn_limit: u64,
|
||||||
|
|
||||||
|
#[serde(with = "serde_utils::quoted_u64")]
|
||||||
|
custody_requirement: u64,
|
||||||
|
#[serde(with = "serde_utils::quoted_u64")]
|
||||||
|
data_column_sidecar_subnet_count: u64,
|
||||||
|
#[serde(with = "serde_utils::quoted_u64")]
|
||||||
|
number_of_columns: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_bellatrix_fork_version() -> [u8; 4] {
|
fn default_bellatrix_fork_version() -> [u8; 4] {
|
||||||
@@ -1426,6 +1477,10 @@ const fn default_max_request_blob_sidecars() -> u64 {
|
|||||||
768
|
768
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fn default_max_request_data_column_sidecars() -> u64 {
|
||||||
|
16384
|
||||||
|
}
|
||||||
|
|
||||||
const fn default_min_epochs_for_blob_sidecars_requests() -> u64 {
|
const fn default_min_epochs_for_blob_sidecars_requests() -> u64 {
|
||||||
4096
|
4096
|
||||||
}
|
}
|
||||||
@@ -1479,6 +1534,20 @@ fn max_blobs_by_root_request_common(max_request_blob_sidecars: u64) -> usize {
|
|||||||
.len()
|
.len()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn max_data_columns_by_root_request_common(max_request_data_column_sidecars: u64) -> usize {
|
||||||
|
let max_request_data_column_sidecars = max_request_data_column_sidecars as usize;
|
||||||
|
let empty_data_column_id = DataColumnIdentifier {
|
||||||
|
block_root: Hash256::zero(),
|
||||||
|
index: 0,
|
||||||
|
};
|
||||||
|
RuntimeVariableList::from_vec(
|
||||||
|
vec![empty_data_column_id; max_request_data_column_sidecars],
|
||||||
|
max_request_data_column_sidecars,
|
||||||
|
)
|
||||||
|
.as_ssz_bytes()
|
||||||
|
.len()
|
||||||
|
}
|
||||||
|
|
||||||
fn default_max_blocks_by_root_request() -> usize {
|
fn default_max_blocks_by_root_request() -> usize {
|
||||||
max_blocks_by_root_request_common(default_max_request_blocks())
|
max_blocks_by_root_request_common(default_max_request_blocks())
|
||||||
}
|
}
|
||||||
@@ -1491,6 +1560,10 @@ fn default_max_blobs_by_root_request() -> usize {
|
|||||||
max_blobs_by_root_request_common(default_max_request_blob_sidecars())
|
max_blobs_by_root_request_common(default_max_request_blob_sidecars())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn default_data_columns_by_root_request() -> usize {
|
||||||
|
max_data_columns_by_root_request_common(default_max_request_data_column_sidecars())
|
||||||
|
}
|
||||||
|
|
||||||
impl Default for Config {
|
impl Default for Config {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
let chain_spec = MainnetEthSpec::default_spec();
|
let chain_spec = MainnetEthSpec::default_spec();
|
||||||
@@ -1580,6 +1653,10 @@ impl Config {
|
|||||||
.electra_fork_epoch
|
.electra_fork_epoch
|
||||||
.map(|epoch| MaybeQuoted { value: epoch }),
|
.map(|epoch| MaybeQuoted { value: epoch }),
|
||||||
|
|
||||||
|
eip7594_fork_epoch: spec
|
||||||
|
.eip7594_fork_epoch
|
||||||
|
.map(|epoch| MaybeQuoted { value: epoch }),
|
||||||
|
|
||||||
seconds_per_slot: spec.seconds_per_slot,
|
seconds_per_slot: spec.seconds_per_slot,
|
||||||
seconds_per_eth1_block: spec.seconds_per_eth1_block,
|
seconds_per_eth1_block: spec.seconds_per_eth1_block,
|
||||||
min_validator_withdrawability_delay: spec.min_validator_withdrawability_delay,
|
min_validator_withdrawability_delay: spec.min_validator_withdrawability_delay,
|
||||||
@@ -1616,12 +1693,17 @@ impl Config {
|
|||||||
attestation_subnet_shuffling_prefix_bits: spec.attestation_subnet_shuffling_prefix_bits,
|
attestation_subnet_shuffling_prefix_bits: spec.attestation_subnet_shuffling_prefix_bits,
|
||||||
max_request_blocks_deneb: spec.max_request_blocks_deneb,
|
max_request_blocks_deneb: spec.max_request_blocks_deneb,
|
||||||
max_request_blob_sidecars: spec.max_request_blob_sidecars,
|
max_request_blob_sidecars: spec.max_request_blob_sidecars,
|
||||||
|
max_request_data_column_sidecars: spec.max_request_data_column_sidecars,
|
||||||
min_epochs_for_blob_sidecars_requests: spec.min_epochs_for_blob_sidecars_requests,
|
min_epochs_for_blob_sidecars_requests: spec.min_epochs_for_blob_sidecars_requests,
|
||||||
blob_sidecar_subnet_count: spec.blob_sidecar_subnet_count,
|
blob_sidecar_subnet_count: spec.blob_sidecar_subnet_count,
|
||||||
|
|
||||||
min_per_epoch_churn_limit_electra: spec.min_per_epoch_churn_limit_electra,
|
min_per_epoch_churn_limit_electra: spec.min_per_epoch_churn_limit_electra,
|
||||||
max_per_epoch_activation_exit_churn_limit: spec
|
max_per_epoch_activation_exit_churn_limit: spec
|
||||||
.max_per_epoch_activation_exit_churn_limit,
|
.max_per_epoch_activation_exit_churn_limit,
|
||||||
|
|
||||||
|
custody_requirement: spec.custody_requirement,
|
||||||
|
data_column_sidecar_subnet_count: spec.data_column_sidecar_subnet_count,
|
||||||
|
number_of_columns: spec.number_of_columns as u64,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1655,6 +1737,7 @@ impl Config {
|
|||||||
deneb_fork_version,
|
deneb_fork_version,
|
||||||
electra_fork_epoch,
|
electra_fork_epoch,
|
||||||
electra_fork_version,
|
electra_fork_version,
|
||||||
|
eip7594_fork_epoch,
|
||||||
seconds_per_slot,
|
seconds_per_slot,
|
||||||
seconds_per_eth1_block,
|
seconds_per_eth1_block,
|
||||||
min_validator_withdrawability_delay,
|
min_validator_withdrawability_delay,
|
||||||
@@ -1687,10 +1770,15 @@ impl Config {
|
|||||||
maximum_gossip_clock_disparity_millis,
|
maximum_gossip_clock_disparity_millis,
|
||||||
max_request_blocks_deneb,
|
max_request_blocks_deneb,
|
||||||
max_request_blob_sidecars,
|
max_request_blob_sidecars,
|
||||||
|
max_request_data_column_sidecars,
|
||||||
min_epochs_for_blob_sidecars_requests,
|
min_epochs_for_blob_sidecars_requests,
|
||||||
blob_sidecar_subnet_count,
|
blob_sidecar_subnet_count,
|
||||||
|
|
||||||
min_per_epoch_churn_limit_electra,
|
min_per_epoch_churn_limit_electra,
|
||||||
max_per_epoch_activation_exit_churn_limit,
|
max_per_epoch_activation_exit_churn_limit,
|
||||||
|
custody_requirement,
|
||||||
|
data_column_sidecar_subnet_count,
|
||||||
|
number_of_columns,
|
||||||
} = self;
|
} = self;
|
||||||
|
|
||||||
if preset_base != E::spec_name().to_string().as_str() {
|
if preset_base != E::spec_name().to_string().as_str() {
|
||||||
@@ -1713,6 +1801,7 @@ impl Config {
|
|||||||
deneb_fork_version,
|
deneb_fork_version,
|
||||||
electra_fork_epoch: electra_fork_epoch.map(|q| q.value),
|
electra_fork_epoch: electra_fork_epoch.map(|q| q.value),
|
||||||
electra_fork_version,
|
electra_fork_version,
|
||||||
|
eip7594_fork_epoch: eip7594_fork_epoch.map(|q| q.value),
|
||||||
seconds_per_slot,
|
seconds_per_slot,
|
||||||
seconds_per_eth1_block,
|
seconds_per_eth1_block,
|
||||||
min_validator_withdrawability_delay,
|
min_validator_withdrawability_delay,
|
||||||
@@ -1749,8 +1838,10 @@ impl Config {
|
|||||||
maximum_gossip_clock_disparity_millis,
|
maximum_gossip_clock_disparity_millis,
|
||||||
max_request_blocks_deneb,
|
max_request_blocks_deneb,
|
||||||
max_request_blob_sidecars,
|
max_request_blob_sidecars,
|
||||||
|
max_request_data_column_sidecars,
|
||||||
min_epochs_for_blob_sidecars_requests,
|
min_epochs_for_blob_sidecars_requests,
|
||||||
blob_sidecar_subnet_count,
|
blob_sidecar_subnet_count,
|
||||||
|
|
||||||
min_per_epoch_churn_limit_electra,
|
min_per_epoch_churn_limit_electra,
|
||||||
max_per_epoch_activation_exit_churn_limit,
|
max_per_epoch_activation_exit_churn_limit,
|
||||||
|
|
||||||
@@ -1760,6 +1851,13 @@ impl Config {
|
|||||||
max_request_blocks_deneb,
|
max_request_blocks_deneb,
|
||||||
),
|
),
|
||||||
max_blobs_by_root_request: max_blobs_by_root_request_common(max_request_blob_sidecars),
|
max_blobs_by_root_request: max_blobs_by_root_request_common(max_request_blob_sidecars),
|
||||||
|
max_data_columns_by_root_request: max_data_columns_by_root_request_common(
|
||||||
|
max_request_data_column_sidecars,
|
||||||
|
),
|
||||||
|
|
||||||
|
custody_requirement,
|
||||||
|
data_column_sidecar_subnet_count,
|
||||||
|
number_of_columns: number_of_columns as usize,
|
||||||
|
|
||||||
..chain_spec.clone()
|
..chain_spec.clone()
|
||||||
})
|
})
|
||||||
@@ -2001,6 +2099,9 @@ mod yaml_tests {
|
|||||||
DEPOSIT_CHAIN_ID: 1
|
DEPOSIT_CHAIN_ID: 1
|
||||||
DEPOSIT_NETWORK_ID: 1
|
DEPOSIT_NETWORK_ID: 1
|
||||||
DEPOSIT_CONTRACT_ADDRESS: 0x00000000219ab540356cBB839Cbe05303d7705Fa
|
DEPOSIT_CONTRACT_ADDRESS: 0x00000000219ab540356cBB839Cbe05303d7705Fa
|
||||||
|
CUSTODY_REQUIREMENT: 1
|
||||||
|
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
|
||||||
|
NUMBER_OF_COLUMNS: 128
|
||||||
"#;
|
"#;
|
||||||
|
|
||||||
let chain_spec: Config = serde_yaml::from_str(spec).unwrap();
|
let chain_spec: Config = serde_yaml::from_str(spec).unwrap();
|
||||||
|
|||||||
@@ -278,6 +278,28 @@ impl ElectraPreset {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
|
||||||
|
#[serde(rename_all = "UPPERCASE")]
|
||||||
|
pub struct Eip7594Preset {
|
||||||
|
#[serde(with = "serde_utils::quoted_u64")]
|
||||||
|
pub field_elements_per_cell: u64,
|
||||||
|
#[serde(with = "serde_utils::quoted_u64")]
|
||||||
|
pub field_elements_per_ext_blob: u64,
|
||||||
|
#[serde(with = "serde_utils::quoted_u64")]
|
||||||
|
pub kzg_commitments_inclusion_proof_depth: u64,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Eip7594Preset {
|
||||||
|
pub fn from_chain_spec<E: EthSpec>(_spec: &ChainSpec) -> Self {
|
||||||
|
Self {
|
||||||
|
field_elements_per_cell: E::field_elements_per_cell() as u64,
|
||||||
|
field_elements_per_ext_blob: E::field_elements_per_ext_blob() as u64,
|
||||||
|
kzg_commitments_inclusion_proof_depth: E::kzg_commitments_inclusion_proof_depth()
|
||||||
|
as u64,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::*;
|
use super::*;
|
||||||
@@ -322,6 +344,9 @@ mod test {
|
|||||||
|
|
||||||
let electra: ElectraPreset = preset_from_file(&preset_name, "electra.yaml");
|
let electra: ElectraPreset = preset_from_file(&preset_name, "electra.yaml");
|
||||||
assert_eq!(electra, ElectraPreset::from_chain_spec::<E>(&spec));
|
assert_eq!(electra, ElectraPreset::from_chain_spec::<E>(&spec));
|
||||||
|
|
||||||
|
let eip7594: Eip7594Preset = preset_from_file(&preset_name, "eip7594.yaml");
|
||||||
|
assert_eq!(eip7594, Eip7594Preset::from_chain_spec::<E>(&spec));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -98,3 +98,8 @@ ATTESTATION_SUBNET_COUNT: 64
|
|||||||
ATTESTATION_SUBNET_EXTRA_BITS: 0
|
ATTESTATION_SUBNET_EXTRA_BITS: 0
|
||||||
ATTESTATION_SUBNET_PREFIX_BITS: 6
|
ATTESTATION_SUBNET_PREFIX_BITS: 6
|
||||||
ATTESTATION_SUBNET_SHUFFLING_PREFIX_BITS: 3
|
ATTESTATION_SUBNET_SHUFFLING_PREFIX_BITS: 3
|
||||||
|
|
||||||
|
# DAS
|
||||||
|
CUSTODY_REQUIREMENT: 1
|
||||||
|
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
|
||||||
|
NUMBER_OF_COLUMNS: 128
|
||||||
Reference in New Issue
Block a user