From f4f55b7cf20d1947ab5ecfc478591754ca61e1d5 Mon Sep 17 00:00:00 2001 From: 0xMithrandir <173684735+0xMithrandir@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:05:24 +0100 Subject: [PATCH 1/8] Add cancellation reward cost calculation for keepers --- .../contracts/ArbGasPriceOracle.sol | 11 +++++++++++ .../OpGasPriceOracle/contracts/OpGasPriceOracle.sol | 8 ++++++++ .../contracts/mocks/MockGasPriceNode.sol | 12 +++++++++++- .../contracts/modules/AsyncOrderCancelModule.sol | 2 +- .../perps-market/contracts/storage/AsyncOrder.sol | 9 +++++++++ .../perps-market/contracts/storage/KeeperCosts.sol | 9 +++++++++ .../KeeperRewards/KeeperRewards.Caps.test.ts | 9 ++++++++- .../KeeperRewards.Large-Position.test.ts | 8 +++++++- .../KeeperRewards.N-Collaterals.test.ts | 8 +++++++- .../KeeperRewards/KeeperRewards.N-Positions.test.ts | 8 +++++++- .../KeeperRewards/KeeperRewards.Settlement.test.ts | 8 +++++++- .../Liquidation/Liquidation.marginOnly.test.ts | 8 +++++++- 12 files changed, 92 insertions(+), 8 deletions(-) diff --git a/auxiliary/ArbitrumGasPriceOracle/contracts/ArbGasPriceOracle.sol b/auxiliary/ArbitrumGasPriceOracle/contracts/ArbGasPriceOracle.sol index e6af12c8f2..19789cd871 100644 --- a/auxiliary/ArbitrumGasPriceOracle/contracts/ArbGasPriceOracle.sol +++ b/auxiliary/ArbitrumGasPriceOracle/contracts/ArbGasPriceOracle.sol @@ -24,6 +24,11 @@ contract ArbGasPriceOracle is IExternalNode { */ uint256 public constant KIND_LIQUIDATE = 2; + /** + * @notice identifies resources consumed via order cancellation + */ + uint public constant KIND_CANCEL = 3; + /** * @notice the ArbGasInfo precompile contract on Arbitrum */ @@ -46,6 +51,9 @@ contract ArbGasPriceOracle is IExternalNode { // Call params uint256 numberOfUpdatedFeeds; uint256 executionKind; + // Cancel + uint256 l1CancelGasUnits; + uint256 l2CancelGasUnits; } /** @@ -223,6 +231,9 @@ contract ArbGasPriceOracle is IExternalNode { // Iterations is fixed to 1 for liquidations gasUnitsL1 = runtimeParams.l1LiquidateGasUnits; gasUnitsL2 = runtimeParams.l2LiquidateGasUnits; + } else if (runtimeParams.executionKind == KIND_CANCEL) { + gasUnitsL1 = runtimeParams.l1CancelGasUnits; + gasUnitsL2 = runtimeParams.l2CancelGasUnits; } else { revert ArbGasPriceOracleInvalidExecutionKind(); } diff --git a/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol b/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol index 83b42bee66..cd3aaa95d9 100644 --- a/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol +++ b/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol @@ -22,6 +22,7 @@ contract OpGasPriceOracle is IExternalNode { uint256 public constant KIND_SETTLEMENT = 0; uint256 public constant KIND_FLAG = 1; uint256 public constant KIND_LIQUIDATE = 2; + uint256 public constant KIND_CANCEL = 3; struct RuntimeParams { // Set up params @@ -41,6 +42,9 @@ contract OpGasPriceOracle is IExternalNode { // Call params uint256 numberOfUpdatedFeeds; uint256 executionKind; + // Cancel + uint256 l1CancelGasUnits; + uint256 l2CancelGasUnits; } constructor(address _ovmGasPriceOracleAddress) { @@ -212,6 +216,10 @@ contract OpGasPriceOracle is IExternalNode { gasUnitsL1 = runtimeParams.l1LiquidateGasUnits; gasUnitsL2 = runtimeParams.l2LiquidateGasUnits; unsignedTxSize = runtimeParams.liquidateTxSize; + } else if (runtimeParams.executionKind == KIND_CANCEL) { + gasUnitsL1 = runtimeParams.l1CancelGasUnits; + gasUnitsL2 = runtimeParams.l2CancelGasUnits; + unsignedTxSize = 0; } else { revert("Invalid execution kind"); } diff --git a/markets/perps-market/contracts/mocks/MockGasPriceNode.sol b/markets/perps-market/contracts/mocks/MockGasPriceNode.sol index b06e92f3e4..70040fa365 100644 --- a/markets/perps-market/contracts/mocks/MockGasPriceNode.sol +++ b/markets/perps-market/contracts/mocks/MockGasPriceNode.sol @@ -9,17 +9,25 @@ contract MockGasPriceNode is IExternalNode { uint256 public constant KIND_SETTLEMENT = 0; uint256 public constant KIND_FLAG = 1; uint256 public constant KIND_LIQUIDATE = 2; + uint256 public constant KIND_CANCEL = 3; uint256 public settlementCost; uint256 public flagCost; uint256 public liquidateCost; + uint256 public cancelCost; constructor() {} - function setCosts(uint256 _settlementCost, uint256 _flagCost, uint256 _liquidateCost) external { + function setCosts( + uint256 _settlementCost, + uint256 _flagCost, + uint256 _liquidateCost, + uint256 _cancelCost + ) external { settlementCost = _settlementCost; flagCost = _flagCost; liquidateCost = _liquidateCost; + cancelCost = _cancelCost; } // solhint-disable numcast/safe-cast @@ -49,6 +57,8 @@ contract MockGasPriceNode is IExternalNode { theOutput.price = int256(flagCost * numberOfUpdatedFeeds); } else if (executionKind == KIND_LIQUIDATE) { theOutput.price = int256(liquidateCost); + } else if (executionKind == KIND_CANCEL) { + theOutput.price = int256(cancelCost); } else { revert("Invalid execution kind"); } diff --git a/markets/perps-market/contracts/modules/AsyncOrderCancelModule.sol b/markets/perps-market/contracts/modules/AsyncOrderCancelModule.sol index 569b6d2c92..2ecc78bfc4 100644 --- a/markets/perps-market/contracts/modules/AsyncOrderCancelModule.sol +++ b/markets/perps-market/contracts/modules/AsyncOrderCancelModule.sol @@ -60,7 +60,7 @@ contract AsyncOrderCancelModule is IAsyncOrderCancelModule, IMarketEvents, IAcco runtime.accountId = asyncOrder.request.accountId; runtime.marketId = asyncOrder.request.marketId; runtime.acceptablePrice = asyncOrder.request.acceptablePrice; - runtime.settlementReward = settlementStrategy.settlementReward; + runtime.settlementReward = AsyncOrder.cancellationRewardCost(settlementStrategy); runtime.sizeDelta = asyncOrder.request.sizeDelta; // check if account is flagged diff --git a/markets/perps-market/contracts/storage/AsyncOrder.sol b/markets/perps-market/contracts/storage/AsyncOrder.sol index 7e84c2f1cd..931ba5b3f4 100644 --- a/markets/perps-market/contracts/storage/AsyncOrder.sol +++ b/markets/perps-market/contracts/storage/AsyncOrder.sol @@ -444,6 +444,15 @@ library AsyncOrder { return KeeperCosts.load().getSettlementKeeperCosts() + strategy.settlementReward; } + /** + * @notice Calculates the cancellation rewards. + */ + function cancellationRewardCost( + SettlementStrategy.Data storage strategy + ) internal view returns (uint256) { + return KeeperCosts.load().getCancellationKeeperCosts() + strategy.settlementReward; + } + /** * @notice Calculates the order fees. */ diff --git a/markets/perps-market/contracts/storage/KeeperCosts.sol b/markets/perps-market/contracts/storage/KeeperCosts.sol index feb0621bd2..3b9ab66ce9 100644 --- a/markets/perps-market/contracts/storage/KeeperCosts.sol +++ b/markets/perps-market/contracts/storage/KeeperCosts.sol @@ -22,6 +22,7 @@ library KeeperCosts { uint256 private constant KIND_SETTLEMENT = 0; uint256 private constant KIND_FLAG = 1; uint256 private constant KIND_LIQUIDATE = 2; + uint256 private constant KIND_CANCEL = 3; struct Data { bytes32 keeperCostNodeId; @@ -44,6 +45,14 @@ library KeeperCosts { sUSDCost = _processWithRuntime(self.keeperCostNodeId, factory, 0, KIND_SETTLEMENT); } + function getCancellationKeeperCosts( + Data storage self + ) internal view returns (uint256 sUSDCost) { + PerpsMarketFactory.Data storage factory = PerpsMarketFactory.load(); + + sUSDCost = _processWithRuntime(self.keeperCostNodeId, factory, 0, KIND_CANCEL); + } + function getFlagKeeperCosts( Data storage self, uint128 accountId diff --git a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Caps.test.ts b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Caps.test.ts index b7f391196c..5ca51e7d4f 100644 --- a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Caps.test.ts +++ b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Caps.test.ts @@ -10,6 +10,7 @@ describe('Keeper Rewards - Caps', () => { settlementCost: 1111, flagCost: 3333, liquidateCost: 5555, + cancelCost: 2222, }; const { systems, perpsMarkets, provider, trader1, keeperCostOracleNode, keeper, owner } = bootstrapMarkets({ @@ -66,7 +67,12 @@ describe('Keeper Rewards - Caps', () => { before('set keeper costs', async () => { await keeperCostOracleNode() .connect(owner()) - .setCosts(KeeperCosts.settlementCost, KeeperCosts.flagCost, KeeperCosts.liquidateCost); + .setCosts( + KeeperCosts.settlementCost, + KeeperCosts.flagCost, + KeeperCosts.liquidateCost, + KeeperCosts.cancelCost + ); }); const restoreToConfiguration = snapshotCheckpoint(provider); @@ -76,6 +82,7 @@ describe('Keeper Rewards - Caps', () => { assertBn.equal(await keeperCostOracleNode().settlementCost(), KeeperCosts.settlementCost); assertBn.equal(await keeperCostOracleNode().flagCost(), KeeperCosts.flagCost); assertBn.equal(await keeperCostOracleNode().liquidateCost(), KeeperCosts.liquidateCost); + assertBn.equal(await keeperCostOracleNode().cancelCost(), KeeperCosts.liquidateCost); }); const capTestCases = [ diff --git a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Large-Position.test.ts b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Large-Position.test.ts index 397e666546..b417d54198 100644 --- a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Large-Position.test.ts +++ b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Large-Position.test.ts @@ -10,6 +10,7 @@ describe('Keeper Rewards - Multiple Liquidation steps', () => { settlementCost: 1111, flagCost: 3333, liquidateCost: 5555, + cancelCost: 2222, }; const { systems, perpsMarkets, provider, trader1, keeperCostOracleNode, keeper, owner } = bootstrapMarkets({ @@ -64,7 +65,12 @@ describe('Keeper Rewards - Multiple Liquidation steps', () => { before('set keeper costs', async () => { await keeperCostOracleNode() .connect(owner()) - .setCosts(KeeperCosts.settlementCost, KeeperCosts.flagCost, KeeperCosts.liquidateCost); + .setCosts( + KeeperCosts.settlementCost, + KeeperCosts.flagCost, + KeeperCosts.liquidateCost, + KeeperCosts.cancelCost + ); }); const rewardGuards = { diff --git a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Collaterals.test.ts b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Collaterals.test.ts index fd36f6cbe6..0ccc435320 100644 --- a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Collaterals.test.ts +++ b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Collaterals.test.ts @@ -10,6 +10,7 @@ describe('Keeper Rewards - Multiple Collaterals', () => { settlementCost: 1111, flagCost: 3333, liquidateCost: 5555, + cancelCost: 2222, }; const { systems, @@ -93,7 +94,12 @@ describe('Keeper Rewards - Multiple Collaterals', () => { before('set keeper costs', async () => { await keeperCostOracleNode() .connect(owner()) - .setCosts(KeeperCosts.settlementCost, KeeperCosts.flagCost, KeeperCosts.liquidateCost); + .setCosts( + KeeperCosts.settlementCost, + KeeperCosts.flagCost, + KeeperCosts.liquidateCost, + KeeperCosts.cancelCost + ); }); before('set minLiquidationRewardUsd, maxLiquidationRewardUsd - uncapped', async () => { diff --git a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Positions.test.ts b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Positions.test.ts index 3dc96cc105..e5cb984caf 100644 --- a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Positions.test.ts +++ b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Positions.test.ts @@ -9,6 +9,7 @@ describe('Keeper Rewards - Multiple Positions', () => { settlementCost: 1111, flagCost: 3333, liquidateCost: 5555, + cancelCost: 2222, }; const { systems, perpsMarkets, provider, trader1, keeperCostOracleNode, keeper, owner } = bootstrapMarkets({ @@ -77,7 +78,12 @@ describe('Keeper Rewards - Multiple Positions', () => { before('set keeper costs', async () => { await keeperCostOracleNode() .connect(owner()) - .setCosts(KeeperCosts.settlementCost, KeeperCosts.flagCost, KeeperCosts.liquidateCost); + .setCosts( + KeeperCosts.settlementCost, + KeeperCosts.flagCost, + KeeperCosts.liquidateCost, + KeeperCosts.cancelCost + ); }); before('set minLiquidationRewardUsd, maxLiquidationRewardUsd - uncapped', async () => { diff --git a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Settlement.test.ts b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Settlement.test.ts index 650dc6156d..c4d147e18e 100644 --- a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Settlement.test.ts +++ b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Settlement.test.ts @@ -14,6 +14,7 @@ describe('Keeper Rewards - Settlement', () => { settlementCost: 1111, flagCost: 3333, liquidateCost: 5555, + cancelCost: 2222, }; const { systems, perpsMarkets, provider, trader1, keeperCostOracleNode, keeper, owner } = bootstrapMarkets({ @@ -72,7 +73,12 @@ describe('Keeper Rewards - Settlement', () => { before('set keeper costs', async () => { await keeperCostOracleNode() .connect(owner()) - .setCosts(KeeperCosts.settlementCost, KeeperCosts.flagCost, KeeperCosts.liquidateCost); + .setCosts( + KeeperCosts.settlementCost, + KeeperCosts.flagCost, + KeeperCosts.liquidateCost, + KeeperCosts.cancelCost + ); }); before('add collateral', async () => { diff --git a/markets/perps-market/test/integration/Liquidation/Liquidation.marginOnly.test.ts b/markets/perps-market/test/integration/Liquidation/Liquidation.marginOnly.test.ts index 0115ccaa96..454032be72 100644 --- a/markets/perps-market/test/integration/Liquidation/Liquidation.marginOnly.test.ts +++ b/markets/perps-market/test/integration/Liquidation/Liquidation.marginOnly.test.ts @@ -65,6 +65,7 @@ const KeeperCosts = { settlementCost: bn(10), flagCost: bn(20), liquidateCost: bn(15), + cancelCost: bn(5), }; const MIN_LIQ_REWARD = bn(10); @@ -116,7 +117,12 @@ describe('liquidation margin only', () => { before('set keeper costs', async () => { await keeperCostOracleNode() .connect(owner()) - .setCosts(KeeperCosts.settlementCost, KeeperCosts.flagCost, KeeperCosts.liquidateCost); + .setCosts( + KeeperCosts.settlementCost, + KeeperCosts.flagCost, + KeeperCosts.liquidateCost, + KeeperCosts.cancelCost + ); }); before('add collateral to margin', async () => { From eb0ed5c6416bca416dc7afde60a765a01977596a Mon Sep 17 00:00:00 2001 From: 0xMithrandir <173684735+0xMithrandir@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:42:33 +0100 Subject: [PATCH 2/8] Fix tests --- auxiliary/ArbitrumGasPriceOracle/storage.dump.json | 14 ++++++++++++++ auxiliary/OpGasPriceOracle/storage.dump.json | 14 ++++++++++++++ .../integration/bootstrap/createKeeperCostNode.ts | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/auxiliary/ArbitrumGasPriceOracle/storage.dump.json b/auxiliary/ArbitrumGasPriceOracle/storage.dump.json index 34aa2caae8..8733bad5e7 100644 --- a/auxiliary/ArbitrumGasPriceOracle/storage.dump.json +++ b/auxiliary/ArbitrumGasPriceOracle/storage.dump.json @@ -59,6 +59,20 @@ "size": 32, "slot": "7", "offset": 0 + }, + { + "type": "uint256", + "name": "l1CancelGasUnits", + "size": 32, + "slot": "8", + "offset": 0 + }, + { + "type": "uint256", + "name": "l2CancelGasUnits", + "size": 32, + "slot": "9", + "offset": 0 } ] } diff --git a/auxiliary/OpGasPriceOracle/storage.dump.json b/auxiliary/OpGasPriceOracle/storage.dump.json index 1891804b6c..d337e98f04 100644 --- a/auxiliary/OpGasPriceOracle/storage.dump.json +++ b/auxiliary/OpGasPriceOracle/storage.dump.json @@ -80,6 +80,20 @@ "size": 32, "slot": "10", "offset": 0 + }, + { + "type": "uint256", + "name": "l1CancelGasUnits", + "size": 32, + "slot": "11", + "offset": 0 + }, + { + "type": "uint256", + "name": "l2CancelGasUnits", + "size": 32, + "slot": "12", + "offset": 0 } ] } diff --git a/markets/perps-market/test/integration/bootstrap/createKeeperCostNode.ts b/markets/perps-market/test/integration/bootstrap/createKeeperCostNode.ts index ec72952eb5..c2fbc40c27 100644 --- a/markets/perps-market/test/integration/bootstrap/createKeeperCostNode.ts +++ b/markets/perps-market/test/integration/bootstrap/createKeeperCostNode.ts @@ -8,7 +8,7 @@ export const createKeeperCostNode = async (owner: ethers.Signer, OracleManager: const factory = await hre.ethers.getContractFactory('MockGasPriceNode'); const keeperCostNode = await factory.connect(owner).deploy(); - await keeperCostNode.setCosts(0, 0, 0); + await keeperCostNode.setCosts(0, 0, 0, 0); const params1 = abi.encode(['address'], [keeperCostNode.address]); await OracleManager.connect(owner).registerNode(NodeTypes.EXTERNAL, params1, []); From 43a3ba8bd736c4578bb7a7c6f534c7d602e84468 Mon Sep 17 00:00:00 2001 From: 0xMithrandir <173684735+0xMithrandir@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:08:16 +0100 Subject: [PATCH 3/8] Fix lint issues --- .../ArbitrumGasPriceOracle/contracts/ArbGasPriceOracle.sol | 2 +- auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol | 7 ++++++- markets/perps-market/contracts/mocks/MockGasPriceNode.sol | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/auxiliary/ArbitrumGasPriceOracle/contracts/ArbGasPriceOracle.sol b/auxiliary/ArbitrumGasPriceOracle/contracts/ArbGasPriceOracle.sol index 19789cd871..114a1c50a6 100644 --- a/auxiliary/ArbitrumGasPriceOracle/contracts/ArbGasPriceOracle.sol +++ b/auxiliary/ArbitrumGasPriceOracle/contracts/ArbGasPriceOracle.sol @@ -27,7 +27,7 @@ contract ArbGasPriceOracle is IExternalNode { /** * @notice identifies resources consumed via order cancellation */ - uint public constant KIND_CANCEL = 3; + uint256 public constant KIND_CANCEL = 3; /** * @notice the ArbGasInfo precompile contract on Arbitrum diff --git a/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol b/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol index cd3aaa95d9..d2cf3f7f73 100644 --- a/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol +++ b/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol @@ -47,6 +47,11 @@ contract OpGasPriceOracle is IExternalNode { uint256 l2CancelGasUnits; } + /** + * @notice thrown when the execution kind is invalid + */ + error OpGasPriceOracleInvalidExecutionKind(); + constructor(address _ovmGasPriceOracleAddress) { // Addresses configuration ovmGasPriceOracleAddress = _ovmGasPriceOracleAddress; @@ -221,7 +226,7 @@ contract OpGasPriceOracle is IExternalNode { gasUnitsL2 = runtimeParams.l2CancelGasUnits; unsignedTxSize = 0; } else { - revert("Invalid execution kind"); + revert InvalidExecutionKind(); } } diff --git a/markets/perps-market/contracts/mocks/MockGasPriceNode.sol b/markets/perps-market/contracts/mocks/MockGasPriceNode.sol index 70040fa365..b0491bb0eb 100644 --- a/markets/perps-market/contracts/mocks/MockGasPriceNode.sol +++ b/markets/perps-market/contracts/mocks/MockGasPriceNode.sol @@ -16,7 +16,7 @@ contract MockGasPriceNode is IExternalNode { uint256 public liquidateCost; uint256 public cancelCost; - constructor() {} + error InvalidExecutionKind(); function setCosts( uint256 _settlementCost, @@ -60,7 +60,7 @@ contract MockGasPriceNode is IExternalNode { } else if (executionKind == KIND_CANCEL) { theOutput.price = int256(cancelCost); } else { - revert("Invalid execution kind"); + revert InvalidExecutionKind(); } return theOutput; From bad990a3c882381b49b5f4f6811b4568df1febbb Mon Sep 17 00:00:00 2001 From: 0xMithrandir <173684735+0xMithrandir@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:14:48 +0100 Subject: [PATCH 4/8] Fix custom error --- auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol b/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol index d2cf3f7f73..da743b18e7 100644 --- a/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol +++ b/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol @@ -226,7 +226,7 @@ contract OpGasPriceOracle is IExternalNode { gasUnitsL2 = runtimeParams.l2CancelGasUnits; unsignedTxSize = 0; } else { - revert InvalidExecutionKind(); + revert OpGasPriceOracleInvalidExecutionKind(); } } From af390492d4ca7fad7e500f1140b9729b44b6886f Mon Sep 17 00:00:00 2001 From: 0xMithrandir <173684735+0xMithrandir@users.noreply.github.com> Date: Mon, 16 Dec 2024 11:27:00 +0100 Subject: [PATCH 5/8] Fix test --- .../test/integration/KeeperRewards/KeeperRewards.Caps.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Caps.test.ts b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Caps.test.ts index 5ca51e7d4f..9e33369810 100644 --- a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Caps.test.ts +++ b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Caps.test.ts @@ -82,7 +82,7 @@ describe('Keeper Rewards - Caps', () => { assertBn.equal(await keeperCostOracleNode().settlementCost(), KeeperCosts.settlementCost); assertBn.equal(await keeperCostOracleNode().flagCost(), KeeperCosts.flagCost); assertBn.equal(await keeperCostOracleNode().liquidateCost(), KeeperCosts.liquidateCost); - assertBn.equal(await keeperCostOracleNode().cancelCost(), KeeperCosts.liquidateCost); + assertBn.equal(await keeperCostOracleNode().cancelCost(), KeeperCosts.cancelCost); }); const capTestCases = [ From 1c321f87b4969cbe01d214a6fa21d27ee9c9a1a1 Mon Sep 17 00:00:00 2001 From: 0xMithrandir <173684735+0xMithrandir@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:35:08 +0100 Subject: [PATCH 6/8] Revert changes, remove additional cancel cost param --- .../contracts/ArbGasPriceOracle.sol | 11 ----------- auxiliary/ArbitrumGasPriceOracle/storage.dump.json | 14 -------------- .../contracts/OpGasPriceOracle.sol | 8 -------- auxiliary/OpGasPriceOracle/storage.dump.json | 14 -------------- .../contracts/mocks/MockGasPriceNode.sol | 5 ----- .../contracts/modules/AsyncOrderCancelModule.sol | 2 +- .../perps-market/contracts/storage/AsyncOrder.sol | 9 --------- .../perps-market/contracts/storage/KeeperCosts.sol | 9 --------- .../KeeperRewards/KeeperRewards.Caps.test.ts | 9 +-------- .../KeeperRewards.Large-Position.test.ts | 1 - .../KeeperRewards.N-Collaterals.test.ts | 1 - .../KeeperRewards.N-Positions.test.ts | 1 - .../KeeperRewards/KeeperRewards.Settlement.test.ts | 1 - .../Liquidation/Liquidation.marginOnly.test.ts | 1 - 14 files changed, 2 insertions(+), 84 deletions(-) diff --git a/auxiliary/ArbitrumGasPriceOracle/contracts/ArbGasPriceOracle.sol b/auxiliary/ArbitrumGasPriceOracle/contracts/ArbGasPriceOracle.sol index 114a1c50a6..e6af12c8f2 100644 --- a/auxiliary/ArbitrumGasPriceOracle/contracts/ArbGasPriceOracle.sol +++ b/auxiliary/ArbitrumGasPriceOracle/contracts/ArbGasPriceOracle.sol @@ -24,11 +24,6 @@ contract ArbGasPriceOracle is IExternalNode { */ uint256 public constant KIND_LIQUIDATE = 2; - /** - * @notice identifies resources consumed via order cancellation - */ - uint256 public constant KIND_CANCEL = 3; - /** * @notice the ArbGasInfo precompile contract on Arbitrum */ @@ -51,9 +46,6 @@ contract ArbGasPriceOracle is IExternalNode { // Call params uint256 numberOfUpdatedFeeds; uint256 executionKind; - // Cancel - uint256 l1CancelGasUnits; - uint256 l2CancelGasUnits; } /** @@ -231,9 +223,6 @@ contract ArbGasPriceOracle is IExternalNode { // Iterations is fixed to 1 for liquidations gasUnitsL1 = runtimeParams.l1LiquidateGasUnits; gasUnitsL2 = runtimeParams.l2LiquidateGasUnits; - } else if (runtimeParams.executionKind == KIND_CANCEL) { - gasUnitsL1 = runtimeParams.l1CancelGasUnits; - gasUnitsL2 = runtimeParams.l2CancelGasUnits; } else { revert ArbGasPriceOracleInvalidExecutionKind(); } diff --git a/auxiliary/ArbitrumGasPriceOracle/storage.dump.json b/auxiliary/ArbitrumGasPriceOracle/storage.dump.json index 8733bad5e7..34aa2caae8 100644 --- a/auxiliary/ArbitrumGasPriceOracle/storage.dump.json +++ b/auxiliary/ArbitrumGasPriceOracle/storage.dump.json @@ -59,20 +59,6 @@ "size": 32, "slot": "7", "offset": 0 - }, - { - "type": "uint256", - "name": "l1CancelGasUnits", - "size": 32, - "slot": "8", - "offset": 0 - }, - { - "type": "uint256", - "name": "l2CancelGasUnits", - "size": 32, - "slot": "9", - "offset": 0 } ] } diff --git a/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol b/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol index da743b18e7..20d993c645 100644 --- a/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol +++ b/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol @@ -22,7 +22,6 @@ contract OpGasPriceOracle is IExternalNode { uint256 public constant KIND_SETTLEMENT = 0; uint256 public constant KIND_FLAG = 1; uint256 public constant KIND_LIQUIDATE = 2; - uint256 public constant KIND_CANCEL = 3; struct RuntimeParams { // Set up params @@ -42,9 +41,6 @@ contract OpGasPriceOracle is IExternalNode { // Call params uint256 numberOfUpdatedFeeds; uint256 executionKind; - // Cancel - uint256 l1CancelGasUnits; - uint256 l2CancelGasUnits; } /** @@ -221,10 +217,6 @@ contract OpGasPriceOracle is IExternalNode { gasUnitsL1 = runtimeParams.l1LiquidateGasUnits; gasUnitsL2 = runtimeParams.l2LiquidateGasUnits; unsignedTxSize = runtimeParams.liquidateTxSize; - } else if (runtimeParams.executionKind == KIND_CANCEL) { - gasUnitsL1 = runtimeParams.l1CancelGasUnits; - gasUnitsL2 = runtimeParams.l2CancelGasUnits; - unsignedTxSize = 0; } else { revert OpGasPriceOracleInvalidExecutionKind(); } diff --git a/auxiliary/OpGasPriceOracle/storage.dump.json b/auxiliary/OpGasPriceOracle/storage.dump.json index d337e98f04..1891804b6c 100644 --- a/auxiliary/OpGasPriceOracle/storage.dump.json +++ b/auxiliary/OpGasPriceOracle/storage.dump.json @@ -80,20 +80,6 @@ "size": 32, "slot": "10", "offset": 0 - }, - { - "type": "uint256", - "name": "l1CancelGasUnits", - "size": 32, - "slot": "11", - "offset": 0 - }, - { - "type": "uint256", - "name": "l2CancelGasUnits", - "size": 32, - "slot": "12", - "offset": 0 } ] } diff --git a/markets/perps-market/contracts/mocks/MockGasPriceNode.sol b/markets/perps-market/contracts/mocks/MockGasPriceNode.sol index b0491bb0eb..c63f8b3962 100644 --- a/markets/perps-market/contracts/mocks/MockGasPriceNode.sol +++ b/markets/perps-market/contracts/mocks/MockGasPriceNode.sol @@ -9,12 +9,10 @@ contract MockGasPriceNode is IExternalNode { uint256 public constant KIND_SETTLEMENT = 0; uint256 public constant KIND_FLAG = 1; uint256 public constant KIND_LIQUIDATE = 2; - uint256 public constant KIND_CANCEL = 3; uint256 public settlementCost; uint256 public flagCost; uint256 public liquidateCost; - uint256 public cancelCost; error InvalidExecutionKind(); @@ -27,7 +25,6 @@ contract MockGasPriceNode is IExternalNode { settlementCost = _settlementCost; flagCost = _flagCost; liquidateCost = _liquidateCost; - cancelCost = _cancelCost; } // solhint-disable numcast/safe-cast @@ -57,8 +54,6 @@ contract MockGasPriceNode is IExternalNode { theOutput.price = int256(flagCost * numberOfUpdatedFeeds); } else if (executionKind == KIND_LIQUIDATE) { theOutput.price = int256(liquidateCost); - } else if (executionKind == KIND_CANCEL) { - theOutput.price = int256(cancelCost); } else { revert InvalidExecutionKind(); } diff --git a/markets/perps-market/contracts/modules/AsyncOrderCancelModule.sol b/markets/perps-market/contracts/modules/AsyncOrderCancelModule.sol index 2ecc78bfc4..158d71c0b9 100644 --- a/markets/perps-market/contracts/modules/AsyncOrderCancelModule.sol +++ b/markets/perps-market/contracts/modules/AsyncOrderCancelModule.sol @@ -60,7 +60,7 @@ contract AsyncOrderCancelModule is IAsyncOrderCancelModule, IMarketEvents, IAcco runtime.accountId = asyncOrder.request.accountId; runtime.marketId = asyncOrder.request.marketId; runtime.acceptablePrice = asyncOrder.request.acceptablePrice; - runtime.settlementReward = AsyncOrder.cancellationRewardCost(settlementStrategy); + runtime.settlementReward = AsyncOrder.settlementRewardCost(settlementStrategy); runtime.sizeDelta = asyncOrder.request.sizeDelta; // check if account is flagged diff --git a/markets/perps-market/contracts/storage/AsyncOrder.sol b/markets/perps-market/contracts/storage/AsyncOrder.sol index 931ba5b3f4..7e84c2f1cd 100644 --- a/markets/perps-market/contracts/storage/AsyncOrder.sol +++ b/markets/perps-market/contracts/storage/AsyncOrder.sol @@ -444,15 +444,6 @@ library AsyncOrder { return KeeperCosts.load().getSettlementKeeperCosts() + strategy.settlementReward; } - /** - * @notice Calculates the cancellation rewards. - */ - function cancellationRewardCost( - SettlementStrategy.Data storage strategy - ) internal view returns (uint256) { - return KeeperCosts.load().getCancellationKeeperCosts() + strategy.settlementReward; - } - /** * @notice Calculates the order fees. */ diff --git a/markets/perps-market/contracts/storage/KeeperCosts.sol b/markets/perps-market/contracts/storage/KeeperCosts.sol index 3b9ab66ce9..feb0621bd2 100644 --- a/markets/perps-market/contracts/storage/KeeperCosts.sol +++ b/markets/perps-market/contracts/storage/KeeperCosts.sol @@ -22,7 +22,6 @@ library KeeperCosts { uint256 private constant KIND_SETTLEMENT = 0; uint256 private constant KIND_FLAG = 1; uint256 private constant KIND_LIQUIDATE = 2; - uint256 private constant KIND_CANCEL = 3; struct Data { bytes32 keeperCostNodeId; @@ -45,14 +44,6 @@ library KeeperCosts { sUSDCost = _processWithRuntime(self.keeperCostNodeId, factory, 0, KIND_SETTLEMENT); } - function getCancellationKeeperCosts( - Data storage self - ) internal view returns (uint256 sUSDCost) { - PerpsMarketFactory.Data storage factory = PerpsMarketFactory.load(); - - sUSDCost = _processWithRuntime(self.keeperCostNodeId, factory, 0, KIND_CANCEL); - } - function getFlagKeeperCosts( Data storage self, uint128 accountId diff --git a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Caps.test.ts b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Caps.test.ts index 9e33369810..b7f391196c 100644 --- a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Caps.test.ts +++ b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Caps.test.ts @@ -10,7 +10,6 @@ describe('Keeper Rewards - Caps', () => { settlementCost: 1111, flagCost: 3333, liquidateCost: 5555, - cancelCost: 2222, }; const { systems, perpsMarkets, provider, trader1, keeperCostOracleNode, keeper, owner } = bootstrapMarkets({ @@ -67,12 +66,7 @@ describe('Keeper Rewards - Caps', () => { before('set keeper costs', async () => { await keeperCostOracleNode() .connect(owner()) - .setCosts( - KeeperCosts.settlementCost, - KeeperCosts.flagCost, - KeeperCosts.liquidateCost, - KeeperCosts.cancelCost - ); + .setCosts(KeeperCosts.settlementCost, KeeperCosts.flagCost, KeeperCosts.liquidateCost); }); const restoreToConfiguration = snapshotCheckpoint(provider); @@ -82,7 +76,6 @@ describe('Keeper Rewards - Caps', () => { assertBn.equal(await keeperCostOracleNode().settlementCost(), KeeperCosts.settlementCost); assertBn.equal(await keeperCostOracleNode().flagCost(), KeeperCosts.flagCost); assertBn.equal(await keeperCostOracleNode().liquidateCost(), KeeperCosts.liquidateCost); - assertBn.equal(await keeperCostOracleNode().cancelCost(), KeeperCosts.cancelCost); }); const capTestCases = [ diff --git a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Large-Position.test.ts b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Large-Position.test.ts index b417d54198..788a4c7026 100644 --- a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Large-Position.test.ts +++ b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Large-Position.test.ts @@ -10,7 +10,6 @@ describe('Keeper Rewards - Multiple Liquidation steps', () => { settlementCost: 1111, flagCost: 3333, liquidateCost: 5555, - cancelCost: 2222, }; const { systems, perpsMarkets, provider, trader1, keeperCostOracleNode, keeper, owner } = bootstrapMarkets({ diff --git a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Collaterals.test.ts b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Collaterals.test.ts index 0ccc435320..416f8ed334 100644 --- a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Collaterals.test.ts +++ b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Collaterals.test.ts @@ -10,7 +10,6 @@ describe('Keeper Rewards - Multiple Collaterals', () => { settlementCost: 1111, flagCost: 3333, liquidateCost: 5555, - cancelCost: 2222, }; const { systems, diff --git a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Positions.test.ts b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Positions.test.ts index e5cb984caf..31e38936fb 100644 --- a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Positions.test.ts +++ b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Positions.test.ts @@ -9,7 +9,6 @@ describe('Keeper Rewards - Multiple Positions', () => { settlementCost: 1111, flagCost: 3333, liquidateCost: 5555, - cancelCost: 2222, }; const { systems, perpsMarkets, provider, trader1, keeperCostOracleNode, keeper, owner } = bootstrapMarkets({ diff --git a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Settlement.test.ts b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Settlement.test.ts index c4d147e18e..d055b149b0 100644 --- a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Settlement.test.ts +++ b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Settlement.test.ts @@ -14,7 +14,6 @@ describe('Keeper Rewards - Settlement', () => { settlementCost: 1111, flagCost: 3333, liquidateCost: 5555, - cancelCost: 2222, }; const { systems, perpsMarkets, provider, trader1, keeperCostOracleNode, keeper, owner } = bootstrapMarkets({ diff --git a/markets/perps-market/test/integration/Liquidation/Liquidation.marginOnly.test.ts b/markets/perps-market/test/integration/Liquidation/Liquidation.marginOnly.test.ts index 454032be72..7f29fa269d 100644 --- a/markets/perps-market/test/integration/Liquidation/Liquidation.marginOnly.test.ts +++ b/markets/perps-market/test/integration/Liquidation/Liquidation.marginOnly.test.ts @@ -65,7 +65,6 @@ const KeeperCosts = { settlementCost: bn(10), flagCost: bn(20), liquidateCost: bn(15), - cancelCost: bn(5), }; const MIN_LIQ_REWARD = bn(10); From 3431e44e00ea43c16bf90db82014e15e4e47ddb1 Mon Sep 17 00:00:00 2001 From: 0xMithrandir <173684735+0xMithrandir@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:37:24 +0100 Subject: [PATCH 7/8] Revert changes in tests --- .../KeeperRewards/KeeperRewards.Large-Position.test.ts | 7 +------ .../KeeperRewards/KeeperRewards.N-Collaterals.test.ts | 7 +------ .../KeeperRewards/KeeperRewards.N-Positions.test.ts | 7 +------ .../KeeperRewards/KeeperRewards.Settlement.test.ts | 7 +------ .../integration/Liquidation/Liquidation.marginOnly.test.ts | 7 +------ .../test/integration/bootstrap/createKeeperCostNode.ts | 2 +- 6 files changed, 6 insertions(+), 31 deletions(-) diff --git a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Large-Position.test.ts b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Large-Position.test.ts index 788a4c7026..397e666546 100644 --- a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Large-Position.test.ts +++ b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Large-Position.test.ts @@ -64,12 +64,7 @@ describe('Keeper Rewards - Multiple Liquidation steps', () => { before('set keeper costs', async () => { await keeperCostOracleNode() .connect(owner()) - .setCosts( - KeeperCosts.settlementCost, - KeeperCosts.flagCost, - KeeperCosts.liquidateCost, - KeeperCosts.cancelCost - ); + .setCosts(KeeperCosts.settlementCost, KeeperCosts.flagCost, KeeperCosts.liquidateCost); }); const rewardGuards = { diff --git a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Collaterals.test.ts b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Collaterals.test.ts index 416f8ed334..fd36f6cbe6 100644 --- a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Collaterals.test.ts +++ b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Collaterals.test.ts @@ -93,12 +93,7 @@ describe('Keeper Rewards - Multiple Collaterals', () => { before('set keeper costs', async () => { await keeperCostOracleNode() .connect(owner()) - .setCosts( - KeeperCosts.settlementCost, - KeeperCosts.flagCost, - KeeperCosts.liquidateCost, - KeeperCosts.cancelCost - ); + .setCosts(KeeperCosts.settlementCost, KeeperCosts.flagCost, KeeperCosts.liquidateCost); }); before('set minLiquidationRewardUsd, maxLiquidationRewardUsd - uncapped', async () => { diff --git a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Positions.test.ts b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Positions.test.ts index 31e38936fb..3dc96cc105 100644 --- a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Positions.test.ts +++ b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.N-Positions.test.ts @@ -77,12 +77,7 @@ describe('Keeper Rewards - Multiple Positions', () => { before('set keeper costs', async () => { await keeperCostOracleNode() .connect(owner()) - .setCosts( - KeeperCosts.settlementCost, - KeeperCosts.flagCost, - KeeperCosts.liquidateCost, - KeeperCosts.cancelCost - ); + .setCosts(KeeperCosts.settlementCost, KeeperCosts.flagCost, KeeperCosts.liquidateCost); }); before('set minLiquidationRewardUsd, maxLiquidationRewardUsd - uncapped', async () => { diff --git a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Settlement.test.ts b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Settlement.test.ts index d055b149b0..650dc6156d 100644 --- a/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Settlement.test.ts +++ b/markets/perps-market/test/integration/KeeperRewards/KeeperRewards.Settlement.test.ts @@ -72,12 +72,7 @@ describe('Keeper Rewards - Settlement', () => { before('set keeper costs', async () => { await keeperCostOracleNode() .connect(owner()) - .setCosts( - KeeperCosts.settlementCost, - KeeperCosts.flagCost, - KeeperCosts.liquidateCost, - KeeperCosts.cancelCost - ); + .setCosts(KeeperCosts.settlementCost, KeeperCosts.flagCost, KeeperCosts.liquidateCost); }); before('add collateral', async () => { diff --git a/markets/perps-market/test/integration/Liquidation/Liquidation.marginOnly.test.ts b/markets/perps-market/test/integration/Liquidation/Liquidation.marginOnly.test.ts index 7f29fa269d..0115ccaa96 100644 --- a/markets/perps-market/test/integration/Liquidation/Liquidation.marginOnly.test.ts +++ b/markets/perps-market/test/integration/Liquidation/Liquidation.marginOnly.test.ts @@ -116,12 +116,7 @@ describe('liquidation margin only', () => { before('set keeper costs', async () => { await keeperCostOracleNode() .connect(owner()) - .setCosts( - KeeperCosts.settlementCost, - KeeperCosts.flagCost, - KeeperCosts.liquidateCost, - KeeperCosts.cancelCost - ); + .setCosts(KeeperCosts.settlementCost, KeeperCosts.flagCost, KeeperCosts.liquidateCost); }); before('add collateral to margin', async () => { diff --git a/markets/perps-market/test/integration/bootstrap/createKeeperCostNode.ts b/markets/perps-market/test/integration/bootstrap/createKeeperCostNode.ts index c2fbc40c27..ec72952eb5 100644 --- a/markets/perps-market/test/integration/bootstrap/createKeeperCostNode.ts +++ b/markets/perps-market/test/integration/bootstrap/createKeeperCostNode.ts @@ -8,7 +8,7 @@ export const createKeeperCostNode = async (owner: ethers.Signer, OracleManager: const factory = await hre.ethers.getContractFactory('MockGasPriceNode'); const keeperCostNode = await factory.connect(owner).deploy(); - await keeperCostNode.setCosts(0, 0, 0, 0); + await keeperCostNode.setCosts(0, 0, 0); const params1 = abi.encode(['address'], [keeperCostNode.address]); await OracleManager.connect(owner).registerNode(NodeTypes.EXTERNAL, params1, []); From fcdfff870a9a9aff494179f0c1142ae197fbbd49 Mon Sep 17 00:00:00 2001 From: 0xMithrandir <173684735+0xMithrandir@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:58:02 +0100 Subject: [PATCH 8/8] Revert changes in mock --- markets/perps-market/contracts/mocks/MockGasPriceNode.sol | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/markets/perps-market/contracts/mocks/MockGasPriceNode.sol b/markets/perps-market/contracts/mocks/MockGasPriceNode.sol index c63f8b3962..f68048466d 100644 --- a/markets/perps-market/contracts/mocks/MockGasPriceNode.sol +++ b/markets/perps-market/contracts/mocks/MockGasPriceNode.sol @@ -16,12 +16,7 @@ contract MockGasPriceNode is IExternalNode { error InvalidExecutionKind(); - function setCosts( - uint256 _settlementCost, - uint256 _flagCost, - uint256 _liquidateCost, - uint256 _cancelCost - ) external { + function setCosts(uint256 _settlementCost, uint256 _flagCost, uint256 _liquidateCost) external { settlementCost = _settlementCost; flagCost = _flagCost; liquidateCost = _liquidateCost;