rfq+tapdb: persist peer-accepted sell quotes#2051
rfq+tapdb: persist peer-accepted sell quotes#2051jtobin wants to merge 4 commits intolightninglabs:mainfrom
Conversation
Expand the rfq_policies CHECK constraint to allow a fourth policy type, RFQ_POLICY_TYPE_PEER_ACCEPTED_SELL, and bump LatestMigrationVersion to 55. This follows the same table-recreation pattern used in migration 053 for peer-accepted buy quotes.
FetchAcceptedQuotes Add the RfqPolicyTypeAssetPeerAcceptedSell constant and the StorePeerAcceptedSellQuote method to the PolicyStore interface and its PersistedPolicyStore implementation. Update FetchAcceptedQuotes to return a fourth slice containing peer-accepted sell quotes.
Persist peer-accepted sell quotes to the DB on acceptance in the SellAccept handler, and restore them into the peerSellQuotes cache on startup. Update mock PolicyStores and add DB-level round-trip tests for the new policy type.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request completes the persistence requirements for RFQ (Request for Quote) policies by adding support for peer-accepted sell quotes. By persisting these quotes to the database, the system ensures that sell-side payment flows remain consistent and survive application restarts, effectively resolving the remaining work for "gap 3". Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request implements the persistence of peer-accepted sell quotes to the database, ensuring that sell-side payment flows survive restarts by being restored into the active cache on startup. The changes include an update to the PolicyStore interface, a new database migration (version 55), and logic in the Manager and OrderHandler to handle the storage and restoration of these quotes. Feedback was provided to use structured logging for error messages in rfq/manager.go to align with the repository's style guide.
Partially addresses #2003 (together with the peer-accepted buy quote persistence that was added in #2009, this fully resolves "gap 3").
Persists peer-accepted sell quotes to the database. Quotes are now written to the
rfq_policiestable on acceptance and restored into the in-memory cache on restart, mirroring our existing practice for buy-side persistence.