Skip to content

Commit

Permalink
Merge develop into branch
Browse files Browse the repository at this point in the history
  • Loading branch information
austinborn committed Sep 14, 2023
2 parents 34f3cd0 + 04665a7 commit 20467b3
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 43 deletions.
44 changes: 22 additions & 22 deletions contracts/gas-snapshots/llo-feeds.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ RewardManagerUpdateRewardRecipientsTest:test_updateRecipientsToDifferentSet() (g
RewardManagerUpdateRewardRecipientsTest:test_updateRecipientsToDifferentSetWithInvalidWeights() (gas: 259546)
RewardManagerUpdateRewardRecipientsTest:test_updateRecipientsUpdateAndRemoveExistingForLargerSet() (gas: 251938)
RewardManagerUpdateRewardRecipientsTest:test_updateRecipientsUpdateAndRemoveExistingForSmallerSet() (gas: 250223)
VerificationdeactivateConfigWhenThereAreMultipleDigestsTest:test_correctlyRemovesAMiddleDigest() (gas: 24155)
VerificationdeactivateConfigWhenThereAreMultipleDigestsTest:test_correctlyRemovesTheFirstDigest() (gas: 24122)
VerificationdeactivateConfigWhenThereAreMultipleDigestsTest:test_correctlyUnsetsDigestsInSequence() (gas: 44043)
VerificationdeactivateConfigWhenThereAreMultipleDigestsTest:test_correctlyRemovesAMiddleDigest() (gas: 24177)
VerificationdeactivateConfigWhenThereAreMultipleDigestsTest:test_correctlyRemovesTheFirstDigest() (gas: 24144)
VerificationdeactivateConfigWhenThereAreMultipleDigestsTest:test_correctlyUnsetsDigestsInSequence() (gas: 44109)
VerificationdeactivateConfigWhenThereAreMultipleDigestsTest:test_revertsIfCalledByNonOwner() (gas: 15016)
VerificationdeactivateConfigWhenThereAreMultipleDigestsTest:test_revertsIfRemovingAnEmptyDigest() (gas: 10907)
VerificationdeactivateConfigWhenThereAreMultipleDigestsTest:test_revertsIfRemovingAnNonExistentDigest() (gas: 13381)
Expand All @@ -186,8 +186,8 @@ VerifierBulkVerifyBillingReport:test_verifyWithBulkLink() (gas: 556847)
VerifierBulkVerifyBillingReport:test_verifyWithBulkNative() (gas: 560426)
VerifierBulkVerifyBillingReport:test_verifyWithBulkNativeUnwrapped() (gas: 567917)
VerifierBulkVerifyBillingReport:test_verifyWithBulkNativeUnwrappedReturnsChange() (gas: 574921)
VerifierConstructorTest:test_revertsIfInitializedWithEmptyVerifierProxy() (gas: 59939)
VerifierConstructorTest:test_setsTheCorrectProperties() (gas: 1788491)
VerifierConstructorTest:test_revertsIfInitializedWithEmptyVerifierProxy() (gas: 59967)
VerifierConstructorTest:test_setsTheCorrectProperties() (gas: 1815769)
VerifierDeactivateFeedWithVerifyTest:test_currentReportAllowsVerification() (gas: 192062)
VerifierDeactivateFeedWithVerifyTest:test_currentReportFailsVerification() (gas: 111727)
VerifierDeactivateFeedWithVerifyTest:test_previousReportAllowsVerification() (gas: 99613)
Expand All @@ -197,15 +197,15 @@ VerifierProxyAccessControlledVerificationTest:test_revertsIfNoAccess() (gas: 110
VerifierProxyConstructorTest:test_correctlySetsTheCorrectAccessControllerInterface() (gas: 1482522)
VerifierProxyConstructorTest:test_correctlySetsTheOwner() (gas: 1462646)
VerifierProxyConstructorTest:test_correctlySetsVersion() (gas: 6873)
VerifierProxyInitializeVerifierTest:test_revertsIfDigestAlreadySet() (gas: 54086)
VerifierProxyInitializeVerifierTest:test_revertsIfDigestAlreadySet() (gas: 54108)
VerifierProxyInitializeVerifierTest:test_revertsIfNotCorrectVerifier() (gas: 13595)
VerifierProxyInitializeVerifierTest:test_revertsIfNotOwner() (gas: 17157)
VerifierProxyInitializeVerifierTest:test_revertsIfVerifierAlreadyInitialized() (gas: 42025)
VerifierProxyInitializeVerifierTest:test_revertsIfZeroAddress() (gas: 10948)
VerifierProxyInitializeVerifierTest:test_setFeeManagerWhichDoesntHonourIERC165Interface() (gas: 13815)
VerifierProxyInitializeVerifierTest:test_setFeeManagerWhichDoesntHonourInterface() (gas: 16301)
VerifierProxyInitializeVerifierTest:test_setFeeManagerZeroAddress() (gas: 10947)
VerifierProxyInitializeVerifierTest:test_updatesVerifierIfVerifier() (gas: 53384)
VerifierProxyInitializeVerifierTest:test_updatesVerifierIfVerifier() (gas: 53406)
VerifierProxySetAccessControllerTest:test_emitsTheCorrectEvent() (gas: 35340)
VerifierProxySetAccessControllerTest:test_revertsIfCalledByNonOwner() (gas: 15061)
VerifierProxySetAccessControllerTest:test_successfullySetsNewAccessController() (gas: 32032)
Expand All @@ -216,20 +216,20 @@ VerifierProxyUnsetVerifierWithPreviouslySetVerifierTest:test_correctlyUnsetsVeri
VerifierProxyUnsetVerifierWithPreviouslySetVerifierTest:test_emitsAnEventAfterUnsettingVerifier() (gas: 17965)
VerifierProxyVerifyTest:test_proxiesToTheCorrectVerifier() (gas: 201609)
VerifierProxyVerifyTest:test_revertsIfNoVerifierConfigured() (gas: 115615)
VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlySetsConfigWhenDigestsAreRemoved() (gas: 538605)
VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesDigestsOnMultipleVerifiersInTheProxy() (gas: 964140)
VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesTheDigestInTheProxy() (gas: 520186)
VerifierSetConfigFromSourceTest:test_revertsIfCalledByNonOwner() (gas: 183115)
VerifierSetConfigTest:test_correctlyUpdatesTheConfig() (gas: 1057670)
VerifierSetConfigTest:test_revertsIfCalledByNonOwner() (gas: 182962)
VerifierSetConfigTest:test_revertsIfDuplicateSigners() (gas: 251529)
VerifierSetConfigTest:test_revertsIfFaultToleranceIsZero() (gas: 176521)
VerifierSetConfigTest:test_revertsIfNotEnoughSigners() (gas: 15813)
VerifierSetConfigTest:test_revertsIfSetWithTooManySigners() (gas: 22191)
VerifierSetConfigTest:test_revertsIfSignerContainsZeroAddress() (gas: 228002)
VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlySetsConfigWhenDigestsAreRemoved() (gas: 538392)
VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlyUpdatesDigestsOnMultipleVerifiersInTheProxy() (gas: 963709)
VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlyUpdatesTheDigestInTheProxy() (gas: 519967)
VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlySetsConfigWhenDigestsAreRemoved() (gas: 538896)
VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesDigestsOnMultipleVerifiersInTheProxy() (gas: 964726)
VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesTheDigestInTheProxy() (gas: 520480)
VerifierSetConfigFromSourceTest:test_revertsIfCalledByNonOwner() (gas: 183215)
VerifierSetConfigTest:test_correctlyUpdatesTheConfig() (gas: 1057923)
VerifierSetConfigTest:test_revertsIfCalledByNonOwner() (gas: 182984)
VerifierSetConfigTest:test_revertsIfDuplicateSigners() (gas: 251559)
VerifierSetConfigTest:test_revertsIfFaultToleranceIsZero() (gas: 176543)
VerifierSetConfigTest:test_revertsIfNotEnoughSigners() (gas: 15835)
VerifierSetConfigTest:test_revertsIfSetWithTooManySigners() (gas: 22213)
VerifierSetConfigTest:test_revertsIfSignerContainsZeroAddress() (gas: 228032)
VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlySetsConfigWhenDigestsAreRemoved() (gas: 538645)
VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlyUpdatesDigestsOnMultipleVerifiersInTheProxy() (gas: 964215)
VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlyUpdatesTheDigestInTheProxy() (gas: 520220)
VerifierSupportsInterfaceTest:test_falseIfIsNotCorrectInterface() (gas: 5590)
VerifierSupportsInterfaceTest:test_trueIfIsCorrectInterface() (gas: 5633)
VerifierTestBillingReport:test_verifyWithLink() (gas: 274946)
Expand All @@ -253,7 +253,7 @@ VerifierVerifySingleConfigDigestTest:test_setsTheCorrectEpoch() (gas: 194270)
Verifier_accessControlledVerify:testVerifyWithAccessControl_gas() (gas: 212066)
Verifier_bulkVerifyWithFee:testBulkVerifyProxyWithLinkFeeSuccess_gas() (gas: 519368)
Verifier_bulkVerifyWithFee:testBulkVerifyProxyWithNativeFeeSuccess_gas() (gas: 542767)
Verifier_setConfig:testSetConfigSuccess_gas() (gas: 922451)
Verifier_setConfig:testSetConfigSuccess_gas() (gas: 922682)
Verifier_verify:testVerifyProxySuccess_gas() (gas: 198731)
Verifier_verify:testVerifySuccess_gas() (gas: 186725)
Verifier_verifyWithFee:testVerifyProxyWithLinkFeeSuccess_gas() (gas: 238886)
Expand Down
8 changes: 7 additions & 1 deletion contracts/src/v0.8/llo-feeds/Verifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ contract Verifier is IVerifier, ConfirmedOwner, TypeAndVersionInterface {
feedId,
block.chainid,
address(this),
0, // 0 defaults to feedConfig.configCount + 1
signers,
offchainTransmitters,
f,
Expand All @@ -338,6 +339,7 @@ contract Verifier is IVerifier, ConfirmedOwner, TypeAndVersionInterface {
bytes32 feedId,
uint256 sourceChainId,
address sourceAddress,
uint32 newConfigCount,
address[] memory signers,
bytes32[] memory offchainTransmitters,
uint8 f,
Expand All @@ -350,6 +352,7 @@ contract Verifier is IVerifier, ConfirmedOwner, TypeAndVersionInterface {
feedId,
sourceChainId,
sourceAddress,
newConfigCount,
signers,
offchainTransmitters,
f,
Expand All @@ -364,6 +367,7 @@ contract Verifier is IVerifier, ConfirmedOwner, TypeAndVersionInterface {
/// @param feedId Feed ID to set config for
/// @param sourceChainId Chain ID of source config
/// @param sourceAddress Address of source config Verifier
/// @param newConfigCount Optional param to force the new config count
/// @param signers addresses with which oracles sign the reports
/// @param offchainTransmitters CSA key for the ith Oracle
/// @param f number of faulty oracles the system can tolerate
Expand All @@ -375,6 +379,7 @@ contract Verifier is IVerifier, ConfirmedOwner, TypeAndVersionInterface {
bytes32 feedId,
uint256 sourceChainId,
address sourceAddress,
uint32 newConfigCount,
address[] memory signers,
bytes32[] memory offchainTransmitters,
uint8 f,
Expand All @@ -386,7 +391,8 @@ contract Verifier is IVerifier, ConfirmedOwner, TypeAndVersionInterface {
VerifierState storage feedVerifierState = s_feedVerifierStates[feedId];

// Increment the number of times a config has been set first
feedVerifierState.configCount++;
if (newConfigCount > 0) feedVerifierState.configCount = newConfigCount;
else feedVerifierState.configCount++;

bytes32 configDigest = _configDigestFromConfigData(
feedId,
Expand Down
2 changes: 2 additions & 0 deletions contracts/src/v0.8/llo-feeds/interfaces/IVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ interface IVerifier is IERC165 {
* @param feedId Feed ID to set config for
* @param sourceChainId Chain ID of source config
* @param sourceAddress Address of source config Verifier
* @param newConfigCount Param to force the new config count
* @param signers addresses with which oracles sign the reports
* @param offchainTransmitters CSA key for the ith Oracle
* @param f number of faulty oracles the system can tolerate
Expand All @@ -57,6 +58,7 @@ interface IVerifier is IERC165 {
bytes32 feedId,
uint256 sourceChainId,
address sourceAddress,
uint32 newConfigCount,
address[] memory signers,
bytes32[] memory offchainTransmitters,
uint8 f,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ contract ErroredVerifier is IVerifier {
bytes32,
uint256,
address,
uint32,
address[] memory,
bytes32[] memory,
uint8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ contract VerifierSetConfigFromSourceTest is BaseTest {
FEED_ID,
12345,
address(12345),
0,
_getSignerAddresses(signers),
s_offchaintransmitters,
FAULT_TOLERANCE,
Expand All @@ -39,6 +40,7 @@ contract VerifierSetConfigFromSourceMultipleDigestsTest is BaseTestWithMultipleC
FEED_ID,
12345,
address(12345),
0,
_getSignerAddresses(newSigners),
s_offchaintransmitters,
4,
Expand All @@ -60,6 +62,7 @@ contract VerifierSetConfigFromSourceMultipleDigestsTest is BaseTestWithMultipleC
FEED_ID_2,
12345,
address(12345),
0,
_getSignerAddresses(newSigners),
s_offchaintransmitters,
4,
Expand All @@ -77,6 +80,7 @@ contract VerifierSetConfigFromSourceMultipleDigestsTest is BaseTestWithMultipleC
FEED_ID_3,
12345,
address(12345),
0,
_getSignerAddresses(newSigners),
s_offchaintransmitters,
4,
Expand All @@ -100,6 +104,7 @@ contract VerifierSetConfigFromSourceMultipleDigestsTest is BaseTestWithMultipleC
FEED_ID,
12345,
address(s_verifier),
0,
_getSignerAddresses(newSigners),
s_offchaintransmitters,
4,
Expand Down
Loading

0 comments on commit 20467b3

Please sign in to comment.