Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: allow automatically replacing a node even if it is active as an API BN #3707

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

r-birkner
Copy link
Contributor

When a node is redeployed, but hasn't been removed from the registry before that, it is automatically replaced: the old node record is removed and the new one created.

Initially, this was only possible for unassigned nodes. Then, functionality was added such that this also worked for nodes assigned to a subnet.

This PR enables the same behavior for API boundary nodes. When a node that is currently active as API boundary node is redeployed, the old node record and the old API boundary node record are removed, and a new node record and a new API boundary node record are created.

We can't just use any node as API boundary node. The node needs to be configured with a domain name. This case will fail as we have an invariant in invariants/api_boundary_node.rs that ensures that each API boundary node record has an associated node record with a domain name.

In addition, I removed the test should_replace_node_in_subnet in do_remove_node_directly.rs as it is a literal copy of should_replace_node_in_subnet_and_update_allowance with one difference in the comment of line 458 and 528.

@github-actions github-actions bot added the chore label Jan 31, 2025
@r-birkner r-birkner marked this pull request as ready for review January 31, 2025 13:01
@r-birkner r-birkner requested a review from a team as a code owner January 31, 2025 13:01
@r-birkner r-birkner requested a review from sasa-tomic January 31, 2025 13:01
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

If this pull request affects the behavior of any canister owned by
the Governance team, remember to update the corresponding
unreleased_changes.md file(s).

To acknowldge this reminder (and unblock the PR), dismiss this
code review by going to the bottom of the pull request page, and
supply one of the following reasons:

  1. Done.

  2. No canister behavior changes.

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.

1 participant