Skip to content

Commit

Permalink
close: spec is final, it's not experimental.
Browse files Browse the repository at this point in the history
That was quick!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Sep 2, 2021
1 parent 0ae8501 commit b40cbe0
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 60 deletions.
11 changes: 5 additions & 6 deletions doc/lightning-close.7

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions doc/lightning-close.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ friends to upgrade!

The *fee_negotiation_step* parameter controls how closing fee
negotiation is performed assuming the peer proposes a fee that is
different than our estimate. (Note that using this option
prevents **experimental-quick-close**, as the quick-close protocol
does not allow negotiation).
different than our estimate. (Note that modern peers use the quick-close protocol which does not allow negotiation: see *feerange* instead).

On every negotiation step we must give up
some amount from our proposal towards the peer's proposal. This parameter
Expand Down Expand Up @@ -65,10 +63,10 @@ can rescue openings which have been manually miscreated.
(option_will_fund), we prevent initiation of a mutual close
unless this flag is passed in. Defaults to false.


*feerange* is an optional array [ *min*, *max* ], indicating the
minimum and maximum feerates to offer. *slow* and *unilateral_close*
are the defaults.
minimum and maximum feerates to offer: the peer will obey these if it
supports the quick-close protocol. *slow* and *unilateral_close* are
the defaults.

Rates are one of the strings *urgent* (aim for next block), *normal*
(next 4 blocks or so) or *slow* (next 100 blocks or so) to use
Expand Down
4 changes: 1 addition & 3 deletions doc/lightning-listconfigs.7

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions doc/lightning-listconfigs.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ On success, an object is returned, containing:
- **experimental-dual-fund** (boolean, optional): `experimental-dual-fund` field from config or cmdline, or default
- **experimental-onion-messages** (boolean, optional): `experimental-onion-messages` field from config or cmdline, or default
- **experimental-offers** (boolean, optional): `experimental-offers` field from config or cmdline, or default
- **experimental-quick-close** (boolean, optional): `experimental-quick-close` field from config or cmdline, or default
- **experimental-shutdown-wrong-funding** (boolean, optional): `experimental-shutdown-wrong-funding` field from config or cmdline, or default
- **rgb** (hex, optional): `rgb` field from config or cmdline, or default (always 6 characters)
- **alias** (string, optional): `alias` field from config or cmdline, or default
Expand Down Expand Up @@ -205,4 +204,4 @@ RESOURCES
---------

Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:7b449305a5b0826a80672002d99e02d9c852c2757acc9d3ea2dea91d9cafafc1)
[comment]: # ( SHA256STAMP:ad98179a7b6254a936d4fde179918b6a975e186adcbc396917a0c2ed2888519e)
12 changes: 1 addition & 11 deletions doc/lightningd-config.5
Original file line number Diff line number Diff line change
Expand Up @@ -625,16 +625,6 @@ about whether to add funds or not to a proposed channel is handled
automatically by a plugin that implements the appropriate logic for
your needs\. The default behavior is to not contribute funds\.


\fBexperimental-quick-close\fR


Specifying this means we send our range of acceptable fees to the peer
on mutual close\. If they support it too, we'll simply use that for
closing (unless \fIfee_negotiation_step\fR is set, see \fBlightning-close\fR(7))\.
We always use this on channels which negotiation \fBoption_anchor_outputs\fR,
as the spec requires that\.

.SH BUGS

You should report bugs on our github issues page, and maybe submit a fix
Expand All @@ -660,4 +650,4 @@ Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
Note: the modules in the ccan/ directory have their own licenses, but
the rest of the code is covered by the BSD-style MIT license\.

\" SHA256STAMP:0d2474276b325cb002191211fb1d0da2409ebc859ff3ccc6dd3e688b10d4550c
\" SHA256STAMP:1c392f3fee66dc6c1fc2c34200204a9be1d79e53fd5fb1720ad169fc671f71c0
8 changes: 0 additions & 8 deletions doc/lightningd-config.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,14 +517,6 @@ about whether to add funds or not to a proposed channel is handled
automatically by a plugin that implements the appropriate logic for
your needs. The default behavior is to not contribute funds.

**experimental-quick-close**

Specifying this means we send our range of acceptable fees to the peer
on mutual close. If they support it too, we'll simply use that for
closing (unless *fee_negotiation_step* is set, see lightning-close(7)).
We always use this on channels which negotiation `option_anchor_outputs`,
as the spec requires that.

BUGS
----

