Skip to content

Commit

Permalink
Add additional capability and DON metadata (#13425)
Browse files Browse the repository at this point in the history
* Add metadata and validate fault tolerance

* Validate node count is more than F

* Refactor test constants

* Update snapshot

* Check capability type is returned

* Update getters and add tests

* Make capability name and version a string

* Gen wrappers and snapshots

* Add changesets
  • Loading branch information
DeividasK authored Jun 6, 2024
1 parent 84db591 commit eeb363f
Show file tree
Hide file tree
Showing 22 changed files with 353 additions and 234 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-dragons-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#internal
5 changes: 5 additions & 0 deletions contracts/.changeset/long-cups-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chainlink/contracts': patch
---

#internal
155 changes: 90 additions & 65 deletions contracts/gas-snapshots/keystone.gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,65 +1,90 @@
CapabilityRegistry_AddCapabilityTest:test_AddCapability_NoConfigurationContract() (gas: 136922)
CapabilityRegistry_AddCapabilityTest:test_AddCapability_WithConfiguration() (gas: 160688)
CapabilityRegistry_AddCapabilityTest:test_DeprecatesCapability() (gas: 87158)
CapabilityRegistry_AddCapabilityTest:test_EmitsEvent() (gas: 87332)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_CalledByNonAdmin() (gas: 22371)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_CalledByNonAdmin() (gas: 23590)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 15513)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_CapabilityExists() (gas: 133959)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_CapabilityIsDeprecated() (gas: 88022)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_ConfigurationContractDoesNotMatchInterface() (gas: 2725761)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_ConfigurationContractNotDeployed() (gas: 23513)
CapabilityRegistry_AddDONTest:test_AddDON() (gas: 227135)
CapabilityRegistry_AddDONTest:test_RevertWhen_CalledByNonAdmin() (gas: 21160)
CapabilityRegistry_AddDONTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 89373)
CapabilityRegistry_AddDONTest:test_RevertWhen_DeprecatedCapabilityAdded() (gas: 180895)
CapabilityRegistry_AddDONTest:test_RevertWhen_DuplicateCapabilityAdded() (gas: 210428)
CapabilityRegistry_AddDONTest:test_RevertWhen_DuplicateNodeAdded() (gas: 109784)
CapabilityRegistry_AddDONTest:test_RevertWhen_NodeDoesNotSupportCapability() (gas: 120851)
CapabilityRegistry_AddNodeOperatorsTest:test_AddNodeOperators() (gas: 164127)
CapabilityRegistry_AddNodeOperatorsTest:test_RevertWhen_CalledByNonAdmin() (gas: 28654)
CapabilityRegistry_AddNodeOperatorsTest:test_RevertWhen_NodeOperatorAdminAddressZero() (gas: 29520)
CapabilityRegistry_AddNodesTest:test_AddsNodeParams() (gas: 205953)
CapabilityRegistry_AddNodesTest:test_OwnerCanAddNodes() (gas: 205953)
CapabilityRegistry_AddNodesTest:test_RevertWhen_AddingDuplicateP2PId() (gas: 152430)
CapabilityRegistry_AddNodesTest:test_RevertWhen_AddingNodeWithInvalidCapability() (gas: 57467)
CapabilityRegistry_AddNodesTest:test_RevertWhen_AddingNodeWithoutCapabilities() (gas: 31747)
CapabilityRegistry_AddNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 30923)
CapabilityRegistry_AddNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 31612)
CapabilityRegistry_AddNodesTest:test_RevertWhen_SignerAddressEmpty() (gas: 31449)
CapabilityRegistry_GetCapabilitiesTest:test_ExcludesDeprecatedCapabilities() (gas: 109143)
CapabilityRegistry_GetCapabilitiesTest:test_ReturnsCapabilities() (gas: 44169)
CapabilityRegistry_RemoveNodeOperatorsTest:test_RemovesNodeOperator() (gas: 36837)
CapabilityRegistry_RemoveNodeOperatorsTest:test_RevertWhen_CalledByNonOwner() (gas: 17912)
CapabilityRegistry_RemoveNodesTest:test_OwnerCanRemoveNodes() (gas: 35545)
CapabilityRegistry_RemoveNodesTest:test_RemovesNode() (gas: 35556)
CapabilityRegistry_RemoveNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 27298)
CapabilityRegistry_RemoveNodesTest:test_RevertWhen_NodeDoesNotExist() (gas: 20508)
CapabilityRegistry_RemoveNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 20498)
CapabilityRegistry_UpdateNodeOperatorTest:test_RevertWhen_CalledByNonAdminAndNonOwner() (gas: 19819)
CapabilityRegistry_UpdateNodeOperatorTest:test_RevertWhen_NodeOperatorAdminIsZeroAddress() (gas: 19754)
CapabilityRegistry_UpdateNodeOperatorTest:test_UpdatesNodeOperator() (gas: 38439)
CapabilityRegistry_UpdateNodesTest:test_OwnerCanUpdateNodes() (gas: 119396)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_AddingNodeWithInvalidCapability() (gas: 40310)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 30901)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_NodeDoesNotExist() (gas: 31576)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 31575)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_SignerAddressEmpty() (gas: 31390)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_UpdatingNodeWithoutCapabilities() (gas: 31667)
CapabilityRegistry_UpdateNodesTest:test_UpdatesNodeParams() (gas: 119439)
KeystoneForwarder_ReportTest:test_Report_SuccessfulDelivery() (gas: 133714)
KeystoneForwarder_ReportTest:test_RevertWhen_AnySignatureIsInvalid() (gas: 97790)
KeystoneForwarder_ReportTest:test_RevertWhen_AnySignerIsInvalid() (gas: 110159)
KeystoneForwarder_ReportTest:test_RevertWhen_ReportAlreadyProcessed() (gas: 141632)
KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasDuplicateSignatures() (gas: 110451)
KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasIncorrectDON() (gas: 84208)
KeystoneForwarder_ReportTest:test_RevertWhen_ReportIsMalformed() (gas: 58504)
KeystoneForwarder_ReportTest:test_RevertWhen_TooFewSignatures() (gas: 68813)
KeystoneForwarder_ReportTest:test_RevertWhen_TooManySignatures() (gas: 69493)
KeystoneForwarder_SetConfigTest:test_RevertWhen_ExcessSigners() (gas: 40038)
KeystoneForwarder_SetConfigTest:test_RevertWhen_FaultToleranceIsZero() (gas: 109995)
KeystoneForwarder_SetConfigTest:test_RevertWhen_InsufficientSigners() (gas: 34399)
KeystoneForwarder_SetConfigTest:test_RevertWhen_ProvidingDuplicateSigners() (gas: 867400)
KeystoneForwarder_SetConfigTest:test_SetConfig_FirstTime() (gas: 2224742)
KeystoneForwarder_SetConfigTest:test_SetConfig_WhenSignersAreRemoved() (gas: 2399768)
KeystoneForwarder_TypeAndVersionTest:test_TypeAndVersion() (gas: 9641)
CapabilityRegistry_AddCapabilityTest:test_AddCapability_NoConfigurationContract() (gas: 146887)
CapabilityRegistry_AddCapabilityTest:test_AddCapability_WithConfiguration() (gas: 171153)
CapabilityRegistry_AddCapabilityTest:test_DeprecatesCapability() (gas: 88700)
CapabilityRegistry_AddCapabilityTest:test_EmitsEvent() (gas: 88821)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_CalledByNonAdmin() (gas: 21734)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_CalledByNonAdmin() (gas: 22208)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 15521)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_CapabilityExists() (gas: 138709)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_CapabilityIsDeprecated() (gas: 89502)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_ConfigurationContractDoesNotMatchInterface() (gas: 3889776)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_ConfigurationContractNotDeployed() (gas: 25007)
CapabilityRegistry_AddDONTest:test_AddDON() (gas: 332981)
CapabilityRegistry_AddDONTest:test_RevertWhen_CalledByNonAdmin() (gas: 19294)
CapabilityRegistry_AddDONTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 155475)
CapabilityRegistry_AddDONTest:test_RevertWhen_DeprecatedCapabilityAdded() (gas: 224972)
CapabilityRegistry_AddDONTest:test_RevertWhen_DuplicateCapabilityAdded() (gas: 239517)
CapabilityRegistry_AddDONTest:test_RevertWhen_DuplicateNodeAdded() (gas: 108063)
CapabilityRegistry_AddDONTest:test_RevertWhen_FaultToleranceIsZero() (gas: 40167)
CapabilityRegistry_AddDONTest:test_RevertWhen_NodeDoesNotSupportCapability() (gas: 169939)
CapabilityRegistry_AddNodeOperatorsTest:test_AddNodeOperators() (gas: 134000)
CapabilityRegistry_AddNodeOperatorsTest:test_RevertWhen_CalledByNonAdmin() (gas: 16961)
CapabilityRegistry_AddNodeOperatorsTest:test_RevertWhen_NodeOperatorAdminAddressZero() (gas: 17813)
CapabilityRegistry_AddNodesTest:test_AddsNodeInfo() (gas: 355902)
CapabilityRegistry_AddNodesTest:test_OwnerCanAddNodes() (gas: 355890)
CapabilityRegistry_AddNodesTest:test_RevertWhen_AddingDuplicateP2PId() (gas: 301737)
CapabilityRegistry_AddNodesTest:test_RevertWhen_AddingNodeWithInvalidCapability() (gas: 55394)
CapabilityRegistry_AddNodesTest:test_RevertWhen_AddingNodeWithoutCapabilities() (gas: 27730)
CapabilityRegistry_AddNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 24597)
CapabilityRegistry_AddNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 27436)
CapabilityRegistry_AddNodesTest:test_RevertWhen_SignerAddressEmpty() (gas: 27069)
CapabilityRegistry_AddNodesTest:test_RevertWhen_SignerAddressNotUnique() (gas: 310150)
CapabilityRegistry_GetCapabilitiesTest:test_ExcludesDeprecatedCapabilities() (gas: 115108)
CapabilityRegistry_GetCapabilitiesTest:test_ReturnsCapabilities() (gas: 54030)
CapabilityRegistry_GetDONsTest:test_CorrectlyFetchesDONs() (gas: 72024)
CapabilityRegistry_GetDONsTest:test_DoesNotIncludeRemovedDONs() (gas: 116236)
CapabilityRegistry_GetHashedCapabilityTest:test_CorrectlyGeneratesHashedCapabilityId() (gas: 10848)
CapabilityRegistry_GetHashedCapabilityTest:test_DoesNotCauseIncorrectClashes() (gas: 11927)
CapabilityRegistry_GetNodeOperatorsTest:test_CorrectlyFetchesNodeOperators() (gas: 34409)
CapabilityRegistry_GetNodeOperatorsTest:test_DoesNotIncludeRemovedNodeOperators() (gas: 99043)
CapabilityRegistry_GetNodesTest:test_CorrectlyFetchesNodes() (gas: 60003)
CapabilityRegistry_GetNodesTest:test_DoesNotIncludeRemovedNodes() (gas: 73840)
CapabilityRegistry_RemoveDONsTest:test_RemovesDON() (gas: 99917)
CapabilityRegistry_RemoveDONsTest:test_RevertWhen_CalledByNonAdmin() (gas: 15675)
CapabilityRegistry_RemoveDONsTest:test_RevertWhen_DONDoesNotExist() (gas: 14166)
CapabilityRegistry_RemoveNodeOperatorsTest:test_RemovesNodeOperator() (gas: 141827)
CapabilityRegistry_RemoveNodeOperatorsTest:test_RevertWhen_CalledByNonOwner() (gas: 15767)
CapabilityRegistry_RemoveNodesTest:test_CanAddNodeWithSameSignerAddressAfterRemoving() (gas: 80925)
CapabilityRegistry_RemoveNodesTest:test_OwnerCanRemoveNodes() (gas: 57877)
CapabilityRegistry_RemoveNodesTest:test_RemovesNode() (gas: 57876)
CapabilityRegistry_RemoveNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 25091)
CapabilityRegistry_RemoveNodesTest:test_RevertWhen_NodeDoesNotExist() (gas: 18407)
CapabilityRegistry_RemoveNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 18397)
CapabilityRegistry_UpdateDONTest:test_RevertWhen_CalledByNonAdmin() (gas: 19379)
CapabilityRegistry_UpdateDONTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 133511)
CapabilityRegistry_UpdateDONTest:test_RevertWhen_DONDoesNotExist() (gas: 17799)
CapabilityRegistry_UpdateDONTest:test_RevertWhen_DeprecatedCapabilityAdded() (gas: 203008)
CapabilityRegistry_UpdateDONTest:test_RevertWhen_DuplicateCapabilityAdded() (gas: 217599)
CapabilityRegistry_UpdateDONTest:test_RevertWhen_DuplicateNodeAdded() (gas: 86101)
CapabilityRegistry_UpdateDONTest:test_RevertWhen_NodeDoesNotSupportCapability() (gas: 148020)
CapabilityRegistry_UpdateDONTest:test_UpdatesDON() (gas: 331007)
CapabilityRegistry_UpdateNodeOperatorTest:test_RevertWhen_CalledByNonAdminAndNonOwner() (gas: 17727)
CapabilityRegistry_UpdateNodeOperatorTest:test_RevertWhen_NodeOperatorAdminIsZeroAddress() (gas: 17651)
CapabilityRegistry_UpdateNodeOperatorTest:test_UpdatesNodeOperator() (gas: 72390)
CapabilityRegistry_UpdateNodesTest:test_CanUpdateParamsIfNodeSignerAddressNoLongerUsed() (gas: 252355)
CapabilityRegistry_UpdateNodesTest:test_OwnerCanUpdateNodes() (gas: 159643)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_AddingNodeWithInvalidCapability() (gas: 36277)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 24598)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_NodeDoesNotExist() (gas: 27368)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_NodeSignerAlreadyAssignedToAnotherNode() (gas: 29330)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 27356)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_SignerAddressEmpty() (gas: 27033)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_UpdatingNodeWithoutCapabilities() (gas: 25690)
CapabilityRegistry_UpdateNodesTest:test_UpdatesNodeInfo() (gas: 159632)
KeystoneForwarder_ReportTest:test_Report_SuccessfulDelivery() (gas: 143626)
KeystoneForwarder_ReportTest:test_RevertWhen_AnySignatureIsInvalid() (gas: 109344)
KeystoneForwarder_ReportTest:test_RevertWhen_AnySignerIsInvalid() (gas: 140918)
KeystoneForwarder_ReportTest:test_RevertWhen_ReportAlreadyProcessed() (gas: 152819)
KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasDuplicateSignatures() (gas: 117273)
KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasIncorrectDON() (gas: 93443)
KeystoneForwarder_ReportTest:test_RevertWhen_ReportIsMalformed() (gas: 67749)
KeystoneForwarder_ReportTest:test_RevertWhen_TooFewSignatures() (gas: 78061)
KeystoneForwarder_ReportTest:test_RevertWhen_TooManySignatures() (gas: 78741)
KeystoneForwarder_SetConfigTest:test_RevertWhen_ExcessSigners() (gas: 19965)
KeystoneForwarder_SetConfigTest:test_RevertWhen_FaultToleranceIsZero() (gas: 89956)
KeystoneForwarder_SetConfigTest:test_RevertWhen_InsufficientSigners() (gas: 14315)
KeystoneForwarder_SetConfigTest:test_RevertWhen_NotOwner() (gas: 90678)
KeystoneForwarder_SetConfigTest:test_RevertWhen_ProvidingDuplicateSigners() (gas: 847316)
KeystoneForwarder_SetConfigTest:test_SetConfig_FirstTime() (gas: 2224343)
KeystoneForwarder_SetConfigTest:test_SetConfig_WhenSignersAreRemoved() (gas: 2367289)
KeystoneForwarder_TypeAndVersionTest:test_TypeAndVersion() (gas: 9663)
Loading

0 comments on commit eeb363f

Please sign in to comment.