Merge remote-tracking branch 'origin/unstable' into tree-states

This commit is contained in:
Michael Sproul
2022-10-19 13:21:47 +11:00
152 changed files with 3788 additions and 3067 deletions

View File

@@ -79,11 +79,16 @@ impl<E: EthSpec> Operation<E> for Attestation<E> {
spec: &ChainSpec,
_: &Operations<E, Self>,
) -> Result<(), BlockProcessingError> {
let proposer_index = state.get_beacon_proposer_index(state.slot(), spec)? as u64;
let mut ctxt = ConsensusContext::new(state.slot());
let proposer_index = ctxt.get_proposer_index(state, spec)?;
match state {
BeaconState::Base(_) => {
base::process_attestations(state, &[self.clone()], VerifySignatures::True, spec)
}
BeaconState::Base(_) => base::process_attestations(
state,
&[self.clone()],
VerifySignatures::True,
&mut ctxt,
spec,
),
BeaconState::Altair(_) | BeaconState::Merge(_) => altair::process_attestation(
state,
self,
@@ -111,7 +116,14 @@ impl<E: EthSpec> Operation<E> for AttesterSlashing<E> {
spec: &ChainSpec,
_: &Operations<E, Self>,
) -> Result<(), BlockProcessingError> {
process_attester_slashings(state, &[self.clone()], VerifySignatures::True, spec)
let mut ctxt = ConsensusContext::new(state.slot());
process_attester_slashings(
state,
&[self.clone()],
VerifySignatures::True,
&mut ctxt,
spec,
)
}
}
@@ -120,6 +132,11 @@ impl<E: EthSpec> Operation<E> for Deposit {
ssz_decode_file(path)
}
fn is_enabled_for_fork(_: ForkName) -> bool {
// Some deposit tests require signature verification but are not marked as such.
cfg!(not(feature = "fake_crypto"))
}
fn apply_to(
&self,
state: &mut BeaconState<E>,
@@ -145,7 +162,14 @@ impl<E: EthSpec> Operation<E> for ProposerSlashing {
spec: &ChainSpec,
_: &Operations<E, Self>,
) -> Result<(), BlockProcessingError> {
process_proposer_slashings(state, &[self.clone()], VerifySignatures::True, spec)
let mut ctxt = ConsensusContext::new(state.slot());
process_proposer_slashings(
state,
&[self.clone()],
VerifySignatures::True,
&mut ctxt,
spec,
)
}
}