mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 12:47:05 +00:00
Gloas bid and preference verification (#9036)
Gossip verify and cache bids and proposer preferences. This PR also ensures we subscribe to new fork topics one epoch early instead of two slots early. This is required for proposer preferences. Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com>
This commit is contained in:
@@ -54,6 +54,7 @@ use crate::observed_block_producers::ObservedBlockProducers;
|
||||
use crate::observed_data_sidecars::ObservedDataSidecars;
|
||||
use crate::observed_operations::{ObservationOutcome, ObservedOperations};
|
||||
use crate::observed_slashable::ObservedSlashable;
|
||||
use crate::payload_bid_verification::payload_bid_cache::GossipVerifiedPayloadBidCache;
|
||||
#[cfg(not(test))]
|
||||
use crate::payload_envelope_streamer::{EnvelopeRequestSource, launch_payload_envelope_stream};
|
||||
use crate::pending_payload_envelopes::PendingPayloadEnvelopes;
|
||||
@@ -61,6 +62,7 @@ use crate::persisted_beacon_chain::PersistedBeaconChain;
|
||||
use crate::persisted_custody::persist_custody_context;
|
||||
use crate::persisted_fork_choice::PersistedForkChoice;
|
||||
use crate::pre_finalization_cache::PreFinalizationBlockCache;
|
||||
use crate::proposer_preferences_verification::proposer_preference_cache::GossipVerifiedProposerPreferenceCache;
|
||||
use crate::shuffling_cache::{BlockShufflingIds, ShufflingCache};
|
||||
use crate::sync_committee_verification::{
|
||||
Error as SyncCommitteeError, VerifiedSyncCommitteeMessage, VerifiedSyncContribution,
|
||||
@@ -466,6 +468,10 @@ pub struct BeaconChain<T: BeaconChainTypes> {
|
||||
pub envelope_times_cache: Arc<RwLock<EnvelopeTimesCache>>,
|
||||
/// A cache used to track pre-finalization block roots for quick rejection.
|
||||
pub pre_finalization_block_cache: PreFinalizationBlockCache,
|
||||
/// A cache used to store gossip verified payload bids.
|
||||
pub gossip_verified_payload_bid_cache: GossipVerifiedPayloadBidCache<T>,
|
||||
/// A cache used to store gossip verified proposer preferences.
|
||||
pub gossip_verified_proposer_preferences_cache: GossipVerifiedProposerPreferenceCache,
|
||||
/// A cache used to produce light_client server messages
|
||||
pub light_client_server_cache: LightClientServerCache<T>,
|
||||
/// Sender to signal the light_client server to produce new updates
|
||||
@@ -6403,6 +6409,8 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
self.naive_aggregation_pool.write().prune(slot);
|
||||
self.block_times_cache.write().prune(slot);
|
||||
self.envelope_times_cache.write().prune(slot);
|
||||
self.gossip_verified_payload_bid_cache.prune(slot);
|
||||
self.gossip_verified_proposer_preferences_cache.prune(slot);
|
||||
|
||||
// Don't run heavy-weight tasks during sync.
|
||||
if self.best_slot() + MAX_PER_SLOT_FORK_CHOICE_DISTANCE < slot {
|
||||
|
||||
Reference in New Issue
Block a user