-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Blocks don't get finalized in light client #3911
Comments
Added a log at
|
Most probably this is because justification is only generated when GRANDPA authorities set changes, and it doesn't change that fast (there are only 33 blocks on your screenshot). And the only way to finalize block on light client is to receive justification (as a part of finality proof). Some time ago, justifications were also generated every N blocks, but it was removed, iirc. So it is the expected behavior atm. Not sure i we can improve it. What are your thoughts, @rphmeier @andresilva ? |
@svyatonik Does it mean I can trust all the imported block even if it's higher than the last finalized block, or I have to wait until the next authorities set change in a light client? |
If by trust you mean whether the block can be reverted, then no - you can't trust. We could switch to the other fork any time before block is finalized. You could trust in what the imported header has passed the other layer of verification - consensus over authorship engine (Aura, I hope BABE in future). In that sense you can trust that the header has been generated and properly signed by the expected authority (but not the 2/3). |
Thanks for the answer. This design introduces a notable delay when a light client user wait for the finalization of a block. I suspect the delay may be a trouble for a lot of use cases. Will there be an option to let the light client request finality proof (or block justification when there's no authorities set change) more frequently, e.g. every block? |
According to paritytech/polkadot-sdk#571, the current implementation is intended but may be changed in the future. I'm not sure how much overhead it will add to announce block justification but at least we can provide a real use case for the need: We are working on a blockchain-TEE (Trusted Execution Environment) hybrid system. TEE is offline. So we need to bridge the chain state to the TEE side. We must validate the imported data inside the TEE in order to make sure the block won't be reverted. So we are trying to implement a Substrate light client in TEE. We have also contacted with our friend project substraTEE (by SCS team) and I belive they have the same requirement. |
Closing. We built our own light validation client in TEE and produce the block justification on a full node with "justification_period: 1" set. |
Reproduce
node-template
Expected behavior
Both the full node and the light node should sync and finalize the blocks.
Actual behavior
The light node doesn't finalize any block. A screenshot is attached. The left side is a full node and the right side is the light node.
The text was updated successfully, but these errors were encountered: