Skip to content

feat: Consult the standard engine replica version.#10840

Merged
daniel-wong-dfinity-org-twin merged 4 commits into
masterfrom
update-replica_version_id-readers-daniel-wong
Jul 21, 2026
Merged

feat: Consult the standard engine replica version.#10840
daniel-wong-dfinity-org-twin merged 4 commits into
masterfrom
update-replica_version_id-readers-daniel-wong

Conversation

@daniel-wong-dfinity-org-twin

@daniel-wong-dfinity-org-twin daniel-wong-dfinity-org-twin commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

When determining what replica version an engine is supposed to run (and it doesn't explicitly specify one).

Future Work

Orchestrator does not use this. That will be fixed in an imminent PR.

References

👈 Previous PR | Next PR 👉

…ws about the new standard engine replica_version.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
github-actions[bot]

This comment was marked as resolved.

@github-actions github-actions Bot added the feat label Jul 20, 2026
@zeropath-ai

zeropath-ai Bot commented Jul 20, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 72f3292.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► rs/registry/helpers/src/subnet.rs
    Use ic_crypto_sha2 for engine upgrade priority and StandardEngineReplicaVersion handling in get_replica_version
► rs/registry/helpers/src/subnet.rs (continued)
Enhancement ► rs/registry/helpers/Cargo.toml
    Add ic-crypto-sha2 dependency
Enhancement ► rs/registry/helpers/BUILD.bazel
    Add dependency on //rs/crypto/sha2 for library, tests, and test suites
Enhancement ► rs/protobuf/def/registry/standard_engine_replica_version/v1/standard_engine_replica_version.proto
    Update comment to reflect new handling of new_replica_version_id and subnet_id representations
► rs/protobuf/src/gen/registry/registry.standard_engine_replica_version.v1.rs
    Update generated docs similarly to reflect new semantics
Enhancement ► rs/registry/helpers/src/subnet.rs (logic changes)
    Introduce StandardEngineReplicaVersionRecord handling in get_replica_version
    Compute upgrade priority using engine_upgrade_priority
    Resolve replica_version_id using new/old fields based on deployment_progress
    Helper get_standard_engine_replica_version_record added
Enhancement ► rs/registry/helpers/src/subnet.rs (new helper functions and tests additions)
    engine_upgrade_priority function implemented with SHA256-based calculation
    get_standard_engine_replica_version_record helper and related tests added

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the registry helper logic for determining a subnet’s effective replica version so that CloudEngine subnets with an empty replica_version_id follow the registry-wide StandardEngineReplicaVersionRecord (instead of returning None), enabling standard engine rollouts with deterministic per-subnet selection.

Changes:

  • Extend get_replica_version() to resolve blank replica_version_id for CloudEngine subnets via StandardEngineReplicaVersionRecord and a deterministic upgrade priority.
  • Add hashing-based rollout priority computation and comprehensive unit tests for selection behavior and error cases.
  • Wire the new SHA-256 dependency into Cargo and Bazel build definitions.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
rs/registry/helpers/src/subnet.rs Resolve CloudEngine replica version via standard engine record + deterministic rollout priority; add tests.
rs/registry/helpers/Cargo.toml Add ic-crypto-sha2 dependency for upgrade priority hashing.
rs/registry/helpers/BUILD.bazel Add //rs/crypto/sha2 to Bazel deps for library/tests.
Cargo.lock Record new dependency in lockfile.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rs/registry/helpers/src/subnet.rs Outdated
Comment thread rs/registry/helpers/src/subnet.rs Outdated
Comment thread rs/registry/helpers/src/subnet.rs Outdated
Comment thread rs/registry/helpers/src/subnet.rs
@eichhorl

Copy link
Copy Markdown
Contributor

The branch name contains update-replica_version_id-readers. Another reader (that doesn't use this "helper" function) is the orchestrator. Did you plan to update it as part of this PR or do so in a follow up?

Comment thread rs/registry/helpers/src/subnet.rs Outdated
@daniel-wong-dfinity-org-twin

Copy link
Copy Markdown
Contributor Author

The branch name contains update-replica_version_id-readers. Another reader (that doesn't use this "helper" function) is the orchestrator. Did you plan to update it as part of this PR or do so in a follow up?

Yes, I'm working on a follow up now. Hope to send it out today.

@bjoernek

Copy link
Copy Markdown
Contributor

Could you add a line to the description noting the remaining steps in this stack (e.g. the orchestrator reader follow-up)? This PR is clear on its own, but a quick "what's still coming" would save future readers from walking the whole prev/next chain to see where it sits. Non-blocking.

@daniel-wong-dfinity-org-twin
daniel-wong-dfinity-org-twin added this pull request to the merge queue Jul 21, 2026
@daniel-wong-dfinity-org-twin
daniel-wong-dfinity-org-twin removed this pull request from the merge queue due to a manual request Jul 21, 2026
@daniel-wong-dfinity-org-twin
daniel-wong-dfinity-org-twin added this pull request to the merge queue Jul 21, 2026
Merged via the queue into master with commit c0c7b29 Jul 21, 2026
41 checks passed
@daniel-wong-dfinity-org-twin
daniel-wong-dfinity-org-twin deleted the update-replica_version_id-readers-daniel-wong branch July 21, 2026 14:58
pull Bot pushed a commit to bit-cook/ic that referenced this pull request Jul 21, 2026
Originally, problems were swept under the rug: if
ReplicaVersion::try_from returned Err, it would be treated the same as
if there were no SubnetRecord at all.

Since replica_version_id is validated, this wouldn't change behavior.
This just makes the code more defensive.

[👈 Previous PR][prev]

[prev]: dfinity#10840

---------

Co-authored-by: Daniel Wong <daniel.wong@dfinity.org>
pull Bot pushed a commit to bit-cook/ic that referenced this pull request Jul 22, 2026
…a thin wrapper... (dfinity#10857)

... around the `get_replica_version` (same name) method of
`RegistryClient`.

This builds on [PR 10840], where we started to become aware of
`StandardEngineReplicaVersionRecord`.

[PR 10840]: dfinity#10840

[👈 Previous PR][prev]

[prev]: dfinity#10851

---------

Co-authored-by: Daniel Wong <daniel.wong@dfinity.org>
Co-authored-by: IDX GitHub Automation <infra+github-automation@dfinity.org>
Comment thread rs/registry/helpers/src/subnet.rs
Comment thread rs/registry/helpers/src/subnet.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants