merge upstream

This commit is contained in:
realbigsean
2022-11-26 10:01:57 -05:00
29 changed files with 557 additions and 69 deletions

View File

@@ -36,6 +36,8 @@ pub struct GossipCache {
signed_contribution_and_proof: Option<Duration>,
/// Timeout for sync committee messages.
sync_committee_message: Option<Duration>,
/// Timeout for signed BLS to execution changes.
bls_to_execution_change: Option<Duration>,
}
#[derive(Default)]
@@ -59,6 +61,8 @@ pub struct GossipCacheBuilder {
signed_contribution_and_proof: Option<Duration>,
/// Timeout for sync committee messages.
sync_committee_message: Option<Duration>,
/// Timeout for signed BLS to execution changes.
bls_to_execution_change: Option<Duration>,
}
#[allow(dead_code)]
@@ -117,6 +121,12 @@ impl GossipCacheBuilder {
self
}
/// Timeout for BLS to execution change messages.
pub fn bls_to_execution_change_timeout(mut self, timeout: Duration) -> Self {
self.bls_to_execution_change = Some(timeout);
self
}
pub fn build(self) -> GossipCache {
let GossipCacheBuilder {
default_timeout,
@@ -129,6 +139,7 @@ impl GossipCacheBuilder {
attester_slashing,
signed_contribution_and_proof,
sync_committee_message,
bls_to_execution_change,
} = self;
GossipCache {
expirations: DelayQueue::default(),
@@ -142,6 +153,7 @@ impl GossipCacheBuilder {
attester_slashing: attester_slashing.or(default_timeout),
signed_contribution_and_proof: signed_contribution_and_proof.or(default_timeout),
sync_committee_message: sync_committee_message.or(default_timeout),
bls_to_execution_change: bls_to_execution_change.or(default_timeout),
}
}
}
@@ -165,6 +177,7 @@ impl GossipCache {
GossipKind::AttesterSlashing => self.attester_slashing,
GossipKind::SignedContributionAndProof => self.signed_contribution_and_proof,
GossipKind::SyncCommitteeMessage(_) => self.sync_committee_message,
GossipKind::BlsToExecutionChange => self.bls_to_execution_change,
};
let expire_timeout = match expire_timeout {
Some(expire_timeout) => expire_timeout,

View File

@@ -199,6 +199,7 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
.attester_slashing_timeout(half_epoch * 2)
// .signed_contribution_and_proof_timeout(timeout) // Do not retry
// .sync_committee_message_timeout(timeout) // Do not retry
.bls_to_execution_change_timeout(half_epoch * 2)
.build()
};

View File

@@ -253,6 +253,7 @@ pub(crate) fn create_whitelist_filter(
add(ProposerSlashing);
add(AttesterSlashing);
add(SignedContributionAndProof);
add(BlsToExecutionChange);
add(BeaconBlocksAndBlobsSidecar);
for id in 0..attestation_subnet_count {
add(Attestation(SubnetId::new(id)));