-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
lnwire+htlcswitch+routing: report and interpret incorrect_or_unknown_payment_details height #3186
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package channeldb | ||
|
||
import "github.com/coreos/bbolt" | ||
|
||
// migrateMcFinalCltv clears mission control to start with a clean slate on | ||
// which final cltv delta values are stored too. Because mission control data is | ||
// not critical we opt for simply clearing the existing data rather than a | ||
// read/update/write migration. | ||
func migrateMcFinalCltv(tx *bbolt.Tx) error { | ||
log.Infof("Migrating to new mission control store by clearing " + | ||
"existing data") | ||
|
||
resultsKey := []byte("missioncontrol-results") | ||
if err := tx.DeleteBucket(resultsKey); err != nil { | ||
return err | ||
} | ||
|
||
log.Infof("Migration to new mission control completed!") | ||
return nil | ||
} |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,6 +161,17 @@ message SendToRouteRequest { | |
|
||
/// Route that should be used to attempt to complete the payment. | ||
lnrpc.Route route = 2; | ||
|
||
/** | ||
The final cltv delta requirement for the payment request. This field is only | ||
required to properly update mission control in case the payment fails with | ||
incorrect_or_unknown_payment_details. Matching the final cltv delta with | ||
the expiry height of the final htlc and the returned acceptance height in | ||
the failure message, allows discerning an incorrect final expiry delta from | ||
an unexpected delay along the route. Only in the latter case, mission | ||
control will apply a penalty to the intermediary nodes. | ||
**/ | ||
int32 final_cltv_delta = 3; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't this be computed ourselves (internally) at the time of route dispatch? So take the height at payment dispatch time, and subtract that from the CLTV expiry value of the final hop. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could do that, but the route may already have been padded by the caller of |
||
} | ||
|
||
message SendToRouteResponse { | ||
|
Large diffs are not rendered by default.
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.
Shall we commence the new migration package proposal with this PR? As it's the first target migration for 0.9, and the migration itself is pretty light.
More on topic for this PR: perhaps we should just start migrating this data? It's not critical, but certain services could see degradation in service quality after updating beyond this PR. We currently don't have a way of loading external data, so there's no way for them to preserve the mission control data if they consider it precious enough to do so.