Skip to content

Commit 0b6b40b

Browse files
committed
close: spec is final, it's not experimental.
That was quick! We remove the 50% test, since the default is now to use quickclose. Signed-off-by: Rusty Russell <[email protected]>
1 parent 29acfbd commit 0b6b40b

12 files changed

+14
-70
lines changed

doc/lightning-close.7

+5-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/lightning-close.7.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ friends to upgrade!
3333

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

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

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

7371
Rates are one of the strings *urgent* (aim for next block), *normal*
7472
(next 4 blocks or so) or *slow* (next 100 blocks or so) to use

doc/lightning-listconfigs.7

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/lightning-listconfigs.7.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ On success, an object is returned, containing:
5555
- **experimental-dual-fund** (boolean, optional): `experimental-dual-fund` field from config or cmdline, or default
5656
- **experimental-onion-messages** (boolean, optional): `experimental-onion-messages` field from config or cmdline, or default
5757
- **experimental-offers** (boolean, optional): `experimental-offers` field from config or cmdline, or default
58-
- **experimental-quick-close** (boolean, optional): `experimental-quick-close` field from config or cmdline, or default
5958
- **experimental-shutdown-wrong-funding** (boolean, optional): `experimental-shutdown-wrong-funding` field from config or cmdline, or default
6059
- **rgb** (hex, optional): `rgb` field from config or cmdline, or default (always 6 characters)
6160
- **alias** (string, optional): `alias` field from config or cmdline, or default
@@ -206,4 +205,4 @@ RESOURCES
206205
---------
207206

208207
Main web site: <https://github.com/ElementsProject/lightning>
209-
[comment]: # ( SHA256STAMP:8b198154e70e1c0acb6c9ccdbe9e41e35ddab55738be9ea9076c5384da965cb8)
208+
[comment]: # ( SHA256STAMP:7bb40fc8fac201b32d9701b02596d0fa59eb14a3baf606439cbf96dc11548ed4)

doc/lightningd-config.5

+1-11
Original file line numberDiff line numberDiff line change
@@ -625,16 +625,6 @@ about whether to add funds or not to a proposed channel is handled
625625
automatically by a plugin that implements the appropriate logic for
626626
your needs\. The default behavior is to not contribute funds\.
627627

628-
629-
\fBexperimental-quick-close\fR
630-
631-
632-
Specifying this means we send our range of acceptable fees to the peer
633-
on mutual close\. If they support it too, we'll simply use that for
634-
closing (unless \fIfee_negotiation_step\fR is set, see \fBlightning-close\fR(7))\.
635-
We always use this on channels which negotiation \fBoption_anchor_outputs\fR,
636-
as the spec requires that\.
637-
638628
.SH BUGS
639629

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

663-
\" SHA256STAMP:0d2474276b325cb002191211fb1d0da2409ebc859ff3ccc6dd3e688b10d4550c
653+
\" SHA256STAMP:1c392f3fee66dc6c1fc2c34200204a9be1d79e53fd5fb1720ad169fc671f71c0

doc/lightningd-config.5.md

-8
Original file line numberDiff line numberDiff line change
@@ -517,14 +517,6 @@ about whether to add funds or not to a proposed channel is handled
517517
automatically by a plugin that implements the appropriate logic for
518518
your needs. The default behavior is to not contribute funds.
519519

520-
**experimental-quick-close**
521-
522-
Specifying this means we send our range of acceptable fees to the peer
523-
on mutual close. If they support it too, we'll simply use that for
524-
closing (unless *fee_negotiation_step* is set, see lightning-close(7)).
525-
We always use this on channels which negotiation `option_anchor_outputs`,
526-
as the spec requires that.
527-
528520
BUGS
529521
----
530522

doc/schemas/listconfigs.schema.json

