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

[BUG]: `check_pending_account_resources` must match pending transaction acceptance #87

Closed sgerbino closed 1 year ago

sgerbino commented 1 year ago

Is there an existing issue for this?

Current behavior

This RPC call is used at the beginning of submit_transaction and determines if the transaction would be accepted so it should match the implementation that actually adds the pending transaction.

Right now it is possible to have enough available RC left on the head node while not having enough RC on another fork which results in the rejection of the pending transaction.

https://github.com/koinos/koinos-mempool/blob/b0e3c2d7590e2c4e46af218e92d8f420ca33a6cb/libraries/mempool/mempool.cpp#L251-L267

Expected behavior

If check_pending_account_resources returns true then the resulting pending transaction should be accepted. If check_pending_account_resources returns false then the resulting pending transaction should fail.

Steps to reproduce

No response

Environment

- OS:

Anything else?

No response