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

@@ -2,7 +2,7 @@ use crate::{DBColumn, Error, StoreItem};
use ssz::{Decode, Encode};
use types::{
BlobSidecarList, EthSpec, ExecutionPayload, ExecutionPayloadBellatrix, ExecutionPayloadCapella,
ExecutionPayloadDeneb, ExecutionPayloadElectra,
ExecutionPayloadDeneb, ExecutionPayloadElectra, ExecutionPayloadFulu,
};
macro_rules! impl_store_item {
@@ -26,6 +26,7 @@ impl_store_item!(ExecutionPayloadBellatrix);
impl_store_item!(ExecutionPayloadCapella);
impl_store_item!(ExecutionPayloadDeneb);
impl_store_item!(ExecutionPayloadElectra);
impl_store_item!(ExecutionPayloadFulu);
impl_store_item!(BlobSidecarList);
/// This fork-agnostic implementation should be only used for writing.
@@ -42,17 +43,21 @@ impl<E: EthSpec> StoreItem for ExecutionPayload<E> {
}
fn from_store_bytes(bytes: &[u8]) -> Result<Self, Error> {
ExecutionPayloadElectra::from_ssz_bytes(bytes)
.map(Self::Electra)
ExecutionPayloadFulu::from_ssz_bytes(bytes)
.map(Self::Fulu)
.or_else(|_| {
ExecutionPayloadDeneb::from_ssz_bytes(bytes)
.map(Self::Deneb)
ExecutionPayloadElectra::from_ssz_bytes(bytes)
.map(Self::Electra)
.or_else(|_| {
ExecutionPayloadCapella::from_ssz_bytes(bytes)
.map(Self::Capella)
ExecutionPayloadDeneb::from_ssz_bytes(bytes)
.map(Self::Deneb)
.or_else(|_| {
ExecutionPayloadBellatrix::from_ssz_bytes(bytes)
.map(Self::Bellatrix)
ExecutionPayloadCapella::from_ssz_bytes(bytes)
.map(Self::Capella)
.or_else(|_| {
ExecutionPayloadBellatrix::from_ssz_bytes(bytes)
.map(Self::Bellatrix)
})
})
})
})