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.
Description
This fixes the OP Legacy Consensus engine
VerifyHeaders
function. WhenVerifyHeaders
is called, only the first block is stored in the database & the reset are passed in as a slice. We previously calledVerifyHeader
fromVerifyHeaders
which would expect that the block's parent was in the database. This modifiesVerifyHeaders
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.