-
Notifications
You must be signed in to change notification settings - Fork 913
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
dual funding -> API changes/breakage #5670
Merged
rustyrussell
merged 19 commits into
ElementsProject:master
from
niftynei:nifty/dual-fund-updates
Feb 4, 2023
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0a8d942
dual-fund: update extracted CSVs to latest bolt draft
m-schmoock 12843d4
dual-fund: update to latest, add in updates to rbf amounts
niftynei 0b00be7
dual-fund: on re-init, re-populate opener_funding/accepter_funding
niftynei 1d50947
df tests: use the amount from the logs to check for!
niftynei 811720f
openingd: pull out validation for shutdown script
niftynei a9249db
dual-fund: validate upfront shutdown using taproot + anchors
niftynei c92fdb2
opening: helper for anchor flagged, use in dualopend also
niftynei f4a3de7
dual-fund: check features to print (anchors not assumed)
niftynei db88b7b
dual-fund: remove anchor assumption for all dual-funded channels
niftynei 3e937d3
dual-fund: only allow for liquidity ads if both nodes support anchors
niftynei c05262d
connectd: patch valgrind error w/ buffers for error msgs
niftynei a7da33d
tests: anchors is only EXPERIMENTAL_FEATURES
niftynei 90d7d25
tests: check that non-anchor opens can't use liquidity ads
niftynei 4f5b8a7
dual-fund: patch in channel_type logic
niftynei a887dcd
test: restart node during rbf
niftynei 8b70405
dual-open-rbf: remember the requested lease amount btw restarts
niftynei 04340c5
fundpsbt: add option to filter out wrapped p2sh inputs
niftynei 3f8bec1
upgradewallet: JSONRPC call to update p2sh outputs to a native segwit
niftynei 62af76d
v2 opens: don't use p2sh inputs for v2 opens
niftynei 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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ | |
#include <sys/types.h> | ||
#include <sys/wait.h> | ||
#include <unistd.h> | ||
#include <wire/wire_io.h> | ||
#include <wire/wire_sync.h> | ||
|
||
/*~ We are passed two file descriptors when exec'ed from `lightningd`: the | ||
|
@@ -305,8 +306,8 @@ struct io_plan *peer_connected(struct io_conn *conn, | |
status_peer_unusual(id, "Unsupported feature %u", unsup); | ||
msg = towire_warningfmt(NULL, NULL, "Unsupported feature %u", | ||
unsup); | ||
msg = cryptomsg_encrypt_msg(tmpctx, cs, take(msg)); | ||
return io_write(conn, msg, tal_count(msg), io_close_cb, NULL); | ||
msg = cryptomsg_encrypt_msg(NULL, cs, take(msg)); | ||
return io_write_wire(conn, take(msg), io_close_cb, NULL); | ||
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. Good catch, just verified that |
||
} | ||
|
||
if (!feature_check_depends(their_features, &depender, &missing)) { | ||
|
@@ -315,8 +316,8 @@ struct io_plan *peer_connected(struct io_conn *conn, | |
msg = towire_warningfmt(NULL, NULL, | ||
"Feature %zu requires feature %zu", | ||
depender, missing); | ||
msg = cryptomsg_encrypt_msg(tmpctx, cs, take(msg)); | ||
return io_write(conn, msg, tal_count(msg), io_close_cb, NULL); | ||
msg = cryptomsg_encrypt_msg(NULL, cs, take(msg)); | ||
return io_write_wire(conn, take(msg), io_close_cb, NULL); | ||
} | ||
|
||
/* We've successfully connected. */ | ||
|
This file contains 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 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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
lightning-upgradewallet -- Command to spend all P2SH-wrapped inputs into a Native Segwit output | ||
================================================================ | ||
|
||
SYNOPSIS | ||
-------- | ||
|
||
**upgradewallet** [*feerate*] [*reservedok*] | ||
|
||
DESCRIPTION | ||
----------- | ||
|
||
`upgradewallet` is a convenience RPC which will spend all p2sh-wrapped | ||
Segwit deposits in a wallet into a single Native Segwit P2WPKH address. | ||
|
||
*feerate* can be one of the feerates listed in lightning-feerates(7), | ||
or one of the strings *urgent* (aim for next block), *normal* (next 4 | ||
blocks or so) or *slow* (next 100 blocks or so) to use lightningd's | ||
internal estimates. It can also be a *feerate* is a number, with an | ||
optional suffix: *perkw* means the number is interpreted as | ||
satoshi-per-kilosipa (weight), and *perkb* means it is interpreted | ||
bitcoind-style as satoshi-per-kilobyte. Omitting the suffix is | ||
equivalent to *perkb*. | ||
|
||
*reservedok* tells the wallet to include all P2SH-wrapped inputs, including | ||
reserved ones. | ||
|
||
EXAMPLE USAGE | ||
------------- | ||
|
||
The caller is trying to buy a liquidity ad but the command keeps failing. | ||
They have funds in their wallet, but they're all P2SH-wrapped outputs. | ||
|
||
The caller can call `upgradewallet` to convert their funds to native segwit | ||
outputs, which are valid for liquidity ad buys. | ||
|
||
RETURN VALUE | ||
------------ | ||
|
||
[comment]: # (GENERATE-FROM-SCHEMA-START) | ||
[comment]: # (GENERATE-FROM-SCHEMA-END) | ||
|
||
|
||
AUTHOR | ||
------ | ||
|
||
~niftynei~ <<[email protected]>> is mainly responsible. | ||
|
||
SEE ALSO | ||
-------- | ||
|
||
lightning-utxopsbt(7), lightning-reserveinputs(7), lightning-unreserveinputs(7). | ||
|
||
RESOURCES | ||
--------- | ||
|
||
Main web site: <https://github.com/ElementsProject/lightning> | ||
|
||
[comment]: # ( SHA256STAMP:0f290582f49c6103258b7f781a9e7fa4075ec6c05335a459a91da0b6fd58c68d) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "object", | ||
"required": [], | ||
"additionalProperties": false, | ||
"properties": { | ||
"feerate": { | ||
"type": "feerate", | ||
"description": "Feerate for the upgrade transaction", | ||
"added": "v23.02" | ||
}, | ||
"reservedok": { | ||
"type": "boolean", | ||
"description": "Include already reserved funds or not", | ||
"added": "v23.02" | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": [ | ||
"upgraded_outs" | ||
], | ||
"properties": { | ||
"upgraded_outs": { | ||
"type": "u64", | ||
"description": "Count of spent/upgraded UTXOs", | ||
"added": "v23.02" | ||
}, | ||
"psbt": { | ||
"type": "string", | ||
"description": "The PSBT that was finalized and sent", | ||
"added": "v23.02" | ||
}, | ||
"tx": { | ||
"type": "hex", | ||
"description": "The raw transaction which was sent", | ||
"added": "v23.02" | ||
}, | ||
"txid": { | ||
"type": "txid", | ||
"description": "The txid of the **tx**", | ||
"added": "v23.02" | ||
} | ||
} | ||
} |
This file contains 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 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 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
Oops, something went wrong.
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.
No explicit signalling needed anymore?
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.
We've removed the implicit dependence on anchor_outputs, instead we just assume that static_remotekey is required.