chore(dkg): remove summary's transcripts for remote subnets (1/4) - #11220
Draft
pierugo-dfinity wants to merge 2 commits into
Draft
chore(dkg): remove summary's transcripts for remote subnets (1/4)#11220pierugo-dfinity wants to merge 2 commits into
pierugo-dfinity wants to merge 2 commits into
Conversation
pierugo-dfinity
force-pushed
the
pierugo/summary/remove-transcripts-for-remote-subnets-1
branch
from
August 20, 2026 07:32
eb46cbe to
e334f07
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR is the first step of a staged migration to remove transcripts_for_remote_subnets from DkgSummary without changing summary hashing across replica versions, by introducing a protobuf presence marker and switching the Rust field to a backwards-compatible representation.
Changes:
- Wrap
DkgSummary::transcripts_for_remote_subnetsinBackwardsCompatible<…>and update protobuf (de)serialization to preserve hash behavior across versions using a new sentinel marker. - Add
try_from_proto_withtoBackwardsCompatibleto support conversions that aren’t expressed viaTryFrom. - Adjust consensus handling/tests to treat the summary’s remote transcripts as optional (and effectively absent going forward).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| rs/types/types/src/consensus/dkg.rs | Switch summary remote transcripts to BackwardsCompatible and add marker-aware protobuf conversions. |
| rs/types/types/src/backwards_compatibility.rs | Document field-removal lifecycle and add try_from_proto_with helper. |
| rs/protobuf/src/gen/types/types.v1.rs | Regenerate protobuf bindings to include the new optional marker field. |
| rs/protobuf/def/types/v1/dkg.proto | Add transcripts_for_remote_subnets_removed sentinel (tag 16) and bump next id. |
| rs/consensus/src/consensus/batch_delivery.rs | Only generate remote-DKG responses from summaries when transcripts are present. |
| rs/consensus/dkg/src/test_utils.rs | Stop reading remote transcripts from summary blocks (return empty). |
| rs/consensus/dkg/src/lib.rs | Update test expectation for the BackwardsCompatible summary field. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
268
to
272
| #[serde_as(as = "Vec<(_, _)>")] | ||
| next_transcripts: BTreeMap<NiDkgTag, NiDkgTranscript>, | ||
| /// Transcripts that are computed for remote subnets. | ||
| pub transcripts_for_remote_subnets: Vec<RemoteTranscriptResult>, | ||
| pub transcripts_for_remote_subnets: BackwardsCompatible<Vec<RemoteTranscriptResult>, true>, | ||
| /// The length of the current interval in rounds (following the start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Since the work performed to speedup the latency of remote DKG requests, their results are delivered as part of data blocks instead of summaries. The
transcripts_for_remote_subnetsfield in summaries is thus now unused. This PR begins the migration to remove it entirely.We cannot simply replace the field with a
BackwardsCompatible<Vec<_>, _>(i.e. replace theVec<_>with anOption<Vec<_>>) because the field is arepeated, and an empty vector is not differentiable from an absent one. In contrast,Some(vec![])andNonehave different hashes. For that reason, we need to add a new sentinel field to the protobuf definition that will be set totrueto explicitely indicate that the field is absent. The entire rollout can be reviewed by looking at the stacked PRs (except the last one) and is described below.Some(vec![])and the hash of an empty vector is appropriately computed.Some(vec![])so will compute V1's summary's hash identically. For its own summaries, it starts to fill the sentinel (because the transcripts areNone).Nonetranscripts meaning their hash was not included, good.true, meaning V2 will interpret the transcripts asNoneand not try to hash them.