fix(sequencer): avoid including unexecuted rollup data #2190
+79
−119
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This is a bugfix for
App::prepare_proposal
.Background
In
prepare_proposal
, while iterating the txs to be executed, we append the rollup data bytes to the collection of these before checking and executing the tx.This is an issue if the given tx fails the size checks or fails execution. The end result is that the proposer later returns an error in finalize_block as the rest of the validators have a different (correct) view of the sequencer block and its included Merkle roots.
Changes
App
underEXECUTION_RESULTS_KEY
in the ephemeral store from(rollup_data_bytes, tx_results, tx_ids)
to aVec<ExecutedTransaction>
where theExecutedTransaction
holds the checked tx and the corresponding execution result. This avoids the possibility of a mismatch between the number (or order) of the three discrete collections currently cached.Testing
There are no current unit or integration tests which would catch this. This probably suits a new form of integration test more akin to the app upgrade tests, or even a new system-test.
In the meantime, I tested locally by sending a few rollup data submission txs which were too large to all be included in a single block to a 5 node network.
Changelogs
Changelogs updated.