mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
af3d3e8cd3
* add in more accurate aggregate parameters * add more param changes * more cleanup * fix order of operations * comments * remove redundant declaration * clean up better * fix up * victor's review * disable mesh scoring * disable mesh scoring Co-authored-by: Raul Jordan <raul@prysmaticlabs.com> Co-authored-by: Victor Farazdagi <simple.square@gmail.com>
42 lines
1.4 KiB
Go
42 lines
1.4 KiB
Go
package p2p
|
|
|
|
import (
|
|
"testing"
|
|
|
|
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
|
"github.com/prysmaticlabs/prysm/shared/testutil/assert"
|
|
)
|
|
|
|
func TestOverlayParameters(t *testing.T) {
|
|
setPubSubParameters()
|
|
assert.Equal(t, gossipSubD, pubsub.GossipSubD, "gossipSubD")
|
|
assert.Equal(t, gossipSubDlo, pubsub.GossipSubDlo, "gossipSubDlo")
|
|
assert.Equal(t, gossipSubDhi, pubsub.GossipSubDhi, "gossipSubDhi")
|
|
}
|
|
|
|
func TestGossipParameters(t *testing.T) {
|
|
setPubSubParameters()
|
|
assert.Equal(t, gossipSubMcacheLen, pubsub.GossipSubHistoryLength, "gossipSubMcacheLen")
|
|
assert.Equal(t, gossipSubMcacheGossip, pubsub.GossipSubHistoryGossip, "gossipSubMcacheGossip")
|
|
assert.Equal(t, gossipSubSeenTTL, int(pubsub.TimeCacheDuration.Milliseconds()/pubsub.GossipSubHeartbeatInterval.Milliseconds()), "gossipSubSeenTtl")
|
|
}
|
|
|
|
func TestFanoutParameters(t *testing.T) {
|
|
setPubSubParameters()
|
|
if pubsub.GossipSubFanoutTTL != gossipSubFanoutTTL {
|
|
t.Errorf("gossipSubFanoutTTL, wanted: %d, got: %d", gossipSubFanoutTTL, pubsub.GossipSubFanoutTTL)
|
|
}
|
|
}
|
|
|
|
func TestHeartbeatParameters(t *testing.T) {
|
|
setPubSubParameters()
|
|
if pubsub.GossipSubHeartbeatInterval != gossipSubHeartbeatInterval {
|
|
t.Errorf("gossipSubHeartbeatInterval, wanted: %d, got: %d", gossipSubHeartbeatInterval, pubsub.GossipSubHeartbeatInterval)
|
|
}
|
|
}
|
|
|
|
func TestMiscParameters(t *testing.T) {
|
|
setPubSubParameters()
|
|
assert.Equal(t, randomSubD, pubsub.RandomSubD, "randomSubD")
|
|
}
|