-
Notifications
You must be signed in to change notification settings - Fork 137
Persist agreed quotes in RFQ service #1863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
3c33ca3 to
f0acc02
Compare
Pull Request Test Coverage Report for Build 19640788309Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 19038516198Details
💛 - Coveralls |
98bcb62 to
5a2bd52
Compare
5a2bd52 to
f7ebd34
Compare
f7ebd34 to
703a103
Compare
e74f4ab to
497b820
Compare
2b3ac4f to
035a840
Compare
497b820 to
7beb886
Compare
GeorgeTsagk
left a comment
There was a problem hiding this 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
GeorgeTsagk
left a comment
There was a problem hiding this 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
| // lightning node. | ||
| scid := msg.ShortChannelId() | ||
| m.peerAcceptedBuyQuotes.Store(scid, msg) | ||
| m.orderHandler.peerAcceptedBuyQuotes.Store(scid, msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we moving the maps to orderHandler if we end up calling them again from rfq.Manager?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason is that all these maps represent an in-memory store. The business layer does not care how the data is stored (it can be an in-memory cache, a Redis cache, a DB, etc). And we should ideally be able to switch between infras without changing the business.
We currently split these maps into the Manager and the OrderHandler. The idea we discussed with @ffranr is to move everything to the OrderHandler for now in a simple refactor in this PR, and then eventually move everything to tapdb (in a QuoteStore or PolicyStore).
Now, about this line: m.orderHandler.peerAcceptedBuyQuotes.Store(scid, msg). I agree it's ugly and I also don't like it so I could expose functions from the orderHandler like m.orderHandler.StoreBuyQuote(), equivalent to the future m.quoteStore.StoreBuyQuote() WDYT?
7beb886 to
d223874
Compare
d223874 to
75b90ba
Compare
Adds a new rfq_policies table and store allowing persistence of sale and purchase policies.
75b90ba to
9023608
Compare
RFQ buy/sell accepts are now written to the database (
rfq_policiestable) whenever a policy is agreed, giving us an audit trail and keeping quotes across restarts.The
OrderHandlerreloads these rows at startup to rebuild policies and the manager repopulates its in-memory caches from the same data.Added a check in
itestthat restarts Bob’stapdmid RFQ flow and verifies the quote remains available to Carol.Fixes #855