-
Notifications
You must be signed in to change notification settings - Fork 411
fuzz: Add LSPS message decoder fuzzing #3849
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: main
Are you sure you want to change the base?
fuzz: Add LSPS message decoder fuzzing #3849
Conversation
👋 I see @jkczyz was un-assigned. |
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.
One comment, otherwise lgtm
fuzz/src/lsps_message.rs
Outdated
let msg_router = | ||
Arc::new(DefaultMessageRouter::new(network_graph.clone(), Arc::clone(&keys_manager))); | ||
let chain_source = Arc::new(TestChainSource::new(Network::Bitcoin)); | ||
let kv_store = Arc::new(FilesystemStore::new("persister".into())); |
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.
Can we use a test persister rather than something that could write to the fs in a fuzz target?
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.
I guess we should just be able to use the in-memory lightning::util::test_utils::TestStore
for this?
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.
LGTM, mod one nit and the pending question regarding the KVStore
.
Great start for lightning-liquidity
fuzzing!
fuzz/src/lsps_message.rs
Outdated
let seed = sha256::Hash::hash(b"lsps-message-seed").to_byte_array(); | ||
let keys_manager = Arc::new(KeysManager::new(&seed, now.as_secs(), now.subsec_nanos())); | ||
let router = Arc::new(DefaultRouter::new( | ||
network_graph.clone(), |
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.
nit: Given we're about to enable a lint enforcing to use Arc::clone
vs. arc.clone()
in #3851, let's switch all of these to Arc::clone
pls.
…nstead of .clone()
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3849 +/- ##
==========================================
+ Coverage 89.88% 89.92% +0.04%
==========================================
Files 162 163 +1
Lines 130415 131655 +1240
Branches 130415 131655 +1240
==========================================
+ Hits 117217 118394 +1177
- Misses 10509 10571 +62
- Partials 2689 2690 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixes #3515
The fuzz test tests the
LiquidityManager
's ability to parse and handle arbitrary LSPS message data safely.