Skip to content

Conversation

@darioAnongba
Copy link
Contributor

This PR adds RFQ forward history tracking, allowing edge nodes to monitor and query their asset forwarding activity and fee revenue. Edge nodes need visibility into their RFQ forwarding activity to:

  • Track fee revenue earned from routing asset payments
  • Monitor forwarding volume
  • Audit historical forwarding events
  • Generate reports on routing performance

Changes

  • New rfq_forwards table to store forward events
  • QueryRfqForwards: New RPC endpoint
    • Filters: min/max timestamp, peer pubkey, asset ID, group key
    • Pagination: limit and offset support
    • Returns: forward records with joined policy data (peer, asset info)
  • tapcli rfqrpc forwards: Query forward history from CLI with filters --min-timestamp, --max-timestamp, --peer, --asset-id, --group-key, --limit, --offset

Fixes #1005

gemini-code-assist[bot]

This comment was marked as outdated.

@darioAnongba darioAnongba moved this from 🆕 New to 👀 In review in Taproot-Assets Project Board Dec 22, 2025
@darioAnongba darioAnongba force-pushed the feat/forward-history branch 2 times, most recently from 26178d0 to 5e71beb Compare December 22, 2025 13:45
@coveralls
Copy link

coveralls commented Dec 22, 2025

Pull Request Test Coverage Report for Build 20822584845

Details

  • 526 of 1126 (46.71%) changed or added relevant lines in 15 files are covered.
  • 8326 unchanged lines in 126 files lost coverage.
  • Overall coverage decreased (-7.2%) to 49.803%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tapdb/rfq_policies.go 4 5 80.0%
rfq/manager.go 9 13 69.23%
taprpc/rfqrpc/rfq_grpc.pb.go 17 26 65.38%
lndservices/router_client.go 0 13 0.0%
rpcserver.go 82 102 80.39%
taprpc/rfqrpc/rfq.pb.json.go 0 21 0.0%
tapdb/sqlc/rfq.sql.go 76 104 73.08%
cmd/commands/rfq.go 0 55 0.0%
tapdb/rfq_forwards.go 162 222 72.97%
taprpc/rfqrpc/rfq.pb.gw.go 1 63 1.59%
Files with Coverage Reduction New Missed Lines %
fn/context_guard.go 1 91.94%
taprpc/rfqrpc/rfq_grpc.pb.go 1 67.01%
taprpc/rfqrpc/rfq.pb.gw.go 1 2.95%
authmailbox/client.go 2 69.84%
commitment/proof.go 2 87.29%
fn/retry.go 2 92.5%
tapdb/interfaces.go 2 80.83%
universe/archive.go 2 81.96%
universe/interface.go 3 74.21%
commitment/encoding.go 4 68.75%
Totals Coverage Status
Change from base Build 20795920245: -7.2%
Covered Lines: 57769
Relevant Lines: 115994

💛 - Coveralls

@lightninglabs lightninglabs deleted a comment from gemini-code-assist bot Dec 22, 2025
@darioAnongba darioAnongba force-pushed the feat/forward-history branch 2 times, most recently from 72a580d to acff712 Compare December 23, 2025 12:58
Copy link
Member

@GeorgeTsagk GeorgeTsagk left a comment

Choose a reason for hiding this comment

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

Direction looking good

@lightninglabs-deploy
Copy link

@jtobin: review reminder
@ffranr: review reminder
@darioAnongba, remember to re-request review from reviewers when ready

@darioAnongba darioAnongba force-pushed the feat/forward-history branch 2 times, most recently from 75f3c39 to 5769d7d Compare January 5, 2026 16:55
payReq := ts.CarolLnd.RPC.DecodePayReq(invoice.PaymentRequest)

// Construct route: Alice -> Bob -> Carol.
routeBuildResp := ts.AliceLnd.RPC.BuildRoute(
Copy link
Member

Choose a reason for hiding this comment

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

Why not just use normal invoices here? Would make the test a bit simpler as then you just make the invoice and all the RFQ related stuff is handled.

@darioAnongba darioAnongba linked an issue Jan 7, 2026 that may be closed by this pull request
@darioAnongba darioAnongba force-pushed the feat/forward-history branch 2 times, most recently from 5412e68 to db0a707 Compare January 8, 2026 12:34
Adds a new rfq_forwards table migration with its associated
models and queries:
- Query forwards with filters
- Count forwards
- Adds the forward store in the DB layer.
- Moves business entities from the DB layer to the RFQ layer.
- Defines Forward Store interface and entities.
On settle event from LND, log the
RFQ forward event into the DB.
@darioAnongba darioAnongba requested review from GeorgeTsagk and Roasbeef and removed request for ffranr and jtobin January 8, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

[feature]: how to calculate Exchange at Edge-Node [feature]: Provide "forwarding history" for Edge Nodes

6 participants