improvement(ordermatch): split trie from orderbook to reduce pre-propagation locking#2661
improvement(ordermatch): split trie from orderbook to reduce pre-propagation locking#2661
Conversation
- Add TrieOp::Flush to be used in ordermatch_tests.rs to wait for trie store commits to be finished - Fix ordermatch_tests.rs to match the changes
… in trie store worker
onur-ozkan
left a comment
There was a problem hiding this comment.
The PR description makes sense, but, doing all of them once in this PR alone causes massive change in a single module (lp_ordermatch) and it makes it difficult to review and understand them in a short time (it would be way easier/possible for me to review this if we could do this refactoring gradually in multiple PRs). Should we pass this QA and let them test it in detail instead?
Sure, it's already been tested extensively by @cipig for a few weeks. I will just fix your notes @onur-ozkan and merge this unless @dimxy have more comments. |
dimxy
left a comment
There was a problem hiding this comment.
LGTM
I'd suggest yet to start breaking lp_ordermatch.rs apart,
e.g. move TrieStore into new file.
Totally agree but it will introduce lots of conflicts in other open PRs. We can do that once our backlog is cleared. |
This PR removes the maker pubkeys trie state and the Patricia-trie memory db out of Orderbook into a dedicated trie store to reduce Orderbook locking time and let messages propagate before trie work.
Why
What changed
TrieOptypes under the index lock then applied by a separate worker.Compatibility
Effect
Future Work (Only suggestions)