-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lightstore Invariants + Maintain Verification Information #499
Comments
@josef-widder As a note to this issue at least in the forward verification case:
In the case of TLA, this is explicitly mentioned in StoredHeadersAreVerifiedOrNotTrustedInv. And in rust it is a bit more involved, if we look at the As a result in both cases, the light store will have a mix of Verified and Unverified light blocks after finishing verification. It is easy to extract just the sequence of Verified blocks, but it is not true that all stored light blocks form this sequence. |
You are right. In my discussion I was not precise. In my text I ignore unverified lightblocks. More generally, unverified lightblocks are something that is relevant for verification, but I guess we should not expose them to an outside observer. |
Would be good to explain a bit better the context. I understand that maintaining this property of the light store might be useful, but explaining better the requirement (use case) would be helpful. |
The main use case is to generate proof of fork.
The question is what should be the proof of fork.
|
After some more thinking, the most efficient thing would be to store for each verified lightblock b2 the height of the lightblock b1 that was used to one-step verify b2, that is, where |
At a glance this looks like a great trade-off between preserving the context and keeping the data lean. |
OK, then let's add this verification information in the next revision of the spec. In #479 in verification.md I have added a section "Status" that explains that this change need to come and I have pointed to this issue. |
spec-wise the required logic is on master. #415 will need to make the link to implementation. For the relayer we may also need to compute evidence, but the spec work for storing the required information is there. |
In order to generate "proof of fork" (#461 , tendermint/tendermint#5149), it would be good to efficiently compute a sequence of lightblocks b(1), b(2), ... b(n), so that b(i+1) can be verified with b(i) in one step. If the light client does forward verification only, this property is maintained by the algorithm (I think @konnov checked that property already). However, if the light client has to fetch lightblocks whose height is less than
latestTrusted
(see LCV-FUNC-IBCMAIN.1), this property might not be maintained.For instance, if b(1).NextValidators = b(2).Validators, but for a later added lightblock in-between, b(1.5).NextValidators and b(1.5).Validators may be piecewise disjunct from both.
To compute the proof of fork, I don't think we should re-verify the blocks to generate a sequence; this is expensive. I wonder whether we should maintain in the light store, for each lightblock which lightblock was used to originally verify it. We would need to add recording this information within VerifyToTarget.
Alternatively, we just keep these additional blocks in the proof of fork, but then the complexity of the "proof of fork verification" at the nodes who receive it increases.
The text was updated successfully, but these errors were encountered: