Skip to content
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

[bug]: Mailbox Collisions in Hashmail Proof Courier When Closing Tap Asset Lightning Channels #1113

Open
ffranr opened this issue Aug 29, 2024 · 2 comments
Labels
bug Something isn't working P2 proofs transfers

Comments

@ffranr
Copy link
Contributor

ffranr commented Aug 29, 2024

A bug has been encountered when closing a Tap Asset Lightning Channel using the Hashmail proof courier. The issue arises in the process of delivering the channel close proof to the channel counterparty peer.

Observed Behavior

When closing a Tap Asset Lightning Channel, the same script pub key is used for all receiving peers. As a result, mailbox collisions occur when the Hashmail proof courier service is used to facilitate proof transfers. This happens because mailbox addresses are derived from the receiver's script pub key, and the Hashmail service only allows a single client connection to wait on a receiver's ACK stream for a given mailbox. Consequently, all channel-closing peers must process sequentially, leading to potential connection timeouts if a receiver delays returning an ACK. In practice, this blocks all proof transfers for channel closures using the Hashmail service.

This behavior has been observed when using the Polar testing framework, the frontend-regtest framework, and was also reproduced in a lightning-terminal integration test.

The earliest version of tapd where this has been observed is v0.4.0-alpha. It may occur in earlier versions.

Steps to Reproduce

  1. Set up a Tap Asset Lightning Channel.
  2. Close the channel while using the Hashmail proof courier.
  3. Observe that the same script pub key is used independent of the receiving peer. In other words, every receiving peer will use the same script pub key and therefore the same Hashmail service mailbox (for receiver ACK).

Suggested Fix

Investigate alternative methods for designating mailboxes in the Hashmail proof courier service that ensure each peer has a unique mailbox for proof transfer. This might involve using an identifier other than the script pub key to avoid mailbox conflicts and allow for concurrent processing of channel close proof transfers.

Priority

Low - The Hashmail proof courier is not the default proof courier for Tap Nodes.

@ffranr ffranr added bug Something isn't working proofs transfers P2 labels Aug 29, 2024
@ffranr
Copy link
Contributor Author

ffranr commented Aug 29, 2024

PR which investigated this bug: #1104

Itest modifications to reproduce the bug in lightning-terminal: #1104 (comment)

Mailbox SID where collision is observed: 2a59fe87c90d5de0a883e280681e4d72fb2c74ceeee462a3e4ae938fe7e3015ef30806eff1be1daf399cd756c26da002d12b3e562d4b72cd8670071af20b0e8e

@Roasbeef
Copy link
Member

A solution here may be to revamp the way we compute stream_id. We can use a new proof courier URI for this. We want something that isn't solely dependent on public data. As is, we have the script_key stored in the address itself, or the given output, this is under control of the receiver(s). We can then combine that with an expose public key from the set of inputs, via ECDH to compute the stream_id needed for the transfer. This looks similar to the way silent payments works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 proofs transfers
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants