Skip to content

Commit 9d65319

Browse files
committed
check from against first verifiable height
1 parent f75569e commit 9d65319

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

engine/verification/verifier/verifiers.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ func VerifyRange(
9090

9191
log.Info().Msgf("verifying blocks from %d to %d", from, to)
9292

93+
root := state.Params().SealedRoot().Height
94+
95+
if from <= root {
96+
return fmt.Errorf("cannot verify blocks before the root block, from: %d, root: %d", from, root)
97+
}
98+
9399
for height := from; height <= to; height++ {
94100
log.Info().Uint64("height", height).Msg("verifying height")
95101
err := verifyHeight(height, storages.Headers, chunkDataPacks, storages.Results, state, verifier)

0 commit comments

Comments
 (0)