Repository navigation
Commit 427f66f
Keep the Handshake read cap at 1MB (#4588)
## Summary
- `ReadSizedMsg` accepts a Handshake up to a fixed 1MB again.
`Handshake.MaxSize()` is the worst case of the fields declared today, so
using it as the cap made the message inextensible: adding a field moved
the on-wire limit, and an older node would reject a newer Handshake
before it could ignore unknown fields.
- `init` panics if `MaxSize()` exceeds that constant, the same check
giga RPC registration uses against its configured message sizes.
## Test plan
- [x] `GOWORK=off go test ./sei-tendermint/internal/p2p/ -count=1 -run
'TestHandshake'` (9 passed)
Made with [Cursor](https://cursor.com)
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent f4f3183 commit 427f66f
2 files changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
| |||
104 | 113 | | |
105 | 114 | | |
106 | 115 | | |
107 | | - | |
| 116 | + | |
108 | 117 | | |
109 | 118 | | |
110 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
277 | 276 | | |
278 | 277 | | |
279 | 278 | | |
280 | | - | |
| 279 | + | |
281 | 280 | | |
282 | 281 | | |
283 | 282 | | |
| |||
0 commit comments