-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Is your feature request related to a problem? Please describe.
Today we don't allow the new RBF close feature to be activated with taproot channels, we'll error out on start up here:
Lines 615 to 624 in b01f4e5
| // For now, the RBF coop close flag and the taproot channel type cannot | |
| // be used together. | |
| // | |
| // TODO(roasbeef): fix | |
| if cfg.ProtocolOptions.RbfCoopClose && | |
| cfg.ProtocolOptions.TaprootChans { | |
| return nil, fmt.Errorf("RBF coop close and taproot " + | |
| "channels cannot be used together") | |
| } |
Describe the solution you'd like
We should fix this by adding the additional nonce logic needed to support taproot channels w/ the new rbf coop close flow. This is very similar to the nonce handling we use for the existing legacy close protocol.
The spec currently lacks a section detailing the changes to support the taproot channels, this comment is the current best source of truth for the protocol extension: lightning/bolts#1205 (comment).
Additional context
As a stop gap (as there's some spec work needed here), we should update this section to just create a normal chan closer if the channel is a taproot channel, and the RBF close feature is enabled:
Lines 3321 to 3340 in b01f4e5
| // If the new RBF co-op close is negotiated, then we'll init and start | |
| // that state machine, skipping the steps for the negotiate machine | |
| // below. | |
| if p.rbfCoopCloseAllowed() { | |
| _, err := p.initRbfChanCloser(lnChan) | |
| if err != nil { | |
| return nil, fmt.Errorf("unable to init rbf chan "+ | |
| "closer during restart: %w", err) | |
| } | |
| shutdownDesc := fn.MapOption( | |
| newRestartShutdownInit, | |
| )(shutdownInfo) | |
| err = p.startRbfChanCloser( | |
| fn.FlattenOption(shutdownDesc), lnChan.ChannelPoint(), | |
| ) | |
| return nil, err | |
| } |