mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 12:11:59 +00:00
Gloas consensus logic for attestations (#8760)
Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -16,8 +16,9 @@ use state_processing::{
|
||||
errors::BlockProcessingError,
|
||||
process_block_header, process_execution_payload,
|
||||
process_operations::{
|
||||
altair_deneb, base, process_attester_slashings, process_bls_to_execution_changes,
|
||||
process_deposits, process_exits, process_proposer_slashings,
|
||||
altair_deneb, base, gloas, process_attester_slashings,
|
||||
process_bls_to_execution_changes, process_deposits, process_exits,
|
||||
process_proposer_slashings,
|
||||
},
|
||||
process_sync_aggregate, withdrawals,
|
||||
},
|
||||
@@ -98,9 +99,18 @@ impl<E: EthSpec> Operation<E> for Attestation<E> {
|
||||
_: &Operations<E, Self>,
|
||||
) -> Result<(), BlockProcessingError> {
|
||||
initialize_epoch_cache(state, spec)?;
|
||||
initialize_progressive_balances_cache(state, spec)?;
|
||||
let mut ctxt = ConsensusContext::new(state.slot());
|
||||
if state.fork_name_unchecked().altair_enabled() {
|
||||
initialize_progressive_balances_cache(state, spec)?;
|
||||
if state.fork_name_unchecked().gloas_enabled() {
|
||||
gloas::process_attestation(
|
||||
state,
|
||||
self.to_ref(),
|
||||
0,
|
||||
&mut ctxt,
|
||||
VerifySignatures::True,
|
||||
spec,
|
||||
)
|
||||
} else if state.fork_name_unchecked().altair_enabled() {
|
||||
altair_deneb::process_attestation(
|
||||
state,
|
||||
self.to_ref(),
|
||||
|
||||
@@ -1137,7 +1137,9 @@ impl<E: EthSpec + TypeName, O: Operation<E>> Handler for OperationsHandler<E, O>
|
||||
fn is_enabled_for_fork(&self, fork_name: ForkName) -> bool {
|
||||
// TODO(gloas): So far only withdrawals tests are enabled for Gloas.
|
||||
Self::Case::is_enabled_for_fork(fork_name)
|
||||
&& (!fork_name.gloas_enabled() || self.handler_name() == "withdrawals")
|
||||
&& (!fork_name.gloas_enabled()
|
||||
|| self.handler_name() == "withdrawals"
|
||||
|| self.handler_name() == "attestation")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user