Skip to content

Commit

Permalink
modifying gossipsub seen ttl
Browse files Browse the repository at this point in the history
  • Loading branch information
srene committed May 9, 2024
1 parent 2f3fa90 commit 22ddcf6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.22.2
require (
code.cloudfoundry.org/go-diodes v0.0.0-20220725190411-383eb6634c40
cosmossdk.io/errors v1.0.1
cosmossdk.io/math v1.3.0
github.com/avast/retry-go/v4 v4.5.0
github.com/celestiaorg/celestia-openrpc v0.4.0-rc.1
github.com/celestiaorg/go-cnc v0.4.2
Expand Down Expand Up @@ -248,6 +247,7 @@ require (
)

require (
cosmossdk.io/math v1.3.0 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions mockery.go

This file was deleted.

3 changes: 2 additions & 1 deletion p2p/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ func (c *Client) setupGossiping(ctx context.Context) error {
pubsub.GossipSubHistoryGossip = c.conf.GossipCacheSize
pubsub.GossipSubHistoryLength = c.conf.GossipCacheSize

ps, err := pubsub.NewGossipSub(ctx, c.Host, pubsub.WithSeenMessagesTTL(time.Duration(int(c.blockTime.Nanoseconds()*int64(c.conf.GossipCacheSize)))))
//We add WithSeenMessagesTTL (with 1 year time) option to avoid ever requesting already seen blocks
ps, err := pubsub.NewGossipSub(ctx, c.Host, pubsub.WithSeenMessagesTTL(8760*time.Hour))
if err != nil {
return err
}
Expand Down

0 comments on commit 22ddcf6

Please sign in to comment.