-
Notifications
You must be signed in to change notification settings - Fork 116
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
Clear mempool at a network upgrade #2773
Conversation
The issue I'm working on also needs a |
@conradoplg, have a look at #2785. |
GitHub (wrongly?) closed this when I merged #2785 🤔 |
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.
Please feel free to merge as soon as #2777 is merged into this PR - I don't need to review again.
* Clear the mempool by using a sync method * Update docs * Apply suggestions from code review Co-authored-by: teor <teor@riseup.net> * Refactor last_tip_change() * Apply suggestions from code review Co-authored-by: Janito Vaqueiro Ferreira Filho <janito.vff@gmail.com> * Fix brackets * Use best_tip_block instead of manual borrowing Co-authored-by: teor <teor@riseup.net> Co-authored-by: teor <teor@riseup.net> Co-authored-by: Janito Vaqueiro Ferreira Filho <janito.vff@gmail.com>
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.
Approving per @teor2345's comment (I also did a quick review)
Motivation
Zebra needs a fresh mempool at each network upgrade.
Solution
At the moment, the implementation uses
now_or_never()
so thattip_change()
behaves like a synchronous function. I tried other ways to approach this but to no avail.The mempool is cleared whenever
tip_change()
returnsTipAction::Reset
, i.e.:ChainTipChange
], which is behind the current tip,Chain
], also known as a rollback, andI labeled it as a draft since I'm not sure about the solution.
Closes #2761.