Skip to content

Do not panic on early tx broadcasts in fuzzing #1513

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

Merged

Conversation

TheBlueMatt
Copy link
Collaborator

If the user broadcasts a funding transaction before the
counterparty provides a funding_signed we will panic in
check_get_channel_ready. This is expected - the user did
something which may lead to loss of funds, and we really need to
let them know.

However, the fuzzer can do this and we shouldn't treat it as a bug,
its a totally expected panic. Thus, we disable the panic in fuzz.

Thanks to Chaincode for providing fuzzing resources which managed
to hit this panic.

If the user broadcasts a funding transaction before the
counterparty provides a `funding_signed` we will panic in
`check_get_channel_ready`. This is expected - the user did
something which may lead to loss of funds, and we *really* need to
let them know.

However, the fuzzer can do this and we shouldn't treat it as a bug,
its a totally expected panic. Thus, we disable the panic in fuzz.

Thanks to Chaincode for providing fuzzing resources which managed
to hit this panic.
@codecov-commenter
Copy link

Codecov Report

Merging #1513 (47045b0) into main (0b77008) will decrease coverage by 0.05%.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##             main    #1513      +/-   ##
==========================================
- Coverage   91.01%   90.96%   -0.06%     
==========================================
  Files          80       80              
  Lines       43409    43410       +1     
  Branches    43409    43410       +1     
==========================================
- Hits        39509    39486      -23     
- Misses       3900     3924      +24     
Impacted Files Coverage Δ
lightning/src/ln/channel.rs 88.57% <33.33%> (-0.03%) ⬇️
lightning/src/chain/onchaintx.rs 93.98% <0.00%> (-0.93%) ⬇️
lightning/src/util/events.rs 41.66% <0.00%> (-0.33%) ⬇️
lightning/src/ln/functional_tests.rs 96.95% <0.00%> (-0.24%) ⬇️
lightning/src/ln/payment_tests.rs 99.06% <0.00%> (-0.19%) ⬇️
lightning-invoice/src/utils.rs 96.63% <0.00%> (-0.15%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b77008...47045b0. Read the comment docs.

@valentinewallace valentinewallace merged commit 6e00c28 into lightningdevkit:main Jun 9, 2022
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.

5 participants