Skip to content

Conversation

@darioAnongba
Copy link
Contributor

@darioAnongba darioAnongba commented Nov 3, 2025

RFQ buy/sell accepts are now written to the database (rfq_policies table) whenever a policy is agreed, giving us an audit trail and keeping quotes across restarts.

The OrderHandler reloads these rows at startup to rebuild policies and the manager repopulates its in-memory caches from the same data.

Added a check in itest that restarts Bob’s tapd mid RFQ flow and verifies the quote remains available to Carol.

Fixes #855

@darioAnongba darioAnongba self-assigned this Nov 3, 2025
@darioAnongba darioAnongba changed the base branch from main to 0-8-0-staging November 3, 2025 14:45
@coveralls
Copy link

coveralls commented Nov 3, 2025

Pull Request Test Coverage Report for Build 20035184886

Details

  • 410 of 530 (77.36%) changed or added relevant lines in 8 files are covered.
  • 8277 unchanged lines in 122 files lost coverage.
  • Overall coverage increased (+0.09%) to 56.735%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tapdb/sqlutils.go 22 28 78.57%
tapdb/sqlc/rfq.sql.go 53 61 86.89%
rfq/manager.go 11 23 47.83%
rfq/order.go 50 70 71.43%
tapdb/rfq_policies.go 263 337 78.04%
Files with Coverage Reduction New Missed Lines %
fn/context_guard.go 1 91.94%
authmailbox/client.go 2 66.67%
commitment/proof.go 2 87.29%
fn/retry.go 2 92.5%
tapdb/interfaces.go 2 78.33%
universe/interface.go 3 74.21%
commitment/encoding.go 4 68.75%
mssmt/encoding.go 4 76.67%
rpcutils/price_oracle_marshal.go 4 85.07%
tapsend/proof.go 4 85.99%
Totals Coverage Status
Change from base Build 20033169882: 0.09%
Covered Lines: 65264
Relevant Lines: 115034

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 19038516198

Details

  • 425 of 603 (70.48%) changed or added relevant lines in 5 files are covered.
  • 507 unchanged lines in 39 files lost coverage.
  • Overall coverage decreased (-0.3%) to 56.265%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rfq/manager.go 14 21 66.67%
tapdb/sqlc/rfq.sql.go 58 74 78.38%
rfq/order.go 28 72 38.89%
tapdb/rfq_policies.go 318 429 74.13%
Files with Coverage Reduction New Missed Lines %
proof/courier.go 1 78.88%
asset/asset.go 2 79.97%
asset/group_key.go 2 72.15%
fn/func.go 2 58.82%
tapdb/assets_common.go 2 77.97%
tapdb/migrations.go 2 76.19%
tapdb/sqlc/mssmt.sql.go 2 47.02%
tapdb/sqlc/transfers.sql.go 2 82.65%
tapdb/universe_federation.go 2 88.55%
tapdb/universe.go 2 80.35%
Totals Coverage Status
Change from base Build 18942913401: -0.3%
Covered Lines: 64373
Relevant Lines: 114410

💛 - Coveralls

@darioAnongba darioAnongba force-pushed the feat/persist-rfq branch 2 times, most recently from 98bcb62 to 5a2bd52 Compare November 3, 2025 15:17
@darioAnongba darioAnongba marked this pull request as ready for review November 3, 2025 15:17
@levmi levmi moved this from 🆕 New to 🏗 In progress in Taproot-Assets Project Board Nov 3, 2025
@levmi levmi added this to the v0.8 milestone Nov 3, 2025
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.

Just a few nits, will do a final pass soon

@darioAnongba darioAnongba moved this from 🏗 In progress to 👀 In review in Taproot-Assets Project Board Nov 17, 2025
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.

Looking good, dropped a few more comments

@darioAnongba darioAnongba changed the base branch from 0-8-0-staging to main November 24, 2025 10:11
@darioAnongba darioAnongba force-pushed the feat/persist-rfq branch 2 times, most recently from 75b90ba to 9023608 Compare November 24, 2025 16:03
@jtobin jtobin removed their request for review November 25, 2025 06:39
Copy link
Contributor

@ffranr ffranr left a comment

Choose a reason for hiding this comment

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

Just a few more trivial points to consider, otherwise this PR is pretty much there IMO.

rfq/order.go Outdated
Comment on lines 548 to 551
// QuoteID returns the RFQ identifier that originated this policy.
func (c *AssetPurchasePolicy) QuoteID() (rfqmsg.ID, bool) {
return c.AcceptedQuoteId, true
}
Copy link
Contributor

@ffranr ffranr Dec 3, 2025

Choose a reason for hiding this comment

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

I don't think this is called anywhere so it can be removed here and in the Policy interface. I might be wrong. Why does this have a bool return value? We could use fn.Option perhaps? But I think this method can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true! Residue of the old implementation with active field. Removed.

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.

Looks good, some last optional nits provided below

Adds a new rfq_policies table and store allowing persistence of sale and purchase policies.
refactors the current quote in-memory storage away from the Manager
into the OrderHandler to encapsulate all quote storage operations
in the same component.
@darioAnongba darioAnongba added this pull request to the merge queue Dec 8, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 8, 2025
@darioAnongba darioAnongba added this pull request to the merge queue Dec 8, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 8, 2025
@darioAnongba darioAnongba added this pull request to the merge queue Dec 8, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 8, 2025
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]: Persist agreed quotes in RFQ service

7 participants