-
Notifications
You must be signed in to change notification settings - Fork 19
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
Use lmdb store for swap requests #16
Conversation
(cherry picked from commit f1f23c4295097e0f806098647dcc2a4d31715355)
(cherry picked from commit 7ab6d3086e4c946ef117ed244bd33c87ff5b9142)
pub enum SwapStatus { | ||
Unprocessed, | ||
InProcess { kernel_hash: Hash }, | ||
Completed { kernel_hash: Hash, block_hash: Hash }, |
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.
We don't use the Completed status yet, nor do we delete SwapData entries after they've long been confirmed. That will be added as part of #8
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.
I didn't run the code. I plan to do that towards the end of the milestone when the thing is complete to avoid too much manual testing in between. I did go through the code and this looks good to me 👍
#[derive(Clone, Debug, PartialEq)] | ||
pub enum SwapStatus { | ||
Unprocessed, | ||
InProcess { kernel_hash: Hash }, |
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.
nitpick: At first I wrongly assumed the InProcess was during the round communication when it's really after it's been sent to the mempool and before being sealed on the chain. Might make sense to add a comment explaining these.
Rather than use an in-memory cache for swap requests waiting to be processed, we switch to using an lmdb database to avoid data loss in the event of a process interruption.
Fixes #5