Skip to content
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

WIP Fail in processSequenceBatches if we don't have the parent batch #82

Closed
wants to merge 1 commit into from

Conversation

jbearer
Copy link
Member

@jbearer jbearer commented Oct 4, 2023

This will cause an error if there has been a reorg since we fetched the batches. In normal mode, this should never happen, since we check for reorgs and then fetch batches synchronously. But in preconfirmations mode, the batches are fetched asynchronously wrt to the reorg detection, and so the L2 head can change under us. In this case the new check will fail and we will re-fetch preconfirmations after checking the new L2 head.

Fixes EspressoSystems/espresso-polygon-zkevm-demo#246

This will cause an error if there has been a reorg since we fetched the
batches. In normal mode, this should never happen, since we check for
reorgs and then fetch batches synchronously. But in preconfirmations
mode, the batches are fetched asynchronously wrt to the reorg
detection, and so the L2 head can change under us. In this case the
new check will fail and we will re-fetch preconfirmations after
checking the new L2 head.

Fixes EspressoSystems/espresso-polygon-zkevm-demo#246
@jbearer
Copy link
Member Author

jbearer commented Oct 12, 2023

Finally have a test for this, and it doesn't work, because, as I learned recently, SQL transactions aren't exclusive. So it is possible for the DB to get reset in between doing this check and processing the batch.

Anyways, I decided it was better to explicitly synchronize with the preconf task whenever we are about to reset the DB, rather than try to detect it after it happens. That fix is in #87

@jbearer jbearer closed this Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preconfirmations node does not handle L1 reorgs correctly
1 participant