-
Notifications
You must be signed in to change notification settings - Fork 939
fuzz-tests: Add fuzz target for closing_sig #8244
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
tests/fuzz/fuzz-wire-closing_sig.c
Outdated
assert(!memcmp(&x->channel_id, &y->channel_id, sizeof(struct channel_id))); | ||
assert(x->locktime == y->locktime); | ||
assert(!memcmp(&x->fee_satoshis, &y->fee_satoshis, sizeof(struct amount_sat))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert(!memcmp(&x->channel_id, &y->channel_id, sizeof(struct channel_id))); | |
assert(x->locktime == y->locktime); | |
assert(!memcmp(&x->fee_satoshis, &y->fee_satoshis, sizeof(struct amount_sat))); | |
assert(memcmp(&x->channel_id, &y->channel_id, sizeof(x->channel_id)) == 0); | |
assert(x->locktime == y->locktime); | |
assert(memcmp(&x->fee_satoshis, &y->fee_satoshis, sizeof(x->fee_satoshis)) == 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, my bad. This change should have been carried over from the review on #8216 .
assert(tal_arr_eq(x->closee_scriptpubkey, y->closee_scriptpubkey)); | ||
|
||
assert(x->tlvs && y->tlvs); | ||
return tal_arr_eq(x->tlvs->closer_and_closee_outputs, y->tlvs->closer_and_closee_outputs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need to compare these TLVs:
closer_output_only
closee_output_only
Changelog-None: 'closing_signed' and 'closing_sig' are channel closing negotiation messages defined in BOLT ElementsProject#2. While 'closing_signed' has a wire fuzz test, 'closing_sig' does not. Add a test to perform a round-trip encoding check (towire -> fromwire) similar to the other wire fuzzers.
Add a minimal input set as a seed corpus for the newly introduced test. This leads to discovery of interesting code paths faster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 149cdfe
closing_signed
andclosing_sig
are channel closing negotiation messages defined in BOLT #2.While
closing_signed
has a wire fuzz test,closing_sig
does not. Add a test to perform a round-trip encoding check (towire -> fromwire) similar to the other wire fuzzers.With this PR and #8216 , wire fuzzing is covered for all types of wire messages (except subtypes).
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:
CC: @morehouse