taproot-assets icon indicating copy to clipboard operation
taproot-assets copied to clipboard

[feature]: log whose buy accept message is out-of-bounds

Open ZZiigguurraatt opened this issue 7 months ago • 3 comments

I run AddInvoice and an RFQ is attempted with 4 connected edge nodes. If a edge node's buy price is out of range, in the log I get

2025-05-27 17:07:22.400 [DBG] RFQS: Buy accept price is not within acceptable bounds (peer_asset_rate=AssetRate(rate=12000000000, expiry=2025-05-27T18:07:22Z), oracle_asset_rate=AssetRate(rate=10149999999.000000
0000, expiry=2025-05-27T17:07:57Z))

however, I have no idea what edge node this was when reading the log.

I'm not sure if the multi-RFQ is done in serial or parallel, so it's possible the previous log entries

2025-05-27 17:07:22.393 [DBG] RFQS: Manager handling outgoing message: BuyRequest(peer=0206982a7f16ab51e3f943fa16f8a232f3ee0f66b6ff2c7fb85d03a8e33d845462, id=f4614bf749a2d5e0a293ee67f3591cf48a5775e102b58b6ef7184
e1c10d9710b, asset=AssetSpecifier(id=af6ae4f3e3c3b7ba1932890b3f8d8ba8d5398ff446623a3c8055394617d8b511, group_pub_key=), max_asset_amount=220000000, asset_rate_hint=AssetRate(rate=10149999999.0000000000, expiry=2
025-05-27T17:07:57Z))
2025-05-27 17:07:22.393 [DBG] RFQS: Stream handling outgoing message: BuyRequest(peer=0206982a7f16ab51e3f943fa16f8a232f3ee0f66b6ff2c7fb85d03a8e33d845462, id=f4614bf749a2d5e0a293ee67f3591cf48a5775e102b58b6ef7184e
1c10d9710b, asset=AssetSpecifier(id=af6ae4f3e3c3b7ba1932890b3f8d8ba8d5398ff446623a3c8055394617d8b511, group_pub_key=), max_asset_amount=220000000, asset_rate_hint=AssetRate(rate=10149999999.0000000000, expiry=20
25-05-27T17:07:57Z))
2025-05-27 17:07:22.393 [DBG] RPCS: [/lnrpc.Lightning/SendCustomMessage] requested
2025-05-27 17:07:22.393 [DBG] PEER: Peer(0206982a7f16ab51e3f943fa16f8a232f3ee0f66b6ff2c7fb85d03a8e33d845462): Sending custom(type=52884) to 0206982a7f16ab51e3f943fa16f8a232f3ee0f66b6ff2c7fb85d03a8e33d845462@172.
99.0.13:60880
2025-05-27 17:07:22.399 [DBG] PEER: Peer(0206982a7f16ab51e3f943fa16f8a232f3ee0f66b6ff2c7fb85d03a8e33d845462): Received custom(type=52885) from 0206982a7f16ab51e3f943fa16f8a232f3ee0f66b6ff2c7fb85d03a8e33d845462@1
72.99.0.13:60880
2025-05-27 17:07:22.399 [DBG] SRVR: Custom message received: peer=0206982a7f16ab51e3f943fa16f8a232f3ee0f66b6ff2c7fb85d03a8e33d845462, type=52885
2025-05-27 17:07:22.399 [DBG] RFQS: Stream handling incoming message: BuyAccept(peer=0206982a7f16ab51e3f943fa16f8a232f3ee0f66b6ff2c7fb85d03a8e33d845462, id=f4614bf749a2d5e0a293ee67f3591cf48a5775e102b58b6ef7184e1
c10d9710b, asset_rate=AssetRate(rate=12000000000, expiry=2025-05-27T18:07:22Z), scid=17805067009257992459)
2025-05-27 17:07:22.400 [DBG] RFQS: Manager handling incoming message: BuyAccept(peer=0206982a7f16ab51e3f943fa16f8a232f3ee0f66b6ff2c7fb85d03a8e33d845462, id=f4614bf749a2d5e0a293ee67f3591cf48a5775e102b58b6ef7184e
1c10d9710b, asset_rate=AssetRate(rate=12000000000, expiry=2025-05-27T18:07:22Z), scid=17805067009257992459)
2025-05-27 17:07:22.400 [DBG] RFQS: Querying price oracle for bid price (asset_specifier=AssetSpecifier(id=af6ae4f3e3c3b7ba1932890b3f8d8ba8d5398ff446623a3c8055394617d8b511, group_pub_key=), asset_max_amt=Some(22
0000000), payment_max_amt=None, asset_rate_hint=Some({12000000000 2025-05-27 18:07:22 +0000 UTC}))

apply to this message and that's how I should identify what peer it is referring to.

Either we need to make the docs more clear that multi-RFQ is done in serial and not parallel, or make the log messages more specific.

ZZiigguurraatt avatar May 27 '25 17:05 ZZiigguurraatt

Based on https://github.com/lightninglabs/taproot-assets/issues/1571 it seems like it is going in serial and not parallel.

However, it seems to me like a better design would be for it to go in parallel since peer connection can be over TOR and might be slow.

ZZiigguurraatt avatar May 27 '25 19:05 ZZiigguurraatt

https://github.com/lightninglabs/taproot-assets/issues/1569 might be a better solution.

ZZiigguurraatt avatar Jul 01 '25 20:07 ZZiigguurraatt

(Adjusted the title and labels after review.)

jtobin avatar Aug 20 '25 09:08 jtobin