splice: Script for complex splices - #6980

Merged
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script
Nov 11, 2024
Merged

splice: Script for complex splices#6980
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script

Conversation

@ddustin

@ddustinddustin commented Jan 6, 2024

Copy link
Copy Markdown
Collaborator

PR reviewers: It might be good to start here to learn the splice script syntax: https://github.com/ddustin/lightning/blob/ddustin/splice_script/doc/lightning-splice.7.md

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.

A test is included that puts some advanced and complex scripts into the parser and validates the results that come out.

Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.

@ddustin
ddustinforce-pushed the ddustin/splice_script branch 9 times, most recently from 5952c41 to 2640bd6CompareJanuary 7, 2024 03:32
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from 2640bd6 to 4e7edecCompareJanuary 7, 2024 18:03

@vincenzopalazzovincenzopalazzo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

Proper documentation is coming but here's a quick summary:

The script isn't required to be used -- there will also be a json option and, of course, the lower level api is available.

When doing splices across multiple channels it quickly becomes unwieldy for users. Using the script is a nice shorthand to make it easier -- and also allows you to do "dry runs" and confirm it's doing what you'd like.

Say you wanted to take 50% of funds and splice them into three other channels, in splice script it's quite simple:

84ff50 -> 50%;
* -> cecf35;
* -> 4fe310;
* -> c14f60;

While working on it, it made sense to add a bunch of other useful things like being able to specify amounts as whole numbers, percentages, or * (split amount among all *s); channel queries; onchain bitcoin addresses; and the onchain wallet.

By building this more powerful part first it becomes trivial to implement the simpler splice commands. For instance:

Splice out 10 million sats

84ff50 -> 10M;

Splice in 10 million sats

wallet -> 10M;
* -> 84ff50;

Cross splice 10 million sats

84ff50 -> 10M;
* -> cecf35;

Pay 10M sats onchain using channel funds

84ff50 -> 10M+fee;
10M -> 1JfbZRwdDHKZmuiZgYArJZhcuuzuw2HuMu;

@ddustinddustin added this to the v24.02 milestone Jan 13, 2024
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 5 times, most recently from 731048c to ab31aa7CompareJanuary 22, 2024 22:12
@ddustin
ddustin marked this pull request as ready for review January 22, 2024 22:13
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from ab31aa7 to e0b188aCompareJanuary 22, 2024 22:14
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 7 times, most recently from 8105050 to 737ffc2CompareJanuary 24, 2024 22:43

@niftyneiniftynei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rustyrussell

Copy link
Copy Markdown
Collaborator

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

I changed the command to "dev-splice," updated the added tag to 24.11, and fixed a handful of issues that came up from rebasing.

Can we push this one through once it passes CI @rustyrussell?

@rustyrussell

Copy link
Copy Markdown
Collaborator

Ack! Will apply once CI is happy!

@rustyrussell

Copy link
Copy Markdown
Collaborator

Accidentally told GH to update to latest master and it did a merge. Gah! Rebased instead.

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.
Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.
A test that puts some advanced and complex scripts into the parser and validates the results that come out.
A routine for getting a signature back out of an input’s list of pending signatures via pubkey search.
This is needed for certain kinds of restarts as we lose our peer’s signature from memory but a copy is kept in the PSBT.
Stores an array of channel_ids into the PSBT globals area.
Changelog-None
`splice_signed` now searchs the PSBT for channel ids
Changelog-Changed: `splice_signed` parameters are switched in order to make `channel_id` an optional parameter, enabling multi-splice-signatures.
This is needed to all multi-channel splices. When channeld can return the signatures to the user (based on signing order precedent), it now does from splice_update.
Additionally, we move sending of the initial psbt from splice_init down to splice_update. This is also necessary for correct psbt diff detection during multi-channel splices.
Changelog-Changed: splice_update can in some cases now return the remotely partiall signed psbt to the user, if so `signtures_secured` will be true.
On certain well timed restarts we lose their siganture from memory and don’t receive it from them. In these cases we can extract it from the PSBT directly.
The ability to stfu channels in bulk is required to do complex multi channel operations. When stfu’ing in this manner, the available funds at the moment of stfu is returned to the user.
In order to cancel the stfu we also add a bulk tx_abort command.
Changelog-Added: `stfu_channels` and `abort_channels` are added for bulk multi-channel splice commands. These allow the user to pause (and resume) multiple channels in place.
This is the sister command of addpsbtoutput.
Adds inputs equal to or greater than the amount requests, reservers them, and reports important information back out to the user.
Changelog-Added: New low-level RPC command addpsbtinput to fund PSBTs directly and help with complex splices & dual-opens.
When set this flag tells addpsbtoutput to add the intiator serial_id to the added output.
Changelog-Changed: addpsbtoutput now allows serial_id to be set while adding which is needed for splicing and dual.
The command called “splice” can take a json payload or a ‘splice script’, process it into a list of ‘actions’ and then execute those actions.
These actions include or will include everything you would want to do with a splice:
* Splice into a channel
* Splice out of a channel
* Fund from wallet
* Deposit to wallet
* Send funds to bitcoin address
Changelog-Added: A new magic “splice” command is added that can take a ‘splice script’ or json payload and perform any complex splice across multiple channels merging the result into a single transaction. Some features are disabled and will be added in time.
Adding schema and documentatino for how to use the scripting portion of the “splice” RPC command.
The fee maximum is used to issue a warning to the user their feerate is high in case they accidentally make a large donation to miners.
During python testing the feerates are high on purpose so we raise the warning level to at least the penality feerate.
Tests that splice-in and splice-out work through the scripting process and confirm the resulting balances are correct.
If the user does not supply enough funds treat it as an abort instead of a channel warning.
Also clean up some indentation while we’re there.
@rustyrussell

Copy link
Copy Markdown
Collaborator

Now a proper rebase, taking into account jsonrpc request API changes. Also minor fixes since it didn't bisect build before.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@ddustin@cdecker@chrisguida@rustyrussell@niftynei@vincenzopalazzo
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

splice: Script for complex splices - #6980

Merged
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script
Nov 11, 2024
Merged

splice: Script for complex splices#6980
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script

Conversation

@ddustin

@ddustinddustin commented Jan 6, 2024

Copy link
Copy Markdown
Collaborator

PR reviewers: It might be good to start here to learn the splice script syntax: https://github.com/ddustin/lightning/blob/ddustin/splice_script/doc/lightning-splice.7.md

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.

A test is included that puts some advanced and complex scripts into the parser and validates the results that come out.

Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.

@ddustin
ddustinforce-pushed the ddustin/splice_script branch 9 times, most recently from 5952c41 to 2640bd6CompareJanuary 7, 2024 03:32
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from 2640bd6 to 4e7edecCompareJanuary 7, 2024 18:03

@vincenzopalazzovincenzopalazzo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

Proper documentation is coming but here's a quick summary:

The script isn't required to be used -- there will also be a json option and, of course, the lower level api is available.

When doing splices across multiple channels it quickly becomes unwieldy for users. Using the script is a nice shorthand to make it easier -- and also allows you to do "dry runs" and confirm it's doing what you'd like.

Say you wanted to take 50% of funds and splice them into three other channels, in splice script it's quite simple:

84ff50 -> 50%;
* -> cecf35;
* -> 4fe310;
* -> c14f60;

While working on it, it made sense to add a bunch of other useful things like being able to specify amounts as whole numbers, percentages, or * (split amount among all *s); channel queries; onchain bitcoin addresses; and the onchain wallet.

By building this more powerful part first it becomes trivial to implement the simpler splice commands. For instance:

Splice out 10 million sats

84ff50 -> 10M;

Splice in 10 million sats

wallet -> 10M;
* -> 84ff50;

Cross splice 10 million sats

84ff50 -> 10M;
* -> cecf35;

Pay 10M sats onchain using channel funds

84ff50 -> 10M+fee;
10M -> 1JfbZRwdDHKZmuiZgYArJZhcuuzuw2HuMu;

@ddustinddustin added this to the v24.02 milestone Jan 13, 2024
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 5 times, most recently from 731048c to ab31aa7CompareJanuary 22, 2024 22:12
@ddustin
ddustin marked this pull request as ready for review January 22, 2024 22:13
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from ab31aa7 to e0b188aCompareJanuary 22, 2024 22:14
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 7 times, most recently from 8105050 to 737ffc2CompareJanuary 24, 2024 22:43

@niftyneiniftynei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rustyrussell

Copy link
Copy Markdown
Collaborator

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

I changed the command to "dev-splice," updated the added tag to 24.11, and fixed a handful of issues that came up from rebasing.

Can we push this one through once it passes CI @rustyrussell?

@rustyrussell

Copy link
Copy Markdown
Collaborator

Ack! Will apply once CI is happy!

@rustyrussell

Copy link
Copy Markdown
Collaborator

Accidentally told GH to update to latest master and it did a merge. Gah! Rebased instead.

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.
Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.
A test that puts some advanced and complex scripts into the parser and validates the results that come out.
A routine for getting a signature back out of an input’s list of pending signatures via pubkey search.
This is needed for certain kinds of restarts as we lose our peer’s signature from memory but a copy is kept in the PSBT.
Stores an array of channel_ids into the PSBT globals area.
Changelog-None
`splice_signed` now searchs the PSBT for channel ids
Changelog-Changed: `splice_signed` parameters are switched in order to make `channel_id` an optional parameter, enabling multi-splice-signatures.
This is needed to all multi-channel splices. When channeld can return the signatures to the user (based on signing order precedent), it now does from splice_update.
Additionally, we move sending of the initial psbt from splice_init down to splice_update. This is also necessary for correct psbt diff detection during multi-channel splices.
Changelog-Changed: splice_update can in some cases now return the remotely partiall signed psbt to the user, if so `signtures_secured` will be true.
On certain well timed restarts we lose their siganture from memory and don’t receive it from them. In these cases we can extract it from the PSBT directly.
The ability to stfu channels in bulk is required to do complex multi channel operations. When stfu’ing in this manner, the available funds at the moment of stfu is returned to the user.
In order to cancel the stfu we also add a bulk tx_abort command.
Changelog-Added: `stfu_channels` and `abort_channels` are added for bulk multi-channel splice commands. These allow the user to pause (and resume) multiple channels in place.
This is the sister command of addpsbtoutput.
Adds inputs equal to or greater than the amount requests, reservers them, and reports important information back out to the user.
Changelog-Added: New low-level RPC command addpsbtinput to fund PSBTs directly and help with complex splices & dual-opens.
When set this flag tells addpsbtoutput to add the intiator serial_id to the added output.
Changelog-Changed: addpsbtoutput now allows serial_id to be set while adding which is needed for splicing and dual.
The command called “splice” can take a json payload or a ‘splice script’, process it into a list of ‘actions’ and then execute those actions.
These actions include or will include everything you would want to do with a splice:
* Splice into a channel
* Splice out of a channel
* Fund from wallet
* Deposit to wallet
* Send funds to bitcoin address
Changelog-Added: A new magic “splice” command is added that can take a ‘splice script’ or json payload and perform any complex splice across multiple channels merging the result into a single transaction. Some features are disabled and will be added in time.
Adding schema and documentatino for how to use the scripting portion of the “splice” RPC command.
The fee maximum is used to issue a warning to the user their feerate is high in case they accidentally make a large donation to miners.
During python testing the feerates are high on purpose so we raise the warning level to at least the penality feerate.
Tests that splice-in and splice-out work through the scripting process and confirm the resulting balances are correct.
If the user does not supply enough funds treat it as an abort instead of a channel warning.
Also clean up some indentation while we’re there.
@rustyrussell

Copy link
Copy Markdown
Collaborator

Now a proper rebase, taking into account jsonrpc request API changes. Also minor fixes since it didn't bisect build before.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@ddustin@cdecker@chrisguida@rustyrussell@niftynei@vincenzopalazzo
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

splice: Script for complex splices - #6980

Merged
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script
Nov 11, 2024
Merged

splice: Script for complex splices#6980
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script

Conversation

@ddustin

@ddustinddustin commented Jan 6, 2024

Copy link
Copy Markdown
Collaborator

PR reviewers: It might be good to start here to learn the splice script syntax: https://github.com/ddustin/lightning/blob/ddustin/splice_script/doc/lightning-splice.7.md

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.

A test is included that puts some advanced and complex scripts into the parser and validates the results that come out.

Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.

@ddustin
ddustinforce-pushed the ddustin/splice_script branch 9 times, most recently from 5952c41 to 2640bd6CompareJanuary 7, 2024 03:32
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from 2640bd6 to 4e7edecCompareJanuary 7, 2024 18:03

@vincenzopalazzovincenzopalazzo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

Proper documentation is coming but here's a quick summary:

The script isn't required to be used -- there will also be a json option and, of course, the lower level api is available.

When doing splices across multiple channels it quickly becomes unwieldy for users. Using the script is a nice shorthand to make it easier -- and also allows you to do "dry runs" and confirm it's doing what you'd like.

Say you wanted to take 50% of funds and splice them into three other channels, in splice script it's quite simple:

84ff50 -> 50%;
* -> cecf35;
* -> 4fe310;
* -> c14f60;

While working on it, it made sense to add a bunch of other useful things like being able to specify amounts as whole numbers, percentages, or * (split amount among all *s); channel queries; onchain bitcoin addresses; and the onchain wallet.

By building this more powerful part first it becomes trivial to implement the simpler splice commands. For instance:

Splice out 10 million sats

84ff50 -> 10M;

Splice in 10 million sats

wallet -> 10M;
* -> 84ff50;

Cross splice 10 million sats

84ff50 -> 10M;
* -> cecf35;

Pay 10M sats onchain using channel funds

84ff50 -> 10M+fee;
10M -> 1JfbZRwdDHKZmuiZgYArJZhcuuzuw2HuMu;

@ddustinddustin added this to the v24.02 milestone Jan 13, 2024
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 5 times, most recently from 731048c to ab31aa7CompareJanuary 22, 2024 22:12
@ddustin
ddustin marked this pull request as ready for review January 22, 2024 22:13
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from ab31aa7 to e0b188aCompareJanuary 22, 2024 22:14
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 7 times, most recently from 8105050 to 737ffc2CompareJanuary 24, 2024 22:43

@niftyneiniftynei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rustyrussell

Copy link
Copy Markdown
Collaborator

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

I changed the command to "dev-splice," updated the added tag to 24.11, and fixed a handful of issues that came up from rebasing.

Can we push this one through once it passes CI @rustyrussell?

@rustyrussell

Copy link
Copy Markdown
Collaborator

Ack! Will apply once CI is happy!

@rustyrussell

Copy link
Copy Markdown
Collaborator

Accidentally told GH to update to latest master and it did a merge. Gah! Rebased instead.

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.
Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.
A test that puts some advanced and complex scripts into the parser and validates the results that come out.
A routine for getting a signature back out of an input’s list of pending signatures via pubkey search.
This is needed for certain kinds of restarts as we lose our peer’s signature from memory but a copy is kept in the PSBT.
Stores an array of channel_ids into the PSBT globals area.
Changelog-None
`splice_signed` now searchs the PSBT for channel ids
Changelog-Changed: `splice_signed` parameters are switched in order to make `channel_id` an optional parameter, enabling multi-splice-signatures.
This is needed to all multi-channel splices. When channeld can return the signatures to the user (based on signing order precedent), it now does from splice_update.
Additionally, we move sending of the initial psbt from splice_init down to splice_update. This is also necessary for correct psbt diff detection during multi-channel splices.
Changelog-Changed: splice_update can in some cases now return the remotely partiall signed psbt to the user, if so `signtures_secured` will be true.
On certain well timed restarts we lose their siganture from memory and don’t receive it from them. In these cases we can extract it from the PSBT directly.
The ability to stfu channels in bulk is required to do complex multi channel operations. When stfu’ing in this manner, the available funds at the moment of stfu is returned to the user.
In order to cancel the stfu we also add a bulk tx_abort command.
Changelog-Added: `stfu_channels` and `abort_channels` are added for bulk multi-channel splice commands. These allow the user to pause (and resume) multiple channels in place.
This is the sister command of addpsbtoutput.
Adds inputs equal to or greater than the amount requests, reservers them, and reports important information back out to the user.
Changelog-Added: New low-level RPC command addpsbtinput to fund PSBTs directly and help with complex splices & dual-opens.
When set this flag tells addpsbtoutput to add the intiator serial_id to the added output.
Changelog-Changed: addpsbtoutput now allows serial_id to be set while adding which is needed for splicing and dual.
The command called “splice” can take a json payload or a ‘splice script’, process it into a list of ‘actions’ and then execute those actions.
These actions include or will include everything you would want to do with a splice:
* Splice into a channel
* Splice out of a channel
* Fund from wallet
* Deposit to wallet
* Send funds to bitcoin address
Changelog-Added: A new magic “splice” command is added that can take a ‘splice script’ or json payload and perform any complex splice across multiple channels merging the result into a single transaction. Some features are disabled and will be added in time.
Adding schema and documentatino for how to use the scripting portion of the “splice” RPC command.
The fee maximum is used to issue a warning to the user their feerate is high in case they accidentally make a large donation to miners.
During python testing the feerates are high on purpose so we raise the warning level to at least the penality feerate.
Tests that splice-in and splice-out work through the scripting process and confirm the resulting balances are correct.
If the user does not supply enough funds treat it as an abort instead of a channel warning.
Also clean up some indentation while we’re there.
@rustyrussell

Copy link
Copy Markdown
Collaborator

Now a proper rebase, taking into account jsonrpc request API changes. Also minor fixes since it didn't bisect build before.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@ddustin@cdecker@chrisguida@rustyrussell@niftynei@vincenzopalazzo
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

splice: Script for complex splices - #6980

Merged
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script
Nov 11, 2024
Merged

splice: Script for complex splices#6980
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script

Conversation

@ddustin

@ddustinddustin commented Jan 6, 2024

Copy link
Copy Markdown
Collaborator

