Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: CON-1434 Serialize current and next transcripts into `pb::N…
…iDkgTranscript` (#3039) As the `NiDkgId` (and therefore the `NiDkgTag`) is already part of the `NiDkgTranscript`, serializing the `NiDkgTag` separately as part of `pb::TaggedNiDkgTranscript` is redundant. This PR instead serializes the current and next transcripts directly as `pb::NiDkgTranscript`. #2838 introduced the new block payload proto fields of type `pb::NiDkgTranscript`, and implemented the deserialization function to consider both new and old fields. This ensures the backwards/forwards compatibility of the change made by this PR. During upgrade: - The old summary still contains `pb::TaggedNiDkgTranscript`s, but they can still be read as the deserialization function supports both types. - Newly created summary blocks will instead contain `pb::NiDkgTranscript`s directly. During downgrade: - As the deserialization function supporting both types already exists in the previous version, Summary blocks created by the version of this PR (using `pb::NiDkgTranscript`) will be deserialized successfully. - Newly created summary blocks on the old version will then again contain `pb::TaggedNiDkgTranscript`s instead. Once this change is deployed to all mainnet subnets, we may remove the deprecated `pb::TaggedNiDkgTranscript` fields entirely. Additionally, this change forces us to fix a state machine setup function in `rs/state_machine_tests/src/lib.rs`, which incorrectly marked both genesis NiDkg transcripts as "high threshold". Therefore, this test setup function broke the (now explicit) invariant that for each (tag, transcript) in `block.dkg_transcript_map` it holds that `tag == transcript.tag`.
- Loading branch information