Increase gossip history and length (#401)

* Increase gossip history and length

* Increase peer outbound queue size
This commit is contained in:
petricadaipegsp 2024-12-03 12:00:48 +01:00 committed by GitHub
parent 63394edc9d
commit 667b2aa2bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 2 deletions

View File

@ -37,8 +37,8 @@ var (
BlossomSubDhi = 12
BlossomSubDscore = 4
BlossomSubDout = 2
BlossomSubHistoryLength = 5
BlossomSubHistoryGossip = 3
BlossomSubHistoryLength = 9
BlossomSubHistoryGossip = 6
BlossomSubDlazy = 6
BlossomSubGossipFactor = 0.25
BlossomSubGossipRetransmission = 3

View File

@ -32,6 +32,9 @@ const DefaultSoftMaxMessageSize = 1 << 20
// DefaultHardMaxMessageSize is 20 MB.
const DefaultHardMaxMessageSize = 10 << 21
// DefaultPeerOutboundQueueSize is the default size of the outbound message channel that we maintain for each peer.
const DefaultPeerOutboundQueueSize = 128
var (
// TimeCacheDuration specifies how long a message ID will be remembered as seen.
// Use WithSeenMessagesTTL to configure this per pubsub instance, instead of overriding the global default.

View File

@ -54,4 +54,5 @@ type P2PConfig struct {
ValidateQueueSize int `yaml:"validateQueueSize"`
ValidateWorkers int `yaml:"validateWorkers"`
SubscriptionQueueSize int `yaml:"subscriptionQueueSize"`
PeerOutboundQueueSize int `yaml:"peerOutboundQueueSize"`
}

View File

@ -476,6 +476,7 @@ func NewBlossomSub(
blossomOpts = append(blossomOpts,
blossomsub.WithValidateQueueSize(p2pConfig.ValidateQueueSize),
blossomsub.WithValidateWorkers(p2pConfig.ValidateWorkers),
blossomsub.WithPeerOutboundQueueSize(p2pConfig.PeerOutboundQueueSize),
)
blossomOpts = append(blossomOpts, observability.WithPrometheusRawTracer())
blossomOpts = append(blossomOpts, blossomsub.WithPeerFilter(internal.NewStaticPeerFilter(
@ -1174,6 +1175,9 @@ func withDefaults(p2pConfig *config.P2PConfig) *config.P2PConfig {
if p2pConfig.SubscriptionQueueSize == 0 {
p2pConfig.SubscriptionQueueSize = blossomsub.DefaultSubscriptionQueueSize
}
if p2pConfig.PeerOutboundQueueSize == 0 {
p2pConfig.PeerOutboundQueueSize = blossomsub.DefaultPeerOutboundQueueSize
}
return p2pConfig
}