koinos / koinos-mempool

The mempool microservice stores pending transactions for inclusion in blocks by the block producer.
MIT License
0 stars 1 forks source link

[FEATURE]: Fork aware `mempool` #79

Closed sgerbino closed 1 year ago

sgerbino commented 1 year ago

Is there an existing issue for this?

New feature

As a Koinos user, I would like a fork aware mempool such that transactions do not get forgotten on forks.

Note: Upon startup, the statedb root should be genesis (0x00). If transactions come in prior to a LIB, apply the transactions directly to the genesis node. When LIB comes in, attempt to attach it to previous, if there is no previous attempt to attach the node to genesis. If there is no genesis, report an error because something went wrong.

Anything else?

Right now it is possible for a transaction to end up on a fork, the cluster makes no attempt to re-apply this transaction on the main fork. This will cause bad UX for both users.