Commit a59ad9e
committed
Merge #7347: fix: punish invalid dstx messages
4329a4f refactor: use named result type and score enum for ValidateDSTX (PastaClaw)
7d073b9 fix: penalize unknown-masternode dstx relays with a small score (PastaClaw)
9c68646 fix: avoid punishing unverifiable dstx relays (PastaClaw)
c25cf3d fix: punish invalid dstx messages (PastaClaw)
Pull request description:
# fix: punish invalid dstx messages
## Issue being fixed or feature implemented
Invalid CoinJoin broadcast transaction (`dstx`) messages can return early from
validation without applying the same peer-accounting consequence used by other
invalid P2P messages.
This hardens DSTX handling by making invalid validation results contribute a low
misbehavior score while preserving benign early returns for duplicate or
otherwise non-error DSTX cases.
## What was done?
- Apply a low misbehavior score when DSTX validation returns an invalid/error
result.
- Preserve existing behavior for successful validation and benign early-return
cases.
- Add P2P test framework serialization for `dstx` messages.
- Add a focused functional test covering invalid DSTX peer accounting.
## How Has This Been Tested?
Tested on macOS arm64.
- `git diff --check`
- `python3 -m py_compile test/functional/p2p_dstx.py test/functional/test_framework/messages.py`
- Configured with depends `config.site`, `--without-gui`, `--disable-bench`,
and `--disable-fuzz-binary`
- `make -j8 src/dashd`
- `test/functional/p2p_dstx.py --tmpdir=/tmp/dash_func_dstx`
- `test/functional/p2p_dstx.py --tmpdir=/tmp/dash_func_dstx_2`
## Breaking Changes
None.
## Checklist
- [x] I have performed a self-review of my own code
- [x] 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
ACKs for top commit:
UdjinM6:
utACK 4329a4f
Tree-SHA512: 79ac5b9bf9d359d68abf9b8a890fd09719c642635f199568efe4cb61c9979aa8cf89df48e6229c5c807b12b4ae127be701aef95ec04f4518fcabcdde305ce9b04 files changed
Lines changed: 195 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3490 | 3490 | | |
3491 | 3491 | | |
3492 | 3492 | | |
3493 | | - | |
3494 | | - | |
| 3493 | + | |
| 3494 | + | |
| 3495 | + | |
| 3496 | + | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
3495 | 3508 | | |
3496 | 3509 | | |
3497 | 3510 | | |
3498 | 3511 | | |
3499 | 3512 | | |
3500 | | - | |
| 3513 | + | |
3501 | 3514 | | |
3502 | 3515 | | |
3503 | 3516 | | |
3504 | | - | |
| 3517 | + | |
3505 | 3518 | | |
3506 | 3519 | | |
3507 | 3520 | | |
| |||
3534 | 3547 | | |
3535 | 3548 | | |
3536 | 3549 | | |
3537 | | - | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
3538 | 3554 | | |
3539 | 3555 | | |
3540 | 3556 | | |
3541 | 3557 | | |
3542 | | - | |
| 3558 | + | |
3543 | 3559 | | |
3544 | 3560 | | |
3545 | 3561 | | |
3546 | 3562 | | |
3547 | 3563 | | |
3548 | 3564 | | |
3549 | | - | |
| 3565 | + | |
3550 | 3566 | | |
3551 | 3567 | | |
3552 | 3568 | | |
3553 | 3569 | | |
3554 | 3570 | | |
3555 | 3571 | | |
3556 | | - | |
| 3572 | + | |
3557 | 3573 | | |
3558 | 3574 | | |
3559 | 3575 | | |
| |||
4617 | 4633 | | |
4618 | 4634 | | |
4619 | 4635 | | |
4620 | | - | |
4621 | | - | |
4622 | | - | |
4623 | | - | |
4624 | | - | |
4625 | | - | |
| 4636 | + | |
| 4637 | + | |
| 4638 | + | |
| 4639 | + | |
| 4640 | + | |
| 4641 | + | |
| 4642 | + | |
| 4643 | + | |
4626 | 4644 | | |
4627 | 4645 | | |
4628 | 4646 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 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 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1835 | 1835 | | |
1836 | 1836 | | |
1837 | 1837 | | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
1838 | 1885 | | |
1839 | 1886 | | |
1840 | 1887 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| 261 | + | |
261 | 262 | | |
262 | 263 | | |
263 | 264 | | |
| |||
0 commit comments