Fix consensus, SSZ, tree hash & run merge EF tests (#2622)

* Update to v1.1.0-beta.4 (squash of #2548)

* SSZ, cached tree hash, EF tests
This commit is contained in:
Michael Sproul
2021-09-24 14:55:21 +10:00
committed by Paul Hauner
parent 3718c36c51
commit ef6158f4ee
23 changed files with 312 additions and 205 deletions

View File

@@ -197,12 +197,17 @@ impl<T: EthSpec> PartialBeaconState<T> {
let epoch = slot.epoch(T::slots_per_epoch());
if spec
.altair_fork_epoch
.map_or(true, |altair_epoch| epoch < altair_epoch)
.merge_fork_epoch
.map_or(false, |merge_epoch| epoch >= merge_epoch)
{
PartialBeaconStateMerge::from_ssz_bytes(bytes).map(Self::Merge)
} else if spec
.altair_fork_epoch
.map_or(false, |altair_epoch| epoch >= altair_epoch)
{
PartialBeaconStateBase::from_ssz_bytes(bytes).map(Self::Base)
} else {
PartialBeaconStateAltair::from_ssz_bytes(bytes).map(Self::Altair)
} else {
PartialBeaconStateBase::from_ssz_bytes(bytes).map(Self::Base)
}
}