Skip to content

refactor(ic-admin): Construct Registry client and keys using the canonical functions.#10734

Open
Bownairo wants to merge 1 commit into
masterfrom
eero/misc-followups-1
Open

refactor(ic-admin): Construct Registry client and keys using the canonical functions.#10734
Bownairo wants to merge 1 commit into
masterfrom
eero/misc-followups-1

Conversation

@Bownairo

@Bownairo Bownairo commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Where possible, use helpers to avoid building RegistryClientImpls and registry keys, directly.

@github-actions github-actions Bot added the chore label Jul 11, 2026
@Bownairo Bownairo force-pushed the eero/misc-followups-1 branch from e68d415 to 1d5d51d Compare July 13, 2026 16:47
@Bownairo Bownairo marked this pull request as ready for review July 13, 2026 18:41
@Bownairo Bownairo requested a review from a team as a code owner July 13, 2026 18:41

@github-actions github-actions Bot 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.

This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):

  1. Update unreleased_changelog.md (if there are behavior changes, even if they are
    non-breaking).

  2. Are there BREAKING changes?

  3. Is a data migration needed?

  4. Security review?

How to Satisfy This Automatic Review

  1. Go to the bottom of the pull request page.

  2. Look for where it says this bot is requesting changes.

  3. Click the three dots to the right.

  4. Select "Dismiss review".

  5. In the text entry box, respond to each of the numbered items in the previous
    section, declare one of the following:

  • Done.

  • $REASON_WHY_NO_NEED. E.g. for unreleased_changelog.md, "No
    canister behavior changes.", or for item 2, "Existing APIs
    behave as before.".

Brief Guide to "Externally Visible" Changes

"Externally visible behavior change" is very often due to some NEW canister API.

Changes to EXISTING APIs are more likely to be "breaking".

If these changes are breaking, make sure that clients know how to migrate, how to
maintain their continuity of operations.

If your changes are behind a feature flag, then, do NOT add entrie(s) to
unreleased_changelog.md in this PR! But rather, add entrie(s) later, in the PR
that enables these changes in production.

Reference(s)

For a more comprehensive checklist, see here.

GOVERNANCE_CHECKLIST_REMINDER_DEDUP

@zeropath-ai

zeropath-ai Bot commented Jul 13, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 1d5d51d.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► rs/registry/admin/bin/main.rs
    Add ApiBoundaryNodeRegistry and NodeOperatorRegistry usage; extend imports
► rs/registry/helpers/src/node_operator.rs
    Implement get_node_operators in NodeOperatorRegistry trait for RegistryClient-based types

@Bownairo Bownairo changed the title chore: Use more helpers in admin chore: Use more helpers in ic-admin Jul 13, 2026
@Bownairo Bownairo dismissed github-actions[bot]’s stale review July 13, 2026 22:11

No canister behavior changes.

@daniel-wong-dfinity-org-twin daniel-wong-dfinity-org-twin changed the title chore: Use more helpers in ic-admin refactor(ic-admin): Construct Registry client and keys in the canonical functions. Jul 14, 2026
@github-actions github-actions Bot added refactor and removed chore labels Jul 14, 2026
@daniel-wong-dfinity-org-twin

Copy link
Copy Markdown
Contributor

I changed the title. PTAL.

@daniel-wong-dfinity-org-twin daniel-wong-dfinity-org-twin changed the title refactor(ic-admin): Construct Registry client and keys in the canonical functions. refactor(ic-admin): Construct Registry client and keys using the canonical functions. Jul 14, 2026
Comment on lines -4664 to +4677
if let Some(secret_key_path) = opts.secret_key_pem {
if let Some(secret_key_path) = &opts.secret_key_pem {
let contents = read_to_string(secret_key_path).expect("Could not read key file");
let sig_keys = SigKeys::from_pem(&contents).expect("Failed to parse pem file");
Sender::SigKeys(sig_keys)
} else if opts.use_hsm {
make_hsm_sender(
&opts.hsm_slot.expect(
opts.hsm_slot.as_ref().expect(
"HSM slot must also be provided for --use-hsm; use --hsm-slot or see --help.",
),
&opts.hsm_key_id.expect(
opts.hsm_key_id.as_ref().expect(
"HSM key ID must also be provided for --use-hsm; use --key-id or see --help.",
),
&opts.hsm_pin.expect(
opts.hsm_pin.as_ref().expect(

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.

This changes seems to be orthogonal? Do you simply need to merge from master (or rebase)?

nns_url,
)),
None,
fn get_api_boundary_node_ids(opts: Opts, nns_url: Vec<Url>) -> Vec<String> {

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.

Could you pass Registry client itself? (As opposed to passing parameters needed to construct it.)

One thing I don't like about passing Opts is that you are passing "the whole hardware store" instead of just the one or two "nails" (verify_nns_resposnes, nns_public_key_pem_file) that you actually actually need/use. Passing Registry client avoids that.

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.

2 participants