@@ -1329,20 +1329,15 @@ messages are), they are independent of requirements here.
1329
1329
1 . type: 1 (` next_to_send ` )
1330
1330
2 . data:
1331
1331
* [ ` tu64 ` :` commitment_number ` ]
1332
- 1 . type: 3 (` desired_type ` )
1332
+ 1 . type: 3 (` desired_channel_type ` )
1333
1333
2 . data:
1334
- * [ ` channel_type ` :` type ` ]
1335
- 1 . type: 5 (` current_type ` )
1334
+ * [ ` ...*byte ` :` type ` ]
1335
+ 1 . type: 5 (` current_channel_type ` )
1336
1336
2 . data:
1337
- * [ ` channel_type ` :` type ` ]
1338
- 1 . type: 7 (` upgradable ` )
1337
+ * [ ` ...*byte ` :` type ` ]
1338
+ 1 . type: 7 (` upgradable_channel_type ` )
1339
1339
2 . data:
1340
- * [ ` ...*channel_type ` :` upgrades ` ]
1341
-
1342
- 1 . subtype: ` channel_type `
1343
- 2 . data:
1344
- * [ ` u16 ` :` len ` ]
1345
- * [ ` len*byte ` :` features ` ]
1340
+ * [ ` ...*byte ` :` type ` ]
1346
1341
1347
1342
` next_commitment_number ` : A commitment number is a 48-bit
1348
1343
incrementing counter for each commitment transaction; counters
@@ -1569,38 +1564,31 @@ channel upgraded and the other not. But this will eventually be
1569
1564
resolved: the channel cannot progress until both sides have received
1570
1565
` channel_reestablish ` anyway.
1571
1566
1572
- Channel features are explicitly enumerated as ` channel_type `
1573
- bitfields, using odd features bits. The currently defined types are:
1574
- - no features (no bits set)
1575
- - ` option_static_remotekey ` (bit 13)
1576
- - ` option_anchor_outputs ` and ` option_static_remotekey ` (bits 21 and 13)
1577
- - ` option_anchors_zero_fee_htlc_tx ` and ` option_static_remotekey ` (bits 23 and 13)
1578
-
1579
1567
#### Requirements
1580
1568
1581
1569
A node sending ` channel_reestablish ` , if it supports upgrading channels:
1582
1570
- MUST set ` next_to_send ` the commitment number of the next ` commitment_signed ` it expects to send.
1583
1571
- if it initiated the channel:
1584
- - MUST set ` desired_type ` to the channel_type it wants for the channel.
1572
+ - MUST set ` desired_channel_type ` to the defined channel type it wants for the channel.
1585
1573
- otherwise:
1586
- - MUST set ` current_type ` to the current channel_type of the channel.
1587
- - MUST set ` upgradable ` to the channel types it could change to.
1588
- - MAY not set ` upgradable ` if it would be empty .
1574
+ - MUST set ` current_channel_type ` to the current channel type of the channel.
1575
+ - If it sets ` upgradable_channel_type ` :
1576
+ - MUST set it to a defined channel type it could change to .
1589
1577
1590
1578
A node receiving ` channel_reestablish ` :
1591
1579
- if it has to retransmit ` commitment_signed ` or ` revoke_and_ack ` :
1592
- - MUST consider the channel feature change failed.
1580
+ - MUST consider the channel type change failed.
1593
1581
- if ` next_to_send ` is missing, or not equal to the ` next_commitment_number ` it sent:
1594
- - MUST consider the channel feature change failed.
1582
+ - MUST consider the channel type change failed.
1595
1583
- if updates are pending on either sides' commitment transaction:
1596
- - MUST consider the channel feature change failed.
1584
+ - MUST consider the channel type change failed.
1597
1585
- otherwise:
1598
- - if ` desired_type ` matches ` current_type ` or any ` upgradable ` ` upgrades ` :
1599
- - MUST consider the channel type to be ` desired_type ` .
1586
+ - if ` desired_channel_type ` matches ` current_channel_type ` or ` upgradable_channel_type ` :
1587
+ - MUST consider the channel type to be ` desired_channel_type ` .
1600
1588
- otherwise:
1601
- - MUST consider the channel feature change failed.
1602
- - if there is a ` current_type ` field:
1603
- - MUST consider the channel type to be ` current_type ` .
1589
+ - MUST consider the channel type change failed.
1590
+ - if there is a ` current_channel_type ` field:
1591
+ - MUST consider the channel type to be ` current_channel_type ` .
1604
1592
1605
1593
#### Rationale
1606
1594
@@ -1618,17 +1606,17 @@ are attempted (all of which require successful exchange of
1618
1606
` channel_reestablish ` messages).
1619
1607
1620
1608
On reconnect, if only the initiator is upgraded, it will reflect this
1621
- upgrade in the next ` desired_type ` , causing the non-initiator to
1609
+ upgrade in the next ` desired_channel_type ` , causing the non-initiator to
1622
1610
upgrade. If only the non-initiator is upgraded, it will be reflected
1623
- in ` current_type ` and the initiator will consider itself upgraded.
1624
-
1625
- There can be desynchronization across multiple upgrades. Both nodes
1626
- start on channel_type A, initiator sets ` desired_type ` B , receives
1627
- ` channel_reestablish ` from A which has B in ` upgradable ` , but B
1628
- doesn't receive ` channel_reestablish ` . On reconnect, initiator tries
1629
- to upgrade again, setting ` desired_type ` to C , which is not in B's
1630
- ` upgradable ` so fails. This is why, on such a failed upgrade, the
1631
- initiator considers the ` current_type ` given by the non-initiator to
1611
+ in ` current_channel_type ` and the initiator will consider itself upgraded.
1612
+
1613
+ There can be desynchronization across multiple upgrades. Both A and B nodes
1614
+ start on channel_type T1, A sets ` desired_channel_type ` T2 , receives
1615
+ ` channel_reestablish ` from B which has ` upgradable_channel_type ` T2 , but B
1616
+ doesn't receive ` channel_reestablish ` . On reconnect, A tries
1617
+ to upgrade again, setting ` desired_channel_type ` to T3 , which is not equal
1618
+ to B's ` upgradable_channel_type ` so fails. This is why, on such a failed upgrade, the
1619
+ initiator considers the ` current_channel_type ` given by the non-initiator to
1632
1620
be canonical.
1633
1621
1634
1622
# Authors
0 commit comments