PR reviewers: It might be good to start here to learn the splice script syntax: https://github.com/ddustin/lightning/blob/ddustin/splice_script/doc/lightning-splice.7.md

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.

A test is included that puts some advanced and complex scripts into the parser and validates the results that come out.

Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.

@ddustin
ddustinforce-pushed the ddustin/splice_script branch 9 times, most recently from 5952c41 to 2640bd6CompareJanuary 7, 2024 03:32
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from 2640bd6 to 4e7edecCompareJanuary 7, 2024 18:03

@vincenzopalazzovincenzopalazzo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

Proper documentation is coming but here's a quick summary:

The script isn't required to be used -- there will also be a json option and, of course, the lower level api is available.

When doing splices across multiple channels it quickly becomes unwieldy for users. Using the script is a nice shorthand to make it easier -- and also allows you to do "dry runs" and confirm it's doing what you'd like.

Say you wanted to take 50% of funds and splice them into three other channels, in splice script it's quite simple:

84ff50 -> 50%;
* -> cecf35;
* -> 4fe310;
* -> c14f60;

While working on it, it made sense to add a bunch of other useful things like being able to specify amounts as whole numbers, percentages, or * (split amount among all *s); channel queries; onchain bitcoin addresses; and the onchain wallet.

By building this more powerful part first it becomes trivial to implement the simpler splice commands. For instance:

Splice out 10 million sats

84ff50 -> 10M;

Splice in 10 million sats

wallet -> 10M;
* -> 84ff50;

Cross splice 10 million sats

84ff50 -> 10M;
* -> cecf35;

Pay 10M sats onchain using channel funds

84ff50 -> 10M+fee;
10M -> 1JfbZRwdDHKZmuiZgYArJZhcuuzuw2HuMu;

@ddustinddustin added this to the v24.02 milestone Jan 13, 2024
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 5 times, most recently from 731048c to ab31aa7CompareJanuary 22, 2024 22:12
@ddustin
ddustin marked this pull request as ready for review January 22, 2024 22:13
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from ab31aa7 to e0b188aCompareJanuary 22, 2024 22:14
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 7 times, most recently from 8105050 to 737ffc2CompareJanuary 24, 2024 22:43

@niftyneiniftynei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rustyrussell

Copy link
Copy Markdown
Collaborator

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

I changed the command to "dev-splice," updated the added tag to 24.11, and fixed a handful of issues that came up from rebasing.

Can we push this one through once it passes CI @rustyrussell?

@rustyrussell

Copy link
Copy Markdown
Collaborator

Ack! Will apply once CI is happy!

@rustyrussell

Copy link
Copy Markdown
Collaborator

Accidentally told GH to update to latest master and it did a merge. Gah! Rebased instead.

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.
Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.
A test that puts some advanced and complex scripts into the parser and validates the results that come out.
A routine for getting a signature back out of an input’s list of pending signatures via pubkey search.
This is needed for certain kinds of restarts as we lose our peer’s signature from memory but a copy is kept in the PSBT.
Stores an array of channel_ids into the PSBT globals area.
Changelog-None
`splice_signed` now searchs the PSBT for channel ids
Changelog-Changed: `splice_signed` parameters are switched in order to make `channel_id` an optional parameter, enabling multi-splice-signatures.
This is needed to all multi-channel splices. When channeld can return the signatures to the user (based on signing order precedent), it now does from splice_update.
Additionally, we move sending of the initial psbt from splice_init down to splice_update. This is also necessary for correct psbt diff detection during multi-channel splices.
Changelog-Changed: splice_update can in some cases now return the remotely partiall signed psbt to the user, if so `signtures_secured` will be true.
On certain well timed restarts we lose their siganture from memory and don’t receive it from them. In these cases we can extract it from the PSBT directly.
The ability to stfu channels in bulk is required to do complex multi channel operations. When stfu’ing in this manner, the available funds at the moment of stfu is returned to the user.
In order to cancel the stfu we also add a bulk tx_abort command.
Changelog-Added: `stfu_channels` and `abort_channels` are added for bulk multi-channel splice commands. These allow the user to pause (and resume) multiple channels in place.
This is the sister command of addpsbtoutput.
Adds inputs equal to or greater than the amount requests, reservers them, and reports important information back out to the user.
Changelog-Added: New low-level RPC command addpsbtinput to fund PSBTs directly and help with complex splices & dual-opens.
When set this flag tells addpsbtoutput to add the intiator serial_id to the added output.
Changelog-Changed: addpsbtoutput now allows serial_id to be set while adding which is needed for splicing and dual.
The command called “splice” can take a json payload or a ‘splice script’, process it into a list of ‘actions’ and then execute those actions.
These actions include or will include everything you would want to do with a splice:
* Splice into a channel
* Splice out of a channel
* Fund from wallet
* Deposit to wallet
* Send funds to bitcoin address
Changelog-Added: A new magic “splice” command is added that can take a ‘splice script’ or json payload and perform any complex splice across multiple channels merging the result into a single transaction. Some features are disabled and will be added in time.
Adding schema and documentatino for how to use the scripting portion of the “splice” RPC command.
The fee maximum is used to issue a warning to the user their feerate is high in case they accidentally make a large donation to miners.
During python testing the feerates are high on purpose so we raise the warning level to at least the penality feerate.
Tests that splice-in and splice-out work through the scripting process and confirm the resulting balances are correct.
If the user does not supply enough funds treat it as an abort instead of a channel warning.
Also clean up some indentation while we’re there.
@rustyrussell

Copy link
Copy Markdown
Collaborator

Now a proper rebase, taking into account jsonrpc request API changes. Also minor fixes since it didn't bisect build before.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@ddustin@cdecker@chrisguida@rustyrussell@niftynei@vincenzopalazzo
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

splice: Script for complex splices - #6980

Merged
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script
Nov 11, 2024
Merged

splice: Script for complex splices#6980
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script

Conversation

@ddustin

@ddustinddustin commented Jan 6, 2024

Copy link
Copy Markdown
Collaborator

PR reviewers: It might be good to start here to learn the splice script syntax: https://github.com/ddustin/lightning/blob/ddustin/splice_script/doc/lightning-splice.7.md

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.

