Skip to content

Commit f9fa637

Browse files
bdchathamclaude
andcommitted
feat: add P2P override key constants and StateSyncerOverrides helper
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 33ed173 commit f9fa637

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

config.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ func NodePortsForMode(mode NodeMode) []NodePort {
7070
}
7171
}
7272

73+
// Override key constants for P2P configuration fields.
74+
const (
75+
KeyP2PExternalAddress = "network.p2p.external_address"
76+
KeyP2PMaxConnections = "network.p2p.max_connections"
77+
KeyP2PSendRate = "network.p2p.send_rate"
78+
KeyP2PRecvRate = "network.p2p.recv_rate"
79+
)
80+
7381
// Pruning strategy constants.
7482
const (
7583
PruningDefault = "default"

defaults.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,16 @@ func SnapshotGenerationOverrides(keepRecent int32) map[string]string {
310310
}
311311
}
312312

313+
// StateSyncerOverrides returns the config overrides for nodes acting as
314+
// state-sync snapshot servers.
315+
func StateSyncerOverrides() map[string]string {
316+
return map[string]string{
317+
KeyP2PMaxConnections: "500",
318+
KeyP2PSendRate: "20971520",
319+
KeyP2PRecvRate: "20971520",
320+
}
321+
}
322+
313323
func defaultMoniker() string {
314324
name, err := os.Hostname()
315325
if err != nil {

0 commit comments

Comments
 (0)