Skip to content

Commit

Permalink
Merge branch 'capability-registry-internal-review' into KS-264/capabi…
Browse files Browse the repository at this point in the history
…lity-registry-internal-review-informational-findings
  • Loading branch information
cds95 committed Jun 5, 2024
2 parents 045a940 + f57ca21 commit 9affacc
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 164 deletions.
5 changes: 5 additions & 0 deletions .changeset/cuddly-lions-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#internal remove update capabilities from capability registry
5 changes: 5 additions & 0 deletions contracts/.changeset/silent-ravens-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chainlink/contracts': patch
---

remove update capabilities from capability registry
14 changes: 3 additions & 11 deletions contracts/src/v0.8/keystone/CapabilityRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,9 @@ contract CapabilityRegistry is OwnerIsCreator, TypeAndVersionInterface {

/// @notice Adds a new capability to the capability registry
/// @param capabilities The capabilities being added
/// @dev There is no function to update capabilities as this would require
/// nodes to trust that the capabilities they support are not updated by the
/// admin
function addCapabilities(Capability[] calldata capabilities) external onlyOwner {
for (uint256 i; i < capabilities.length; ++i) {
Capability memory capability = capabilities[i];
Expand All @@ -558,17 +561,6 @@ contract CapabilityRegistry is OwnerIsCreator, TypeAndVersionInterface {
}
}

/// @notice Updates capabilities
/// @param capabilities The updated capability params
function updateCapabilities(Capability[] calldata capabilities) external onlyOwner {
for (uint256 i; i < capabilities.length; ++i) {
Capability memory capability = capabilities[i];
bytes32 hashedCapabilityId = getHashedCapabilityId(capability.labelledName, capability.version);
if (!s_hashedCapabilityIds.contains(hashedCapabilityId)) revert CapabilityDoesNotExist(hashedCapabilityId);
_setCapability(hashedCapabilityId, capability);
}
}

/// @notice Deprecates a capability
/// @param hashedCapabilityIds[] The IDs of the capabilities to deprecate
function deprecateCapabilities(bytes32[] calldata hashedCapabilityIds) external onlyOwner {
Expand Down

This file was deleted.

Loading

0 comments on commit 9affacc

Please sign in to comment.