A test is included that puts some advanced and complex scripts into the parser and validates the results that come out.

Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.

@ddustin
ddustinforce-pushed the ddustin/splice_script branch 9 times, most recently from 5952c41 to 2640bd6CompareJanuary 7, 2024 03:32
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from 2640bd6 to 4e7edecCompareJanuary 7, 2024 18:03

@vincenzopalazzovincenzopalazzo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

Proper documentation is coming but here's a quick summary:

The script isn't required to be used -- there will also be a json option and, of course, the lower level api is available.

When doing splices across multiple channels it quickly becomes unwieldy for users. Using the script is a nice shorthand to make it easier -- and also allows you to do "dry runs" and confirm it's doing what you'd like.

Say you wanted to take 50% of funds and splice them into three other channels, in splice script it's quite simple:

84ff50 -> 50%;
* -> cecf35;
* -> 4fe310;
* -> c14f60;

While working on it, it made sense to add a bunch of other useful things like being able to specify amounts as whole numbers, percentages, or * (split amount among all *s); channel queries; onchain bitcoin addresses; and the onchain wallet.

By building this more powerful part first it becomes trivial to implement the simpler splice commands. For instance:

Splice out 10 million sats

84ff50 -> 10M;

Splice in 10 million sats

wallet -> 10M;
* -> 84ff50;

Cross splice 10 million sats

84ff50 -> 10M;
* -> cecf35;

Pay 10M sats onchain using channel funds

84ff50 -> 10M+fee;
10M -> 1JfbZRwdDHKZmuiZgYArJZhcuuzuw2HuMu;

@ddustinddustin added this to the v24.02 milestone Jan 13, 2024
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 5 times, most recently from 731048c to ab31aa7CompareJanuary 22, 2024 22:12
@ddustin
ddustin marked this pull request as ready for review January 22, 2024 22:13
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from ab31aa7 to e0b188aCompareJanuary 22, 2024 22:14
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 7 times, most recently from 8105050 to 737ffc2CompareJanuary 24, 2024 22:43

@niftyneiniftynei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rustyrussell

Copy link
Copy Markdown
Collaborator

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

I changed the command to "dev-splice," updated the added tag to 24.11, and fixed a handful of issues that came up from rebasing.

Can we push this one through once it passes CI @rustyrussell?

@rustyrussell

Copy link
Copy Markdown
Collaborator

Ack! Will apply once CI is happy!

@rustyrussell

Copy link
Copy Markdown
Collaborator

Accidentally told GH to update to latest master and it did a merge. Gah! Rebased instead.

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.
Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.
A test that puts some advanced and complex scripts into the parser and validates the results that come out.
A routine for getting a signature back out of an input’s list of pending signatures via pubkey search.
This is needed for certain kinds of restarts as we lose our peer’s signature from memory but a copy is kept in the PSBT.
Stores an array of channel_ids into the PSBT globals area.
Changelog-None
`splice_signed` now searchs the PSBT for channel ids
Changelog-Changed: `splice_signed` parameters are switched in order to make `channel_id` an optional parameter, enabling multi-splice-signatures.
This is needed to all multi-channel splices. When channeld can return the signatures to the user (based on signing order precedent), it now does from splice_update.
Additionally, we move sending of the initial psbt from splice_init down to splice_update. This is also necessary for correct psbt diff detection during multi-channel splices.
Changelog-Changed: splice_update can in some cases now return the remotely partiall signed psbt to the user, if so `signtures_secured` will be true.
On certain well timed restarts we lose their siganture from memory and don’t receive it from them. In these cases we can extract it from the PSBT directly.
The ability to stfu channels in bulk is required to do complex multi channel operations. When stfu’ing in this manner, the available funds at the moment of stfu is returned to the user.
In order to cancel the stfu we also add a bulk tx_abort command.
Changelog-Added: `stfu_channels` and `abort_channels` are added for bulk multi-channel splice commands. These allow the user to pause (and resume) multiple channels in place.
This is the sister command of addpsbtoutput.
Adds inputs equal to or greater than the amount requests, reservers them, and reports important information back out to the user.
Changelog-Added: New low-level RPC command addpsbtinput to fund PSBTs directly and help with complex splices & dual-opens.
When set this flag tells addpsbtoutput to add the intiator serial_id to the added output.
Changelog-Changed: addpsbtoutput now allows serial_id to be set while adding which is needed for splicing and dual.
The command called “splice” can take a json payload or a ‘splice script’, process it into a list of ‘actions’ and then execute those actions.
These actions include or will include everything you would want to do with a splice:
* Splice into a channel
* Splice out of a channel
* Fund from wallet
* Deposit to wallet
* Send funds to bitcoin address
Changelog-Added: A new magic “splice” command is added that can take a ‘splice script’ or json payload and perform any complex splice across multiple channels merging the result into a single transaction. Some features are disabled and will be added in time.
Adding schema and documentatino for how to use the scripting portion of the “splice” RPC command.
The fee maximum is used to issue a warning to the user their feerate is high in case they accidentally make a large donation to miners.
During python testing the feerates are high on purpose so we raise the warning level to at least the penality feerate.
Tests that splice-in and splice-out work through the scripting process and confirm the resulting balances are correct.
If the user does not supply enough funds treat it as an abort instead of a channel warning.
Also clean up some indentation while we’re there.
@rustyrussell

Copy link
Copy Markdown
Collaborator

Now a proper rebase, taking into account jsonrpc request API changes. Also minor fixes since it didn't bisect build before.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@ddustin@cdecker@chrisguida@rustyrussell@niftynei@vincenzopalazzo
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

splice: Script for complex splices - #6980

Merged
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script
Nov 11, 2024
Merged

splice: Script for complex splices#6980
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script

Conversation

@ddustin

@ddustinddustin commented Jan 6, 2024

Copy link
Copy Markdown
Collaborator

PR reviewers: It might be good to start here to learn the splice script syntax: https://github.com/ddustin/lightning/blob/ddustin/splice_script/doc/lightning-splice.7.md

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.

A test is included that puts some advanced and complex scripts into the parser and validates the results that come out.

Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.

