smol-dot/smoldot

Parachain parent-child relationship confusions

Opened this issue · 0 comments

Smoldot currently treats parachain blocks as opaque. It tries to decode them, but if it fails everything continues anyway.

Due to this, it makes the assumption that if relayChainBlock1 is the parent of relayChainBlock2, then parahead(relayChainBlock1) is also the parent of parahead(relayChainBlock2).

I think that this might not necessarily be the case, for example if the relay chain stalls.

Unfortunately, figuring out the parent of a block requires decoding it, which, again, might not be possible.
We could in principle have 2 code paths: one where parents are always correct if blocks are decodable, and one where they're not necessarily. But I don't think that this is the best idea, because this behaviour is surprising, and that blocks might become undecodable in case of breaking change.