Commit 6a051f5
committed
Merge #7348: fix: penalize oversized notfound messages
a97b7b4 fix: align oversized notfound penalty (PastaClaw)
a43a27f test: avoid hardcoded oversized notfound count (PastaClaw)
f84962b fix: penalize oversized notfound messages (PastaClaw)
Pull request description:
# fix: penalize oversized notfound messages
## Issue being fixed or feature implemented
Oversized `notfound` inventory vectors were ignored after deserialization. This
change gives them a small misbehavior score, matching the defensive treatment
used for other inventory-vector messages, and avoids holding `cs_main` while
deserializing the vector.
## What was done?
- Deserialize `notfound` inventory vectors before taking `cs_main`.
- Return early with a small misbehavior score when a `notfound` vector exceeds
the maximum outstanding object/block request count.
- Add functional coverage for the oversized `notfound` path.
## How Has This Been Tested?
Environment: macOS 15.6 arm64, local Dash Core autotools build from this branch.
- `git diff --check`
- Local build configured with:
```bash
./configure --without-gui --disable-bench --disable-fuzz-binary \
--disable-tests --disable-wallet
```
- `make -j8 src/dashd src/dash-cli`
- Initial parallel build hit a generated dependency-file race while building
`dash-cli`; `dashd` linked successfully.
- `make -j1 src/dash-cli`
- `test/functional/p2p_tx_download.py --cachedir=/tmp/dash_func_cache_notfound`
## Breaking Changes
None.
## Checklist
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e tests
- [ ] I have made corresponding changes to the documentation
- [ ] I have assigned this pull request to a milestone
*(for repository code-owners and collaborators only)*
ACKs for top commit:
UdjinM6:
utACK a97b7b4
Tree-SHA512: 35ff6b0b9e12e377e5600f4b0b2caee9582d0b4022dad04727fab54599807a5659c1837e43d30205386be34ce4dda33d4d9f687101ce67e8a694fb1a614d39142 files changed
Lines changed: 29 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5451 | 5451 | | |
5452 | 5452 | | |
5453 | 5453 | | |
5454 | | - | |
5455 | | - | |
5456 | 5454 | | |
5457 | 5455 | | |
5458 | | - | |
5459 | | - | |
5460 | | - | |
5461 | | - | |
5462 | | - | |
5463 | | - | |
5464 | | - | |
5465 | | - | |
5466 | | - | |
5467 | | - | |
5468 | | - | |
5469 | | - | |
5470 | | - | |
| 5456 | + | |
| 5457 | + | |
| 5458 | + | |
| 5459 | + | |
| 5460 | + | |
| 5461 | + | |
| 5462 | + | |
| 5463 | + | |
| 5464 | + | |
| 5465 | + | |
| 5466 | + | |
| 5467 | + | |
| 5468 | + | |
| 5469 | + | |
| 5470 | + | |
| 5471 | + | |
5471 | 5472 | | |
| 5473 | + | |
| 5474 | + | |
5472 | 5475 | | |
5473 | 5476 | | |
5474 | 5477 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
145 | 155 | | |
146 | 156 | | |
147 | 157 | | |
148 | 158 | | |
149 | 159 | | |
150 | 160 | | |
151 | | - | |
| 161 | + | |
152 | 162 | | |
153 | 163 | | |
154 | 164 | | |
| |||
0 commit comments