Skip to content

Commit db847c3

Browse files
committed
Add sync committee topics to whitelist
1 parent f3a1b8a commit db847c3

File tree

1 file changed

+8
-3
lines changed
  • beacon_node/eth2_libp2p/src/behaviour

1 file changed

+8
-3
lines changed

beacon_node/eth2_libp2p/src/behaviour/mod.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl<TSpec: EthSpec> Behaviour<TSpec> {
173173

174174
let possible_fork_digests = fork_context.all_fork_digests();
175175
let filter = MaxCountSubscriptionFilter {
176-
filter: Self::create_whitelist_filter(possible_fork_digests, 64), //TODO change this to a constant
176+
filter: Self::create_whitelist_filter(possible_fork_digests, 64, 8), //TODO change this to a constant
177177
max_subscribed_topics: 200, //TODO change this to a constant
178178
max_subscriptions_per_request: 100, //this is according to the current go implementation
179179
};
@@ -365,8 +365,8 @@ impl<TSpec: EthSpec> Behaviour<TSpec> {
365365
let topic: Topic = topic.into();
366366

367367
match self.gossipsub.subscribe(&topic) {
368-
Err(_) => {
369-
warn!(self.log, "Failed to subscribe to topic"; "topic" => %topic);
368+
Err(e) => {
369+
warn!(self.log, "Failed to subscribe to topic"; "topic" => %topic, "error" => ?e);
370370
false
371371
}
372372
Ok(v) => {
@@ -947,6 +947,7 @@ impl<TSpec: EthSpec> Behaviour<TSpec> {
947947
fn create_whitelist_filter(
948948
possible_fork_digests: Vec<[u8; 4]>,
949949
attestation_subnet_count: u64,
950+
sync_committee_subnet_count: u64,
950951
) -> WhitelistSubscriptionFilter {
951952
let mut possible_hashes = HashSet::new();
952953
for fork_digest in possible_fork_digests {
@@ -962,9 +963,13 @@ impl<TSpec: EthSpec> Behaviour<TSpec> {
962963
add(VoluntaryExit);
963964
add(ProposerSlashing);
964965
add(AttesterSlashing);
966+
add(SignedContributionAndProof);
965967
for id in 0..attestation_subnet_count {
966968
add(Attestation(SubnetId::new(id)));
967969
}
970+
for id in 0..sync_committee_subnet_count {
971+
add(SyncCommitteeSignature(SubnetId::new(id)));
972+
}
968973
}
969974
WhitelistSubscriptionFilter(possible_hashes)
970975
}

0 commit comments

Comments
 (0)