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:

  1. An upgrade
    1. A blueprint containing a deposit triggers an upgrade
    2. The kernel reboots and upgrade
    3. The blueprint is popped again and fails to find the deposit
  2. A bug in a transaction
    1. A blueprint containing a deposit is popped
    2. One invalid transaction makes the kernel fail
    3. 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.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Valentin Chaboche

Merge request reports

Loading