zebra
zebra copied to clipboard
Avoid temporary failures verifying the first non-finalized block
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
This isn't actually fixed, we need a fix in PR #5257.
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.
I know why this is happening now, I've updated the ticket description.
Still not a release blocker.