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

AUTO-8948: auto plugin versioning #12248

Merged
merged 59 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a68000b
auto plugin versioning
FelixFan1992 Feb 29, 2024
9429835
update
FelixFan1992 Feb 29, 2024
96cc290
update
FelixFan1992 Feb 29, 2024
5baf9d3
fix tests
FelixFan1992 Feb 29, 2024
89832af
use the unified interface
FelixFan1992 Mar 1, 2024
6289b90
fix
FelixFan1992 Mar 1, 2024
2dc0d5c
fix integration
FelixFan1992 Mar 1, 2024
2f07aa7
fix
FelixFan1992 Mar 1, 2024
3620730
update
FelixFan1992 Mar 1, 2024
3964c6a
address some initial feedback for auto 2.2
FelixFan1992 Mar 1, 2024
363a669
remove registrar2_2
FelixFan1992 Mar 1, 2024
6f48ad4
fix
FelixFan1992 Mar 1, 2024
3cb6906
fix
FelixFan1992 Mar 1, 2024
8bb6e91
exclude file from sonarqube
FelixFan1992 Mar 1, 2024
7dc35b9
fix
FelixFan1992 Mar 1, 2024
b582ea6
resolve conflicts
FelixFan1992 Mar 1, 2024
47a5539
fix
FelixFan1992 Mar 1, 2024
46edbac
fix tests
FelixFan1992 Mar 1, 2024
dafbccc
fix tests
FelixFan1992 Mar 1, 2024
0ab12ef
update
FelixFan1992 Mar 6, 2024
37b98b4
formatting
FelixFan1992 Mar 6, 2024
e68df18
add ts tests for interfaces
FelixFan1992 Mar 6, 2024
deb41cb
formatting
FelixFan1992 Mar 6, 2024
50d0954
resolve conflicts
FelixFan1992 Mar 7, 2024
13fbeda
update wrappers
FelixFan1992 Mar 7, 2024
694bad0
fix build
FelixFan1992 Mar 7, 2024
4763f9a
rename and adjustments
FelixFan1992 Mar 7, 2024
6e230c0
fix build
FelixFan1992 Mar 7, 2024
ae95ff1
ts tests
FelixFan1992 Mar 7, 2024
bc73993
ts test
FelixFan1992 Mar 7, 2024
467f808
Merge branch 'develop' into plugin-version
FelixFan1992 Mar 7, 2024
1f6f7a5
geth wrapper
FelixFan1992 Mar 7, 2024
aee6e8d
rename and use setConfigTypeSafe
FelixFan1992 Mar 8, 2024
cd7e3fb
format
FelixFan1992 Mar 8, 2024
590b550
fix tests and conflicts
FelixFan1992 Mar 8, 2024
6e83e53
fix tests
FelixFan1992 Mar 8, 2024
0343059
remove comments
FelixFan1992 Mar 8, 2024
3f5b1af
update
FelixFan1992 Mar 8, 2024
4467a58
Merge branch 'develop' into plugin-version
FelixFan1992 Mar 8, 2024
ad20f92
add changeset
FelixFan1992 Mar 8, 2024
83c6669
fix smoke tests
FelixFan1992 Mar 8, 2024
d62c0fa
fix args
FelixFan1992 Mar 8, 2024
1ea4aca
update switch
FelixFan1992 Mar 8, 2024
3034ff5
group imports
FelixFan1992 Mar 8, 2024
6961b0e
fix
FelixFan1992 Mar 8, 2024
76e5e1a
udpate naming
FelixFan1992 Mar 8, 2024
55fccce
fix
FelixFan1992 Mar 8, 2024
63239bd
remove
FelixFan1992 Mar 8, 2024
0d8e258
update tests
FelixFan1992 Mar 8, 2024
077c922
resolve
FelixFan1992 Mar 8, 2024
8d61e6a
fix
FelixFan1992 Mar 8, 2024
3aa084d
fix tests
FelixFan1992 Mar 8, 2024
af769f0
Merge branch 'develop' into plugin-version
FelixFan1992 Mar 8, 2024
68704f4
addressed comments
FelixFan1992 Mar 11, 2024
640ffdf
use shared structs
FelixFan1992 Mar 11, 2024
3d71d27
fix tests
FelixFan1992 Mar 11, 2024
e778592
resolve conflicts
FelixFan1992 Mar 13, 2024
1a2d3be
update
FelixFan1992 Mar 13, 2024
9dd5094
resolve conflicts
FelixFan1992 Mar 13, 2024
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
5 changes: 5 additions & 0 deletions .changeset/warm-chefs-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

add version support for automation registry 2.\*
4 changes: 3 additions & 1 deletion contracts/scripts/native_solc_compile_all_automation
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ compileContract automation/chains/ChainModuleBase.sol
compileContract automation/chains/OptimismModule.sol
compileContract automation/chains/ScrollModule.sol
compileContract automation/interfaces/IChainModule.sol
compileContract automation/interfaces/IAutomationV21PlusCommon.sol
compileContract automation/AutomationCompatibleUtils.sol

compileContract automation/dev/v2_3/AutomationRegistrar2_3.sol
compileContract automation/dev/v2_3/AutomationRegistry2_3.sol
compileContract automation/dev/v2_3/AutomationRegistryLogicA2_3.sol
compileContract automation/dev/v2_3/AutomationRegistryLogicB2_3.sol
compileContract automation/dev/v2_3/AutomationUtils2_3.sol
compileContract automation/dev/interfaces/v2_3/IAutomationRegistryMaster2_3.sol
compileContract automation/dev/interfaces/v2_3/IAutomationRegistryMaster2_3.sol
17 changes: 17 additions & 0 deletions contracts/src/v0.8/automation/AutomationCompatibleUtils.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;

import {Log} from "./interfaces/ILogAutomation.sol";
import {IAutomationV21PlusCommon} from "./interfaces/IAutomationV21PlusCommon.sol";

contract AutomationCompatibleUtils {
function _report(IAutomationV21PlusCommon.Report memory) external {}

function _logTriggerConfig(IAutomationV21PlusCommon.LogTriggerConfig memory) external {}

function _logTrigger(IAutomationV21PlusCommon.LogTrigger memory) external {}

function _conditionalTrigger(IAutomationV21PlusCommon.ConditionalTrigger memory) external {}

function _log(Log memory) external {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.4;

interface IAutomationV21PlusCommon {
// registry events
event AdminPrivilegeConfigSet(address indexed admin, bytes privilegeConfig);
event CancelledUpkeepReport(uint256 indexed id, bytes trigger);
event ConfigSet(
uint32 previousConfigBlockNumber,
bytes32 configDigest,
uint64 configCount,
address[] signers,
address[] transmitters,
uint8 f,
bytes onchainConfig,
uint64 offchainConfigVersion,
bytes offchainConfig
);
event DedupKeyAdded(bytes32 indexed dedupKey);
event InsufficientFundsUpkeepReport(uint256 indexed id, bytes trigger);
event OwnershipTransferred(address indexed from, address indexed to);
event OwnershipTransferRequested(address indexed from, address indexed to);
event Paused(address account);
event PayeeshipTransferred(address indexed transmitter, address indexed from, address indexed to);
event PayeeshipTransferRequested(address indexed transmitter, address indexed from, address indexed to);
event PayeesUpdated(address[] transmitters, address[] payees);
event PaymentWithdrawn(address indexed transmitter, uint256 indexed amount, address indexed to, address payee);
event ReorgedUpkeepReport(uint256 indexed id, bytes trigger);
event StaleUpkeepReport(uint256 indexed id, bytes trigger);
event Transmitted(bytes32 configDigest, uint32 epoch);
event Unpaused(address account);

// upkeep events
event FundsAdded(uint256 indexed id, address indexed from, uint96 amount);
event FundsWithdrawn(uint256 indexed id, uint256 amount, address to);
event UpkeepAdminTransferred(uint256 indexed id, address indexed from, address indexed to);
event UpkeepAdminTransferRequested(uint256 indexed id, address indexed from, address indexed to);
event UpkeepCanceled(uint256 indexed id, uint64 indexed atBlockHeight);
event UpkeepCheckDataSet(uint256 indexed id, bytes newCheckData);
event UpkeepGasLimitSet(uint256 indexed id, uint96 gasLimit);
event UpkeepMigrated(uint256 indexed id, uint256 remainingBalance, address destination);
event UpkeepOffchainConfigSet(uint256 indexed id, bytes offchainConfig);
event UpkeepPaused(uint256 indexed id);
event UpkeepPerformed(
uint256 indexed id,
bool indexed success,
uint96 totalPayment,
uint256 gasUsed,
uint256 gasOverhead,
bytes trigger
);
event UpkeepPrivilegeConfigSet(uint256 indexed id, bytes privilegeConfig);
event UpkeepReceived(uint256 indexed id, uint256 startingBalance, address importedFrom);
event UpkeepRegistered(uint256 indexed id, uint32 performGas, address admin);
event UpkeepTriggerConfigSet(uint256 indexed id, bytes triggerConfig);
event UpkeepUnpaused(uint256 indexed id);

/**
* @notice structure of trigger for log triggers
*/
struct LogTriggerConfig {
address contractAddress;
uint8 filterSelector; // denotes which topics apply to filter ex 000, 101, 111...only last 3 bits apply
bytes32 topic0;
bytes32 topic1;
bytes32 topic2;
bytes32 topic3;
}

/// @dev Report transmitted by OCR to transmit function
struct Report {
uint256 fastGasWei;
uint256 linkNative;
uint256[] upkeepIds;
uint256[] gasLimits;
bytes[] triggers;
bytes[] performDatas;
}

/**
* @notice all information about an upkeep
* @dev only used in return values
* @dev this will likely be deprecated in a future version of the registry
* @member target the contract which needs to be serviced
* @member performGas the gas limit of upkeep execution
* @member checkData the checkData bytes for this upkeep
* @member balance the balance of this upkeep
* @member admin for this upkeep
* @member maxValidBlocknumber until which block this upkeep is valid
* @member lastPerformedBlockNumber the last block number when this upkeep was performed
* @member amountSpent the amount this upkeep has spent
* @member paused if this upkeep has been paused
* @member offchainConfig the off-chain config of this upkeep
*/
struct UpkeepInfoLegacy {
address target;
uint32 performGas;
bytes checkData;
uint96 balance;
address admin;
uint64 maxValidBlocknumber;
uint32 lastPerformedBlockNumber;
uint96 amountSpent;
bool paused;
bytes offchainConfig;
}

/**
* @notice the trigger structure conditional trigger type
*/
struct ConditionalTrigger {
uint32 blockNum;
bytes32 blockHash;
}

/**
* @notice the trigger structure of log upkeeps
* @dev NOTE that blockNum / blockHash describe the block used for the callback,
* not necessarily the block number that the log was emitted in!!!!
*/
struct LogTrigger {
bytes32 logBlockHash;
bytes32 txHash;
uint32 logIndex;
uint32 blockNum;
bytes32 blockHash;
}

/**
* @notice state of the registry
* @dev only used in params and return values
* @dev this will likely be deprecated in a future version of the registry in favor of individual getters
* @member nonce used for ID generation
* @member ownerLinkBalance withdrawable balance of LINK by contract owner
* @member expectedLinkBalance the expected balance of LINK of the registry
* @member totalPremium the total premium collected on registry so far
* @member numUpkeeps total number of upkeeps on the registry
* @member configCount ordinal number of current config, out of all configs applied to this contract so far
* @member latestConfigBlockNumber last block at which this config was set
* @member latestConfigDigest domain-separation tag for current config
* @member latestEpoch for which a report was transmitted
* @member paused freeze on execution scoped to the entire registry
*/
struct StateLegacy {
uint32 nonce;
uint96 ownerLinkBalance;
uint256 expectedLinkBalance;
uint96 totalPremium;
uint256 numUpkeeps;
uint32 configCount;
uint32 latestConfigBlockNumber;
bytes32 latestConfigDigest;
uint32 latestEpoch;
bool paused;
}

/**
* @notice OnchainConfigLegacy of the registry
* @dev only used in params and return values
* @member paymentPremiumPPB payment premium rate oracles receive on top of
* being reimbursed for gas, measured in parts per billion
* @member flatFeeMicroLink flat fee paid to oracles for performing upkeeps,
* priced in MicroLink; can be used in conjunction with or independently of
* paymentPremiumPPB
* @member checkGasLimit gas limit when checking for upkeep
* @member stalenessSeconds number of seconds that is allowed for feed data to
* be stale before switching to the fallback pricing
* @member gasCeilingMultiplier multiplier to apply to the fast gas feed price
* when calculating the payment ceiling for keepers
* @member minUpkeepSpend minimum LINK that an upkeep must spend before cancelling
* @member maxPerformGas max performGas allowed for an upkeep on this registry
* @member maxCheckDataSize max length of checkData bytes
* @member maxPerformDataSize max length of performData bytes
* @member maxRevertDataSize max length of revertData bytes
* @member fallbackGasPrice gas price used if the gas price feed is stale
* @member fallbackLinkPrice LINK price used if the LINK price feed is stale
* @member transcoder address of the transcoder contract
* @member registrars addresses of the registrar contracts
* @member upkeepPrivilegeManager address which can set privilege for upkeeps
*/
struct OnchainConfigLegacy {
uint32 paymentPremiumPPB;
uint32 flatFeeMicroLink; // min 0.000001 LINK, max 4294 LINK
uint32 checkGasLimit;
uint24 stalenessSeconds;
uint16 gasCeilingMultiplier;
uint96 minUpkeepSpend;
uint32 maxPerformGas;
uint32 maxCheckDataSize;
uint32 maxPerformDataSize;
uint32 maxRevertDataSize;
uint256 fallbackGasPrice;
uint256 fallbackLinkPrice;
address transcoder;
address[] registrars;
address upkeepPrivilegeManager;
}

function checkUpkeep(
uint256 id,
bytes memory triggerData
)
external
view
returns (
bool upkeepNeeded,
bytes memory performData,
uint8 upkeepFailureReason,
uint256 gasUsed,
uint256 gasLimit,
uint256 fastGasWei,
uint256 linkNative
);
function checkUpkeep(
uint256 id
)
external
view
returns (
bool upkeepNeeded,
bytes memory performData,
uint8 upkeepFailureReason,
uint256 gasUsed,
uint256 gasLimit,
uint256 fastGasWei,
uint256 linkNative
);
function simulatePerformUpkeep(
uint256 id,
bytes memory performData
) external view returns (bool success, uint256 gasUsed);
function executeCallback(
uint256 id,
bytes memory payload
) external returns (bool upkeepNeeded, bytes memory performData, uint8 upkeepFailureReason, uint256 gasUsed);
function checkCallback(
uint256 id,
bytes[] memory values,
bytes memory extraData
) external view returns (bool upkeepNeeded, bytes memory performData, uint8 upkeepFailureReason, uint256 gasUsed);
function typeAndVersion() external view returns (string memory);
function addFunds(uint256 id, uint96 amount) external;
function cancelUpkeep(uint256 id) external;

function getUpkeepPrivilegeConfig(uint256 upkeepId) external view returns (bytes memory);
function hasDedupKey(bytes32 dedupKey) external view returns (bool);
function getUpkeepTriggerConfig(uint256 upkeepId) external view returns (bytes memory);
function getUpkeep(uint256 id) external view returns (UpkeepInfoLegacy memory upkeepInfo);
function getMinBalance(uint256 id) external view returns (uint96);
function getState()
external
view
returns (
StateLegacy memory state,
OnchainConfigLegacy memory config,
address[] memory signers,
address[] memory transmitters,
uint8 f
);
function registerUpkeep(
address target,
uint32 gasLimit,
address admin,
uint8 triggerType,
bytes memory checkData,
bytes memory triggerConfig,
bytes memory offchainConfig
) external returns (uint256 id);
function setUpkeepGasLimit(uint256 id, uint32 gasLimit) external;
function setUpkeepPrivilegeConfig(uint256 upkeepId, bytes memory newPrivilegeConfig) external;
function pauseUpkeep(uint256 id) external;
function unpauseUpkeep(uint256 id) external;
function getActiveUpkeepIDs(uint256 startIndex, uint256 maxCount) external view returns (uint256[] memory);
function pause() external;
function setUpkeepCheckData(uint256 id, bytes memory newCheckData) external;
function setUpkeepTriggerConfig(uint256 id, bytes memory triggerConfig) external;
function owner() external view returns (address);
function getTriggerType(uint256 upkeepId) external pure returns (uint8);
}
Loading
Loading