@ddustin
ddustinforce-pushed the ddustin/splice_script branch 9 times, most recently from 5952c41 to 2640bd6CompareJanuary 7, 2024 03:32
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from 2640bd6 to 4e7edecCompareJanuary 7, 2024 18:03

@vincenzopalazzovincenzopalazzo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

Proper documentation is coming but here's a quick summary:

The script isn't required to be used -- there will also be a json option and, of course, the lower level api is available.

When doing splices across multiple channels it quickly becomes unwieldy for users. Using the script is a nice shorthand to make it easier -- and also allows you to do "dry runs" and confirm it's doing what you'd like.

Say you wanted to take 50% of funds and splice them into three other channels, in splice script it's quite simple:

84ff50 -> 50%;
* -> cecf35;
* -> 4fe310;
* -> c14f60;

While working on it, it made sense to add a bunch of other useful things like being able to specify amounts as whole numbers, percentages, or * (split amount among all *s); channel queries; onchain bitcoin addresses; and the onchain wallet.

By building this more powerful part first it becomes trivial to implement the simpler splice commands. For instance:

Splice out 10 million sats

84ff50 -> 10M;

Splice in 10 million sats

wallet -> 10M;
* -> 84ff50;

Cross splice 10 million sats

84ff50 -> 10M;
* -> cecf35;

Pay 10M sats onchain using channel funds

84ff50 -> 10M+fee;
10M -> 1JfbZRwdDHKZmuiZgYArJZhcuuzuw2HuMu;

@ddustinddustin added this to the v24.02 milestone Jan 13, 2024
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 5 times, most recently from 731048c to ab31aa7CompareJanuary 22, 2024 22:12
@ddustin
ddustin marked this pull request as ready for review January 22, 2024 22:13
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from ab31aa7 to e0b188aCompareJanuary 22, 2024 22:14
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 7 times, most recently from 8105050 to 737ffc2CompareJanuary 24, 2024 22:43

@niftyneiniftynei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rustyrussell

Copy link
Copy Markdown
Collaborator

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

I changed the command to "dev-splice," updated the added tag to 24.11, and fixed a handful of issues that came up from rebasing.

Can we push this one through once it passes CI @rustyrussell?

@rustyrussell

Copy link
Copy Markdown
Collaborator

Ack! Will apply once CI is happy!

@rustyrussell

Copy link
Copy Markdown
Collaborator

Accidentally told GH to update to latest master and it did a merge. Gah! Rebased instead.

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.
Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.
A test that puts some advanced and complex scripts into the parser and validates the results that come out.
A routine for getting a signature back out of an input’s list of pending signatures via pubkey search.
This is needed for certain kinds of restarts as we lose our peer’s signature from memory but a copy is kept in the PSBT.
Stores an array of channel_ids into the PSBT globals area.
Changelog-None
`splice_signed` now searchs the PSBT for channel ids
Changelog-Changed: `splice_signed` parameters are switched in order to make `channel_id` an optional parameter, enabling multi-splice-signatures.
This is needed to all multi-channel splices. When channeld can return the signatures to the user (based on signing order precedent), it now does from splice_update.
Additionally, we move sending of the initial psbt from splice_init down to splice_update. This is also necessary for correct psbt diff detection during multi-channel splices.
Changelog-Changed: splice_update can in some cases now return the remotely partiall signed psbt to the user, if so `signtures_secured` will be true.
On certain well timed restarts we lose their siganture from memory and don’t receive it from them. In these cases we can extract it from the PSBT directly.
The ability to stfu channels in bulk is required to do complex multi channel operations. When stfu’ing in this manner, the available funds at the moment of stfu is returned to the user.
In order to cancel the stfu we also add a bulk tx_abort command.
Changelog-Added: `stfu_channels` and `abort_channels` are added for bulk multi-channel splice commands. These allow the user to pause (and resume) multiple channels in place.
This is the sister command of addpsbtoutput.
Adds inputs equal to or greater than the amount requests, reservers them, and reports important information back out to the user.
Changelog-Added: New low-level RPC command addpsbtinput to fund PSBTs directly and help with complex splices & dual-opens.
When set this flag tells addpsbtoutput to add the intiator serial_id to the added output.
Changelog-Changed: addpsbtoutput now allows serial_id to be set while adding which is needed for splicing and dual.
The command called “splice” can take a json payload or a ‘splice script’, process it into a list of ‘actions’ and then execute those actions.
These actions include or will include everything you would want to do with a splice:
* Splice into a channel
* Splice out of a channel
* Fund from wallet
* Deposit to wallet
* Send funds to bitcoin address
Changelog-Added: A new magic “splice” command is added that can take a ‘splice script’ or json payload and perform any complex splice across multiple channels merging the result into a single transaction. Some features are disabled and will be added in time.
Adding schema and documentatino for how to use the scripting portion of the “splice” RPC command.
The fee maximum is used to issue a warning to the user their feerate is high in case they accidentally make a large donation to miners.
During python testing the feerates are high on purpose so we raise the warning level to at least the penality feerate.
Tests that splice-in and splice-out work through the scripting process and confirm the resulting balances are correct.
If the user does not supply enough funds treat it as an abort instead of a channel warning.
Also clean up some indentation while we’re there.
@rustyrussell

Copy link
Copy Markdown
Collaborator

Now a proper rebase, taking into account jsonrpc request API changes. Also minor fixes since it didn't bisect build before.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@ddustin@cdecker@chrisguida@rustyrussell@niftynei@vincenzopalazzo
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

splice: Script for complex splices - #6980

Merged
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script
Nov 11, 2024
Merged

splice: Script for complex splices#6980
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script

Conversation

@ddustin

@ddustinddustin commented Jan 6, 2024

Copy link
Copy Markdown
Collaborator

PR reviewers: It might be good to start here to learn the splice script syntax: https://github.com/ddustin/lightning/blob/ddustin/splice_script/doc/lightning-splice.7.md

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.

A test is included that puts some advanced and complex scripts into the parser and validates the results that come out.

Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.

