Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove/deprecate delegation parameters cooldown #866

Merged
merged 3 commits into from Dec 7, 2023

Conversation

pcarranzav
Copy link
Member

@pcarranzav pcarranzav commented Oct 11, 2023

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (59240bd) 92.60% compared to head (f453249) 92.57%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #866      +/-   ##
==========================================
- Coverage   92.60%   92.57%   -0.04%     
==========================================
  Files          47       47              
  Lines        2368     2357      -11     
  Branches      432      430       -2     
==========================================
- Hits         2193     2182      -11     
  Misses        175      175              
Flag Coverage Δ
unittests 92.57% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
contracts/discovery/GNS.sol 98.98% <100.00%> (ø)
contracts/discovery/L1GNS.sol 100.00% <100.00%> (ø)
contracts/l2/discovery/L2GNS.sol 100.00% <100.00%> (ø)
contracts/l2/staking/L2Staking.sol 100.00% <100.00%> (ø)
contracts/staking/Staking.sol 98.12% <100.00%> (-0.03%) ⬇️
contracts/staking/StakingExtension.sol 98.63% <ø> (-0.08%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

* @param _delegationRatio Delegation capacity multiplier (e.g. 10 means 10x the indexer stake)
* @param _delegationTaxPercentage Percentage of delegated tokens to burn as delegation tax, expressed in parts per million
*/
function initialize(
uint32 _delegationUnbondingPeriod,
uint32 _cooldownBlocks,
uint32, //_cooldownBlocks, deprecated
Copy link
Contributor

@tmigone tmigone Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to keep this? I understand doing it for setDelegationParameters so we don't change the interface but I think we can entirely remove it here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but I'd rather keep it to keep changes minimal (this is called from Staking.initialize, so we'd have to change that too)

/// @dev Time in blocks an indexer needs to wait to change delegation parameters
uint32 internal __delegationParametersCooldown;
/// @dev Time in blocks an indexer needs to wait to change delegation parameters (deprecated)
uint32 internal __DEPRECATED_delegationParametersCooldown;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should pick one way of signaling deprecated variables. We have __DEPRECATED__ or ...Deprecated all over the codebase.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed all of them to use the __DEPRECATED_ prefix, wdyt?

Copy link
Contributor

@tmigone tmigone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits

@tmigone
Copy link
Contributor

tmigone commented Oct 20, 2023

Also we need to remove this:

'staking-delegation-parameters-cooldown': {
contract: 'Staking',
name: 'setDelegationParametersCooldown',
},

@openzeppelin-code
Copy link

openzeppelin-code bot commented Oct 23, 2023

feat: remove/deprecate delegation parameters cooldown

Generated at commit: f453249a16f25ae638ed5200a73b69565a4a93f6

🚨 Vulnerabilities Summary

Process Issues Results
Contract Inspector note
low
critical
high
Total
32
18
1
1
52
Dependency Checker low
note
Total
1
23
24

For more details view the full report in OpenZeppelin Code

@pcarranzav pcarranzav merged commit 5120495 into main Dec 7, 2023
7 checks passed
@pcarranzav pcarranzav deleted the pcv/remove-delegation-params-cooldown branch December 7, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants