Skip to content

Misc fuzzing tweaks - #1939

Merged
TheBlueMatt merged 5 commits into
lightningdevkit:mainfrom
TheBlueMatt:2022-01-fuzz-hashbrown
Jan 17, 2023
Merged

TheBlueMatt merged 5 commits into
lightningdevkit:mainfrom
TheBlueMatt:2022-01-fuzz-hashbrown

Conversation

@TheBlueMatt

Copy link
Copy Markdown
Collaborator

Nothing big, just some cleanup.

@TheBlueMatt
TheBlueMatt force-pushed the 2022-01-fuzz-hashbrown branch from 4dd6e17 to 64c9916 Compare January 6, 2023 20:09
@codecov-commenter

codecov-commenter commented Jan 6, 2023 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.71%. Comparing base (ce6bcf6) to head (f9bafa6).
⚠️ Report is 6689 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/channelmanager.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1939      +/-   ##
==========================================
- Coverage   90.72%   90.71%   -0.02%     
==========================================
  Files          97       97              
  Lines       50579    50579              
  Branches    50579    50579              
==========================================
- Hits        45888    45882       -6     
- Misses       4691     4697       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TheBlueMatt
TheBlueMatt force-pushed the 2022-01-fuzz-hashbrown branch from 41c2743 to 56f54c9 Compare January 6, 2023 21:01
tnull
tnull previously approved these changes Jan 9, 2023
@TheBlueMatt

Copy link
Copy Markdown
Collaborator Author

Will merge this pre-0.0.114, but gonna let it sit for now.

@TheBlueMatt TheBlueMatt self-assigned this Jan 9, 2023
@TheBlueMatt TheBlueMatt added this to the 0.0.114 milestone Jan 9, 2023
hashbrown by default uses ahash, which may be a bit faster, but
more importantly, if we upgrade to hashbrown 0.13/ahash 0.8 we can
make it use a constant randomization factor, making fuzzers happier.
In newer versions of `hashbrown` this code would be broken. While
we aren't updating `hashbrown` any time soon (as it requires an
MSRV bump), it is useful to swap for a newer `hashbrown` when
fuzzing, which this makes easier.
This fixes a crash in the `full_stack_target` fuzz test (found by
Chaincode's generous fuzzing infrastructure!) but ultimately is a
better error code - a peer disconnecting before we can fund a
channel isn't a "misuse error" its an unavailable channel.
@TheBlueMatt
TheBlueMatt dismissed stale reviews from tnull and valentinewallace via f9bafa6 January 15, 2023 23:38
@TheBlueMatt
TheBlueMatt force-pushed the 2022-01-fuzz-hashbrown branch from 56f54c9 to f9bafa6 Compare January 15, 2023 23:38
@TheBlueMatt

Copy link
Copy Markdown
Collaborator Author

Oops, this ended up needing rebase. In any case, I also fixed a full_stack_target crash in a new, last commit. Will go ahead and land this so it doesn't get stale again instead.

let peer_state_mutex_opt = per_peer_state.get(counterparty_node_id);
if let None = peer_state_mutex_opt {
return Err(APIError::APIMisuseError { err: format!("Can't find a peer matching the passed counterparty node_id {}", counterparty_node_id) })
return Err(APIError::ChannelUnavailable { err: format!("Can't find a peer matching the passed counterparty node_id {}", counterparty_node_id) })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On mobile so I could be wrong but there may be a few more occurrences of this

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, there are, I'll work with @ViktorTigerstrom to address those as a part of #1945, for now let's just land this to fix the fuzzers on git HEAD.

@TheBlueMatt TheBlueMatt mentioned this pull request Jan 17, 2023
@TheBlueMatt
TheBlueMatt merged commit 7fefa00 into lightningdevkit:main Jan 17, 2023
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.

4 participants