EVM/Kernel: remove from delayed inbox on block promotion
What
The kernel currently deletes the transaction from the delayed inbox when it reads a blueprint. This merge request instead collects the transactions to remove, then do it at the end.
Why
We might lose transactions. There can be at least 2 scenarios:
- An upgrade
- A blueprint containing a deposit triggers an upgrade
- The kernel reboots and upgrade
- The blueprint is popped again and fails to find the deposit
- A bug in a transaction
- A blueprint containing a deposit is popped
- One invalid transaction makes the kernel fail
- The blueprint is removed, the delayed transaction with it
How
Simply collect the valid transactions in BlockInProgress, and remove them at block promotion. Note that the struct ComputationResult::Finished is not really perfect because sometimes it contains the list of transactions, sometimes an empty vector. There's room for improvement there.
Manually testing the MR
Best way to manually test the merge request is to run the test after you've reverted the fix. Then look at the logs.
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Valentin Chaboche