-
Notifications
You must be signed in to change notification settings - Fork 366
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
Document monitor archival idempotency requirement (#3276 followup) #3329
Document monitor archival idempotency requirement (#3276 followup) #3329
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3329 +/- ##
==========================================
+ Coverage 89.66% 90.89% +1.23%
==========================================
Files 126 127 +1
Lines 102676 115304 +12628
Branches 102676 115304 +12628
==========================================
+ Hits 92062 104805 +12743
+ Misses 7894 7861 -33
+ Partials 2720 2638 -82
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
lightning/src/chain/chainmonitor.rs
Outdated
@@ -162,6 +162,13 @@ pub trait Persist<ChannelSigner: EcdsaChannelSigner> { | |||
/// | |||
/// Archiving the data in a backup location (rather than deleting it fully) is useful for | |||
/// hedging against data loss in case of unexpected failure. | |||
/// | |||
/// Note that if a crash occurs during the archiving process, a state may emerge where the |
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.
The Persist
trait doesn't mandate any specific I/O pattern/features, so talking about it being "copied" to a "path" or seeing the monitor in both places isn't really appropriate here. We should instead phrase this in terms of the requirements (it being idempotent and be explicit that this can be async/fail and LDK will just call it again on restart).
lightning/src/chain/chainmonitor.rs
Outdated
@@ -162,6 +162,12 @@ pub trait Persist<ChannelSigner: EcdsaChannelSigner> { | |||
/// | |||
/// Archiving the data in a backup location (rather than deleting it fully) is useful for | |||
/// hedging against data loss in case of unexpected failure. | |||
/// | |||
/// Note that if a crash occurs during the archiving process, a state may emerge with the | |||
/// archival operation only being partially complete. In that scenario, the monitor may still be |
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 this is still only true if the Persist
implementation allows for it. The Persist
implementation may make this atomic, or it may not. We should phrase this around how it doesn't strictly need to be atomic, but then of course if its not the implementation has to handle 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.
It needs to be either atomic or idempotent since it is retried on startup.
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.
ok, I added that in the form of a caveat
Sure, feel free to squash. |
8d0dda5
to
268675a
Compare
Followup to #3276, addressing #3122.