-
Notifications
You must be signed in to change notification settings - Fork 390
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
Add deterministic random bytes in override_random_bytes
#3647
Conversation
👋 I see @valentinewallace was un-assigned. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3647 +/- ##
==========================================
- Coverage 89.25% 89.23% -0.03%
==========================================
Files 155 155
Lines 119954 119952 -2
Branches 119954 119952 -2
==========================================
- Hits 107064 107034 -30
- Misses 10277 10292 +15
- Partials 2613 2626 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Ok, thanks for the feedback! Quick question—would it make more sense to reduce the RNG dependency just enough so |
In an ideal world I think we can drop the |
Got it! I'll work on these removals and see if I can make it work. |
baa728e
to
8080bc0
Compare
Hello @TheBlueMatt, I updated the code as suggested. I removed the Could you please confirm if this reasoning is correct or if there's anything else needed? |
Doh! When I did #3302 and commented above I had not actually bothered to look into why the test needed specific RNG output. Having to have the RNG output match the hard-coded |
Thanks a lot! I saw your comment—I was trying to tackle the RNG issue in a different way, but I realized I was way off and getting stuck. I had already gone back and modified |
Add `override_next_keys_id` to `TestKeysInterface`, enabling predictable `generate_channel_keys_id` output when se
Similar to `create_chanmon_cfgs`, but allows using `override_next_keys_id` in `TestKeysInterface` to ensure predictable key ID generation
8080bc0
to
36748f8
Compare
Removes `set_counter` (which resets RNG) and adds control over channel key ID generation
36748f8
to
f8d1126
Compare
Hi @TheBlueMatt I've implemented the requested changes. I removed I also added I believe the test now relies less on RNG manipulation. |
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.
Hell yea, thanks! Just gonna land this since its test-only and straightforward.
Fixes #2827
To ensure deterministic
override_random_bytes
for each node, I first reverted to the state before commit a3b416a and usedkeys_manager.get_secure_random_bytes()
to retrieve the required values. Then, I restored the current state of the code and assigned the collected values to their respective nodes.This is my first PR for LDK, so I’d appreciate any feedback on my approach and possible improvements.