forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 1
Fixed splice_locked messgae to include splice_txid field and other interop fixes #6
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
Closed
remyers
wants to merge
3
commits into
ddustin:ddustin/splice_interop_final_(probably)
from
remyers:splice_interop
Closed
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This should be
&peer->splice_state->locked_txid-- however this value is not preserved after channel restarts, so that needs to addressed as well.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.
This is a bit of a heavy lift. I think this is the best way to make
splice_state->locked_txidwork over restarts.{SQL("ALTER TABLE channel_funding_inflights ADD locked_onchain BOOL DEFAULT 0"), NULL},to db.c at the end of the db table be able to mark an inflight locked onchainis_lockedwithinflight->is_locked = fromwire_bool(cursor, max);infromwire_inflightandtowire_bool(pptr, inflight->is_locked);in towire_inflight.channeld_updating_inflightto include anis_lockedparameterhandle_update_inflightto takeis_lockedparameter and update that value in its inflightwallet_inflight_saveSQL query to saveis_lockedto the databasewallet_channel_load_inflightsto load `is_locked from the databasetowire_channeld_initto addis_lockedto theinfcopyfromwire_channeld_init, loop through each inflight inpeer->splice_state->inflightsand get the txid from the psbt of the one thatis_locked, placing it in peer->splice_state->locked_txid. Additionally it would be useful to assert only 1 is locked as two would be an error.I thiiiiink that would do 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.
I can't really comment on if that's the right approach. Do you need to use
splice_state->locked_txidduring reconnect? It should already be your latest funding tx once you have sent and receivedsplice_locked. If it has reached acceptable depth then your node can resendsplice_lockedwith the txid of the latest funding tx. You must have already have saved that information after you exchangedsplice_lockedwith your peer.However, when you do a reconnect before exchanging
splice_lockedI can see that you'll need to save the txid of the funding tx negotiated for the splice. We save this information with the splice commitment along with the signatures exchanged.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.
Yes you're right,
peer->channel->funding.txidis correct in this case.There needs to be a new separate case that uses
peer->splice_state->locked_txidthat I'm working on at the moment.