-4
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,6 @@
117117
"type": "boolean",
118118
"description": "`experimental-offers` field from config or cmdline, or default"
119119
},
120-
"experimental-quick-close": {
121-
"type": "boolean",
122-
"description": "`experimental-quick-close` field from config or cmdline, or default"
123-
},
124120
"experimental-shutdown-wrong-funding": {
125121
"type": "boolean",
126122
"description": "`experimental-shutdown-wrong-funding` field from config or cmdline, or default"

lightningd/closing_control.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,8 @@ void peer_start_closingd(struct channel *channel,
312312
channel->shutdown_scriptpubkey[REMOTE],
313313
channel->closing_fee_negotiation_step,
314314
channel->closing_fee_negotiation_step_unit,
315-
(ld->use_quickclose
316315
/* Don't quickclose if they specified how to negotiate! */
317-
&& channel->closing_fee_negotiation_step == 50
316+
(channel->closing_fee_negotiation_step == 50
318317
&& channel->closing_fee_negotiation_step_unit == CLOSING_FEE_NEGOTIATION_STEP_UNIT_PERCENTAGE)
319318
/* Always use quickclose with anchors */
320319
|| channel->option_anchor_outputs,

lightningd/lightningd.c

-5
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,6 @@ static struct lightningd *new_lightningd(const tal_t *ctx)
295295
* case this is a pointer to an enum feerate-indexed array of values */
296296
ld->force_feerates = NULL;
297297

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

lightningd/lightningd.h

-3
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,6 @@ struct lightningd {
283283
/* Should we re-exec ourselves instead of just exiting? */
284284
bool try_reexec;
285285

286-
/* --experimental-quick-close */
287-
bool use_quickclose;
288-
289286
/* Array of (even) TLV types that we should allow. This is required
290287
* since we otherwise would outright reject them. */
291288
u64 *accept_extra_tlv_types;

lightningd/options.c

-4
Original file line numberDiff line numberDiff line change
@@ -1062,10 +1062,6 @@ static void register_opts(struct lightningd *ld)
10621062
"--subdaemon=hsmd:remote_signer "
10631063
"would use a hypothetical remote signing subdaemon.");
10641064

1065-
opt_register_noarg("--experimental-quick-close",
1066-
opt_set_bool, &ld->use_quickclose,
1067-
"EXPERIMENTAL: offer range to mutual close");
1068-
10691065
opt_register_logging(ld);
10701066
opt_register_version();
10711067

tests/test_closing.py

+1-16
Original file line numberDiff line numberDiff line change
@@ -461,21 +461,6 @@ def test_closing_negotiation_step_30pct(node_factory, bitcoind, chainparams):
461461
closing_negotiation_step(node_factory, bitcoind, chainparams, opts)
462462

463463

464-
@unittest.skipIf(EXPERIMENTAL_FEATURES, "anchors uses quick-close, not negotiation")
465-
def test_closing_negotiation_step_50pct(node_factory, bitcoind, chainparams):
466-
"""Test that the closing fee negotiation step works, 50%, the default"""
467-
opts = {}
468-
opts['fee_negotiation_step'] = '50%'
469-
470-
opts['close_initiated_by'] = 'opener'
471-
opts['expected_close_fee'] = 20334 if not chainparams['elements'] else 25789
472-
closing_negotiation_step(node_factory, bitcoind, chainparams, opts)
473-
474-
opts['close_initiated_by'] = 'peer'
475-
opts['expected_close_fee'] = 20334 if not chainparams['elements'] else 25789
476-
closing_negotiation_step(node_factory, bitcoind, chainparams, opts)
477-
478-
479464
@unittest.skipIf(EXPERIMENTAL_FEATURES, "anchors uses quick-close, not negotiation")
480465
def test_closing_negotiation_step_100pct(node_factory, bitcoind, chainparams):
481466
"""Test that the closing fee negotiation step works, 100%"""
@@ -3331,7 +3316,7 @@ def test_anysegwit_close_needs_feature(node_factory, bitcoind):
33313316

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

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

0 commit comments

Comments
 (0)