Skip to content

Commit 5120495

Browse files
authored
Merge pull request #866 from graphprotocol/pcv/remove-delegation-params-cooldown
feat: remove/deprecate delegation parameters cooldown
2 parents 5bdc078 + f453249 commit 5120495

File tree

19 files changed

+40
-156
lines changed

19 files changed

+40
-156
lines changed

cli/commands/contracts/staking.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ export const setDelegationParameters = async (
9797
const staking = cli.contracts.Staking
9898

9999
logger.info(`Setting the following delegation parameters for indexer ${cli.walletAddress}
100-
indexingRewardCut = ${indexingRewardCut}
101-
queryFeeCut = ${queryFeeCut}
102-
cooldownBlocks = ${cooldownBlocks}
100+
indexingRewardCut = ${indexingRewardCut}
101+
queryFeeCut = ${queryFeeCut}
102+
cooldownBlocks (deprecated) = ${cooldownBlocks}
103103
`)
104104
await sendTransaction(cli.wallet, staking, 'setDelegationParameters', [
105105
indexingRewardCut,
@@ -305,7 +305,7 @@ export const stakingCommand = {
305305
demandOption: true,
306306
})
307307
.option('cooldownBlocks', {
308-
description: 'Period that need to pass to update delegation parameters',
308+
description: 'Period that need to pass to update delegation parameters (deprecated)',
309309
type: 'number',
310310
})
311311
},

cli/commands/protocol/get.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ export const gettersList = {
1313
'staking-thawing-period': { contract: 'Staking', name: 'thawingPeriod' },
1414
'staking-max-allocation-epochs': { contract: 'Staking', name: 'maxAllocationEpochs' },
1515
'staking-delegation-ratio': { contract: 'Staking', name: 'delegationRatio' },
16-
'staking-delegation-parameters-cooldown': {
17-
contract: 'Staking',
18-
name: 'delegationParametersCooldown',
19-
},
2016
'staking-delegation-unbonding-period': { contract: 'Staking', name: 'delegationUnbondingPeriod' },
2117
'protocol-percentage': { contract: 'Staking', name: 'protocolPercentage' },
2218
// Curation

cli/commands/protocol/set.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ export const settersList = {
1414
'staking-max-allocation-epochs': { contract: 'Staking', name: 'setMaxAllocationEpochs' },
1515
'staking-protocol-percentage': { contract: 'Staking', name: 'setProtocolPercentage' },
1616
'staking-delegation-parameters': { contract: 'Staking', name: 'setDelegationParameters' },
17-
'staking-delegation-parameters-cooldown': {
18-
contract: 'Staking',
19-
name: 'setDelegationParametersCooldown',
20-
},
2117
'staking-delegation-unbonding-period': {
2218
contract: 'Staking',
2319
name: 'setDelegationUnbondingPeriod',

contracts/discovery/GNS.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ abstract contract GNS is GNSV3Storage, GraphUpgradeable, IGNS, Multicall {
257257
uint256 subgraphID = _nextSubgraphID(subgraphOwner);
258258
SubgraphData storage subgraphData = _getSubgraphData(subgraphID);
259259
subgraphData.subgraphDeploymentID = _subgraphDeploymentID;
260-
subgraphData.reserveRatioDeprecated = fixedReserveRatio;
260+
subgraphData.__DEPRECATED_reserveRatio = fixedReserveRatio;
261261

262262
// Mint the NFT. Use the subgraphID as tokenID.
263263
// This function will check the if tokenID already exists.
@@ -371,7 +371,7 @@ abstract contract GNS is GNSV3Storage, GraphUpgradeable, IGNS, Multicall {
371371
// Deprecate the subgraph and do cleanup
372372
subgraphData.disabled = true;
373373
subgraphData.vSignal = 0;
374-
subgraphData.reserveRatioDeprecated = 0;
374+
subgraphData.__DEPRECATED_reserveRatio = 0;
375375
// NOTE: We don't reset the following variable as we use it to test if the Subgraph was ever created
376376
// subgraphData.subgraphDeploymentID = 0;
377377

contracts/discovery/IGNS.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface IGNS {
1818
uint256 nSignal; // The token of the subgraph bonding curve
1919
mapping(address => uint256) curatorNSignal;
2020
bytes32 subgraphDeploymentID;
21-
uint32 reserveRatioDeprecated; // Ratio for the bonding curve, always 1 in PPM, deprecated.
21+
uint32 __DEPRECATED_reserveRatio; // solhint-disable-line var-name-mixedcase
2222
bool disabled;
2323
uint256 withdrawableGRT;
2424
}

contracts/discovery/L1GNS.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ contract L1GNS is GNS, L1GNSV1Storage {
107107
extraData
108108
);
109109

110-
subgraphData.reserveRatioDeprecated = 0;
110+
subgraphData.__DEPRECATED_reserveRatio = 0;
111111
_burnNFT(_subgraphID);
112112
emit SubgraphSentToL2(_subgraphID, msg.sender, _l2Owner, tokensForL2);
113113
}

contracts/l2/discovery/L2GNS.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ contract L2GNS is GNS, L2GNSV1Storage, IL2GNS {
282282
SubgraphData storage subgraphData = _getSubgraphData(l2SubgraphID);
283283
IL2GNS.SubgraphL2TransferData storage transferData = subgraphL2TransferData[l2SubgraphID];
284284

285-
subgraphData.reserveRatioDeprecated = fixedReserveRatio;
285+
subgraphData.__DEPRECATED_reserveRatio = fixedReserveRatio;
286286
// The subgraph will be disabled until finishSubgraphTransferFromL1 is called
287287
subgraphData.disabled = true;
288288

contracts/l2/staking/L2Staking.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ contract L2Staking is Staking, IL2StakingBase {
102102

103103
// Initialize the delegation pool the first time
104104
if (__delegationPools[_indexer].updatedAtBlock == 0) {
105-
_setDelegationParameters(_indexer, MAX_PPM, MAX_PPM, __delegationParametersCooldown);
105+
_setDelegationParameters(_indexer, MAX_PPM, MAX_PPM);
106106
}
107107

108108
emit StakeDeposited(_indexer, _amount);

contracts/rewards/RewardsManagerStorage.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import "../governance/Managed.sol";
88
contract RewardsManagerV1Storage is Managed {
99
// -- State --
1010

11-
uint256 private issuanceRateDeprecated;
11+
uint256 private __DEPRECATED_issuanceRate; // solhint-disable-line var-name-mixedcase
1212
uint256 public accRewardsPerSignal;
1313
uint256 public accRewardsPerSignalLastBlockUpdated;
1414

@@ -29,7 +29,7 @@ contract RewardsManagerV2Storage is RewardsManagerV1Storage {
2929

3030
contract RewardsManagerV3Storage is RewardsManagerV2Storage {
3131
// Snapshot of the total supply of GRT when accRewardsPerSignal was last updated
32-
uint256 private tokenSupplySnapshotDeprecated;
32+
uint256 private __DEPRECATED_tokenSupplySnapshot; // solhint-disable-line var-name-mixedcase
3333
}
3434

3535
contract RewardsManagerV4Storage is RewardsManagerV3Storage {

contracts/staking/IStakingBase.sol

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ interface IStakingBase is IStakingData {
9090
address indexed indexer,
9191
uint32 indexingRewardCut,
9292
uint32 queryFeeCut,
93-
uint32 cooldownBlocks
93+
uint32 __DEPRECATED_cooldownBlocks // solhint-disable-line var-name-mixedcase
9494
);
9595

9696
/**
@@ -260,12 +260,11 @@ interface IStakingBase is IStakingData {
260260
* @notice Set the delegation parameters for the caller.
261261
* @param _indexingRewardCut Percentage of indexing rewards left for the indexer
262262
* @param _queryFeeCut Percentage of query fees left for the indexer
263-
* @param _cooldownBlocks Period that need to pass to update delegation parameters
264263
*/
265264
function setDelegationParameters(
266265
uint32 _indexingRewardCut,
267266
uint32 _queryFeeCut,
268-
uint32 _cooldownBlocks
267+
uint32 // _cooldownBlocks, deprecated
269268
) external;
270269

271270
/**

0 commit comments

Comments
 (0)