@ddustin
ddustinforce-pushed the ddustin/splice_script branch 9 times, most recently from 5952c41 to 2640bd6CompareJanuary 7, 2024 03:32
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from 2640bd6 to 4e7edecCompareJanuary 7, 2024 18:03

@vincenzopalazzovincenzopalazzo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

Proper documentation is coming but here's a quick summary:

The script isn't required to be used -- there will also be a json option and, of course, the lower level api is available.

When doing splices across multiple channels it quickly becomes unwieldy for users. Using the script is a nice shorthand to make it easier -- and also allows you to do "dry runs" and confirm it's doing what you'd like.

Say you wanted to take 50% of funds and splice them into three other channels, in splice script it's quite simple:

84ff50 -> 50%;
* -> cecf35;
* -> 4fe310;
* -> c14f60;

While working on it, it made sense to add a bunch of other useful things like being able to specify amounts as whole numbers, percentages, or * (split amount among all *s); channel queries; onchain bitcoin addresses; and the onchain wallet.

By building this more powerful part first it becomes trivial to implement the simpler splice commands. For instance:

Splice out 10 million sats

84ff50 -> 10M;

Splice in 10 million sats

wallet -> 10M;
* -> 84ff50;

Cross splice 10 million sats

84ff50 -> 10M;
* -> cecf35;

Pay 10M sats onchain using channel funds

84ff50 -> 10M+fee;
10M -> 1JfbZRwdDHKZmuiZgYArJZhcuuzuw2HuMu;

@ddustinddustin added this to the v24.02 milestone Jan 13, 2024
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 5 times, most recently from 731048c to ab31aa7CompareJanuary 22, 2024 22:12
@ddustin
ddustin marked this pull request as ready for review January 22, 2024 22:13
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from ab31aa7 to e0b188aCompareJanuary 22, 2024 22:14
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 7 times, most recently from 8105050 to 737ffc2CompareJanuary 24, 2024 22:43

@niftyneiniftynei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rustyrussell

Copy link
Copy Markdown
Collaborator

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

I changed the command to "dev-splice," updated the added tag to 24.11, and fixed a handful of issues that came up from rebasing.

Can we push this one through once it passes CI @rustyrussell?

@rustyrussell

Copy link
Copy Markdown
Collaborator

Ack! Will apply once CI is happy!

@rustyrussell

Copy link
Copy Markdown
Collaborator

Accidentally told GH to update to latest master and it did a merge. Gah! Rebased instead.

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.
Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.
A test that puts some advanced and complex scripts into the parser and validates the results that come out.
A routine for getting a signature back out of an input’s list of pending signatures via pubkey search.
This is needed for certain kinds of restarts as we lose our peer’s signature from memory but a copy is kept in the PSBT.
Stores an array of channel_ids into the PSBT globals area.
Changelog-None
`splice_signed` now searchs the PSBT for channel ids
Changelog-Changed: `splice_signed` parameters are switched in order to make `channel_id` an optional parameter, enabling multi-splice-signatures.
This is needed to all multi-channel splices. When channeld can return the signatures to the user (based on signing order precedent), it now does from splice_update.
Additionally, we move sending of the initial psbt from splice_init down to splice_update. This is also necessary for correct psbt diff detection during multi-channel splices.
Changelog-Changed: splice_update can in some cases now return the remotely partiall signed psbt to the user, if so `signtures_secured` will be true.
On certain well timed restarts we lose their siganture from memory and don’t receive it from them. In these cases we can extract it from the PSBT directly.
The ability to stfu channels in bulk is required to do complex multi channel operations. When stfu’ing in this manner, the available funds at the moment of stfu is returned to the user.
In order to cancel the stfu we also add a bulk tx_abort command.
Changelog-Added: `stfu_channels` and `abort_channels` are added for bulk multi-channel splice commands. These allow the user to pause (and resume) multiple channels in place.
This is the sister command of addpsbtoutput.
Adds inputs equal to or greater than the amount requests, reservers them, and reports important information back out to the user.
Changelog-Added: New low-level RPC command addpsbtinput to fund PSBTs directly and help with complex splices & dual-opens.
When set this flag tells addpsbtoutput to add the intiator serial_id to the added output.
Changelog-Changed: addpsbtoutput now allows serial_id to be set while adding which is needed for splicing and dual.
The command called “splice” can take a json payload or a ‘splice script’, process it into a list of ‘actions’ and then execute those actions.
These actions include or will include everything you would want to do with a splice:
* Splice into a channel
* Splice out of a channel
* Fund from wallet
* Deposit to wallet
* Send funds to bitcoin address
Changelog-Added: A new magic “splice” command is added that can take a ‘splice script’ or json payload and perform any complex splice across multiple channels merging the result into a single transaction. Some features are disabled and will be added in time.
Adding schema and documentatino for how to use the scripting portion of the “splice” RPC command.
The fee maximum is used to issue a warning to the user their feerate is high in case they accidentally make a large donation to miners.
During python testing the feerates are high on purpose so we raise the warning level to at least the penality feerate.
Tests that splice-in and splice-out work through the scripting process and confirm the resulting balances are correct.
If the user does not supply enough funds treat it as an abort instead of a channel warning.
Also clean up some indentation while we’re there.
@rustyrussell

Copy link
Copy Markdown
Collaborator

Now a proper rebase, taking into account jsonrpc request API changes. Also minor fixes since it didn't bisect build before.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@ddustin@cdecker@chrisguida@rustyrussell@niftynei@vincenzopalazzo
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

splice: Script for complex splices - #6980

Merged
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script
Nov 11, 2024
Merged

splice: Script for complex splices#6980
rustyrussell merged 21 commits into
ElementsProject:masterfrom
ddustin:ddustin/splice_script

Conversation

@ddustin

@ddustinddustin commented Jan 6, 2024

Copy link
Copy Markdown
Collaborator

PR reviewers: It might be good to start here to learn the splice script syntax: https://github.com/ddustin/lightning/blob/ddustin/splice_script/doc/lightning-splice.7.md

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.

A test is included that puts some advanced and complex scripts into the parser and validates the results that come out.

Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.

