Skip to content

Tech: Mempool Rollback #393

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

Closed
andy-shi88 opened this issue Oct 31, 2019 · 1 comment · Fixed by #406 or #419
Closed

Tech: Mempool Rollback #393

andy-shi88 opened this issue Oct 31, 2019 · 1 comment · Fixed by #406 or #419
Assignees
Labels
CORE core functionalities FEATURE New feature or request
Milestone

Comments

@andy-shi88
Copy link
Contributor

andy-shi88 commented Oct 31, 2019

Description

Our current implementation of mempool doesn't has rollback capability, since there is no block_height field in it to reference. We'll need to implement rollback to mempool to avoid strange behaviour in the system.

case:

- client post tx -> got into mempool, spendable got decreased
- rollback happen, and mempool is still considered valid, but new account_balance.spendable has not been decreased yet, because the new last block does not recognized that new tx
- when block got pushed (tx got applied) it undo the unconfirmed action (a.k.a add money to spendable) this cause spendable balance > balance.

Breakdown

  • Mempool BlockHeight
  • Rollback and save into KV

Additional Diagram / File

Put additional diagram or file

@andy-shi88 andy-shi88 added FEATURE New feature or request CORE core functionalities labels Oct 31, 2019
@andy-shi88 andy-shi88 added this to the Milestone 9 milestone Oct 31, 2019
@astaphobia astaphobia self-assigned this Oct 31, 2019
@astaphobia
Copy link
Contributor

Start restoring mempool transactions after backup done in rollback process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CORE core functionalities FEATURE New feature or request
Projects
None yet
2 participants