Skip to content

Add fuzz tests for Bolt11 and Bolt12 deserialization#3292

Open
NishantBansal2003 wants to merge 2 commits intoACINQ:masterfrom
NishantBansal2003:roundtrip-fuzz
Open

Add fuzz tests for Bolt11 and Bolt12 deserialization#3292
NishantBansal2003 wants to merge 2 commits intoACINQ:masterfrom
NishantBansal2003:roundtrip-fuzz

Conversation

@NishantBansal2003
Copy link
Copy Markdown
Contributor

In this commit, I am adding fuzz tests for BOLT 11 invoice deserialization, BOLT 12 offers, BOLT 12 invoice requests, BOLT 12 invoice deserialization, and minimal BOLT 12 invoice deserialization.

In the BOLT 11 fuzz tests, I normalize the input and then compare the second and third roundtrips due to an existing bug. In contrast, for the BOLT 12 tests, I perform direct roundtrip comparisons. The main objective is to ensure that eclair can handle all types of invoice data without crashing or exhibiting unintended behavior on malformed inputs.

For some of the BOLT 12 fuzz tests, I have included seed inputs (for offers, invoice requests, and invoices), since the fuzzer initially struggled to generate valid inputs. This should help the fuzzer learn more effectively and make further progress.

Also, in these fuzz tests, I am performing some initial mutations on the fuzz inputs to help generate valid invoices, since it would otherwise be quite difficult for the fuzzer to produce valid inputs and reach deeper code paths.

Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant