Peer Storage Feature – Part 2
This is the second PR in the peer storage feature series.
Key Changes
- Enable ChainMonitor to send peer storage to all channel partners whenever a new block is mined.
- Add get_peer_storage_key() to NodeSigner.
- Implement decryption logic for peer storage in handle_peer_storage_retrieval().
In the next one, I will add serialisation logic for ChannelMonitors inside peer storage.
Seems this isn't properly rebased, hence CI is failing?
Seems this isn't properly rebased, hence CI is failing?
I think #3626 will fix this.
Seems this isn't properly rebased, hence CI is failing?
I think #3626 will fix this.
No, it fails with:
src/ln/our_peer_storage.rs - ln::our_peer_storage::OurPeerStorage (line 48) stdout ----
error[E0433]: failed to resolve: use of undeclared type `OurPeerStorage`
--> src/ln/our_peer_storage.rs:49:28
|
3 | let mut our_peer_storage = OurPeerStorage::new();
| ^^^^^^^^^^^^^^ not found in this scope
|
help: consider importing this struct
|
2 | use lightning::ln::our_peer_storage::OurPeerStorage;
|
error[E0433]: failed to resolve: use of undeclared type `OurPeerStorage`
--> src/ln/our_peer_storage.rs:54:1
|
8 | OurPeerStorage::decrypt_our_peer_storage(&mut decrypted, &encrypted).unwrap();
| ^^^^^^^^^^^^^^ not found in this scope
|
help: consider importing this struct
|
2 | use lightning::ln::our_peer_storage::OurPeerStorage;
|
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0433`.
Couldn't compile the test.
failures:
src/ln/our_peer_storage.rs - ln::our_peer_storage::OurPeerStorage (line 48)
test result: FAILED. 28 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.00s
error: test failed, to rerun pass '--doc'
That is because it’s trying to compile the commented code in the documentation, I will fix it in a bit.
Thanks for the review @tnull.
Fixed the CI :)
Codecov Report
Attention: Patch coverage is 83.91960% with 32 lines in your changes missing coverage. Please review.
Project coverage is 89.37%. Comparing base (
c355ea4) to head (7d56ef7). Report is 5 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #3623 +/- ##
==========================================
+ Coverage 89.20% 89.37% +0.16%
==========================================
Files 155 156 +1
Lines 119377 121060 +1683
Branches 119377 121060 +1683
==========================================
+ Hits 106496 108193 +1697
+ Misses 10266 10262 -4
+ Partials 2615 2605 -10
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚀 New features to boost your workflow:
- ❄ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
This unfortunately needs a rebase now.
Thank you so much, @tnull and @TheBlueMatt, for taking the time to review this. I’ve done my best to address all the comments. Please let me know if there’s anything I might have missed or if further changes are needed.
@tnull Thank you for the review. I’m really sorry for squashing the fixups, I won’t do that again without approval.
@tnull We're calling send_peer_storage from ChainMonitor, which doesn't have access to entropy_source to derive random_bytes. Is there any other way to generate random bytes?
We're calling send_peer_storage from ChainMonitor, which doesn't have access to entropy_source to derive random_bytes. Is there any other way to generate random bytes?
We'll need to provide ChainMonitor with an EntropySource, sadly.
@tnull Thank you so much for your patience and reviews on this.
If it looks good now, can I squash the fixups?
@tnull if these fixups looks good to you I will squash and work on fixing the CI...
@adi2011 #3784 has landed, please rebase to fix CI!
Pushed changes for the benchmark check.