1 suggestion
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.
Optional improvements
[suggestion] · Negative GetFeePerK floor rounding lacks unit coverage
The existing positive fractional functional check cannot distinguish floor from truncation for negative rates, leaving that part of GetFeePerK's documented contract without a unit regression check.
Location: src/policy/feerate.h:64 (head).
Details and suggested fix
GetFeePerK() correctly uses EvaluateFeeDown(1000), but GetFeeTest directly asserts its result only for empty rates, and the negative ToStringTest cases all have integral sat/kvB values. The fractional-rate assertion in rpc_psbt.py checks a positive value, where floor and truncation toward zero agree. Add assertions in GetFeeTest that CFeeRate(CAmount{1}, 3).GetFeePerK() returns 333 and CFeeRate(CAmount{-1}, 3).GetFeePerK() returns -334. The negative case would detect a change to truncation returning -333 and pin the rounding contract documented here.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Rounding comments leave the negative-feerate case implicit (earlier report)