-
Couldn't load subscription status.
- Fork 421
Bump electrsd to 0.36.1, fix CI
#4180
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?
Conversation
|
👋 Thanks for assigning @TheBlueMatt as a reviewer! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4180 +/- ##
==========================================
- Coverage 88.82% 88.79% -0.04%
==========================================
Files 180 180
Lines 137278 137278
Branches 137278 137278
==========================================
- Hits 121944 121894 -50
- Misses 12522 12573 +51
+ Partials 2812 2811 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
We bump our `electrsd` dependency to the latest version, allowing us to remove the `home` pin.
2cca9e7 to
98c83df
Compare
.. `proptest` 1.9.0 was just released, now requiring rustc 1.82.
427da08 to
9753e6d
Compare
| PIN_RELEASE_DEPS # pin the release dependencies | ||
|
|
||
| # Starting with version 0.5.11, the `home` crate has an MSRV of rustc 1.81.0. | ||
| [ "$RUSTC_MINOR_VERSION" -lt 81 ] && cargo update -p home --precise "0.5.9" --verbose |
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.
This is gonna conflict with #4175, can we just do that?
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.
Not quite sure I understand what you mean? In #4175 you just move the pin over to be even more general, but we can just drop it now?
| [ "$RUSTC_MINOR_VERSION" -lt 82 ] && cargo update -p backtrace --precise "0.3.74" --verbose | ||
|
|
||
| # proptest 1.9.0 requires rustc 1.82.0 | ||
| [ "$RUSTC_MINOR_VERSION" -lt 82 ] && cargo update -p proptest --precise "1.8.0" --verbose |
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.
If proptest doesnt have an MSRV, can we just remove the two small proptests we have and make them fuzzers (or drop them entirely, its not clear to me they're really worth it)?
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.
No, as I generally find it a good tool to have on our belt. FWIW, many unit/integration tests would benefit from some extended coverage based on proptest.
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 mean its really just a glorified fuzz test, and one that's slower/generates less coverage. What's the motivation for that?
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.
It's very easy to convert a simple unit/functional test to a proptest, i.e., very easy to add additional coverage. Meanwhile many contributors wouldn't dare attempt to add fuzz coverage if not explicitly prompted.
The process is entirely different. It's usually just writing a test, and then at the end deciding "hey this could benefit from some randomness to increase coverage". And instead of pulling out some rand::thread_rng, you can just use proptest and get shrinking for free.
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'm pretty skeptical that contributors are all that familiar with proptest any more or less than fuzzing, and our fuzzing framework isn't all that crazy to use? IMO way simpler cause you don't have to go digging into some proptest-specific language for specifying inputs. Looking through our current proptests, I'm not really sure much would be lost with dropping them entirely (they're mostly just re-implementing a simple fn and checking that the prod method is equivalent), but if we want the coverage, I'm not actually convinced a non-coverage-guided fuzzer is gonna get very much coverage. A proptest, afaiu, will shove in MAX/MIN/0/-1/etc but not actually look for other paths, and there's enough in calculate_amount_to_forward_per_htlc that I dunno that it even finds its way into everything.
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.
For example, this diff currently passes proptest for me, indicating proptest is actually giving us a false sense of security, arguably worse than not having it
$ git diff
diff --git a/lightning-liquidity/src/lsps2/service.rs b/lightning-liquidity/src/lsps2/service.rs
index c715d40502..215a2d7a15 100644
--- a/lightning-liquidity/src/lsps2/service.rs
+++ b/lightning-liquidity/src/lsps2/service.rs
@@ -2094,8 +2094,8 @@ fn calculate_amount_to_forward_per_htlc(
/ total_expected_outbound_msat as u128) as u64;
let mut actual_fee_amt_msat = core::cmp::min(fee_remaining_msat, proportional_fee_amt_msat);
- actual_fee_amt_msat =
- core::cmp::min(actual_fee_amt_msat, htlc.expected_outbound_amount_msat);
+ /*actual_fee_amt_msat =
+ core::cmp::min(actual_fee_amt_msat, htlc.expected_outbound_amount_msat);*/
fee_remaining_msat -= actual_fee_amt_msat;
if index == htlcs.len() - 1 {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'm pretty skeptical that contributors are all that familiar with proptest any more or less than fuzzing, and our fuzzing framework isn't all that crazy to use?
I'm pretty certain about that. Quite a few new contributors were okay writing proptests that wouldn't touch LDK's custom fuzz setup with a ten foot pole.
IMO way simpler cause you don't have to go digging into some proptest-specific language for specifying inputs. Looking through our current proptests, I'm not really sure much would be lost with dropping them entirely (they're mostly just re-implementing a simple fn and checking that the prod method is equivalent), but if we want the coverage, I'm not actually convinced a non-coverage-guided fuzzer is gonna get very much coverage.
Well, we basically just started adding some proptests, IMO we should get into the habit of utilizing it more. Note that you can also easily write proptests for unit tests that wouldn't work for the fuzzer (which essentially does blackbox testing without (easy) access to internals), and of course proptests can make use of our internal test utilities more easily.
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.
Given the above experience, I'm quite skeptical that proptests aren't just going to give us a false sense of security. I was wrong above, proptest doesn't even bother passing 0/MAX/MIN/-1, it only pulls random input and passes that in. Looking at the three proptests we have currently, I think proptest is the wrong tool for all of them:
- the test of
calculate_amount_to_forward_per_htlcclearly needs either fuzzing or specific input testing, as it doesn't hit much of the logic, compute_opening_feeclearly needs specific input testing as theproptestis highly unlikely to check the boundary case, which is maybe the most interesting one (and given the simplicity of the logic under test I'm not convinced a prop/fuzz test is worth it),- the
LSPSUrlparsing test doesn't really generate any interesting test-cases that aren't pretty thoroughly covered with the specific-input testing (and goes to a lot of regex-effort to do so).
I'm open to being convinced by some future test case where (a) random-input non-coverage-guided fuzzing is sufficient on some method and (b) its not trivially possible to test all the boundary conditions by just writing them out, but I'm honestly not sure that such cases are gonna be a thing almost ever.
|
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
We bump our
electrsddependency to the latest version, allowing us to remove thehomepin.We also added a commit pinning
proptestagain, as the most-recent release had our CI fail.