Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize: extended expire time for sequencer block broadcasting #106

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions op-node/p2p/gossip.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const (
globalValidateThrottle = 512
gossipHeartbeat = 500 * time.Millisecond
// seenMessagesTTL limits the duration that message IDs are remembered for gossip deduplication purposes
// 130 * gossipHeartbeat
seenMessagesTTL = 130 * gossipHeartbeat
// 2500 * gossipHeartbeat
seenMessagesTTL = 2500 * gossipHeartbeat
DefaultMeshD = 8 // topic stable mesh target count
DefaultMeshDlo = 6 // topic stable mesh low watermark
DefaultMeshDhi = 12 // topic stable mesh high watermark
Expand Down Expand Up @@ -242,7 +242,7 @@ func BuildBlocksValidator(log log.Logger, cfg *rollup.Config, runCfg GossipRunti

// Seen block hashes per block height
// uint64 -> *seenBlocks
blockHeightLRU, err := lru.New(1000)
blockHeightLRU, err := lru.New(1500)
if err != nil {
panic(fmt.Errorf("failed to set up block height LRU cache: %w", err))
}
Expand Down Expand Up @@ -291,8 +291,8 @@ func BuildBlocksValidator(log log.Logger, cfg *rollup.Config, runCfg GossipRunti
// rounding down to seconds is fine here.
now := uint64(time.Now().Unix())

// [REJECT] if the `payload.timestamp` is older than 60 seconds in the past
if uint64(payload.Timestamp) < now-60 {
// [REJECT] if the `payload.timestamp` is older than 20 min in the past
if uint64(payload.Timestamp) < now-1200 {
log.Warn("payload is too old", "timestamp", uint64(payload.Timestamp))
return pubsub.ValidationReject
}
Expand Down
Loading