mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 10:52:43 +00:00
Fix attestation withdrawals root mismatch (#4249)
## Issue Addressed Addresses #4234 ## Proposed Changes - Skip withdrawals processing in an inconsistent state replay. - Repurpose `StateRootStrategy`: rename to `StateProcessingStrategy` and always skip withdrawals if using `StateProcessingStrategy::Inconsistent` - Add a test to reproduce the scenario Co-authored-by: Jimmy Chen <jimmy@sigmaprime.io>
This commit is contained in:
@@ -39,6 +39,7 @@ mod verify_exit;
|
||||
mod verify_proposer_slashing;
|
||||
|
||||
use crate::common::decrease_balance;
|
||||
use crate::StateProcessingStrategy;
|
||||
|
||||
#[cfg(feature = "arbitrary-fuzz")]
|
||||
use arbitrary::Arbitrary;
|
||||
@@ -96,6 +97,7 @@ pub fn per_block_processing<T: EthSpec, Payload: AbstractExecPayload<T>>(
|
||||
state: &mut BeaconState<T>,
|
||||
signed_block: &SignedBeaconBlock<T, Payload>,
|
||||
block_signature_strategy: BlockSignatureStrategy,
|
||||
state_processing_strategy: StateProcessingStrategy,
|
||||
verify_block_root: VerifyBlockRoot,
|
||||
ctxt: &mut ConsensusContext<T>,
|
||||
spec: &ChainSpec,
|
||||
@@ -160,7 +162,9 @@ pub fn per_block_processing<T: EthSpec, Payload: AbstractExecPayload<T>>(
|
||||
// previous block.
|
||||
if is_execution_enabled(state, block.body()) {
|
||||
let payload = block.body().execution_payload()?;
|
||||
process_withdrawals::<T, Payload>(state, payload, spec)?;
|
||||
if state_processing_strategy == StateProcessingStrategy::Accurate {
|
||||
process_withdrawals::<T, Payload>(state, payload, spec)?;
|
||||
}
|
||||
process_execution_payload::<T, Payload>(state, payload, spec)?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user