Skip to content

Misc fuzzing tweaks #1939

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
merged 5 commits into from
Jan 17, 2023

Conversation

TheBlueMatt
Copy link
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
Copy link

codecov-commenter commented Jan 6, 2023

Codecov Report

Base: 90.71% // Head: 90.71% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (f9bafa6) compared to base (ce6bcf6).
Patch coverage: 87.50% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1939      +/-   ##
==========================================
- Coverage   90.71%   90.71%   -0.01%     
==========================================
  Files          97       97              
  Lines       50579    50579              
  Branches    50579    50579              
==========================================
- Hits        45885    45882       -3     
- Misses       4694     4697       +3     
Impacted Files Coverage Δ
lightning/src/ln/channelmanager.rs 87.10% <66.66%> (ø)
lightning/src/chain/onchaintx.rs 95.39% <100.00%> (ø)
lightning/src/chain/channelmonitor.rs 90.98% <0.00%> (-0.10%) ⬇️
lightning/src/ln/functional_tests.rs 96.96% <0.00%> (-0.04%) ⬇️
lightning/src/util/events.rs 30.73% <0.00%> (+0.22%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@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
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
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.

@@ -2552,7 +2552,7 @@ where
let per_peer_state = self.per_peer_state.read().unwrap();
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
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
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