Skip to content

[feature]: add taproot chan support to rbf-closer #9662

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

Open
Roasbeef opened this issue Apr 1, 2025 · 0 comments
Open

[feature]: add taproot chan support to rbf-closer #9662

Roasbeef opened this issue Apr 1, 2025 · 0 comments
Labels
channel closing Related to the closing of channels cooperatively and uncooperatively enhancement Improvements to existing features / behaviour protocol rbf

Comments

@Roasbeef
Copy link
Member

Roasbeef commented Apr 1, 2025

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:

lnd/server.go

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:

lnd/peer/brontide.go

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
}

@Roasbeef Roasbeef added channel closing Related to the closing of channels cooperatively and uncooperatively enhancement Improvements to existing features / behaviour protocol rbf labels Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
channel closing Related to the closing of channels cooperatively and uncooperatively enhancement Improvements to existing features / behaviour protocol rbf
Projects
None yet
Development

No branches or pull requests

1 participant