Skip to content

Commit 10bfb60

Browse files
auricomclaude
andcommitted
fix(pkg/p2p): purge gater blocklist on restart by using in-memory datastore
Stale blocklist entries accumulated in the Badger datastore were causing the edennet-2 incident (#3267): fullnodes rejected every binary builder peer, header sync never initialized, and nodes fell back to DA-only sync. Fixes the root cause by giving BasicConnectionGater a fresh in-memory datastore on every startup instead of the persistent one. The blocklist is always empty at boot; config-driven blocks (conf.BlockedPeers) are still re-applied each run via setupBlockedPeers. This is ADR-023 Option A. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3421230 commit 10bfb60

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pkg/p2p/client.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ func NewClient(
8282
metrics *Metrics,
8383
) (*Client, error) {
8484

85-
gater, err := conngater.NewBasicConnectionGater(ds)
85+
// Use a fresh in-memory datastore so the gater blocklist is always clean on
86+
// restart. Persistent config blocks (conf.BlockedPeers) are re-applied each
87+
// time startWithHost runs. Dynamic runtime bans are intentionally ephemeral.
88+
// The ds parameter is reserved for the future TTL gater (ADR-023 Option C).
89+
gater, err := conngater.NewBasicConnectionGater(datastore.NewMapDatastore())
8690
if err != nil {
8791
return nil, fmt.Errorf("failed to create connection gater: %w", err)
8892
}

0 commit comments

Comments
 (0)