Commit 29ad7e9
## Summary
- Cap `SeenTxSet` to 10M entries (~5 GB worst-case) to prevent unbounded
memory growth from malicious peers flooding `SeenTx` messages with
random tx keys on channel `0x31`.
- When the cap is reached and a new key arrives, one random existing
entry is evicted to make room. Updates to existing keys are unaffected.
- Added `TestSeenTxSetMaxSize` to verify the cap, eviction, and
existing-key update behavior.
Closes PROTOCO-1325
## Test plan
- [x] `TestSeenTxSet` passes (existing behavior preserved)
- [x] `TestSeenTxSetMaxSize` passes (cap enforced, eviction works,
existing-key updates work at capacity)
- [ ] Run full mempool/cat test suite: `go test ./mempool/cat/...`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---
<a
href="https://app.devin.ai/review/celestiaorg/celestia-core/pull/2887"
target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open with Devin">
</picture>
</a>
<hr>This is an automatic backport of pull request #2887 done by
[Mergify](https://mergify.com).
<!-- devin-review-badge-begin -->
---
<a
href="https://app.devin.ai/review/celestiaorg/celestia-core/pull/2927"
target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open with Devin">
</picture>
</a>
<!-- devin-review-badge-end -->
Co-authored-by: CHAMI Rachid <chamirachid1@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Rootul P <rootulp@gmail.com>
Co-authored-by: Mikhail Rakhmanov <rakhmanov.m@gmail.com>
1 parent 6f09eba commit 29ad7e9
3 files changed
Lines changed: 42 additions & 0 deletions
File tree
- .changelog/unreleased/bug-fixes
- mempool/cat
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
35 | 48 | | |
36 | 49 | | |
37 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
0 commit comments