tests: Add fuzzing harnesses for various classes/functions in policy/ (CBlockPolicyEstimator, IsRBFOptIn(…), etc.)#18775
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
src/test/fuzz/util.h
Outdated
There was a problem hiding this comment.
how is this possible? ConsumeMoney should be less than 34873208148477500
There was a problem hiding this comment.
I think you're misunderstanding what is happening here: note that it ConsumeMoney is always returning within the money bounds, but the calculation does not take place directly on that amount :)
See this example:
const CAmount fee_paid = 348732081484775;
assert(MoneyRange(fee_paid));
const size_t bytes = 10;
const CFeeRate fee_rate(fee_paid, bytes);
(void)fee_rate.GetFeePerK();
policy/feerate.cpp:28:34: runtime error: signed integer overflow: 34873208148477500 * 1000 cannot be represented in type 'long'9e8bf1c to
13c1f6b
Compare
…eeRate::GetFeePerK() when fuzzing
|
Added a commit which clarifies how the signed integer overflow in |
BTC has error too // policy/feerate.cpp:28:34: runtime error: signed integer overflow: 34873208148477500 * 1000 cannot be represented in type 'long' bitcoin/bitcoin#18775
Add fuzzing harnesses for various classes/functions in
policy/(CBlockPolicyEstimator,IsRBFOptIn(…), etc.).See
doc/fuzzing.mdfor information on how to fuzz Bitcoin Core. Don't forget to contribute any coverage increasing inputs you find to the Bitcoin Core fuzzing corpus repo.Happy fuzzing :)