Backport release/v6.6: fix(p2p): make the inbound accept rate configurable and raise its default - #3939
Conversation
…ault (#3899) Manual backport of #3899 (squash d17806f) to release/v6.6. The UCI action refused it — the source PR carries a merge commit, from when main was merged in to resolve conflicts — and cherry-picking the squash directly mis-aligned createRouter, splicing main's signature into this branch's body. So the three affected files were reconstructed from the release/v6.6 side rather than patched out of a bad merge. The resolution is the INVERSE of the one taken on main. #3922 (which unwraps MaxDialRate/MaxAcceptRate from Option[rate.Limit] to plain rate.Limit) is on main only, so this branch keeps the Option form: - RouterOptions.MaxAcceptRate stays utils.Option[rate.Limit]. - setup.go wraps: MaxDialRate/MaxAcceptRate: utils.Some(dialRate/acceptRate). - setup_test.go asserts utils.Some(...) on both rates. - routeroptions_test.go is #3899's original fallback-based test, not the Validate-based rewrite that main's version needed. One difference is load-bearing rather than cosmetic. On main, dropping #3899's raised package-level fallback was safe because #3922 added a Validate() guard rejecting a zero rate, so a construction site that forgets the field fails loudly. This branch has no such guard, so maxAcceptRate() keeps .Or(rate.Every(10 * time.Millisecond)) — without it an unset field silently inherits 1/s and the backport ships nothing. pacingRate and p2pRouterOptions are introduced by #3899 itself, not pre-existing main drift, so both come across; createRouter here keeps its own signature (p2pMetrics first, 3 return values) and just calls p2pRouterOptions. Verified: gofmt -s and go vet clean; ./sei-tendermint/config/... and ./sei-tendermint/internal/p2p/ green; TestP2PRouterOptions_PacingAndBudgetWiring and TestRouterOptionsPacingDefaults pass. ./sei-tendermint/node/ has 3 failures (TestNodeStartStop, TestNodeRestartEventAllowsRecreate, TestNodeSetPrivValTCP) confirmed identical on pristine release/v6.6. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/v6.6 #3939 +/- ##
================================================
- Coverage 59.00% 58.13% -0.88%
================================================
Files 2225 2151 -74
Lines 183577 175032 -8545
================================================
- Hits 108320 101749 -6571
+ Misses 65511 64238 -1273
+ Partials 9746 9045 -701
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
PR SummaryMedium Risk Overview Adds
Reviewed by Cursor Bugbot for commit 36705fa. Bugbot is set up for automated code reviews on this repo. Configure here. |
Backport of #3899 to
release/v6.6. Done by hand — see below.Why this is manual
The UCI backport action refused it:
#3899 was updated by merging
mainin to resolve conflicts, and the action cherry-picks a PR's commits individually. Configuringmerge_commits: skipwould have been the wrong fix, since that merge commit is where the conflict resolution lives.Cherry-picking the squash (
d17806f6c) directly also does not work cleanly: it mis-alignscreateRouter, splicingmain's signature and return shape into this branch's body while marking only part of the damage. So the three affected files were reconstructed from therelease/v6.6side instead of patched out of a bad merge.config.go,toml.go, and the three config test files applied cleanly and are unmodified from the source commit.The resolution is the inverse of the one on main
#3922 — which unwraps
MaxDialRate/MaxAcceptRatefromOption[rate.Limit]to plainrate.Limit— is onmainonly. So this branch keeps the Option form:mainMaxAcceptRate rate.LimitMaxAcceptRate utils.Option[rate.Limit]setup.goMaxAcceptRate: acceptRateMaxAcceptRate: utils.Some(acceptRate)routeroptions_test.gopacingRateandp2pRouterOptionsare introduced by #3899 itself rather than pre-existingmaindrift, so both come across.createRouterhere keeps its own signature —p2pMetricsfirst, three return values — and just callsp2pRouterOptions.One difference that is load-bearing
On
main, dropping #3899's raised package-level fallback was safe because #3922 added aValidate()guard rejecting a zero rate, so a construction site that forgets the field fails loudly.This branch has no such guard. So
maxAcceptRate()keeps.Or(rate.Every(10 * time.Millisecond)). Without it, an unset field silently inherits the old 1/s and the backport ships no behaviour change at all.Verification
gofmt -sandgo vetclean./sei-tendermint/config/...and./sei-tendermint/internal/p2p/greenTestP2PRouterOptions_PacingAndBudgetWiring(7 subtests) andTestRouterOptionsPacingDefaultspass./sei-tendermint/node/has 3 failures —TestNodeStartStop,TestNodeRestartEventAllowsRecreate,TestNodeSetPrivValTCP— which I confirmed are identical on pristinerelease/v6.6, not introduced hereWhy it matters for v6.6
The seeds run v6.6.0. Their inbound accept limiter is pinned at 1/s with no way to reach it from config, so the kernel completes handshakes into the listen backlog faster than the loop drains it and arriving peers time out — a node that accepts TCP and then says nothing. That is the observed state of all three
prod-cell seeds.Paired with sei-config v0.0.26, which carries the
accept-intervalkey through the config schema.🤖 Generated with Claude Code