Skip to content

Tap HTLC revocation itest#1235

Closed
GeorgeTsagk wants to merge 2 commits intolightninglabs:masterfrom
GeorgeTsagk:aux-htlc-revocation-itest
Closed

Tap HTLC revocation itest#1235
GeorgeTsagk wants to merge 2 commits intolightninglabs:masterfrom
GeorgeTsagk:aux-htlc-revocation-itest

Conversation

@GeorgeTsagk
Copy link
Copy Markdown
Member

Description

Extends the breach itest to cover a breach scenario. We expect the revocation sweep to work for the assets.

The first commit is marked as temp as we need:

@GeorgeTsagk GeorgeTsagk self-assigned this Feb 19, 2026
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @GeorgeTsagk, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a critical integration test to validate the system's resilience against channel breaches involving HTLCs. By simulating a breach where a node attempts to broadcast a revoked channel state containing active HTLCs, the changes ensure that the justice transaction correctly sweeps all funds, including those from revoked HTLCs. This enhancement significantly improves the robustness of asset recovery mechanisms within the Lightning Terminal, alongside necessary dependency updates to support these new testing capabilities.

Highlights

  • HTLC Revocation Breach Test: Expanded the testCustomChannelsBreach integration test to cover a breach scenario involving revoked HTLCs. This ensures that the system correctly sweeps both commitment outputs and revoked HTLCs (offered and accepted) during a breach, verifying the integrity of asset recovery.
  • Dependency Updates and Replacements: Updated Go version to 1.25.5 and several Go module dependencies, including btcec/v2 and lnd/sqldb. Temporary replace directives were added for lnd and taproot-assets to point to specific development branches, facilitating ongoing work on dependent pull requests.
  • Asset Balance Consolidation Verification: Added a step to the breach test to verify that after a breach and subsequent justice transaction, the breached node can successfully consolidate all recovered assets into a single UTXO, confirming full asset recoverability.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • go.mod
    • Updated Go language version from 1.24.11 to 1.25.5.
    • Updated github.com/btcsuite/btcd/btcec/v2 from v2.3.4 to v2.3.6.
    • Updated github.com/lightningnetwork/lnd/sqldb to a newer development version.
    • Added temporary replace directives for github.com/lightninglabs/taproot-assets, github.com/lightninglabs/taproot-assets/taprpc, github.com/lightningnetwork/lnd/sqldb, and github.com/lightningnetwork/lnd to point to specific forks.
  • go.sum
    • Updated checksums for github.com/btcsuite/btcd/btcec/v2 to reflect the new version.
    • Added new checksum entries for the replaced lnd and taproot-assets modules from the author's fork.
    • Removed checksum entries for older versions of github.com/lightninglabs/taproot-assets and github.com/lightningnetwork/lnd.
  • itest/assets_test.go
    • Removed direct import of github.com/lightninglabs/taproot-assets.
    • Added import for github.com/lightninglabs/taproot-assets/rpcserver.
    • Updated ConfirmationText references from taprootassets.AssetBurnConfirmationText to rpcserver.AssetBurnConfirmationText.
  • itest/litd_custom_channels_test.go
    • Modified testCustomChannelsBreach to introduce HODL invoices and simulate HTLCs in flight before a breach.
    • Implemented logic to settle HODL invoices, thereby revoking the backed-up channel state with active HTLCs.
    • Added assertions to verify the number of active HTLCs before and after settlement.
    • Enhanced justice transaction verification to confirm it sweeps both commitment outputs and revoked HTLCs (offered and accepted).
    • Introduced a final check to ensure the breached node can consolidate all recovered assets into a single UTXO after the breach.
  • subservers/taproot-assets.go
    • Added import for github.com/lightninglabs/taproot-assets/tapconfig.
    • Updated references for UniversePublicAccessStatusRead and UniversePublicAccessStatusWrite to use tapconfig package constants.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

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

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 extends the channel breach integration test to cover a scenario with active HTLCs, which is a great addition for ensuring the correctness of Taproot Asset channel breach handling. The test logic appears sound, correctly setting up a breachable state with HODL invoices and then verifying that the justice transaction sweeps all expected outputs, including revoked HTLCs.

The changes also include some dependency updates and refactoring by moving constants, which are fine.

I've added comments regarding the temporary changes in go.mod to ensure they are reverted before the final merge.

module github.com/lightninglabs/lightning-terminal

go 1.24.11
go 1.25.5
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

As noted in the PR description, this Go version bump is temporary for development purposes. Please ensure this is reverted before merging if the dependency changes requiring it are not part of the final version of this PR.

Comment on lines +256 to +262
replace github.com/lightninglabs/taproot-assets => github.com/GeorgeTsagk/taproot-assets v0.0.0-20260216125845-2dd50064afbe

replace github.com/lightninglabs/taproot-assets/taprpc => github.com/GeorgeTsagk/taproot-assets/taprpc v0.0.0-20260216125845-2dd50064afbe

replace github.com/lightningnetwork/lnd/sqldb => github.com/GeorgeTsagk/lnd/sqldb v0.0.0-20260216125012-1bb47e1ca203

replace github.com/lightningnetwork/lnd => github.com/GeorgeTsagk/lnd v0.0.0-20260216125012-1bb47e1ca203
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

These replace directives point to personal forks to facilitate development across repositories. As noted in the PR description, these are temporary. Please ensure these are removed and the official dependencies are updated once the upstream PRs are merged.

@lightninglabs-deploy
Copy link
Copy Markdown

@Roasbeef: review reminder
@gijswijs: review reminder
@GeorgeTsagk, remember to re-request review from reviewers when ready

@GeorgeTsagk
Copy link
Copy Markdown
Member Author

Closing in favor of lightninglabs/taproot-assets#1994.

Itest is now natively introduced in taproot-assets, so this PR will no longer be needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants