Add Fulu boilerplate (#6695)

* Add Fulu boilerplate

* Add more boilerplate

* Change fulu_time to osaka_time

* Merge branch 'unstable' into fulu-boilerplate

* Fix tests

* Merge branch 'unstable' into fulu-boilerplate

* More test fixes

* Apply suggestions

* Remove `get_payload` boilerplate

* Add lightclient fulu types and fix beacon-chain-tests

* Disable Fulu in ef-tests

* Reduce boilerplate for future forks

* Small fixes

* One more fix

* Apply suggestions

* Merge branch 'unstable' into fulu-boilerplate

* Fix lints
This commit is contained in:
Mac L
2025-01-10 09:25:23 +04:00
committed by GitHub
parent 722573f7ed
commit ecdf2d891f
91 changed files with 2365 additions and 674 deletions

View File

@@ -1078,6 +1078,9 @@ impl ForkVersionDeserialize for SsePayloadAttributes {
ForkName::Electra => serde_json::from_value(value)
.map(Self::V3)
.map_err(serde::de::Error::custom),
ForkName::Fulu => serde_json::from_value(value)
.map(Self::V3)
.map_err(serde::de::Error::custom),
ForkName::Base | ForkName::Altair => Err(serde::de::Error::custom(format!(
"SsePayloadAttributes deserialization for {fork_name} not implemented"
))),
@@ -1861,14 +1864,10 @@ impl<E: EthSpec> PublishBlockRequest<E> {
impl<E: EthSpec> TryFrom<Arc<SignedBeaconBlock<E>>> for PublishBlockRequest<E> {
type Error = &'static str;
fn try_from(block: Arc<SignedBeaconBlock<E>>) -> Result<Self, Self::Error> {
match *block {
SignedBeaconBlock::Base(_)
| SignedBeaconBlock::Altair(_)
| SignedBeaconBlock::Bellatrix(_)
| SignedBeaconBlock::Capella(_) => Ok(PublishBlockRequest::Block(block)),
SignedBeaconBlock::Deneb(_) | SignedBeaconBlock::Electra(_) => Err(
"post-Deneb block contents cannot be fully constructed from just the signed block",
),
if block.message().fork_name_unchecked().deneb_enabled() {
Err("post-Deneb block contents cannot be fully constructed from just the signed block")
} else {
Ok(PublishBlockRequest::Block(block))
}
}
}
@@ -1972,16 +1971,18 @@ impl<E: EthSpec> ForkVersionDeserialize for FullPayloadContents<E> {
value: Value,
fork_name: ForkName,
) -> Result<Self, D::Error> {
match fork_name {
ForkName::Bellatrix | ForkName::Capella => serde_json::from_value(value)
.map(Self::Payload)
.map_err(serde::de::Error::custom),
ForkName::Deneb | ForkName::Electra => serde_json::from_value(value)
if fork_name.deneb_enabled() {
serde_json::from_value(value)
.map(Self::PayloadAndBlobs)
.map_err(serde::de::Error::custom),
ForkName::Base | ForkName::Altair => Err(serde::de::Error::custom(format!(
.map_err(serde::de::Error::custom)
} else if fork_name.bellatrix_enabled() {
serde_json::from_value(value)
.map(Self::Payload)
.map_err(serde::de::Error::custom)
} else {
Err(serde::de::Error::custom(format!(
"FullPayloadContents deserialization for {fork_name} not implemented"
))),
)))
}
}
}

View File

@@ -15,7 +15,6 @@ TERMINAL_TOTAL_DIFFICULTY: 231707791542740786049188744689299064356246512
TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615
# Genesis
# ---------------------------------------------------------------
# *CUSTOM
@@ -27,7 +26,6 @@ GENESIS_FORK_VERSION: 0x0000006f
# *CUSTOM
GENESIS_DELAY: 300
# Forking
# ---------------------------------------------------------------
# Some forks are disabled for now:
@@ -49,6 +47,9 @@ DENEB_FORK_EPOCH: 516608 # Wed Jan 31 2024 18:15:40 GMT+0000
# Electra
ELECTRA_FORK_VERSION: 0x0500006f
ELECTRA_FORK_EPOCH: 18446744073709551615
# Fulu
FULU_FORK_VERSION: 0x0600006f
FULU_FORK_EPOCH: 18446744073709551615
# Time parameters
# ---------------------------------------------------------------
@@ -63,7 +64,6 @@ SHARD_COMMITTEE_PERIOD: 256
# 2**10 (= 1024) ~1.4 hour
ETH1_FOLLOW_DISTANCE: 1024
# Validator cycle
# ---------------------------------------------------------------
# 2**2 (= 4)
@@ -90,7 +90,6 @@ REORG_PARENT_WEIGHT_THRESHOLD: 160
# `2` epochs
REORG_MAX_EPOCHS_SINCE_FINALIZATION: 2
# Deposit contract
# ---------------------------------------------------------------
# xDai Mainnet
@@ -141,4 +140,4 @@ BLOB_SIDECAR_SUBNET_COUNT: 6
CUSTODY_REQUIREMENT: 4
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
NUMBER_OF_COLUMNS: 128
SAMPLES_PER_SLOT: 8
SAMPLES_PER_SLOT: 8

View File

@@ -23,7 +23,6 @@ GENESIS_FORK_VERSION: 0x00000064
# 6000 seconds (100 minutes)
GENESIS_DELAY: 6000
# Forking
# ---------------------------------------------------------------
# Some forks are disabled for now:
@@ -45,7 +44,9 @@ DENEB_FORK_EPOCH: 889856 # 2024-03-11T18:30:20.000Z
# Electra
ELECTRA_FORK_VERSION: 0x05000064
ELECTRA_FORK_EPOCH: 18446744073709551615
# Fulu
FULU_FORK_VERSION: 0x06000064
FULU_FORK_EPOCH: 18446744073709551615
# Time parameters
# ---------------------------------------------------------------
@@ -60,7 +61,6 @@ SHARD_COMMITTEE_PERIOD: 256
# 2**10 (= 1024) ~1.4 hour
ETH1_FOLLOW_DISTANCE: 1024
# Validator cycle
# ---------------------------------------------------------------
# 2**2 (= 4)
@@ -76,7 +76,6 @@ MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 2
# 2**12 (= 4096)
CHURN_LIMIT_QUOTIENT: 4096
# Fork choice
# ---------------------------------------------------------------
# 40%
@@ -124,4 +123,4 @@ BLOB_SIDECAR_SUBNET_COUNT: 6
CUSTODY_REQUIREMENT: 4
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
NUMBER_OF_COLUMNS: 128
SAMPLES_PER_SLOT: 8
SAMPLES_PER_SLOT: 8

View File

@@ -12,7 +12,6 @@ GENESIS_FORK_VERSION: 0x01017000
# Genesis delay 5 mins
GENESIS_DELAY: 300
# Forking
# ---------------------------------------------------------------
# Some forks are disabled for now:
@@ -37,6 +36,9 @@ DENEB_FORK_EPOCH: 29696
# Electra
ELECTRA_FORK_VERSION: 0x06017000
ELECTRA_FORK_EPOCH: 18446744073709551615
# Fulu
FULU_FORK_VERSION: 0x07017000
FULU_FORK_EPOCH: 18446744073709551615
# Time parameters
# ---------------------------------------------------------------
@@ -51,7 +53,6 @@ SHARD_COMMITTEE_PERIOD: 256
# 2**11 (= 2,048) Eth1 blocks ~8 hours
ETH1_FOLLOW_DISTANCE: 2048
# Validator cycle
# ---------------------------------------------------------------
# 2**2 (= 4)
@@ -128,4 +129,4 @@ BLOB_SIDECAR_SUBNET_COUNT: 6
CUSTODY_REQUIREMENT: 4
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
NUMBER_OF_COLUMNS: 128
SAMPLES_PER_SLOT: 8
SAMPLES_PER_SLOT: 8

View File

@@ -18,8 +18,6 @@ TERMINAL_TOTAL_DIFFICULTY: 58750000000000000000000
TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615
# Genesis
# ---------------------------------------------------------------
# `2**14` (= 16,384)
@@ -31,7 +29,6 @@ GENESIS_FORK_VERSION: 0x00000000
# 604800 seconds (7 days)
GENESIS_DELAY: 604800
# Forking
# ---------------------------------------------------------------
# Some forks are disabled for now:
@@ -40,23 +37,25 @@ GENESIS_DELAY: 604800
# Altair
ALTAIR_FORK_VERSION: 0x01000000
ALTAIR_FORK_EPOCH: 74240 # Oct 27, 2021, 10:56:23am UTC
ALTAIR_FORK_EPOCH: 74240 # Oct 27, 2021, 10:56:23am UTC
# Bellatrix
BELLATRIX_FORK_VERSION: 0x02000000
BELLATRIX_FORK_EPOCH: 144896 # Sept 6, 2022, 11:34:47am UTC
BELLATRIX_FORK_EPOCH: 144896 # Sept 6, 2022, 11:34:47am UTC
# Capella
CAPELLA_FORK_VERSION: 0x03000000
CAPELLA_FORK_EPOCH: 194048 # April 12, 2023, 10:27:35pm UTC
CAPELLA_FORK_EPOCH: 194048 # April 12, 2023, 10:27:35pm UTC
# Deneb
DENEB_FORK_VERSION: 0x04000000
DENEB_FORK_EPOCH: 269568 # March 13, 2024, 01:55:35pm UTC
DENEB_FORK_EPOCH: 269568 # March 13, 2024, 01:55:35pm UTC
# Electra
ELECTRA_FORK_VERSION: 0x05000000
ELECTRA_FORK_EPOCH: 18446744073709551615
# Fulu
FULU_FORK_VERSION: 0x06000000
FULU_FORK_EPOCH: 18446744073709551615
# PeerDAS
EIP7594_FORK_EPOCH: 18446744073709551615
# Time parameters
# ---------------------------------------------------------------
# 12 seconds
@@ -70,7 +69,6 @@ SHARD_COMMITTEE_PERIOD: 256
# 2**11 (= 2,048) Eth1 blocks ~8 hours
ETH1_FOLLOW_DISTANCE: 2048
# Validator cycle
# ---------------------------------------------------------------
# 2**2 (= 4)
@@ -97,7 +95,6 @@ REORG_PARENT_WEIGHT_THRESHOLD: 160
# `2` epochs
REORG_MAX_EPOCHS_SINCE_FINALIZATION: 2
# Deposit contract
# ---------------------------------------------------------------
# Ethereum PoW Mainnet
@@ -105,7 +102,6 @@ DEPOSIT_CHAIN_ID: 1
DEPOSIT_NETWORK_ID: 1
DEPOSIT_CONTRACT_ADDRESS: 0x00000000219ab540356cBB839Cbe05303d7705Fa
# Networking
# ---------------------------------------------------------------
# `10 * 2**20` (= 10485760, 10 MiB)
@@ -150,4 +146,4 @@ BLOB_SIDECAR_SUBNET_COUNT: 6
CUSTODY_REQUIREMENT: 4
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
NUMBER_OF_COLUMNS: 128
SAMPLES_PER_SLOT: 8
SAMPLES_PER_SLOT: 8

View File

@@ -124,4 +124,4 @@ BLOB_SIDECAR_SUBNET_COUNT: 6
CUSTODY_REQUIREMENT: 4
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
NUMBER_OF_COLUMNS: 128
SAMPLES_PER_SLOT: 8
SAMPLES_PER_SLOT: 8