Expand Down
4 changes: 0 additions & 4 deletions doc/schemas/listconfigs.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@
"type": "boolean",
"description": "`experimental-offers` field from config or cmdline, or default"
},
"experimental-quick-close": {
"type": "boolean",
"description": "`experimental-quick-close` field from config or cmdline, or default"
},
"experimental-shutdown-wrong-funding": {
"type": "boolean",
"description": "`experimental-shutdown-wrong-funding` field from config or cmdline, or default"
Expand Down
3 changes: 1 addition & 2 deletions lightningd/closing_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,8 @@ void peer_start_closingd(struct channel *channel,
channel->shutdown_scriptpubkey[REMOTE],
channel->closing_fee_negotiation_step,
channel->closing_fee_negotiation_step_unit,
(ld->use_quickclose
/* Don't quickclose if they specified how to negotiate! */
&& channel->closing_fee_negotiation_step == 50
(channel->closing_fee_negotiation_step == 50
&& channel->closing_fee_negotiation_step_unit == CLOSING_FEE_NEGOTIATION_STEP_UNIT_PERCENTAGE)
/* Always use quickclose with anchors */
|| channel->option_anchor_outputs,
Expand Down
5 changes: 0 additions & 5 deletions lightningd/lightningd.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,6 @@ static struct lightningd *new_lightningd(const tal_t *ctx)
* case this is a pointer to an enum feerate-indexed array of values */
ld->force_feerates = NULL;

/*~ We don't enable new network features until they've been approved
* and tested in the spec (i.e. some other implementation has also
* implemented and tested!). Until then we use a flag: */
ld->use_quickclose = false;

return ld;
}

Expand Down
3 changes: 0 additions & 3 deletions lightningd/lightningd.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,6 @@ struct lightningd {
/* Should we re-exec ourselves instead of just exiting? */
bool try_reexec;

/* --experimental-quick-close */
bool use_quickclose;

/* Array of (even) TLV types that we should allow. This is required
* since we otherwise would outright reject them. */
u64 *accept_extra_tlv_types;
Expand Down
4 changes: 0 additions & 4 deletions lightningd/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,10 +1062,6 @@ static void register_opts(struct lightningd *ld)
"--subdaemon=hsmd:remote_signer "
"would use a hypothetical remote signing subdaemon.");

opt_register_noarg("--experimental-quick-close",
opt_set_bool, &ld->use_quickclose,
"EXPERIMENTAL: offer range to mutual close");

opt_register_logging(ld);
opt_register_version();

Expand Down
7 changes: 1 addition & 6 deletions tests/test_closing.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ def get_mempool_when_size_1():
assert opts['expected_close_fee'] == fee_mempool


@unittest.skipIf(EXPERIMENTAL_FEATURES, "anchors uses quick-close, not negotiation")
def test_closing_negotiation_step_30pct(node_factory, bitcoind, chainparams):
"""Test that the closing fee negotiation step works, 30%"""
opts = {}
Expand All @@ -461,7 +460,6 @@ def test_closing_negotiation_step_30pct(node_factory, bitcoind, chainparams):
closing_negotiation_step(node_factory, bitcoind, chainparams, opts)


@unittest.skipIf(EXPERIMENTAL_FEATURES, "anchors uses quick-close, not negotiation")
def test_closing_negotiation_step_50pct(node_factory, bitcoind, chainparams):
"""Test that the closing fee negotiation step works, 50%, the default"""
opts = {}
Expand All @@ -476,7 +474,6 @@ def test_closing_negotiation_step_50pct(node_factory, bitcoind, chainparams):
closing_negotiation_step(node_factory, bitcoind, chainparams, opts)


@unittest.skipIf(EXPERIMENTAL_FEATURES, "anchors uses quick-close, not negotiation")
def test_closing_negotiation_step_100pct(node_factory, bitcoind, chainparams):
"""Test that the closing fee negotiation step works, 100%"""
opts = {}
Expand All @@ -496,7 +493,6 @@ def test_closing_negotiation_step_100pct(node_factory, bitcoind, chainparams):
closing_negotiation_step(node_factory, bitcoind, chainparams, opts)


@unittest.skipIf(EXPERIMENTAL_FEATURES, "anchors uses quick-close, not negotiation")
def test_closing_negotiation_step_1sat(node_factory, bitcoind, chainparams):
"""Test that the closing fee negotiation step works, 1sat"""
opts = {}
Expand All @@ -511,7 +507,6 @@ def test_closing_negotiation_step_1sat(node_factory, bitcoind, chainparams):
closing_negotiation_step(node_factory, bitcoind, chainparams, opts)


@unittest.skipIf(EXPERIMENTAL_FEATURES, "anchors uses quick-close, not negotiation")
def test_closing_negotiation_step_700sat(node_factory, bitcoind, chainparams):
"""Test that the closing fee negotiation step works, 700sat"""
opts = {}
Expand Down Expand Up @@ -3331,7 +3326,7 @@ def test_anysegwit_close_needs_feature(node_factory, bitcoind):

def test_close_feerate_range(node_factory, bitcoind, chainparams):
"""Test the quick-close fee range negotiation"""
l1, l2 = node_factory.line_graph(2, opts={'experimental-quick-close': None})
l1, l2 = node_factory.line_graph(2)

# Lowball the range here.
l1.rpc.close(l2.info['id'], feerange=['253perkw', 'normal'])
Expand Down

0 comments on commit b40cbe0

Please sign in to comment.