zebra icon indicating copy to clipboard operation
zebra copied to clipboard

Avoid temporary failures verifying the first non-finalized block

Open teor2345 opened this issue 1 year ago • 3 comments

Motivation

Waiting for the last finalized block is currently handled by can_fork_chain_at(), which returns early if the tip hash doesn't match any blocks.

https://github.com/ZcashFoundation/zebra/blob/093d503d22894fee57249387f25eb86a5bc8b985/zebra-state/src/service.rs#L378-L381

But it has a bug: if the first non-finalized block arrives before the last finalized block, it will time out and fail verification, because the fork point is only checked once per block. But it will verify correctly when it gets retried.

Originally posted by @teor2345 in https://github.com/ZcashFoundation/zebra/issues/4937#issuecomment-1241352383

Status

We partially fixed this in PR #5257, and added a workaround for the remaining timeouts.

Tasks

  • when receiving a finalized block in the last checkpoint, check for pending non-finalized UTXO requests
  • remove the special 5 minute timeout for initial fully verified blocks in sync:: downloads

teor2345 avatar Sep 09 '22 00:09 teor2345

This isn't actually fixed, we need a fix in PR #5257.

teor2345 avatar Oct 06 '22 03:10 teor2345

We decided not to do this in this sprint, because it's not a release blocker.

It's still a bug we might want to fix in future, but only if it causes problems.

teor2345 avatar Oct 11 '22 00:10 teor2345

I know why this is happening now, I've updated the ticket description.

Still not a release blocker.

teor2345 avatar Oct 12 '22 00:10 teor2345