docs: update the nonces docs in QGB store #1841
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Closes #1805
The latest attestation nonce and earliest attestation nonce are values written to store. In order to get them, we use the
getLatestAttestationNonce
and thegetEarliestAvailableAttestationNonce
methods.These methods panic if these values don't exist in store. However, the only time these values don't exist in store, if no manual changes were done to the store, is during the period between chain startup and block 1.
So, we have the
CheckLatestAttestationNonce
method that checks if the value exists in store and returns true if so. And we use it inabci.EndBlocker
and in queries not to return a stack trace, but a relevant error when querying during the period between chain startup and block 1.Thus, the only change we can do is think about in this case, is having these methods return an error instead of panicking, but it returns the same thing via using the
CheckLatestAttestationNonce
, instead of usingif errors.Is(...)
.This is why this PR removes the misleading docs but makes no changes on the methods.