* increase the max topic subscriptions #4581 * make the max_subscription limitation based off constants / configuration * format * wording & add deneb topic array * reduce max_subscriptions_per_request to 2x * format * update comment
This commit is contained in:
parent
8e7b57a794
commit
4a31e369bf
@ -15,7 +15,8 @@ use crate::service::behaviour::BehaviourEvent;
|
||||
pub use crate::service::behaviour::Gossipsub;
|
||||
use crate::types::{
|
||||
fork_core_topics, subnet_from_topic_hash, GossipEncoding, GossipKind, GossipTopic,
|
||||
SnappyTransform, Subnet, SubnetDiscovery,
|
||||
SnappyTransform, Subnet, SubnetDiscovery, ALTAIR_CORE_TOPICS, BASE_CORE_TOPICS,
|
||||
CAPELLA_CORE_TOPICS, DENEB_CORE_TOPICS, LIGHT_CLIENT_GOSSIP_TOPICS,
|
||||
};
|
||||
use crate::EnrExt;
|
||||
use crate::Eth2Enr;
|
||||
@ -224,6 +225,15 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
|
||||
// Set up a scoring update interval
|
||||
let update_gossipsub_scores = tokio::time::interval(params.decay_interval);
|
||||
|
||||
let max_topics = ctx.chain_spec.attestation_subnet_count as usize
|
||||
+ SYNC_COMMITTEE_SUBNET_COUNT as usize
|
||||
+ BLOB_SIDECAR_SUBNET_COUNT as usize
|
||||
+ BASE_CORE_TOPICS.len()
|
||||
+ ALTAIR_CORE_TOPICS.len()
|
||||
+ CAPELLA_CORE_TOPICS.len()
|
||||
+ DENEB_CORE_TOPICS.len()
|
||||
+ LIGHT_CLIENT_GOSSIP_TOPICS.len();
|
||||
|
||||
let possible_fork_digests = ctx.fork_context.all_fork_digests();
|
||||
let filter = gossipsub::MaxCountSubscriptionFilter {
|
||||
filter: utils::create_whitelist_filter(
|
||||
@ -232,9 +242,10 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
|
||||
SYNC_COMMITTEE_SUBNET_COUNT,
|
||||
BLOB_SIDECAR_SUBNET_COUNT,
|
||||
),
|
||||
max_subscribed_topics: 200,
|
||||
// during a fork we subscribe to both the old and new topics
|
||||
max_subscribed_topics: max_topics * 4,
|
||||
// 162 in theory = (64 attestation + 4 sync committee + 7 core topics + 6 blob topics) * 2
|
||||
max_subscriptions_per_request: 160,
|
||||
max_subscriptions_per_request: max_topics * 2,
|
||||
};
|
||||
|
||||
let gossipsub_config_params = GossipsubConfigParams {
|
||||
|
@ -18,5 +18,6 @@ pub use subnet::{Subnet, SubnetDiscovery};
|
||||
pub use sync_state::{BackFillState, SyncState};
|
||||
pub use topics::{
|
||||
core_topics_to_subscribe, fork_core_topics, subnet_from_topic_hash, GossipEncoding, GossipKind,
|
||||
GossipTopic, LIGHT_CLIENT_GOSSIP_TOPICS,
|
||||
GossipTopic, ALTAIR_CORE_TOPICS, BASE_CORE_TOPICS, CAPELLA_CORE_TOPICS, DENEB_CORE_TOPICS,
|
||||
LIGHT_CLIENT_GOSSIP_TOPICS,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user