Skip to content

Commit

Permalink
keystone: multiple signer sets (#13417)
Browse files Browse the repository at this point in the history
* keystone: Store configs by version

* Restructure code to avoid double lookup

* Only load the F value once

* Implement clearConfig

* Remove now unused parameter

* keystone: Match other optimizer runs configs

* keystone: Test report submission with different config versions

* Move f value validation earlier in the call

* keystone: prettier format

* Remove unused error

* Update gas snapshots

* Update gethwrappers

---------

Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 9bb35d4 commit 77efaa2
Show file tree
Hide file tree
Showing 8 changed files with 257 additions and 144 deletions.
2 changes: 1 addition & 1 deletion contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ test = 'src/v0.8/llo-feeds/test'
solc_version = '0.8.19'

[profile.keystone]
optimizer_runs = 1_000_000
solc_version = '0.8.19'
src = 'src/v0.8/keystone'
test = 'src/v0.8/keystone/test'
optimizer_runs = 10_000

[profile.operatorforwarder]
optimizer_runs = 1_000_000
Expand Down
180 changes: 91 additions & 89 deletions contracts/gas-snapshots/keystone.gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,90 +1,92 @@
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_AddCapability_NoConfigurationContract() (gas: 146839)
CapabilityRegistry_AddCapabilityTest:test_AddCapability_WithConfiguration() (gas: 171105)
CapabilityRegistry_AddCapabilityTest:test_DeprecatesCapability() (gas: 88694)
CapabilityRegistry_AddCapabilityTest:test_EmitsEvent() (gas: 88815)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_CalledByNonAdmin() (gas: 21728)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_CalledByNonAdmin() (gas: 22199)
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)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_CapabilityExists() (gas: 138685)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_CapabilityIsDeprecated() (gas: 89496)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_ConfigurationContractDoesNotMatchInterface() (gas: 3998052)
CapabilityRegistry_AddCapabilityTest:test_RevertWhen_ConfigurationContractNotDeployed() (gas: 24995)
CapabilityRegistry_AddDONTest:test_AddDON() (gas: 332870)
CapabilityRegistry_AddDONTest:test_RevertWhen_CalledByNonAdmin() (gas: 19285)
CapabilityRegistry_AddDONTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 155460)
CapabilityRegistry_AddDONTest:test_RevertWhen_DeprecatedCapabilityAdded() (gas: 224960)
CapabilityRegistry_AddDONTest:test_RevertWhen_DuplicateCapabilityAdded() (gas: 239487)
CapabilityRegistry_AddDONTest:test_RevertWhen_DuplicateNodeAdded() (gas: 108051)
CapabilityRegistry_AddDONTest:test_RevertWhen_FaultToleranceIsZero() (gas: 40158)
CapabilityRegistry_AddDONTest:test_RevertWhen_NodeDoesNotSupportCapability() (gas: 169921)
CapabilityRegistry_AddNodeOperatorsTest:test_AddNodeOperators() (gas: 133916)
CapabilityRegistry_AddNodeOperatorsTest:test_RevertWhen_CalledByNonAdmin() (gas: 16949)
CapabilityRegistry_AddNodeOperatorsTest:test_RevertWhen_NodeOperatorAdminAddressZero() (gas: 17795)
CapabilityRegistry_AddNodesTest:test_AddsNodeInfo() (gas: 355866)
CapabilityRegistry_AddNodesTest:test_OwnerCanAddNodes() (gas: 355854)
CapabilityRegistry_AddNodesTest:test_RevertWhen_AddingDuplicateP2PId() (gas: 301701)
CapabilityRegistry_AddNodesTest:test_RevertWhen_AddingNodeWithInvalidCapability() (gas: 55370)
CapabilityRegistry_AddNodesTest:test_RevertWhen_AddingNodeWithoutCapabilities() (gas: 27706)
CapabilityRegistry_AddNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 24579)
CapabilityRegistry_AddNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 27412)
CapabilityRegistry_AddNodesTest:test_RevertWhen_SignerAddressEmpty() (gas: 27051)
CapabilityRegistry_AddNodesTest:test_RevertWhen_SignerAddressNotUnique() (gas: 310108)
CapabilityRegistry_GetCapabilitiesTest:test_ExcludesDeprecatedCapabilities() (gas: 115054)
CapabilityRegistry_GetCapabilitiesTest:test_ReturnsCapabilities() (gas: 53946)
CapabilityRegistry_GetDONsTest:test_CorrectlyFetchesDONs() (gas: 71958)
CapabilityRegistry_GetDONsTest:test_DoesNotIncludeRemovedDONs() (gas: 116197)
CapabilityRegistry_GetHashedCapabilityTest:test_CorrectlyGeneratesHashedCapabilityId() (gas: 10842)
CapabilityRegistry_GetHashedCapabilityTest:test_DoesNotCauseIncorrectClashes() (gas: 11915)
CapabilityRegistry_GetNodeOperatorsTest:test_CorrectlyFetchesNodeOperators() (gas: 34361)
CapabilityRegistry_GetNodeOperatorsTest:test_DoesNotIncludeRemovedNodeOperators() (gas: 99004)
CapabilityRegistry_GetNodesTest:test_CorrectlyFetchesNodes() (gas: 59970)
CapabilityRegistry_GetNodesTest:test_DoesNotIncludeRemovedNodes() (gas: 73816)
CapabilityRegistry_RemoveDONsTest:test_RemovesDON() (gas: 99887)
CapabilityRegistry_RemoveDONsTest:test_RevertWhen_CalledByNonAdmin() (gas: 15669)
CapabilityRegistry_RemoveDONsTest:test_RevertWhen_DONDoesNotExist() (gas: 14160)
CapabilityRegistry_RemoveNodeOperatorsTest:test_RemovesNodeOperator() (gas: 141779)
CapabilityRegistry_RemoveNodeOperatorsTest:test_RevertWhen_CalledByNonOwner() (gas: 15761)
CapabilityRegistry_RemoveNodesTest:test_CanAddNodeWithSameSignerAddressAfterRemoving() (gas: 80895)
CapabilityRegistry_RemoveNodesTest:test_OwnerCanRemoveNodes() (gas: 57865)
CapabilityRegistry_RemoveNodesTest:test_RemovesNode() (gas: 57864)
CapabilityRegistry_RemoveNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 25085)
CapabilityRegistry_RemoveNodesTest:test_RevertWhen_NodeDoesNotExist() (gas: 18395)
CapabilityRegistry_RemoveNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 18385)
CapabilityRegistry_UpdateDONTest:test_RevertWhen_CalledByNonAdmin() (gas: 19370)
CapabilityRegistry_UpdateDONTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 133496)
CapabilityRegistry_UpdateDONTest:test_RevertWhen_DONDoesNotExist() (gas: 17790)
CapabilityRegistry_UpdateDONTest:test_RevertWhen_DeprecatedCapabilityAdded() (gas: 202996)
CapabilityRegistry_UpdateDONTest:test_RevertWhen_DuplicateCapabilityAdded() (gas: 217569)
CapabilityRegistry_UpdateDONTest:test_RevertWhen_DuplicateNodeAdded() (gas: 86089)
CapabilityRegistry_UpdateDONTest:test_RevertWhen_NodeDoesNotSupportCapability() (gas: 148002)
CapabilityRegistry_UpdateDONTest:test_UpdatesDON() (gas: 330869)
CapabilityRegistry_UpdateNodeOperatorTest:test_RevertWhen_CalledByNonAdminAndNonOwner() (gas: 17712)
CapabilityRegistry_UpdateNodeOperatorTest:test_RevertWhen_NodeOperatorAdminIsZeroAddress() (gas: 17636)
CapabilityRegistry_UpdateNodeOperatorTest:test_UpdatesNodeOperator() (gas: 72345)
CapabilityRegistry_UpdateNodesTest:test_CanUpdateParamsIfNodeSignerAddressNoLongerUsed() (gas: 252301)
CapabilityRegistry_UpdateNodesTest:test_OwnerCanUpdateNodes() (gas: 159616)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_AddingNodeWithInvalidCapability() (gas: 36253)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 24580)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_NodeDoesNotExist() (gas: 27344)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_NodeSignerAlreadyAssignedToAnotherNode() (gas: 29312)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 27332)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_SignerAddressEmpty() (gas: 27015)
CapabilityRegistry_UpdateNodesTest:test_RevertWhen_UpdatingNodeWithoutCapabilities() (gas: 25666)
CapabilityRegistry_UpdateNodesTest:test_UpdatesNodeInfo() (gas: 159605)
KeystoneForwarder_ReportTest:test_Report_ConfigVersion() (gas: 2676465)
KeystoneForwarder_ReportTest:test_Report_SuccessfulDelivery() (gas: 150738)
KeystoneForwarder_ReportTest:test_RevertWhen_AlreadyProcessed() (gas: 158024)
KeystoneForwarder_ReportTest:test_RevertWhen_AnySignatureIsInvalid() (gas: 111634)
KeystoneForwarder_ReportTest:test_RevertWhen_AnySignerIsInvalid() (gas: 143377)
KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasDuplicateSignatures() (gas: 119553)
KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasIncorrectDON() (gas: 98500)
KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasInexistentConfigVersion() (gas: 98757)
KeystoneForwarder_ReportTest:test_RevertWhen_ReportIsMalformed() (gas: 67777)
KeystoneForwarder_ReportTest:test_RevertWhen_TooFewSignatures() (gas: 77819)
KeystoneForwarder_ReportTest:test_RevertWhen_TooManySignatures() (gas: 78543)
KeystoneForwarder_SetConfigTest:test_RevertWhen_ExcessSigners() (gas: 20162)
KeystoneForwarder_SetConfigTest:test_RevertWhen_FaultToleranceIsZero() (gas: 90143)
KeystoneForwarder_SetConfigTest:test_RevertWhen_InsufficientSigners() (gas: 14511)
KeystoneForwarder_SetConfigTest:test_RevertWhen_NotOwner() (gas: 90874)
KeystoneForwarder_SetConfigTest:test_RevertWhen_ProvidingDuplicateSigners() (gas: 847644)
KeystoneForwarder_SetConfigTest:test_SetConfig_FirstTime() (gas: 2224138)
KeystoneForwarder_SetConfigTest:test_SetConfig_WhenSignersAreRemoved() (gas: 2365984)
KeystoneForwarder_TypeAndVersionTest:test_TypeAndVersion() (gas: 9641)
Loading

0 comments on commit 77efaa2

Please sign in to comment.