Single-pass epoch processing (#4483)

This commit is contained in:
Michael Sproul
2023-07-18 16:59:55 +10:00
committed by GitHub
parent 079cd67df2
commit 5d2063d262
42 changed files with 1558 additions and 730 deletions

View File

@@ -119,8 +119,9 @@ pub fn per_block_processing<T: EthSpec, Payload: AbstractExecPayload<T>>(
.map_err(BlockProcessingError::InconsistentStateFork)?;
// Build epoch cache if it hasn't already been built, or if it is no longer valid
initialize_epoch_cache(state, state.current_epoch(), spec)?;
initialize_epoch_cache(state, spec)?;
initialize_progressive_balances_cache(state, None, spec)?;
state.build_slashings_cache()?;
let verify_signatures = match block_signature_strategy {
BlockSignatureStrategy::VerifyBulk => {
@@ -242,6 +243,9 @@ pub fn process_block_header<T: EthSpec>(
);
}
state
.slashings_cache_mut()
.update_latest_block_slot(block_header.slot);
*state.latest_block_header_mut() = block_header;
// Verify proposer is not slashed