Skip to content
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

Merged
merged 2 commits into from
Jan 18, 2024

Conversation

ParthDesai
Copy link
Contributor

@ParthDesai ParthDesai commented Jan 17, 2024

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 the new_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 the EventPhase 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:

  1. Use runtime at particular block to decode the event (Rejected: Too costly and complex to implement in order to simply count the votes and rewards)
  2. Modify subspace runtime to return votes and rewards at particular block (Rejected: Would require refactoring runtime just to accommodate pulsar)
  3. Remove votes and rewards data aggregation from pulsar (Accepted: This is ideal solution since it would not require introduction of more machinery and votes and rewards data are now viewed from the subspace block explorer as well.)

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.

@ParthDesai ParthDesai force-pushed the fix-reward-error-and-upgrade branch 2 times, most recently from a6c0f3f to e088ba4 Compare January 17, 2024 20:01
@ParthDesai ParthDesai merged commit 062f6b0 into main Jan 18, 2024
5 checks passed
@ParthDesai ParthDesai deleted the fix-reward-error-and-upgrade branch January 18, 2024 09:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants