Skip to content

[CRE-774] Prevent node operators from being deleted if still on a node#208

Merged
DeividasK merged 9 commits into
developfrom
CRE-774-4
Sep 10, 2025
Merged

[CRE-774] Prevent node operators from being deleted if still on a node#208
DeividasK merged 9 commits into
developfrom
CRE-774-4

Conversation

@justinkaseman
Copy link
Copy Markdown
Contributor

Description

To prevent NOPs from being deleted if still in use, adds an EnumerableSet of bytes32 P2PIDs to the Node Operator struct.

A new struct NodeOperatorParams acts as the Node Operator structure for parameters and query info.

@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-3 to develop September 9, 2025 08:12
@DeividasK DeividasK dismissed mchain0’s stale review September 9, 2025 08:12

The base branch was changed.

# Conflicts:
#	contracts/gas-snapshots/workflow.gas-snapshot
#	contracts/src/v0.8/workflow/dev/v2/CapabilitiesRegistry.sol
#	contracts/src/v0.8/workflow/dev/v2/test/CapabilitiesRegistry/CapabilitiesRegistry_AddNodeOperatorsTest.t.sol
#	contracts/src/v0.8/workflow/dev/v2/test/CapabilitiesRegistry/CapabilitiesRegistry_UpdateNodeOperatorsTest.t.sol
#	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
/// a trusted admin will supply these names. We reduce gas costs by omitting these checks on-chain.
string name;
/// @notice The P2P IDs of the nodes that this Node Operator owns
bytes32[] nodeP2PIDs;
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.

In case we do something like this:

struct NodeOperatorInfo {
  NodeOperatorParams params;
  bytes32[] nodeP2PIDs;
}

Would it result in the same storage and memory layout?

Copy link
Copy Markdown
Contributor

@DeividasK DeividasK Sep 10, 2025

Choose a reason for hiding this comment

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

It would be a nested structure and, I think, it would have the same storage and memory layout, yes. Generally, it seems that the practice is to flatten the structs, but I don't have a strong pref 🤷‍♂️

@DeividasK DeividasK merged commit 631b8c6 into develop Sep 10, 2025
51 checks passed
@DeividasK DeividasK deleted the CRE-774-4 branch September 10, 2025 12:21
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