Skip to content

tapchannel+itest: implement AuxCloseShape and cover the coop close fee baseline - #2091

Merged
darioAnongba merged 2 commits into
mainfrom
test/chancloser-aux-outputs
Aug 28, 2026
Merged

tapchannel+itest: implement AuxCloseShape and cover the coop close fee baseline#2091
darioAnongba merged 2 commits into
mainfrom
test/chancloser-aux-outputs

Conversation

@darioAnongba

@darioAnongba darioAnongba commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Adds the tapd side of lightningnetwork/lnd#10969, which fixes the initial coop close fee baseline for channels with auxiliary close outputs, together with a regression itest.

AuxCloseShape implementation

AuxChanCloser.AuxCloseShape returns the fee-independent shape of the auxiliary close outputs: one P2TR entry per party with a non-zero asset balance. lnd uses this shape to include the aux output weight in the coop close fee baseline, and validates the concrete outputs returned by AuxCloseOutputs against it before signing a proposal. The close fee only affects the values of the asset outputs, never their number or script sizes, which is the invariant that makes the shape fee-independent.

The first commit bumps lnd to a master version that contains the new interface method.

Regression itest

coop_close_fee_baseline opens an asset channel and cooperatively closes it at the relay floor fee rate (1 sat/vByte), asserting that the close transaction confirms and carries the expected auxiliary output. At the relay floor there is no headroom: a fee baseline that omits the aux output weight produces a close transaction below the relay fee rate, which the mempool rejects, and the test times out waiting for the close.

Run with make itest-cc cccase=coop_close_fee_baseline.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a regression test for cooperative close fee estimation when auxiliary outputs are present, ensuring that closing at the relay floor remains successful. It also adds helper functions closeAssetChannelWithFeeAndAssert and waitForClosePendingUpdate to facilitate testing channel closures with specific fee rates. Feedback suggests replacing the magic number 1000 with a named constant for better maintainability and improving the reliability of channel closure operations by using a longer timeout and applying it to the CloseChannel RPC call.

Comment thread itest/custom_channels/fee_test.go
Comment thread itest/custom_channels/helpers.go
@darioAnongba darioAnongba changed the title [codex] itest: add chancloser aux output regression coverage itest: add chancloser aux output regression coverage Apr 22, 2026
@darioAnongba darioAnongba self-assigned this Apr 22, 2026
@lightninglabs lightninglabs deleted a comment from gemini-code-assist Bot Aug 27, 2026
@darioAnongba
darioAnongba force-pushed the test/chancloser-aux-outputs branch from d25dda6 to f087881 Compare August 28, 2026 10:46
@lightninglabs lightninglabs deleted a comment from coveralls Aug 28, 2026
@darioAnongba darioAnongba changed the title itest: add chancloser aux output regression coverage tapchannel+itest: implement AuxCloseShape and cover the coop close fee baseline Aug 28, 2026
@darioAnongba darioAnongba moved this from 🆕 New to 🏗 In progress in Taproot-Assets Project Board Aug 28, 2026
@darioAnongba
darioAnongba marked this pull request as ready for review August 28, 2026 10:51
@litbot-9000

Copy link
Copy Markdown

@darioAnongba, remember to re-request review from reviewers when ready

@GeorgeTsagk GeorgeTsagk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
pending LND PR and final go.mod replace

@github-project-automation github-project-automation Bot moved this from 🏗 In progress to 👀 In review in Taproot-Assets Project Board Aug 28, 2026
Bumps lnd to pull in the AuxCloseShape interface method
(lightningnetwork/lnd#10969) and implements it: one P2TR entry per
party with a non-zero asset balance. The close fee only affects the
values of the asset outputs, never their number or script sizes.

Also updates the lntest harness call to the NewNodeWatchOnly API.
@darioAnongba
darioAnongba force-pushed the test/chancloser-aux-outputs branch from f087881 to d2d85bf Compare August 28, 2026 15:02
Closes an asset channel at the relay floor fee rate and asserts the
close transaction confirms with the expected auxiliary output. A fee
baseline that omits the aux output weight underprices the close
transaction, which is then rejected by the mempool and the test times
out waiting for the close.
@darioAnongba
darioAnongba force-pushed the test/chancloser-aux-outputs branch from d2d85bf to 5c2b5e6 Compare August 28, 2026 16:23
@darioAnongba
darioAnongba added this pull request to the merge queue Aug 28, 2026
Merged via the queue into main with commit af41397 Aug 28, 2026
42 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Taproot-Assets Project Board Aug 28, 2026
@darioAnongba
darioAnongba deleted the test/chancloser-aux-outputs branch August 28, 2026 17:09
jtobin pushed a commit that referenced this pull request Sep 2, 2026
tapchannel+itest: implement AuxCloseShape and cover the coop close fee baseline

(cherry picked from commit af41397)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

chancloser: account for aux close outputs in initial coop close fee baseline

3 participants