ef-test updates

This commit is contained in:
realbigsean 2022-11-22 20:13:51 -05:00
parent 902055f295
commit f601fb3b7e
No known key found for this signature in database
GPG Key ID: B372B64D866BF8CC
5 changed files with 13 additions and 12 deletions

View File

@ -8,6 +8,8 @@ edition = "2021"
[features] [features]
portable = ["bls/supranational-portable"] portable = ["bls/supranational-portable"]
fake_crypto = ['bls/fake_crypto'] fake_crypto = ['bls/fake_crypto']
withdrawals = ["types/withdrawals", "beacon_chain/withdrawals", "store/withdrawals", "state_processing/withdrawals"]
withdrawals-processing = ["beacon_chain/withdrawals-processing", "store/withdrawals-processing", "state_processing/withdrawals-processing"]
[dependencies] [dependencies]
bls = { path = "../crypto/bls" } bls = { path = "../crypto/bls" }

View File

@ -44,19 +44,25 @@ pub fn run_parse_ssz<T: EthSpec>(matches: &ArgMatches) -> Result<(), String> {
bytes bytes
}; };
info!("Using {} spec", T::spec_name()); println!("Using {} spec", T::spec_name());
info!("Type: {:?}", type_str); println!("Type: {:?}", type_str);
match type_str { match type_str {
"signed_block_base" => decode_and_print::<SignedBeaconBlockBase<T>>(&bytes, format)?, "signed_block_base" => decode_and_print::<SignedBeaconBlockBase<T>>(&bytes, format)?,
"signed_block_altair" => decode_and_print::<SignedBeaconBlockAltair<T>>(&bytes, format)?, "signed_block_altair" => decode_and_print::<SignedBeaconBlockAltair<T>>(&bytes, format)?,
"signed_block_merge" => decode_and_print::<SignedBeaconBlockMerge<T>>(&bytes, format)?, "signed_block_merge" => decode_and_print::<SignedBeaconBlockMerge<T>>(&bytes, format)?,
"signed_block_capella" => decode_and_print::<SignedBeaconBlockCapella<T>>(&bytes, format)?,
"signed_block_eip4844" => decode_and_print::<SignedBeaconBlockEip4844<T>>(&bytes, format)?,
"block_base" => decode_and_print::<BeaconBlockBase<T>>(&bytes, format)?, "block_base" => decode_and_print::<BeaconBlockBase<T>>(&bytes, format)?,
"block_altair" => decode_and_print::<BeaconBlockAltair<T>>(&bytes, format)?, "block_altair" => decode_and_print::<BeaconBlockAltair<T>>(&bytes, format)?,
"block_merge" => decode_and_print::<BeaconBlockMerge<T>>(&bytes, format)?, "block_merge" => decode_and_print::<BeaconBlockMerge<T>>(&bytes, format)?,
"block_capella" => decode_and_print::<BeaconBlockCapella<T>>(&bytes, format)?,
"block_eip4844" => decode_and_print::<SignedBeaconBlockEip4844<T>>(&bytes, format)?,
"state_base" => decode_and_print::<BeaconStateBase<T>>(&bytes, format)?, "state_base" => decode_and_print::<BeaconStateBase<T>>(&bytes, format)?,
"state_altair" => decode_and_print::<BeaconStateAltair<T>>(&bytes, format)?, "state_altair" => decode_and_print::<BeaconStateAltair<T>>(&bytes, format)?,
"state_merge" => decode_and_print::<BeaconStateMerge<T>>(&bytes, format)?, "state_merge" => decode_and_print::<BeaconStateMerge<T>>(&bytes, format)?,
"state_capella" => decode_and_print::<BeaconStateCapella<T>>(&bytes, format)?,
"state_eip4844" => decode_and_print::<BeaconStateEip4844<T>>(&bytes, format)?,
other => return Err(format!("Unknown type: {}", other)), other => return Err(format!("Unknown type: {}", other)),
}; };

View File

@ -289,10 +289,9 @@ impl<E: EthSpec, T: EpochTransition<E>> Case for EpochProcessing<E, T> {
&& T::name() != "participation_flag_updates" && T::name() != "participation_flag_updates"
} }
// No phase0 tests for Altair and later. // No phase0 tests for Altair and later.
ForkName::Altair | ForkName::Merge | ForkName::Capella => { ForkName::Altair | ForkName::Merge | ForkName::Capella | ForkName::Eip4844=> {
T::name() != "participation_record_updates" T::name() != "participation_record_updates"
} }
ForkName::Eip4844 => false, // TODO: revisit when tests are out
} }
} }

View File

@ -3,7 +3,7 @@ use crate::case_result::compare_beacon_state_results_without_caches;
use crate::cases::common::previous_fork; use crate::cases::common::previous_fork;
use crate::decode::{ssz_decode_state, yaml_decode_file}; use crate::decode::{ssz_decode_state, yaml_decode_file};
use serde_derive::Deserialize; use serde_derive::Deserialize;
use state_processing::upgrade::{upgrade_to_altair, upgrade_to_bellatrix, upgrade_to_capella}; use state_processing::upgrade::{upgrade_to_altair, upgrade_to_bellatrix, upgrade_to_capella, upgrade_to_eip4844};
use types::{BeaconState, ForkName}; use types::{BeaconState, ForkName};
#[derive(Debug, Clone, Default, Deserialize)] #[derive(Debug, Clone, Default, Deserialize)]
@ -62,8 +62,7 @@ impl<E: EthSpec> Case for ForkTest<E> {
ForkName::Altair => upgrade_to_altair(&mut result_state, spec).map(|_| result_state), ForkName::Altair => upgrade_to_altair(&mut result_state, spec).map(|_| result_state),
ForkName::Merge => upgrade_to_bellatrix(&mut result_state, spec).map(|_| result_state), ForkName::Merge => upgrade_to_bellatrix(&mut result_state, spec).map(|_| result_state),
ForkName::Capella => upgrade_to_capella(&mut result_state, spec).map(|_| result_state), ForkName::Capella => upgrade_to_capella(&mut result_state, spec).map(|_| result_state),
ForkName::Eip4844 => panic!("eip4844 not supported"), ForkName::Eip4844 => upgrade_to_eip4844(&mut result_state, spec).map(|_| result_state), };
};
compare_beacon_state_results_without_caches(&mut result, &mut expected) compare_beacon_state_results_without_caches(&mut result, &mut expected)
} }

View File

@ -24,11 +24,6 @@ pub trait Handler {
fn run(&self) { fn run(&self) {
for fork_name in ForkName::list_all() { for fork_name in ForkName::list_all() {
// FIXME(eip4844): enable eip4844
if fork_name == ForkName::Eip4844 {
continue;
}
if self.is_enabled_for_fork(fork_name) { if self.is_enabled_for_fork(fork_name) {
self.run_for_fork(fork_name) self.run_for_fork(fork_name)
} }