Skip to content

Commit

Permalink
Merge pull request ethereum#193 from OffchainLabs/fix-missing-block-log
Browse files Browse the repository at this point in the history
Fix log when missing parent while recreating validation state
  • Loading branch information
PlasmaPower authored Jan 20, 2023
2 parents 960ec60 + 1b8ee27 commit 46c6132
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arbitrum/recordingdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,10 @@ func (r *RecordingDatabase) GetOrRecreateState(ctx context.Context, header *type
if currentHeader.Number.Uint64() <= genesis {
return nil, fmt.Errorf("moved beyond genesis looking for state looking for %d, genesis %d, err %w", returnedBlockNumber, genesis, err)
}
lastHeader := currentHeader
currentHeader = r.bc.GetHeader(currentHeader.ParentHash, currentHeader.Number.Uint64()-1)
if currentHeader == nil {
return nil, fmt.Errorf("chain doesn't contain parent of block %d hash %v", currentHeader.Number, currentHeader.Hash())
return nil, fmt.Errorf("chain doesn't contain parent of block %d hash %v (expected parent hash %v)", lastHeader.Number, lastHeader.Hash(), lastHeader.ParentHash)
}
stateDb, err = r.StateFor(currentHeader)
if err == nil {
Expand Down

0 comments on commit 46c6132

Please sign in to comment.