-
Notifications
You must be signed in to change notification settings - Fork 942
fuzz-tests: add test for amount-{sat, msat} arithmetic #8298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Hey @morehouse , running this test throws the following errors:
among a few others, which are probably due to faulty harness logic. The above failures happen in the following two functions:
Has the fuzzer found an actual bug or is it just another impossible edge case? |
I think technically these are bugs -- In practice, all current usages of these functions in the codebase have positive values for |
Makes me wonder why |
Probably because there's no way to represent an unsigned float. |
The fuzz-amount test doesn't fuzz the arithmetic operations for `struct amount_sat` and `struct amount_msat`. Add a test for the same.
2e97725
to
108f7a6
Compare
An assertion failure occurs in amount_msat_sub_fee() due to overlow of parameters. Add a test in tests/test_askrene.py to try and trigger this failure through a user-level command.
Hey @morehouse, As we discussed over email, I spent some time last week investigating the potential bug caused by an assertion failure in To test this path, I added a user-level Python test in In summary, it doesn’t appear that any external message can trigger the failure seen in the fuzz test. I’ve pushed the test in case you’d like to take a look. |
The fuzz-amount test doesn't fuzz the arithmetic operations for
struct amount_sat
andstruct amount_msat
. Add a test for the same.Checklist
Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked: