From 06b8f29c5d6a76fb38ce6131d7dd0da7f8f3b5dc Mon Sep 17 00:00:00 2001 From: Christopher Dimitri Sastropranoto Date: Wed, 5 Jun 2024 15:36:17 -0700 Subject: [PATCH 1/2] add capability registry comment explaining why we do not validate node operator name --- .changeset/famous-timers-love.md | 5 +++++ contracts/.changeset/chilly-rivers-study.md | 5 +++++ contracts/src/v0.8/keystone/CapabilityRegistry.sol | 4 ++++ 3 files changed, 14 insertions(+) create mode 100644 .changeset/famous-timers-love.md create mode 100644 contracts/.changeset/chilly-rivers-study.md diff --git a/.changeset/famous-timers-love.md b/.changeset/famous-timers-love.md new file mode 100644 index 00000000000..271040ab726 --- /dev/null +++ b/.changeset/famous-timers-love.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#internal add capability registry comment explaining why we do not validate node operator name diff --git a/contracts/.changeset/chilly-rivers-study.md b/contracts/.changeset/chilly-rivers-study.md new file mode 100644 index 00000000000..0bd5d713a1b --- /dev/null +++ b/contracts/.changeset/chilly-rivers-study.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +add capability registry comment explaining why we do not validate node operator name diff --git a/contracts/src/v0.8/keystone/CapabilityRegistry.sol b/contracts/src/v0.8/keystone/CapabilityRegistry.sol index a45bcdf2a29..c4fd9fdb1e9 100644 --- a/contracts/src/v0.8/keystone/CapabilityRegistry.sol +++ b/contracts/src/v0.8/keystone/CapabilityRegistry.sol @@ -20,6 +20,10 @@ contract CapabilityRegistry is OwnerIsCreator, TypeAndVersionInterface { /// operator address admin; /// @notice Human readable name of a Node Operator managing the node + /// @dev The contract does not validate the length of the node operator + /// name and does not validate whether or not it contains invalid + /// characters. These names will be supplied by a trusted admin + /// and we want to minimize gas costs by omitting these checks on-chain. string name; } From 521d3a2aeb479c210a3bd99eb0f48ad9384d85cc Mon Sep 17 00:00:00 2001 From: Christopher Dimitri Sastropranoto Date: Wed, 5 Jun 2024 22:36:51 -0700 Subject: [PATCH 2/2] address PR feedback --- contracts/src/v0.8/keystone/CapabilityRegistry.sol | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/contracts/src/v0.8/keystone/CapabilityRegistry.sol b/contracts/src/v0.8/keystone/CapabilityRegistry.sol index c4fd9fdb1e9..7f29b511e7d 100644 --- a/contracts/src/v0.8/keystone/CapabilityRegistry.sol +++ b/contracts/src/v0.8/keystone/CapabilityRegistry.sol @@ -20,10 +20,9 @@ contract CapabilityRegistry is OwnerIsCreator, TypeAndVersionInterface { /// operator address admin; /// @notice Human readable name of a Node Operator managing the node - /// @dev The contract does not validate the length of the node operator - /// name and does not validate whether or not it contains invalid - /// characters. These names will be supplied by a trusted admin - /// and we want to minimize gas costs by omitting these checks on-chain. + /// @dev The contract does not validate the length or characters of the + /// node operator name because a trusted admin will supply these names. + /// We reduce gas costs by omitting these checks on-chain. string name; }