evm/node: tx_queue also store the transaction object
Checklist
-
Provide automatic testing. -
Add an item in the changelog
What
meta-issue for the stacked MR: #7785
The tx_queue can be queried to retried the tx_object associated with an hash.
Why
Because the rpc get_transaction_by_hash should returns the transaction when it's still in the tx_queue.
How
I add a new hashtabl to store the tx_object in the state.
At first I added the tx_object in the request, but this required to fold over the queue, or query the pending transaction. This approch is simpler, but requires to make sure the transaction object is cleaned properly when needed.
Manually testing the MR
Run an observer with the tx queue activated and submit a transaction to it to make sure it's relayed. This is what this following test do:
$ dune exec etherlink/tezt/tests/main.exe -- tx_queue /multichain_enabled --verbose
Edited by Sylvain R.