Repository navigation
Closed
Labels
bugSomething isn't working
Description
Summary
PeerManagerImpl::GetAntiDoSWorkThreshold() currently derives its 144-block near-tip allowance from:
144 * GetBlockProof(*tip)Qbit's permissionless and AuxPoW lanes can contribute materially different per-block proof. As a result, the P2P admission threshold changes depending on the active tip's lane rather than the chain's actual recent aggregate work.
This is a bounded P2P DoS/liveness risk, not a known consensus-split risk.
Affected paths
src/net_processing.cpp:GetAntiDoSWorkThreshold()- Low-work headers synchronization
- Compact-block admission
- Block-message
min_pow_checkedhandling src/validation.cpp: the related6 * GetBlockProof(*tip)best-invalid warning margin
Proposed change
Replace the single-tip proof proxy with the actual chainwork accumulated over the recent window:
- For chains at least 144 blocks deep, use the chainwork delta between the tip and its 144-block ancestor.
- For shorter chains, use the available chainwork so the near-tip threshold retains its current conservative behavior.
- Continue applying
MinimumChainWork()as the lower bound. - Apply the same lane-independent approach—or record an explicit bounded-risk rationale—to the six-block best-invalid warning margin.
Implementation details should avoid duplicating the recent-chainwork calculation between networking and validation.
Acceptance criteria
- The 144-block threshold is based on aggregate recent chainwork, not the current tip's proof.
- Changing only the tip-lane arrangement does not materially collapse or expand the work window when aggregate recent work is unchanged.
- Short-chain and
MinimumChainWork()behavior is covered. - Regression coverage addresses:
- low-work headers synchronization;
- compact-block admission;
- block-message
min_pow_checkedhandling.
- The best-invalid warning margin receives either the same fix or a documented accepted-risk disposition.
Suggested validation
- Add focused unit tests using synthetic mixed-lane
CBlockIndexchains. - Run:
headers_sync_chainwork_testsdenialofservice_tests, if affectedp2p_headers_sync_with_minchainwork.pyp2p_initial_headers_sync.pyfeature_minchainwork.py
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
[-][P0][R13] Make near-tip anti-DoS work thresholds lane-independent[/-][+]Make near-tip anti-DoS work thresholds lane-independent[/+]