smoldot
smoldot copied to clipboard
Properly handle warp syncing failures
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.
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).