integritee-network / worker

Integritee off-chain worker and sidechain validateer
Apache License 2.0
90 stars 47 forks source link

[light-client-state] remove or prune `unjustified_header` field until we have proper finality check #1404

Open clangenb opened 1 year ago

clangenb commented 1 year ago

Currently, we keep track of finalized heads, which have not been proven to be final with a justification in the unjustified_headers. Once we receive a block including a justification, we check it and mark all unjustified_headers as finalized, which finalizes them in our state.

However, this logic is partially flawed, as we there is only a justification in a block when the authority set changes. This in turn implies that, depending on the chain configuration, we will never get a justification and the unjustified_header field will grow indefinitely, which probably leads to #1374.

Considering this, I suggest for now removing the unjustified_header field until:

clangenb commented 1 year ago

I can confirm that in OLIs case we also have a very slow parentchain block import. Probably because of deserializing many unjustified headers.