Skip to content

Commit

Permalink
Update setConfigFromSource to force config count
Browse files Browse the repository at this point in the history
  • Loading branch information
austinborn committed Sep 4, 2023
1 parent fe6fd64 commit 64b2553
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit 64b2553

Please sign in to comment.