mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 19:51:47 +00:00
Merge branch 'beacon-api-electra' of https://github.com/sigp/lighthouse into ef-tests-electra
This commit is contained in:
@@ -131,7 +131,6 @@ pub struct ForkChoiceTest<E: EthSpec> {
|
||||
pub anchor_state: BeaconState<E>,
|
||||
pub anchor_block: BeaconBlock<E>,
|
||||
#[allow(clippy::type_complexity)]
|
||||
// TODO(electra): these tests will need to be updated to use new types
|
||||
pub steps: Vec<
|
||||
Step<SignedBeaconBlock<E>, BlobsList<E>, Attestation<E>, AttesterSlashing<E>, PowBlock>,
|
||||
>,
|
||||
@@ -180,42 +179,34 @@ impl<E: EthSpec> LoadCase for ForkChoiceTest<E> {
|
||||
valid,
|
||||
})
|
||||
}
|
||||
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
|
||||
| ForkName::Bellatrix
|
||||
| ForkName::Capella
|
||||
| ForkName::Deneb => {
|
||||
Step::Attestation { attestation } => {
|
||||
if fork_name.electra_enabled() {
|
||||
ssz_decode_file(&path.join(format!("{}.ssz_snappy", attestation))).map(
|
||||
|attestation| Step::Attestation {
|
||||
attestation: Attestation::Electra(attestation),
|
||||
},
|
||||
)
|
||||
} else {
|
||||
ssz_decode_file(&path.join(format!("{}.ssz_snappy", attestation))).map(
|
||||
|attestation| Step::Attestation {
|
||||
attestation: Attestation::Base(attestation),
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
Step::AttesterSlashing { attester_slashing } => {
|
||||
if fork_name.electra_enabled() {
|
||||
ssz_decode_file(&path.join(format!("{}.ssz_snappy", attester_slashing)))
|
||||
.map(|attester_slashing| Step::AttesterSlashing {
|
||||
attester_slashing: AttesterSlashing::Electra(attester_slashing),
|
||||
})
|
||||
} else {
|
||||
ssz_decode_file(&path.join(format!("{}.ssz_snappy", attester_slashing)))
|
||||
.map(|attester_slashing| Step::AttesterSlashing {
|
||||
attester_slashing: AttesterSlashing::Base(attester_slashing),
|
||||
})
|
||||
}
|
||||
ForkName::Electra => {
|
||||
ssz_decode_file(&path.join(format!("{}.ssz_snappy", attester_slashing)))
|
||||
.map(|attester_slashing| Step::AttesterSlashing {
|
||||
attester_slashing: AttesterSlashing::Electra(attester_slashing),
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
Step::PowBlock { pow_block } => {
|
||||
ssz_decode_file(&path.join(format!("{}.ssz_snappy", pow_block)))
|
||||
.map(|pow_block| Step::PowBlock { pow_block })
|
||||
|
||||
@@ -247,7 +247,6 @@ mod ssz_static {
|
||||
PendingPartialWithdrawal, *,
|
||||
};
|
||||
|
||||
ssz_static_test!(attestation, Attestation<_>);
|
||||
ssz_static_test!(attestation_data, AttestationData);
|
||||
ssz_static_test!(beacon_block, SszStaticWithSpecHandler, BeaconBlock<_>);
|
||||
ssz_static_test!(beacon_block_header, BeaconBlockHeader);
|
||||
@@ -274,6 +273,16 @@ mod ssz_static {
|
||||
ssz_static_test!(validator, Validator);
|
||||
ssz_static_test!(voluntary_exit, VoluntaryExit);
|
||||
|
||||
#[test]
|
||||
fn attestation() {
|
||||
SszStaticHandler::<AttestationBase<MinimalEthSpec>, MinimalEthSpec>::pre_electra().run();
|
||||
SszStaticHandler::<AttestationBase<MainnetEthSpec>, MainnetEthSpec>::pre_electra().run();
|
||||
SszStaticHandler::<AttestationElectra<MinimalEthSpec>, MinimalEthSpec>::electra_only()
|
||||
.run();
|
||||
SszStaticHandler::<AttestationElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only()
|
||||
.run();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn attester_slashing() {
|
||||
SszStaticHandler::<AttesterSlashingBase<MinimalEthSpec>, MinimalEthSpec>::pre_electra()
|
||||
|
||||
@@ -11,7 +11,7 @@ use unused_port::unused_tcp4_port;
|
||||
/// We've pinned the Nethermind version since our method of using the `master` branch to
|
||||
/// find the latest tag isn't working. It appears Nethermind don't always tag on `master`.
|
||||
/// We should fix this so we always pull the latest version of Nethermind.
|
||||
const NETHERMIND_BRANCH: &str = "release/1.21.0";
|
||||
const NETHERMIND_BRANCH: &str = "release/1.27.0";
|
||||
const NETHERMIND_REPO_URL: &str = "https://github.com/NethermindEth/nethermind";
|
||||
|
||||
fn build_result(repo_dir: &Path) -> Output {
|
||||
@@ -70,11 +70,10 @@ impl NethermindEngine {
|
||||
.join("nethermind")
|
||||
.join("src")
|
||||
.join("Nethermind")
|
||||
.join("Nethermind.Runner")
|
||||
.join("artifacts")
|
||||
.join("bin")
|
||||
.join("Release")
|
||||
.join("net7.0")
|
||||
.join("linux-x64")
|
||||
.join("Nethermind.Runner")
|
||||
.join("release")
|
||||
.join("nethermind")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
//! simulation uses `println` to communicate some info. It might be nice if the nodes logged to
|
||||
//! easy-to-find files and stdout only contained info from the simulation.
|
||||
//!
|
||||
|
||||
extern crate clap;
|
||||
|
||||
mod basic_sim;
|
||||
mod checks;
|
||||
mod cli;
|
||||
|
||||
Reference in New Issue
Block a user