From 8eab8f52d180c62cd91e2f4af21d688cad8338b5 Mon Sep 17 00:00:00 2001 From: Miguel de Elias Date: Wed, 16 Oct 2024 16:28:07 -0300 Subject: [PATCH 1/2] fix(Horizon): added missing parameter for TAPCollector deployment --- packages/horizon/README.md | 2 +- packages/horizon/ignition/configs/horizon.hardhat.json | 3 ++- packages/horizon/ignition/modules/core/TAPCollector.ts | 3 ++- packages/horizon/scripts/deploy.ts | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/horizon/README.md b/packages/horizon/README.md index d3a0d6200..4b0954953 100644 --- a/packages/horizon/README.md +++ b/packages/horizon/README.md @@ -10,7 +10,7 @@ We use Hardhat Ignition to deploy the contracts. To build and deploy the contrac yarn install yarn build npx hardhat ignition deploy ./ignition/modules/horizon.ts \ - --parameters ./ignition/configs/graph.hardhat.json \ + --parameters ./ignition/configs/horizon.hardhat.json \ --network hardhat ``` diff --git a/packages/horizon/ignition/configs/horizon.hardhat.json b/packages/horizon/ignition/configs/horizon.hardhat.json index 894a2ed59..ef16c8136 100644 --- a/packages/horizon/ignition/configs/horizon.hardhat.json +++ b/packages/horizon/ignition/configs/horizon.hardhat.json @@ -41,6 +41,7 @@ }, "TAPCollector": { "eip712Name": "TAPCollector", - "eip712Version": "1" + "eip712Version": "1", + "revokeSignerThawingPeriod": 10000 } } diff --git a/packages/horizon/ignition/modules/core/TAPCollector.ts b/packages/horizon/ignition/modules/core/TAPCollector.ts index 429dc5083..2e8be4bfb 100644 --- a/packages/horizon/ignition/modules/core/TAPCollector.ts +++ b/packages/horizon/ignition/modules/core/TAPCollector.ts @@ -11,8 +11,9 @@ export default buildModule('TAPCollector', (m) => { const name = m.getParameter('eip712Name') const version = m.getParameter('eip712Version') + const revokeSignerThawingPeriod = m.getParameter('revokeSignerThawingPeriod') - const TAPCollector = m.contract('TAPCollector', TAPCollectorArtifact, [name, version, Controller], { after: [PeripheryRegistered, HorizonRegistered] }) + const TAPCollector = m.contract('TAPCollector', TAPCollectorArtifact, [name, version, Controller, revokeSignerThawingPeriod], { after: [PeripheryRegistered, HorizonRegistered] }) return { TAPCollector } }) diff --git a/packages/horizon/scripts/deploy.ts b/packages/horizon/scripts/deploy.ts index a7daff3d4..5a94398d2 100644 --- a/packages/horizon/scripts/deploy.ts +++ b/packages/horizon/scripts/deploy.ts @@ -1,6 +1,6 @@ import { ignition } from 'hardhat' -import Parameters from '../ignition/graph.hardhat.json' +import Parameters from '../ignition/configs/horizon.hardhat.json' import PeripheryModule from '../ignition/modules/periphery' async function main() { From 25a26a1c1b037f02628ef7fadfe43f3abd6fb0b3 Mon Sep 17 00:00:00 2001 From: Miguel de Elias Date: Wed, 16 Oct 2024 17:01:09 -0300 Subject: [PATCH 2/2] fix attempt: subgraph service missing parameter --- packages/subgraph-service/contracts/SubgraphService.sol | 1 + .../ignition/configs/subgraph-service.hardhat.json | 3 ++- packages/subgraph-service/ignition/modules/SubgraphService.ts | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/subgraph-service/contracts/SubgraphService.sol b/packages/subgraph-service/contracts/SubgraphService.sol index a07463a25..ed076a05d 100644 --- a/packages/subgraph-service/contracts/SubgraphService.sol +++ b/packages/subgraph-service/contracts/SubgraphService.sol @@ -77,6 +77,7 @@ contract SubgraphService is * on the DisputeManager. We use the {ProvisionManager} overrideable getters to get the ranges. * @param minimumProvisionTokens The minimum amount of provisioned tokens required to create an allocation * @param maximumDelegationRatio The maximum delegation ratio allowed for an allocation + * @param stakeToFeesRatio The ratio of stake to fees to lock when collecting query fees */ function initialize( uint256 minimumProvisionTokens, diff --git a/packages/subgraph-service/ignition/configs/subgraph-service.hardhat.json b/packages/subgraph-service/ignition/configs/subgraph-service.hardhat.json index 83dfa1899..c1a248448 100644 --- a/packages/subgraph-service/ignition/configs/subgraph-service.hardhat.json +++ b/packages/subgraph-service/ignition/configs/subgraph-service.hardhat.json @@ -8,6 +8,7 @@ }, "SubgraphService": { "minimumProvisionTokens": "100000000000000000000000n", - "maximumDelegationRatio": 16 + "maximumDelegationRatio": 16, + "stakeToFeesRatio": 2 } } diff --git a/packages/subgraph-service/ignition/modules/SubgraphService.ts b/packages/subgraph-service/ignition/modules/SubgraphService.ts index 783cd7d15..5f237dc27 100644 --- a/packages/subgraph-service/ignition/modules/SubgraphService.ts +++ b/packages/subgraph-service/ignition/modules/SubgraphService.ts @@ -16,6 +16,7 @@ export default buildModule('SubgraphService', (m) => { // Parameters - config file const minimumProvisionTokens = m.getParameter('minimumProvisionTokens') const maximumDelegationRatio = m.getParameter('maximumDelegationRatio') + const stakeToFeesRatio = m.getParameter('stakeToFeesRatio', 2) // Deploy implementation const SubgraphServiceImplementation = m.contract('SubgraphService', [controllerAddress, disputeManagerAddress, tapCollectorAddress, curationAddress]) @@ -25,6 +26,7 @@ export default buildModule('SubgraphService', (m) => { const encodedCall = m.encodeFunctionCall(SubgraphServiceImplementation, 'initialize', [ minimumProvisionTokens, maximumDelegationRatio, + stakeToFeesRatio, ]) m.call(SubgraphServiceProxyAdmin, 'upgradeAndCall', [subgraphServiceProxyAddress, SubgraphServiceImplementation, encodedCall])