Skip to content

Commit

Permalink
Cleanup pipeline data references and change back to checkData (#9650)
Browse files Browse the repository at this point in the history
* Cleanup pipeline data references and change back to checkData

* fix tests

* regen wrappers

* regen wrappers
  • Loading branch information
infiloop2 committed Jun 21, 2023
1 parent 5fa2f37 commit 567a318
Show file tree
Hide file tree
Showing 13 changed files with 629 additions and 629 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ abstract contract KeeperRegistryBase2_1 is ConfirmedOwner, ExecutionPrevention {
error IncorrectNumberOfFaultyOracles();
error RepeatedSigner();
error RepeatedTransmitter();
error PipelineDataExceedsLimit();
error CheckDataExceedsLimit();
error MaxCheckDataSizeCanOnlyIncrease();
error MaxPerformDataSizeCanOnlyIncrease();
error InvalidReport();
Expand Down Expand Up @@ -414,7 +414,7 @@ abstract contract KeeperRegistryBase2_1 is ConfirmedOwner, ExecutionPrevention {
event UpkeepAdminTransferRequested(uint256 indexed id, address indexed from, address indexed to);
event UpkeepAdminTransferred(uint256 indexed id, address indexed from, address indexed to);
event UpkeepCanceled(uint256 indexed id, uint64 indexed atBlockHeight);
event UpkeepPipelineDataSet(uint256 indexed id, bytes newPipelineData);
event UpkeepCheckDataSet(uint256 indexed id, bytes newCheckData);
event UpkeepGasLimitSet(uint256 indexed id, uint96 gasLimit);
event UpkeepOffchainConfigSet(uint256 indexed id, bytes offchainConfig);
event UpkeepTriggerConfigSet(uint256 indexed id, bytes triggerConfig);
Expand Down Expand Up @@ -483,7 +483,7 @@ abstract contract KeeperRegistryBase2_1 is ConfirmedOwner, ExecutionPrevention {
* @param id the id of the upkeep
* @param upkeep the upkeep to create
* @param admin address to cancel upkeep and withdraw remaining funds
* @param checkData data the optional input data to the first pipeline task (either "check data" or "perform data")
* @param checkData data which is passed to user's checkUpkeep
* @param triggerConfig the trigger config for this upkeep
* @param offchainConfig the off-chain config of this upkeep
*/
Expand All @@ -497,7 +497,7 @@ abstract contract KeeperRegistryBase2_1 is ConfirmedOwner, ExecutionPrevention {
) internal {
if (s_hotVars.paused) revert RegistryPaused();
if (!upkeep.target.isContract()) revert NotAContract();
if (checkData.length > s_storage.maxCheckDataSize) revert PipelineDataExceedsLimit();
if (checkData.length > s_storage.maxCheckDataSize) revert CheckDataExceedsLimit();
if (upkeep.executeGas < PERFORM_GAS_MIN || upkeep.executeGas > s_storage.maxPerformGas)
revert GasLimitOutsideRange();
if (s_upkeep[id].target != ZERO_ADDRESS) revert UpkeepAlreadyExists();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ contract KeeperRegistryLogicA2_1 is
);
s_storage.nonce++;
emit UpkeepRegistered(id, gasLimit, admin);
emit UpkeepPipelineDataSet(id, checkData);
emit UpkeepCheckDataSet(id, checkData);
emit UpkeepTriggerConfigSet(id, triggerConfig);
emit UpkeepOffchainConfigSet(id, offchainConfig);
return (id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ contract KeeperRegistryLogicB2_1 is KeeperRegistryBase2_1 {
emit UpkeepUnpaused(id);
}

function setUpkeepPipelineData(uint256 id, bytes calldata newPipelineData) external {
function setUpkeepCheckData(uint256 id, bytes calldata newCheckData) external {
_requireAdminAndNotCancelled(id);
if (newPipelineData.length > s_storage.maxCheckDataSize) revert PipelineDataExceedsLimit();
s_checkData[id] = newPipelineData;
emit UpkeepPipelineDataSet(id, newPipelineData);
if (newCheckData.length > s_storage.maxCheckDataSize) revert CheckDataExceedsLimit();
s_checkData[id] = newCheckData;
emit UpkeepCheckDataSet(id, newCheckData);
}

function setUpkeepGasLimit(uint256 id, uint32 gasLimit) external {
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/src/v0.8/tests/VerifiableLoadBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ abstract contract VerifiableLoadBase is ConfirmedOwner {
* @param pipelineData the new pipeline data for the upkeep
*/
function updateUpkeepPipelineData(uint256 upkeepId, bytes calldata pipelineData) external {
registry.setUpkeepPipelineData(upkeepId, pipelineData);
registry.setUpkeepCheckData(upkeepId, pipelineData);
checkDatas[upkeepId] = pipelineData;
}

Expand Down
24 changes: 12 additions & 12 deletions contracts/test/v0.8/automation/KeeperRegistry2_1.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3878,7 +3878,7 @@ describe('KeeperRegistry2_1', () => {
longBytes,
'0x',
),
'PipelineDataExceedsLimit()',
'CheckDataExceedsLimit()',
)
})

Expand Down Expand Up @@ -3907,7 +3907,7 @@ describe('KeeperRegistry2_1', () => {
.withArgs(testUpkeepId, executeGas, await admin.getAddress())

await expect(tx)
.to.emit(registry, 'UpkeepPipelineDataSet')
.to.emit(registry, 'UpkeepCheckDataSet')
.withArgs(testUpkeepId, checkData)
await expect(tx)
.to.emit(registry, 'UpkeepTriggerConfigSet')
Expand Down Expand Up @@ -4038,19 +4038,19 @@ describe('KeeperRegistry2_1', () => {
})
})

describe('#setUpkeepPipelineData', () => {
describe('#setUpkeepCheckData', () => {
it('reverts if the registration does not exist', async () => {
await evmRevert(
registry
.connect(keeper1)
.setUpkeepPipelineData(upkeepId.add(1), randomBytes),
.setUpkeepCheckData(upkeepId.add(1), randomBytes),
'OnlyCallableByAdmin()',
)
})

it('reverts if the caller is not upkeep admin', async () => {
await evmRevert(
registry.connect(keeper1).setUpkeepPipelineData(upkeepId, randomBytes),
registry.connect(keeper1).setUpkeepCheckData(upkeepId, randomBytes),
'OnlyCallableByAdmin()',
)
})
Expand All @@ -4059,14 +4059,14 @@ describe('KeeperRegistry2_1', () => {
await registry.connect(admin).cancelUpkeep(upkeepId)

await evmRevert(
registry.connect(admin).setUpkeepPipelineData(upkeepId, randomBytes),
registry.connect(admin).setUpkeepCheckData(upkeepId, randomBytes),
'UpkeepCancelled()',
)
})

it('is allowed to update on paused upkeep', async () => {
await registry.connect(admin).pauseUpkeep(upkeepId)
await registry.connect(admin).setUpkeepPipelineData(upkeepId, randomBytes)
await registry.connect(admin).setUpkeepCheckData(upkeepId, randomBytes)

const registration = await registry.getUpkeep(upkeepId)
assert.equal(randomBytes, registration.checkData)
Expand All @@ -4079,17 +4079,17 @@ describe('KeeperRegistry2_1', () => {
}

await evmRevert(
registry.connect(admin).setUpkeepPipelineData(upkeepId, longBytes),
'PipelineDataExceedsLimit()',
registry.connect(admin).setUpkeepCheckData(upkeepId, longBytes),
'CheckDataExceedsLimit()',
)
})

it('updates the upkeep pipeline data and emits an event', async () => {
it('updates the upkeep check data and emits an event', async () => {
const tx = await registry
.connect(admin)
.setUpkeepPipelineData(upkeepId, randomBytes)
.setUpkeepCheckData(upkeepId, randomBytes)
await expect(tx)
.to.emit(registry, 'UpkeepPipelineDataSet')
.to.emit(registry, 'UpkeepCheckDataSet')
.withArgs(upkeepId, randomBytes)

const registration = await registry.getUpkeep(upkeepId)
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ flux_aggregator_wrapper: ../../contracts/solc/v0.6/FluxAggregator.abi ../../cont
functions_billing_registry_events_mock: ../../contracts/solc/v0.8.6/FunctionsBillingRegistryEventsMock.abi ../../contracts/solc/v0.8.6/FunctionsBillingRegistryEventsMock.bin 50deeb883bd9c3729702be335c0388f9d8553bab4be5e26ecacac496a89e2b77
functions_oracle_events_mock: ../../contracts/solc/v0.8.6/FunctionsOracleEventsMock.abi ../../contracts/solc/v0.8.6/FunctionsOracleEventsMock.bin 3ca70f966f8fe751987f0ccb50bebb6aa5be77e4a9f835d1ae99e0e9bfb7d52c
gas_wrapper: ../../contracts/solc/v0.8.6/KeeperRegistryCheckUpkeepGasUsageWrapper1_2.abi ../../contracts/solc/v0.8.6/KeeperRegistryCheckUpkeepGasUsageWrapper1_2.bin 4a5dcdac486d18fcd58e3488c15c1710ae76b977556a3f3191bd269a4bc75723
i_keeper_registry_master_wrapper_2_1: ../../contracts/solc/v0.8.16/IKeeperRegistryMaster.abi ../../contracts/solc/v0.8.16/IKeeperRegistryMaster.bin e3d0375a6988c04e91ffb9cd6ef8e4a151d130699f485dbd80baa898a96166af
i_keeper_registry_master_wrapper_2_1: ../../contracts/solc/v0.8.16/IKeeperRegistryMaster.abi ../../contracts/solc/v0.8.16/IKeeperRegistryMaster.bin 7c213f2fe2ba983be209349c9b97fa6557606ceac3b319400033ccc2de20e73f
keeper_registrar_wrapper1_2: ../../contracts/solc/v0.8.6/KeeperRegistrar.abi ../../contracts/solc/v0.8.6/KeeperRegistrar.bin e49b2f8b23da17af1ed2209b8ae0968cc04350554d636711e6c24a3ad3118692
keeper_registrar_wrapper2_0: ../../contracts/solc/v0.8.6/KeeperRegistrar2_0.abi ../../contracts/solc/v0.8.6/KeeperRegistrar2_0.bin 647f125c2f0dafabcdc545cb77b15dc2ec3ea9429357806813179b1fd555c2d2
keeper_registry_logic1_3: ../../contracts/solc/v0.8.6/KeeperRegistryLogic1_3.abi ../../contracts/solc/v0.8.6/KeeperRegistryLogic1_3.bin e1bee66ce7cd0085469f923c46f0eddb58fd45dec207def1bb383b37e413a6ca
keeper_registry_logic2_0: ../../contracts/solc/v0.8.6/KeeperRegistryLogic2_0.abi ../../contracts/solc/v0.8.6/KeeperRegistryLogic2_0.bin ba5c23c495c4e1e487560ed56d917632f0047266c06fda4af9edbcda5aca99fa
keeper_registry_logic_a_wrapper_2_1: ../../contracts/solc/v0.8.16/KeeperRegistryLogicA2_1.abi ../../contracts/solc/v0.8.16/KeeperRegistryLogicA2_1.bin 683f72747fdd19aba8480e8486028ac7ad1bb936f01bd2e9e05f8d099db955f8
keeper_registry_logic_b_wrapper_2_1: ../../contracts/solc/v0.8.16/KeeperRegistryLogicB2_1.abi ../../contracts/solc/v0.8.16/KeeperRegistryLogicB2_1.bin da9b5dab6e3669431576f6335e37e9e010c863ba775b83f12c39205823ff8a6f
keeper_registry_logic_a_wrapper_2_1: ../../contracts/solc/v0.8.16/KeeperRegistryLogicA2_1.abi ../../contracts/solc/v0.8.16/KeeperRegistryLogicA2_1.bin 27437425ccb333658d80078280edb46f4e6506692e96f01ded4e0e8972c87449
keeper_registry_logic_b_wrapper_2_1: ../../contracts/solc/v0.8.16/KeeperRegistryLogicB2_1.abi ../../contracts/solc/v0.8.16/KeeperRegistryLogicB2_1.bin 047a04bf1f8eb8932607aaba6972caabbab51b0811a1943471aa30c294953c83
keeper_registry_wrapper1_1: ../../contracts/solc/v0.7/KeeperRegistry1_1.abi ../../contracts/solc/v0.7/KeeperRegistry1_1.bin 6ce079f2738f015f7374673a2816e8e9787143d00b780ea7652c8aa9ad9e1e20
keeper_registry_wrapper1_2: ../../contracts/solc/v0.8.6/KeeperRegistry1_2.abi ../../contracts/solc/v0.8.6/KeeperRegistry1_2.bin 41faf687ad6a5171cc91e627244d0b3d6f62d393c418ca22d4ba7fc921fd32c6
keeper_registry_wrapper1_3: ../../contracts/solc/v0.8.6/KeeperRegistry1_3.abi ../../contracts/solc/v0.8.6/KeeperRegistry1_3.bin 5e1414eacbc1880b7349a4f253b7eca176f7f6300ef3cd834c493ce795a17e25
keeper_registry_wrapper2_0: ../../contracts/solc/v0.8.6/KeeperRegistry2_0.abi ../../contracts/solc/v0.8.6/KeeperRegistry2_0.bin c32dea7d5ef66b7c58ddc84ddf69aa44df1b3ae8601fbc271c95be4ff5853056
keeper_registry_wrapper_2_1: ../../contracts/solc/v0.8.16/KeeperRegistry2_1.abi ../../contracts/solc/v0.8.16/KeeperRegistry2_1.bin 5d374c2d15681443dafc4ff963e7c0e0ab2c8de89d0fda8eb504e78dc7f346fc
keeper_registry_wrapper_2_1: ../../contracts/solc/v0.8.16/KeeperRegistry2_1.abi ../../contracts/solc/v0.8.16/KeeperRegistry2_1.bin d80872337bde5dde7c786d82d2534fb2afec0220b6a56da685708262bb95ed72
keepers_vrf_consumer: ../../contracts/solc/v0.8.6/KeepersVRFConsumer.abi ../../contracts/solc/v0.8.6/KeepersVRFConsumer.bin fa75572e689c9e84705c63e8dbe1b7b8aa1a8fe82d66356c4873d024bb9166e8
llo_feeds: ../../contracts/solc/v0.8.16/VerifierProxy.abi ../../contracts/solc/v0.8.16/VerifierProxy.bin 3b69ffe9c694e8551b5375c02b9e960adc985e2390566740e7fea70c89e436f1
llo_feeds_test: ../../contracts/solc/v0.8.16/ExposedVerifier.abi ../../contracts/solc/v0.8.16/ExposedVerifier.bin 6932cea8f2738e874d3ec9e1a4231d2421704030c071d9e15dd2f7f08482c246
Expand Down Expand Up @@ -64,8 +64,8 @@ type_and_version_interface_wrapper: ../../contracts/solc/v0.8.6/TypeAndVersionIn
upkeep_counter_wrapper: ../../contracts/solc/v0.7/UpkeepCounter.abi ../../contracts/solc/v0.7/UpkeepCounter.bin 901961ebf18906febc1c350f02da85c7ea1c2a68da70cfd94efa27c837a48663
upkeep_perform_counter_restrictive_wrapper: ../../contracts/solc/v0.7/UpkeepPerformCounterRestrictive.abi ../../contracts/solc/v0.7/UpkeepPerformCounterRestrictive.bin 8975a058fba528e16d8414dc6f13946d17a145fcbc66cf25a32449b6fe1ce878
upkeep_transcoder: ../../contracts/solc/v0.8.6/UpkeepTranscoder.abi ../../contracts/solc/v0.8.6/UpkeepTranscoder.bin 336c92a981597be26508455f81a908a0784a817b129a59686c5b2c4afcba730a
verifiable_load_mercury_upkeep_wrapper: ../../contracts/solc/v0.8.6/VerifiableLoadMercuryUpkeep.abi ../../contracts/solc/v0.8.6/VerifiableLoadMercuryUpkeep.bin cecedbfaabc49f34311819fbcec38205d7f73ab98cdd3cbcd44af4ba65f75a89
verifiable_load_upkeep_wrapper: ../../contracts/solc/v0.8.6/VerifiableLoadUpkeep.abi ../../contracts/solc/v0.8.6/VerifiableLoadUpkeep.bin 75800e0a60709b8ed9668affd65ee06c4487cb51ca2938a5d4a95c2138c4dc8d
verifiable_load_mercury_upkeep_wrapper: ../../contracts/solc/v0.8.6/VerifiableLoadMercuryUpkeep.abi ../../contracts/solc/v0.8.6/VerifiableLoadMercuryUpkeep.bin 83ccf231fec162786942d239268552525dfa04b3d98347983a7ef1b183e5d997
verifiable_load_upkeep_wrapper: ../../contracts/solc/v0.8.6/VerifiableLoadUpkeep.abi ../../contracts/solc/v0.8.6/VerifiableLoadUpkeep.bin b6ea79e8b71dddc185ca137ec2eaab00709a37c664df11011a6348ac17fa989e
vrf_consumer_v2: ../../contracts/solc/v0.8.6/VRFConsumerV2.abi ../../contracts/solc/v0.8.6/VRFConsumerV2.bin 9ef258bf8e9f8d880fd229ceb145593d91e24fc89366baa0bf19169c5787d15f
vrf_consumer_v2_upgradeable_example: ../../contracts/solc/v0.8.6/VRFConsumerV2UpgradeableExample.abi ../../contracts/solc/v0.8.6/VRFConsumerV2UpgradeableExample.bin f1790a9a2f2a04c730593e483459709cb89e897f8a19d7a3ac0cfe6a97265e6e
vrf_coordinator_mock: ../../contracts/solc/v0.8.6/VRFCoordinatorMock.abi ../../contracts/solc/v0.8.6/VRFCoordinatorMock.bin 5c495cf8df1f46d8736b9150cdf174cce358cb8352f60f0d5bb9581e23920501
Expand Down

0 comments on commit 567a318

Please sign in to comment.