This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
Fix reward error and upgrade to gemini-3g-2024-jan-08
snapshot
#284
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.
Description
This PR fixes the error encountered during the decoding of the events. And also upgrades to
gemini-3g-2024-jan-08
snapshot.Context
During the gemini-3g network run, we upgraded the runtime multiple times. During one of the upgrade, we modified
FraudProofProcessed
event. Specifically, adding Option to thenew_head_receipt_number
field. This added an extra byte in the encoding of that event after the runtime upgrade.Issue
Since pulsar uses the latest runtime present in the code (and not on-chain runtime for that block) to decode the events, when it encounters the
FraudProofProcessed
event generated before runtime upgrade, it reads one extra byte during the decoding. This causes the decoding of next runtime event to fail and since theEventPhase
is the first field in an event, the decoding of it fails with the variant does not exists error.Solution
Three potential solutions were investigated:
3rd solution is and implemented in this PR by removing calculation of votes and rewards from pulsar. If at any point of time, subspace runtime do introduce the functionality to query the votes and rewards through runtime api or rpc for particular block, this can be revisited.