This commit is contained in:
Cassandra Heart 2024-04-04 01:40:57 -05:00 committed by GitHub
parent 9cc9e252db
commit 4148de06bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 37 deletions

View File

@ -6,15 +6,15 @@ import (
) )
func GetMinimumVersionCutoff() time.Time { func GetMinimumVersionCutoff() time.Time {
return time.Date(2024, time.March, 27, 8, 30, 0, 0, time.UTC) return time.Date(2024, time.April, 4, 6, 20, 0, 0, time.UTC)
} }
func GetMinimumVersion() []byte { func GetMinimumVersion() []byte {
return []byte{0x01, 0x04, 0x0D} return []byte{0x01, 0x04, 0x0E}
} }
func GetVersion() []byte { func GetVersion() []byte {
return []byte{0x01, 0x04, 0x0D} return []byte{0x01, 0x04, 0x0E}
} }
func GetVersionString() string { func GetVersionString() string {

View File

@ -160,44 +160,11 @@ func NewBlossomSub(
} }
blossomOpts := []blossomsub.Option{} blossomOpts := []blossomsub.Option{}
if isBootstrapPeer {
blossomOpts = append(blossomOpts,
blossomsub.WithPeerExchange(true),
)
}
if tracer != nil { if tracer != nil {
blossomOpts = append(blossomOpts, blossomsub.WithEventTracer(tracer)) blossomOpts = append(blossomOpts, blossomsub.WithEventTracer(tracer))
} }
blossomOpts = append(blossomOpts, blossomsub.WithPeerScore(
&blossomsub.PeerScoreParams{
SkipAtomicValidation: false,
BitmaskScoreCap: 0,
IPColocationFactorWeight: 0,
IPColocationFactorThreshold: 6,
BehaviourPenaltyWeight: 0,
BehaviourPenaltyThreshold: 100,
BehaviourPenaltyDecay: .5,
DecayInterval: 10 * time.Second,
DecayToZero: .1,
RetainScore: 5 * time.Minute,
AppSpecificScore: func(p peer.ID) float64 {
return float64(bs.GetPeerScore([]byte(p)))
},
AppSpecificWeight: 10.0,
},
&blossomsub.PeerScoreThresholds{
SkipAtomicValidation: false,
GossipThreshold: -2000,
PublishThreshold: -5000,
GraylistThreshold: -10000,
AcceptPXThreshold: 100,
OpportunisticGraftThreshold: 2,
}))
params := mergeDefaults(p2pConfig) ps, err := blossomsub.NewFloodSub(ctx, h, blossomOpts...)
rt := blossomsub.NewBlossomSubRouter(h, params)
ps, err := blossomsub.NewBlossomSubWithRouter(ctx, h, rt, blossomOpts...)
if err != nil { if err != nil {
panic(err) panic(err)
} }