Skip to content

[CRE-774] (feat): Prevent duplicate Node Operators in Capabilites Registry#207

Merged
DeividasK merged 6 commits into
developfrom
CRE-774-3
Sep 9, 2025
Merged

[CRE-774] (feat): Prevent duplicate Node Operators in Capabilites Registry#207
DeividasK merged 6 commits into
developfrom
CRE-774-3

Conversation

@justinkaseman
Copy link
Copy Markdown
Contributor

Description

There are no checks to prevent duplicate Node Operators from being added to the Capabilities Registry.

This PR ensures that Node Operators are unique by hash(admin, name) by adding a lookup mapping for if the data has been set.

@justinkaseman justinkaseman requested a review from a team as a code owner August 29, 2025 01:55
@justinkaseman justinkaseman requested review from a team, bolekk and eutopian August 29, 2025 01:55
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 29, 2025

Static analysis results are available

Hey @DeividasK, you can view Slither reports in the job summary here or download them as artifact here.
Please check them before merging and make sure you have addressed all issues.

mchain0
mchain0 previously approved these changes Sep 8, 2025
Base automatically changed from CRE-774-2 to develop September 9, 2025 05:30
@DeividasK DeividasK dismissed mchain0’s stale review September 9, 2025 05:30

The base branch was changed.

# Conflicts:
#	contracts/gas-snapshots/workflow.gas-snapshot
#	gethwrappers/workflow/generated/capabilities_registry_wrapper_v2_dev/capabilities_registry_wrapper_v2_dev.go
#	gethwrappers/workflow/generation/generated-wrapper-dependency-versions-do-not-edit.txt
) external onlyOwner {
for (uint32 i; i < nodeOperatorIds.length; ++i) {
uint32 nodeOperatorId = nodeOperatorIds[i];
NodeOperator memory nodeOperator = s_nodeOperators[nodeOperatorId];
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.

What if someone sends a node operation ID outside of the current range? For example, s_nodeOperators contains 10 nodes, but someone sent a list of node operator IDs: 20, 21, 22. Do we want to proceed with deletion if nodeOperator comes out empty?

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.

Do we want to proceed with deletion if nodeOperator comes out empty?

Yes, as this would be a no-op. Reverting wouldn't serve much of a purpose here.

@DeividasK DeividasK merged commit ef47a70 into develop Sep 9, 2025
51 checks passed
@DeividasK DeividasK deleted the CRE-774-3 branch September 9, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants