mirror of
https://github.com/status-im/libp2p-test-plans.git
synced 2025-01-27 15:14:47 +00:00
f0762b1814
* refactor baseline test out of private repo * rm references to attackers * fix default plan name & add widget to override * add configs for local runners * update runner notebook intro text * fix build tags * increase setup time in saved configs
39 lines
976 B
Go
39 lines
976 B
Go
// +build !hardened_api
|
|
|
|
// This file is used when the hardened_api build tag is not present.
|
|
// It targets the go-libp2p-pubsub API before GossipSub v1.1.0 was introduced.
|
|
// When using this file, peer scores will not be present in the test output.
|
|
|
|
package main
|
|
|
|
import (
|
|
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
|
)
|
|
|
|
func pubsubOptions(cfg PubsubNodeConfig) ([]pubsub.Option, error) {
|
|
opts := []pubsub.Option{
|
|
pubsub.WithEventTracer(cfg.Tracer),
|
|
}
|
|
|
|
if cfg.ValidateQueueSize > 0 {
|
|
opts = append(opts, pubsub.WithValidateQueueSize(cfg.ValidateQueueSize))
|
|
}
|
|
|
|
if cfg.OutboundQueueSize > 0 {
|
|
opts = append(opts, pubsub.WithPeerOutboundQueueSize(cfg.OutboundQueueSize))
|
|
}
|
|
|
|
// Set the overlay parameters
|
|
if cfg.OverlayParams.d >= 0 {
|
|
pubsub.GossipSubD = cfg.OverlayParams.d
|
|
}
|
|
if cfg.OverlayParams.dlo >= 0 {
|
|
pubsub.GossipSubDlo = cfg.OverlayParams.dlo
|
|
}
|
|
if cfg.OverlayParams.dhi >= 0 {
|
|
pubsub.GossipSubDhi = cfg.OverlayParams.dhi
|
|
}
|
|
|
|
return opts, nil
|
|
}
|