@ddustin
ddustinforce-pushed the ddustin/splice_script branch 9 times, most recently from 5952c41 to 2640bd6CompareJanuary 7, 2024 03:32
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from 2640bd6 to 4e7edecCompareJanuary 7, 2024 18:03

@vincenzopalazzovincenzopalazzo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

Mh What do you mean by "Scripts"? and why now we need a "compiler" for splicing? 😕

I feel that I am missing somethings?

Proper documentation is coming but here's a quick summary:

The script isn't required to be used -- there will also be a json option and, of course, the lower level api is available.

When doing splices across multiple channels it quickly becomes unwieldy for users. Using the script is a nice shorthand to make it easier -- and also allows you to do "dry runs" and confirm it's doing what you'd like.

Say you wanted to take 50% of funds and splice them into three other channels, in splice script it's quite simple:

84ff50 -> 50%;
* -> cecf35;
* -> 4fe310;
* -> c14f60;

While working on it, it made sense to add a bunch of other useful things like being able to specify amounts as whole numbers, percentages, or * (split amount among all *s); channel queries; onchain bitcoin addresses; and the onchain wallet.

By building this more powerful part first it becomes trivial to implement the simpler splice commands. For instance:

Splice out 10 million sats

84ff50 -> 10M;

Splice in 10 million sats

wallet -> 10M;
* -> 84ff50;

Cross splice 10 million sats

84ff50 -> 10M;
* -> cecf35;

Pay 10M sats onchain using channel funds

84ff50 -> 10M+fee;
10M -> 1JfbZRwdDHKZmuiZgYArJZhcuuzuw2HuMu;

@ddustinddustin added this to the v24.02 milestone Jan 13, 2024
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 5 times, most recently from 731048c to ab31aa7CompareJanuary 22, 2024 22:12
@ddustin
ddustin marked this pull request as ready for review January 22, 2024 22:13
@ddustin
ddustinforce-pushed the ddustin/splice_script branch from ab31aa7 to e0b188aCompareJanuary 22, 2024 22:14
@ddustin
ddustinforce-pushed the ddustin/splice_script branch 7 times, most recently from 8105050 to 737ffc2CompareJanuary 24, 2024 22:43

@niftyneiniftynei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rustyrussell

Copy link
Copy Markdown
Collaborator

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

@ddustin

Copy link
Copy Markdown
CollaboratorAuthor

OK, can we make this experimental, or a dev- command? I'm not convinced this is the way we want to go, but it's great for exercising all the nasty cases, and may well be useful for larger nodes.

Needs rebase because it was now "added v24.11" not "v24.08", sorry :(

I changed the command to "dev-splice," updated the added tag to 24.11, and fixed a handful of issues that came up from rebasing.

Can we push this one through once it passes CI @rustyrussell?

@rustyrussell

Copy link
Copy Markdown
Collaborator

Ack! Will apply once CI is happy!

@rustyrussell

Copy link
Copy Markdown
Collaborator

Accidentally told GH to update to latest master and it did a merge. Gah! Rebased instead.

New compiler for splice scripts that parses splice scripts, validates them, converts them to json and back again.
Changelog-Added: Splice script parser — takes a custom splice query language to bundle multiple complex splices into a single task in a simple way.
A test that puts some advanced and complex scripts into the parser and validates the results that come out.
A routine for getting a signature back out of an input’s list of pending signatures via pubkey search.
This is needed for certain kinds of restarts as we lose our peer’s signature from memory but a copy is kept in the PSBT.
Stores an array of channel_ids into the PSBT globals area.
Changelog-None
`splice_signed` now searchs the PSBT for channel ids
Changelog-Changed: `splice_signed` parameters are switched in order to make `channel_id` an optional parameter, enabling multi-splice-signatures.
This is needed to all multi-channel splices. When channeld can return the signatures to the user (based on signing order precedent), it now does from splice_update.
Additionally, we move sending of the initial psbt from splice_init down to splice_update. This is also necessary for correct psbt diff detection during multi-channel splices.
Changelog-Changed: splice_update can in some cases now return the remotely partiall signed psbt to the user, if so `signtures_secured` will be true.
On certain well timed restarts we lose their siganture from memory and don’t receive it from them. In these cases we can extract it from the PSBT directly.
The ability to stfu channels in bulk is required to do complex multi channel operations. When stfu’ing in this manner, the available funds at the moment of stfu is returned to the user.
In order to cancel the stfu we also add a bulk tx_abort command.
Changelog-Added: `stfu_channels` and `abort_channels` are added for bulk multi-channel splice commands. These allow the user to pause (and resume) multiple channels in place.
This is the sister command of addpsbtoutput.
Adds inputs equal to or greater than the amount requests, reservers them, and reports important information back out to the user.
Changelog-Added: New low-level RPC command addpsbtinput to fund PSBTs directly and help with complex splices & dual-opens.
When set this flag tells addpsbtoutput to add the intiator serial_id to the added output.
Changelog-Changed: addpsbtoutput now allows serial_id to be set while adding which is needed for splicing and dual.
The command called “splice” can take a json payload or a ‘splice script’, process it into a list of ‘actions’ and then execute those actions.
These actions include or will include everything you would want to do with a splice:
* Splice into a channel
* Splice out of a channel
* Fund from wallet
* Deposit to wallet
* Send funds to bitcoin address
Changelog-Added: A new magic “splice” command is added that can take a ‘splice script’ or json payload and perform any complex splice across multiple channels merging the result into a single transaction. Some features are disabled and will be added in time.
Adding schema and documentatino for how to use the scripting portion of the “splice” RPC command.
The fee maximum is used to issue a warning to the user their feerate is high in case they accidentally make a large donation to miners.
During python testing the feerates are high on purpose so we raise the warning level to at least the penality feerate.
Tests that splice-in and splice-out work through the scripting process and confirm the resulting balances are correct.
If the user does not supply enough funds treat it as an abort instead of a channel warning.
Also clean up some indentation while we’re there.
@rustyrussell

Copy link
Copy Markdown
Collaborator

Now a proper rebase, taking into account jsonrpc request API changes. Also minor fixes since it didn't bisect build before.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@ddustin@cdecker@chrisguida@rustyrussell@niftynei@vincenzopalazzo