returnderive.NewTemporaryError(fmt.Errorf("failed to check if on finalizing L1 chain, could not fetch block %d: %w",fi.finalizedL1.Number,err))
fi.emitter.Emit(rollup.L1TemporaryErrorEvent{Err:fmt.Errorf("failed to check if on finalizing L1 chain, could not fetch block %d: %w",fi.finalizedL1.Number,err)})
return
}
ifsignalRef.Hash!=fi.finalizedL1.Hash{
returnderive.NewResetError(fmt.Errorf("need to reset, we assumed %s is finalized, but canonical chain is %s",fi.finalizedL1,signalRef))
fi.emitter.Emit(rollup.ResetEvent{Err:fmt.Errorf("need to reset, we assumed %s is finalized, but canonical chain is %s",fi.finalizedL1,signalRef)})
return
}
// Sanity check we are indeed on the finalizing chain, and not stuck on something else.
// We assume that the block-by-number query is consistent with the previously received finalized chain signal
returnderive.NewTemporaryError(fmt.Errorf("failed to check if on finalizing L1 chain, could not fetch block %d: %w",finalizedDerivedFrom.Number,err))
fi.emitter.Emit(rollup.L1TemporaryErrorEvent{Err:fmt.Errorf("failed to check if on finalizing L1 chain, could not fetch block %d: %w",finalizedDerivedFrom.Number,err)})
return
}
ifderivedRef.Hash!=finalizedDerivedFrom.Hash{
returnderive.NewResetError(fmt.Errorf("need to reset, we are on %s, not on the finalizing L1 chain %s (towards %s)",
finalizedDerivedFrom,derivedRef,fi.finalizedL1))
fi.emitter.Emit(rollup.ResetEvent{Err:fmt.Errorf("need to reset, we are on %s, not on the finalizing L1 chain %s (towards %s)",