mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 13:54:44 +00:00
Electra attestation changes rm decode impl (#5856)
* Remove Crappy Decode impl for Attestation * Remove Inefficient Attestation Decode impl * Implement Schema Upgrade / Downgrade * Update beacon_node/beacon_chain/src/schema_change/migration_schema_v20.rs Co-authored-by: Michael Sproul <micsproul@gmail.com> --------- Co-authored-by: Michael Sproul <micsproul@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -78,8 +78,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(
|
||||
|
||||
Reference in New Issue
Block a user