chore: allow automatically replacing a node even if it is active as an API BN #3707
+209
−73
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.
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
indo_remove_node_directly.rs
as it is a literal copy ofshould_replace_node_in_subnet_and_update_allowance
with one difference in the comment of line 458 and 528.