Skip to content

Remove proptest dev-dependency in favor of manual randomization#59

Open
tnull wants to merge 1 commit intolightningdevkit:mainfrom
tnull:2026-02-remove-proptest
Open

Remove proptest dev-dependency in favor of manual randomization#59
tnull wants to merge 1 commit intolightningdevkit:mainfrom
tnull:2026-02-remove-proptest

Conversation

@tnull
Copy link
Contributor

@tnull tnull commented Feb 18, 2026

A sub-dependency of proptest started depending on getrandom v0.4.1 which uses edition = 2024, which isn't supported in our MSRV of 1.75.0.

Here we replace the proptest-based round-trip test with a simple loop using rand (already a regular dependency) to generate random inputs. This removes a dev-dependency and its associated MSRV pin in CI.

Co-Authored-By: HAL 9000

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Feb 18, 2026

👋 Thanks for assigning @tankyleo as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@tnull tnull requested a review from tankyleo February 18, 2026 09:07
@tnull tnull mentioned this pull request Feb 18, 2026
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: if we have \t, let's also add \n and \r ? HAL tells me these would be matched by the earlier regex given \s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, now amended to include (though I doubt it makes any difference, in practice our charset should be much more restrictive anyways):

diff --git a/src/util/key_obfuscator.rs b/src/util/key_obfuscator.rs
index 4e7ade2..c096e3d 100644
--- a/src/util/key_obfuscator.rs
+++ b/src/util/key_obfuscator.rs
@@ -200,5 +200,5 @@ mod tests {

                let charset =
-                       b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_!@#,;:% *$^&()[]{}.\t";
+                       b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_!@#,;:% *$^&()[]{}.\t\n\r";
                let mut rng = rand::thread_rng();

A sub-dependency of `proptest` started depending on `getrandom` v0.4.1
which uses `edition = 2024`, which isn't supported in our MSRV of
1.75.0.

Here we replace the `proptest`-based round-trip test with a simple loop
using `rand` (already a regular dependency) to generate random inputs.
This removes a dev-dependency and its associated MSRV pin in CI.

Co-Authored-By: HAL 9000
Signed-off-by: Elias Rohrer <dev@tnull.de>
@tnull tnull force-pushed the 2026-02-remove-proptest branch from a91f2e7 to 8be27f1 Compare February 19, 2026 08:18
@tnull tnull requested a review from tankyleo February 19, 2026 08:19
@@ -26,7 +26,6 @@ jobs:
if: matrix.msrv
run: |
cargo update -p idna_adapter --precise 1.1.0 # This has us use `unicode-normalization` which has a more conservative MSRV
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Want to note that it would be nice to drop this pin at some point, now that we don't depend on url anymore. However, we do still depend on it through mockito. Given we previously wondered how much benefit the mock testing gives us to begin with, we might at some point consider to drop that dev-dependency, too.

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.

3 participants

Comments