Skip to content

Commit 5876cd5

Browse files
committed
fix: added missing parameters to deploy script and reduced runs to 50 for SubgraphService
1 parent 0c0d090 commit 5876cd5

File tree

10 files changed

+17
-14
lines changed

10 files changed

+17
-14
lines changed

packages/horizon/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ We use Hardhat Ignition to deploy the contracts. To build and deploy the contrac
1010
yarn install
1111
yarn build
1212
npx hardhat ignition deploy ./ignition/modules/horizon.ts \
13-
--parameters ./ignition/configs/graph.hardhat.json \
13+
--parameters ./ignition/configs/horizon.hardhat.json \
1414
--network hardhat
1515
```
1616

packages/horizon/ignition/configs/horizon.hardhat.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
},
4242
"TAPCollector": {
4343
"eip712Name": "TAPCollector",
44-
"eip712Version": "1"
44+
"eip712Version": "1",
45+
"revokeSignerThawingPeriod": 10000
4546
}
4647
}

packages/horizon/ignition/modules/core/TAPCollector.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ export default buildModule('TAPCollector', (m) => {
1111

1212
const name = m.getParameter('eip712Name')
1313
const version = m.getParameter('eip712Version')
14+
const revokeSignerThawingPeriod = m.getParameter('revokeSignerThawingPeriod')
1415

15-
const TAPCollector = m.contract('TAPCollector', TAPCollectorArtifact, [name, version, Controller], { after: [PeripheryRegistered, HorizonRegistered] })
16+
const TAPCollector = m.contract('TAPCollector', TAPCollectorArtifact, [name, version, Controller, revokeSignerThawingPeriod], { after: [PeripheryRegistered, HorizonRegistered] })
1617

1718
return { TAPCollector }
1819
})

packages/horizon/scripts/deploy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ignition } from 'hardhat'
22

3-
import Parameters from '../ignition/graph.hardhat.json'
3+
import Parameters from '../ignition/configs/horizon.hardhat.json'
44
import PeripheryModule from '../ignition/modules/periphery'
55

66
async function main() {

packages/subgraph-service/contracts/SubgraphService.sol

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ contract SubgraphService is
7777
* on the DisputeManager. We use the {ProvisionManager} overrideable getters to get the ranges.
7878
* @param minimumProvisionTokens The minimum amount of provisioned tokens required to create an allocation
7979
* @param maximumDelegationRatio The maximum delegation ratio allowed for an allocation
80+
* @param stakeToFeesRatio The ratio of stake to fees to lock when collecting query fees
8081
*/
8182
function initialize(
8283
uint256 minimumProvisionTokens,
@@ -497,8 +498,7 @@ contract SubgraphService is
497498
* @return max The maximum is unbounded
498499
*/
499500
function _getThawingPeriodRange() internal view override returns (uint64 min, uint64 max) {
500-
uint64 disputePeriod = _disputeManager().getDisputePeriod();
501-
return (disputePeriod, DEFAULT_MAX_THAWING_PERIOD);
501+
return (_disputeManager().getDisputePeriod(), DEFAULT_MAX_THAWING_PERIOD);
502502
}
503503

504504
/**
@@ -507,8 +507,7 @@ contract SubgraphService is
507507
* @return max The maximum is 100% in PPM
508508
*/
509509
function _getVerifierCutRange() internal view override returns (uint32 min, uint32 max) {
510-
uint32 verifierCut = _disputeManager().getVerifierCut();
511-
return (verifierCut, DEFAULT_MAX_VERIFIER_CUT);
510+
return (_disputeManager().getVerifierCut(), DEFAULT_MAX_VERIFIER_CUT);
512511
}
513512

514513
/**

packages/subgraph-service/contracts/utilities/AllocationManager.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,7 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
485485
* @param _proof The EIP712 proof, an EIP712 signed message of (indexer,allocationId)
486486
*/
487487
function _verifyAllocationProof(address _indexer, address _allocationId, bytes memory _proof) private view {
488-
bytes32 digest = _encodeAllocationProof(_indexer, _allocationId);
489-
address signer = ECDSA.recover(digest, _proof);
488+
address signer = ECDSA.recover(_encodeAllocationProof(_indexer, _allocationId), _proof);
490489
require(signer == _allocationId, AllocationManagerInvalidAllocationProof(signer, _allocationId));
491490
}
492491
}

packages/subgraph-service/hardhat.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const config: HardhatUserConfig = {
1313
settings: {
1414
optimizer: {
1515
enabled: true,
16-
runs: 200,
16+
runs: 50,
1717
},
1818
},
1919
},

packages/subgraph-service/ignition/configs/subgraph-service.hardhat.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"SubgraphService": {
1010
"minimumProvisionTokens": "100000000000000000000000n",
11-
"maximumDelegationRatio": 16
11+
"maximumDelegationRatio": 16,
12+
"stakeToFeesRatio": 2
1213
}
1314
}

packages/subgraph-service/ignition/modules/DisputeManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default buildModule('DisputeManager', (m) => {
2020
const DisputeManagerImplementation = m.contract('DisputeManager', [controllerAddress])
2121

2222
// Upgrade implementation
23-
const DisputeManagerProxyAdmin = m.contractAt('TransparentUpgradeableProxy', ProxyAdminArtifact, disputeManagerProxyAdminAddress)
23+
const DisputeManagerProxyAdmin = m.contractAt('ProxyAdmin', ProxyAdminArtifact, disputeManagerProxyAdminAddress)
2424
const encodedCall = m.encodeFunctionCall(DisputeManagerImplementation, 'initialize', [
2525
arbitrator,
2626
disputePeriod,

packages/subgraph-service/ignition/modules/SubgraphService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ export default buildModule('SubgraphService', (m) => {
1616
// Parameters - config file
1717
const minimumProvisionTokens = m.getParameter('minimumProvisionTokens')
1818
const maximumDelegationRatio = m.getParameter('maximumDelegationRatio')
19+
const stakeToFeesRatio = m.getParameter('stakeToFeesRatio')
1920

2021
// Deploy implementation
2122
const SubgraphServiceImplementation = m.contract('SubgraphService', [controllerAddress, disputeManagerAddress, tapCollectorAddress, curationAddress])
2223

2324
// Upgrade implementation
24-
const SubgraphServiceProxyAdmin = m.contractAt('TransparentUpgradeableProxy', ProxyAdminArtifact, subgraphServiceProxyAdminAddress)
25+
const SubgraphServiceProxyAdmin = m.contractAt('ProxyAdmin', ProxyAdminArtifact, subgraphServiceProxyAdminAddress)
2526
const encodedCall = m.encodeFunctionCall(SubgraphServiceImplementation, 'initialize', [
2627
minimumProvisionTokens,
2728
maximumDelegationRatio,
29+
stakeToFeesRatio,
2830
])
2931
m.call(SubgraphServiceProxyAdmin, 'upgradeAndCall', [subgraphServiceProxyAddress, SubgraphServiceImplementation, encodedCall])
3032

0 commit comments

Comments
 (0)