mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 10:52:43 +00:00
Update to spec v1.1.8 (#2893)
## Proposed Changes Change the canonical fork name for the merge to Bellatrix. Keep other merge naming the same to avoid churn. I've also fixed and enabled the `fork` and `transition` tests for Bellatrix, and the v1.1.7 fork choice tests. Additionally, the `BellatrixPreset` has been added with tests. It gets served via the `/config/spec` API endpoint along with the other presets.
This commit is contained in:
@@ -3,7 +3,7 @@ use crate::case_result::compare_beacon_state_results_without_caches;
|
||||
use crate::cases::common::previous_fork;
|
||||
use crate::decode::{ssz_decode_state, yaml_decode_file};
|
||||
use serde_derive::Deserialize;
|
||||
use state_processing::upgrade::upgrade_to_altair;
|
||||
use state_processing::upgrade::{upgrade_to_altair, upgrade_to_bellatrix};
|
||||
use types::{BeaconState, ForkName};
|
||||
|
||||
#[derive(Debug, Clone, Default, Deserialize)]
|
||||
@@ -49,10 +49,7 @@ impl<E: EthSpec> Case for ForkTest<E> {
|
||||
fn is_enabled_for_fork(fork_name: ForkName) -> bool {
|
||||
// Upgrades exist targeting all forks except phase0/base.
|
||||
// Fork tests also need BLS.
|
||||
// FIXME(merge): enable merge tests once available
|
||||
cfg!(not(feature = "fake_crypto"))
|
||||
&& fork_name != ForkName::Base
|
||||
&& fork_name != ForkName::Merge
|
||||
cfg!(not(feature = "fake_crypto")) && fork_name != ForkName::Base
|
||||
}
|
||||
|
||||
fn result(&self, _case_index: usize, fork_name: ForkName) -> Result<(), Error> {
|
||||
@@ -61,8 +58,9 @@ impl<E: EthSpec> Case for ForkTest<E> {
|
||||
let spec = &E::default_spec();
|
||||
|
||||
let mut result = match fork_name {
|
||||
ForkName::Base => panic!("phase0 not supported"),
|
||||
ForkName::Altair => upgrade_to_altair(&mut result_state, spec).map(|_| result_state),
|
||||
_ => panic!("unknown fork: {:?}", fork_name),
|
||||
ForkName::Merge => upgrade_to_bellatrix(&mut result_state, spec).map(|_| result_state),
|
||||
};
|
||||
|
||||
compare_beacon_state_results_without_caches(&mut result, &mut expected)
|
||||
|
||||
@@ -154,15 +154,10 @@ impl<E: EthSpec> Case for ForkChoiceTest<E> {
|
||||
fn result(&self, _case_index: usize, fork_name: ForkName) -> Result<(), Error> {
|
||||
let tester = Tester::new(self, fork_choice_spec::<E>(fork_name))?;
|
||||
|
||||
// TODO(merge): enable these tests before production.
|
||||
// This test will fail until this PR is merged and released:
|
||||
//
|
||||
// https://github.com/ethereum/consensus-specs/pull/2760
|
||||
if self.description == "shorter_chain_but_heavier_weight"
|
||||
// This test is skipped until we can do retrospective confirmations of the terminal
|
||||
// block after an optimistic sync.
|
||||
|| self.description == "block_lookup_failed"
|
||||
{
|
||||
// TODO(merge): re-enable this test before production.
|
||||
// This test is skipped until we can do retrospective confirmations of the terminal
|
||||
// block after an optimistic sync.
|
||||
if self.description == "block_lookup_failed" {
|
||||
return Err(Error::SkippedKnownFailure);
|
||||
};
|
||||
|
||||
|
||||
@@ -239,7 +239,6 @@ impl<E: EthSpec> Operation<E> for ExecutionPayload<E> {
|
||||
spec: &ChainSpec,
|
||||
extra: &Operations<E, Self>,
|
||||
) -> Result<(), BlockProcessingError> {
|
||||
// FIXME(merge): we may want to plumb the validity bool into state processing
|
||||
let valid = extra
|
||||
.execution_metadata
|
||||
.as_ref()
|
||||
|
||||
@@ -39,7 +39,8 @@ impl<E: EthSpec> LoadCase for TransitionTest<E> {
|
||||
spec.altair_fork_epoch = Some(metadata.fork_epoch);
|
||||
}
|
||||
ForkName::Merge => {
|
||||
spec.merge_fork_epoch = Some(metadata.fork_epoch);
|
||||
spec.altair_fork_epoch = Some(Epoch::new(0));
|
||||
spec.bellatrix_fork_epoch = Some(metadata.fork_epoch);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,10 +74,7 @@ impl<E: EthSpec> Case for TransitionTest<E> {
|
||||
fn is_enabled_for_fork(fork_name: ForkName) -> bool {
|
||||
// Upgrades exist targeting all forks except phase0/base.
|
||||
// Transition tests also need BLS.
|
||||
// FIXME(merge): Merge transition tests are now available but not yet passing
|
||||
cfg!(not(feature = "fake_crypto"))
|
||||
&& fork_name != ForkName::Base
|
||||
&& fork_name != ForkName::Merge
|
||||
cfg!(not(feature = "fake_crypto")) && fork_name != ForkName::Base
|
||||
}
|
||||
|
||||
fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {
|
||||
|
||||
Reference in New Issue
Block a user