8000 fix(sequencer): avoid including unexecuted rollup data by Fraser999 · Pull Request #2190 · astriaorg/astria · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(sequencer): avoid including unexecuted rollup data #2190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025

Conversation

Fraser999
Copy link
Contributor

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

  • Changed the type stored by the App under EXECUTION_RESULTS_KEY in the ephemeral store from (rollup_data_bytes, tx_results, tx_ids) to a Vec<ExecutedTransaction> where the ExecutedTransaction 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.

@Fraser999 Fraser999 requested a review from noot as a code owner May 21, 2025 18:07
@github-actions github-actions bot added the sequencer pertaining to the astria-sequencer crate label May 21, 2025
@Fraser999 Fraser999 requested a review from ethanoroshiba May 21, 2025 18:08
Copy link
Contributor
@ethanoroshiba ethanoroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. In the PR description a new kind of integration test is discussed, but I think it wouldn't be too much lift to create a new app-level test and simply compare the results of two apps, one with the proposer flow and the other with a non-proposer flow. That being said, in the interest of getting the fix in, I think it can probably be ticketed for a followup. Nice catch!

@Fraser999 Fraser999 added this pull request to the merge queue May 21, 2025
Merged via the queue into main with commit 31a6903 May 21, 2025
51 checks passed
@Fraser999 Fraser999 deleted the fraser/fix-prepare-proposal branch May 21, 2025 20:47
ethanoroshiba pushed a commit that referenced this pull request May 27, 2025
## 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
- Changed the type stored by the `App` under `EXECUTION_RESULTS_KEY` in
the ephemeral store from `(rollup_data_bytes, tx_results, tx_ids)` to a
`Vec<ExecutedTransaction>` where the `ExecutedTransaction` 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sequencer pertaining to the astria-sequencer crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0