Skip to content
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

[txpool] Implement removal of txs that are included into chain #154

Closed
rakita opened this issue Feb 1, 2022 · 0 comments · Fixed by #263
Closed

[txpool] Implement removal of txs that are included into chain #154

rakita opened this issue Feb 1, 2022 · 0 comments · Fixed by #263

Comments

@rakita
Copy link
Contributor

rakita commented Feb 1, 2022

When new block is included, processed transaction needs to be removed from txpool. Steps for implementing this:

  • remove tx from by_hash
  • remove tx from by_gas_price
  • remove tx from by_dependenct
    • Go over all remove tx outputs and compare them with coins. If it is variable output, check if dependent tx has maching input, if not, remove it. Go over all dependency and decrease their depth.
    • go over all removed tx outputs and compare them with contracts. Set origin to None, gas_price to MAX and decrease depth for it and all its dependencies found inside used_by.

If block is for some reason reverted, transaction of that block need to be reinjected inside txpool for usage in next block. We can still use block_update function. Check how does reverting happen in our PoS consensus.

this is medium effort to implement and it is hard requirement for client.

@rakita rakita moved this to Todo in Fuel Network Feb 1, 2022
Repository owner moved this from Todo to Done in Fuel Network Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant