Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update setConfigFromSource to force config count #10472

Merged
merged 19 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
64b2553
Update setConfigFromSource to force config count
austinborn Sep 4, 2023
969e50e
Merge branch 'develop' into llo-feeds-config-count-from-source
austinborn Sep 5, 2023
6af03dc
Test fixes + wrappers
Fletch153 Sep 5, 2023
7c69237
Merge remote-tracking branch 'origin/llo-feeds-config-count-from-sour…
Fletch153 Sep 5, 2023
1069294
Merge branch 'develop' into llo-feeds-config-count-from-source
Fletch153 Sep 5, 2023
b0cd052
Merge branch 'develop' into llo-feeds-config-count-from-source
austinborn Sep 6, 2023
46a3357
Merge develop into branch
austinborn Sep 12, 2023
25da6ea
Removed foundry from commit
Fletch153 Sep 12, 2023
2109e78
lint, wrappers, gas
Fletch153 Sep 12, 2023
d373ba9
Merge develop into branch
austinborn Sep 14, 2023
cab6f5f
Merge branch 'develop' into llo-feeds-config-count-from-source
austinborn Sep 14, 2023
6f03881
Merge develop into branch
austinborn Sep 14, 2023
6d73f43
Merge branch 'develop' into llo-feeds-config-count-from-source
austinborn Sep 14, 2023
646aa0e
Merge branch 'develop' into llo-feeds-config-count-from-source
austinborn Sep 14, 2023
f4accc5
Merge remote-tracking branch 'origin/develop' into llo-feeds-config-c…
austinborn Sep 14, 2023
501e3c3
Merge branch 'develop' into llo-feeds-config-count-from-source
austinborn Sep 14, 2023
32a36f8
Merge branch 'develop' into llo-feeds-config-count-from-source
austinborn Sep 14, 2023
f29f661
Revert changed files outside of llo-feeds
austinborn Sep 14, 2023
e86f523
Merge branch 'develop' into llo-feeds-config-count-from-source
austinborn Sep 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -168,9 +168,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 @@ -191,8 +191,8 @@ VerifierBulkVerifyBillingReport:test_verifyWithBulkLink() (gas: 578193)
VerifierBulkVerifyBillingReport:test_verifyWithBulkNative() (gas: 581776)
VerifierBulkVerifyBillingReport:test_verifyWithBulkNativeUnwrapped() (gas: 589250)
VerifierBulkVerifyBillingReport:test_verifyWithBulkNativeUnwrappedReturnsChange() (gas: 596277)
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 @@ -202,15 +202,15 @@ VerifierProxyAccessControlledVerificationTest:test_revertsIfNoAccess() (gas: 107
VerifierProxyConstructorTest:test_correctlySetsTheCorrectAccessControllerInterface() (gas: 1439877)
VerifierProxyConstructorTest:test_correctlySetsTheOwner() (gas: 1419891)
VerifierProxyConstructorTest:test_correctlySetsVersion() (gas: 6873)
VerifierProxyInitializeVerifierTest:test_revertsIfDigestAlreadySet() (gas: 54085)
VerifierProxyInitializeVerifierTest:test_revertsIfDigestAlreadySet() (gas: 54107)
VerifierProxyInitializeVerifierTest:test_revertsIfNotCorrectVerifier() (gas: 13572)
VerifierProxyInitializeVerifierTest:test_revertsIfNotOwner() (gas: 17179)
VerifierProxyInitializeVerifierTest:test_revertsIfVerifierAlreadyInitialized() (gas: 42069)
VerifierProxyInitializeVerifierTest:test_revertsIfZeroAddress() (gas: 10970)
VerifierProxyInitializeVerifierTest:test_setFeeManagerWhichDoesntHonourIERC165Interface() (gas: 13815)
VerifierProxyInitializeVerifierTest:test_setFeeManagerWhichDoesntHonourInterface() (gas: 16301)
VerifierProxyInitializeVerifierTest:test_setFeeManagerZeroAddress() (gas: 10947)
VerifierProxyInitializeVerifierTest:test_updatesVerifierIfVerifier() (gas: 53315)
VerifierProxyInitializeVerifierTest:test_updatesVerifierIfVerifier() (gas: 53337)
VerifierProxySetAccessControllerTest:test_emitsTheCorrectEvent() (gas: 35384)
VerifierProxySetAccessControllerTest:test_revertsIfCalledByNonOwner() (gas: 15105)
VerifierProxySetAccessControllerTest:test_successfullySetsNewAccessController() (gas: 32120)
Expand All @@ -221,20 +221,20 @@ VerifierProxyUnsetVerifierWithPreviouslySetVerifierTest:test_correctlyUnsetsVeri
VerifierProxyUnsetVerifierWithPreviouslySetVerifierTest:test_emitsAnEventAfterUnsettingVerifier() (gas: 17965)
VerifierProxyVerifyTest:test_proxiesToTheCorrectVerifier() (gas: 198420)
VerifierProxyVerifyTest:test_revertsIfNoVerifierConfigured() (gas: 114671)
VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlySetsConfigWhenDigestsAreRemoved() (gas: 538582)
VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesDigestsOnMultipleVerifiersInTheProxy() (gas: 964048)
VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesTheDigestInTheProxy() (gas: 520140)
VerifierSetConfigFromSourceTest:test_revertsIfCalledByNonOwner() (gas: 183115)
VerifierSetConfigTest:test_correctlyUpdatesTheConfig() (gas: 1057669)
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: 538369)
VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlyUpdatesDigestsOnMultipleVerifiersInTheProxy() (gas: 963617)
VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlyUpdatesTheDigestInTheProxy() (gas: 519921)
VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlySetsConfigWhenDigestsAreRemoved() (gas: 538873)
VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesDigestsOnMultipleVerifiersInTheProxy() (gas: 964634)
VerifierSetConfigFromSourceMultipleDigestsTest:test_correctlyUpdatesTheDigestInTheProxy() (gas: 520434)
VerifierSetConfigFromSourceTest:test_revertsIfCalledByNonOwner() (gas: 183215)
VerifierSetConfigTest:test_correctlyUpdatesTheConfig() (gas: 1057922)
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: 538622)
VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlyUpdatesDigestsOnMultipleVerifiersInTheProxy() (gas: 964123)
VerifierSetConfigWhenThereAreMultipleDigestsTest:test_correctlyUpdatesTheDigestInTheProxy() (gas: 520174)
VerifierSupportsInterfaceTest:test_falseIfIsNotCorrectInterface() (gas: 5590)
VerifierSupportsInterfaceTest:test_trueIfIsCorrectInterface() (gas: 5633)
VerifierTestBillingReport:test_verifyWithLink() (gas: 278565)
Expand All @@ -258,7 +258,7 @@ VerifierVerifySingleConfigDigestTest:test_setsTheCorrectEpoch() (gas: 194270)
Verifier_accessControlledVerify:testVerifyWithAccessControl_gas() (gas: 208853)
Verifier_bulkVerifyWithFee:testBulkVerifyProxyWithLinkFeeSuccess_gas() (gas: 540715)
Verifier_bulkVerifyWithFee:testBulkVerifyProxyWithNativeFeeSuccess_gas() (gas: 564087)
Verifier_setConfig:testSetConfigSuccess_gas() (gas: 922428)
Verifier_setConfig:testSetConfigSuccess_gas() (gas: 922659)
Verifier_verify:testVerifyProxySuccess_gas() (gas: 195542)
Verifier_verify:testVerifySuccess_gas() (gas: 186725)
Verifier_verifyWithFee:testVerifyProxyWithLinkFeeSuccess_gas() (gas: 242514)
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
Loading