fix(sei-tendermint): default HTTP write timeout to 30s on CometBFT RPC server (SEI-10199)#3558
fix(sei-tendermint): default HTTP write timeout to 30s on CometBFT RPC server (SEI-10199)#3558amir-deris wants to merge 5 commits into
Conversation
PR SummaryMedium Risk Overview The JSON-RPC server Reviewed by Cursor Bugbot for commit 0d6f6f4. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
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 @@
## main #3558 +/- ##
==========================================
- Coverage 59.19% 58.34% -0.85%
==========================================
Files 2223 2148 -75
Lines 183570 174950 -8620
==========================================
- Hits 108661 102083 -6578
+ Misses 65115 63796 -1319
+ Partials 9794 9071 -723
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d19bf5e. Configure here.
|
@claude review |
| if cfg.WriteTimeout <= conf.RPC.TimeoutBroadcastTxCommit { | ||
| cfg.WriteTimeout = conf.RPC.TimeoutBroadcastTxCommit + 1*time.Second | ||
| } |
There was a problem hiding this comment.
nit: I would just return an error with a descriptive message. This prevents any sort of magic going on under the hood and makes it very clear to a user when their setup needs to be corrected

Summary
WriteTimeouton the CometBFT JSON-RPC HTTP server was0(disabled), allowing clients to hold connections open indefinitely and exhaust server memory (SEI-10199).WriteTimeoutis now 30s, enforced as a hard backstop across all handlers.timeout-writeinRPCConfigand the generatedconfig.tomlso operators can tune or disable it (0s).WriteTimeoutat runtime,ValidateBasicnow returns a descriptive error whentimeout-writeis positive but not greater thantimeout-broadcast-tx-commit, making misconfiguration explicit at startup.Changes
sei-tendermint/rpc/jsonrpc/server/http_server.goWriteTimeout: 0→30sinDefaultConfig()sei-tendermint/config/config.goTimeoutWritefield toRPCConfig; default30s; validated non-negative and greater thanTimeoutBroadcastTxCommitsei-tendermint/internal/rpc/core/env.goconf.RPC.TimeoutWritedirectly; removes silent runtime bumpsei-tendermint/cmd/tendermint/commands/light.goTimeoutWritedirectlysei-tendermint/internal/inspect/rpc/rpc.goTimeoutWritedirectlysei-tendermint/config/toml.gotimeout-writetemplate entrysei-tendermint/config/config_test.goTestRPCConfigValidateBasicto coverTimeoutWritenegative and cross-field casesRisk
broadcast_tx_commitwaits at most ~400ms on Sei — well within 30s. Settingtimeout-write = "0s"restores the previous behaviour. Iftimeout-writeis set to a value ≤timeout-broadcast-tx-commit, node startup will fail with a descriptive error rather than silently adjusting the value.🤖 Generated with Claude Code