smoldot icon indicating copy to clipboard operation
smoldot copied to clipboard

Properly handle warp syncing failures

Open tomaka opened this issue 3 years ago • 1 comments

The warp syncing process can fail for various reasons, and currently we just try again. This is a poor idea because all these reasons are "deterministic", in the sense that trying again will always lead to the same error.

What to do in that situation isn't obvious, but I think that the least we can do is print a proper error and stop trying.

tomaka avatar Jul 19 '22 08:07 tomaka

all these reasons are "deterministic", in the sense that trying again will always lead to the same error.

This isn't actually totally true. For example, the runtime missing the function that we want to call is a pretty terrific/irrecoverable problem, but it could also be caused by a mistake in the runtime, and it could be that in the future this mistake gets corrected on the chain. In other words, continuing to sync could in principle lead to a recovery.

I think that the behavior of trying again is correct, but we should probably add a delay (in number of blocks) between the syncing attempts. Additionally, we should probably indicate through logs if this happens (cc https://github.com/paritytech/smoldot/issues/2222).

tomaka avatar Oct 25 '22 10:10 tomaka