Merge branch 'p2p-electra' of https://github.com/sigp/lighthouse into ef-tests-electra

This commit is contained in:
realbigsean
2024-05-31 09:09:10 -04:00
188 changed files with 5716 additions and 3865 deletions

View File

@@ -24,19 +24,16 @@ serde_json = { workspace = true }
serde_repr = { workspace = true }
serde_yaml = { workspace = true }
eth2_network_config = { workspace = true }
ethereum_serde_utils = { workspace = true }
ethereum_ssz = { workspace = true }
ethereum_ssz_derive = { workspace = true }
tree_hash = { workspace = true }
tree_hash_derive = { workspace = true }
cached_tree_hash = { workspace = true }
state_processing = { workspace = true }
swap_or_not_shuffle = { workspace = true }
types = { workspace = true }
snap = { workspace = true }
fs2 = { workspace = true }
beacon_chain = { workspace = true }
store = { workspace = true }
fork_choice = { workspace = true }
execution_layer = { workspace = true }
logging = { workspace = true }

View File

@@ -180,10 +180,24 @@ impl<E: EthSpec> LoadCase for ForkChoiceTest<E> {
valid,
})
}
Step::Attestation { attestation } => {
ssz_decode_file(&path.join(format!("{}.ssz_snappy", attestation)))
.map(|attestation| Step::Attestation { attestation })
}
Step::Attestation { attestation } => match fork_name {
ForkName::Base
| ForkName::Altair
| ForkName::Bellatrix
| ForkName::Capella
| ForkName::Deneb => ssz_decode_file(
&path.join(format!("{}.ssz_snappy", attestation)),
)
.map(|attestation| Step::Attestation {
attestation: Attestation::Base(attestation),
}),
ForkName::Electra => ssz_decode_file(
&path.join(format!("{}.ssz_snappy", attestation)),
)
.map(|attestation| Step::Attestation {
attestation: Attestation::Electra(attestation),
}),
},
Step::AttesterSlashing { attester_slashing } => match fork_name {
ForkName::Base
| ForkName::Altair

View File

@@ -82,8 +82,12 @@ impl<E: EthSpec> Operation<E> for Attestation<E> {
"attestation".into()
}
fn decode(path: &Path, _fork_name: ForkName, _spec: &ChainSpec) -> Result<Self, Error> {
ssz_decode_file(path)
fn decode(path: &Path, fork_name: ForkName, _spec: &ChainSpec) -> Result<Self, Error> {
if fork_name < ForkName::Electra {
Ok(Self::Base(ssz_decode_file(path)?))
} else {
Ok(Self::Electra(ssz_decode_file(path)?))
}
}
fn apply_to(