Skip to content

[bug]: AuxTrafficShaper.PaymentBandwidth should check quote against the asset ID and peer #1374

Open
@GeorgeTsagk

Description

Description

Currently, when dispatching an asset payment over tapd we acquire a quote and provide it as a "hint" to the lnd call SendPaymentV2 via the first hop custom records field.

This field is later on used by LND to query channel bandwidth by calling the PaymentBandwidth tapd hook where the htlcBlob containing the previous quote is provided.

At this point any asset channel will try to provide their bandwidth as they can calculate it locally (i.e external to lnd). During that calculation, bandwidth is produced based on the asset units available and the provided quote in the htlcBlob, which is also looked up locally.

Problem

An asset channel may proceed with the bandwidth calculation based on a quote that is not meant for that asset ID. If selected by LND, it will then produce wrong htlc records, causing the payment to fail because of strict forwarding on the rfq peer's side.

Solution

The AuxTrafficShaper.PaymentBandwidth hook should make sure that the quote corresponds to the asset IDs present in the channel, plus verify that the rfq peer is the channel peer.

Activity

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

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions