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

beacon: Fix OP Legacy block hash checks #228

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

trianglesphere
Copy link
Contributor

@trianglesphere trianglesphere commented Jan 27, 2024

Description

This fixes the OP Legacy Consensus engine VerifyHeaders function. When VerifyHeaders is called, only the first block is stored in the database & the reset are passed in as a slice. We previously called VerifyHeader from VerifyHeaders which would expect that the block's parent was in the database. This modifies VerifyHeaders to check that the first block is in the database & then checks the blocks one by one through the slice.

Tests

I have tested this on op-goerli & op-mainnet.

@trianglesphere trianglesphere force-pushed the jg/fix_batch_verify_headers branch from ea63a6b to 5fa45a6 Compare January 30, 2024 01:42
When verifying a batch of headers, verify the parent inside the section
of headers because they don't exist in the DB yet.
@trianglesphere trianglesphere force-pushed the jg/fix_batch_verify_headers branch from 5fa45a6 to 5ef4144 Compare January 30, 2024 17:02
@trianglesphere trianglesphere marked this pull request as ready for review January 30, 2024 17:03
Copy link
Member

@sebastianst sebastianst left a comment

Choose a reason for hiding this comment

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

thanks for fixing this!

@trianglesphere trianglesphere enabled auto-merge (squash) January 30, 2024 17:10
@trianglesphere trianglesphere merged commit 3f05663 into optimism Jan 30, 2024
8 of 10 checks passed
@trianglesphere trianglesphere deleted the jg/fix_batch_verify_headers branch January 30, 2024 17:16
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