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

interop: Handle ErrParentToFirst from PreviousDerivedFrom #12833

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

axelKingsley
Copy link
Contributor

Prior PRs changed the behavior of WithParent and PreviousDerivedFrom to not panic, and instead error, when the PreviousDerivedFrom can't be determined.

However, the codepaths which use this are expected to function even on the first row of the database. Functions like CrossDerivedFromBlockRef and CanddiateCrossSafe need to handle the fact that there is no parent item for the DerivedFrom in question.

This PR adds the same basic handling -- if the error matches ErrPreviousToFirst, the calling functions use ForceWithParent(BlockRef{}) instead of erroring or panicing.

The devnet is currently running, but we see a lot of

t=2024-11-05T22:16:57+0000 lvl=warn msg="Failed to process work" chain=11473209 err="failed to determine candidate block for cross-safe: failed to find parent-block of cross-derived-from BlockSeal(hash:0xa39fd1a98c35ba3bc981366b87def30b7e796896bdc52988e4c1008524c415ae, number:7012090, time:1730748744): cannot find previous derived before start of database: 0xa39fd1a98c35ba3bc981366b87def30b7e796896bdc52988e4c1008524c415ae:7012090"

in the logs. This is because the workflows which expect to be function on the first row of the database are returning errors inappropriately.

@axelKingsley axelKingsley changed the title interop: Handle ErrParentTo from PreviousDerivedFrom interop: Handle ErrParentToFirst from PreviousDerivedFrom Nov 5, 2024
@protolambda protolambda added this pull request to the merge queue Nov 6, 2024
Merged via the queue into develop with commit b20ca5d Nov 6, 2024
52 checks passed
@protolambda protolambda deleted the interop-handle-ErrPreviousToFirst branch November 6, 2024 05:07
GrapeBaBa pushed a commit to optimism-java/optimism that referenced this pull request Nov 13, 2024
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.

2 participants