Skip to content

Conversation

@Spablob
Copy link

@Spablob Spablob commented Nov 12, 2025

Adds pausing capability to stake and stakeOnBehalf functions.
Adds access control roles which replaces the original Ownable2StepUpgradeable

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Spablob Spablob changed the title Staking v2 Add pausing to staking contract Nov 12, 2025
Copy link
Contributor

@Ramarti Ramarti left a comment

Choose a reason for hiding this comment

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

Please address comments and also add the deploy script for new version.
That way we can ensure new admin is the timelock (get admin value from owner() using old implementation)

@Spablob
Copy link
Author

Spablob commented Nov 18, 2025

Please address comments and also add the deploy script for new version. That way we can ensure new admin is the timelock (get admin value from owner() using old implementation)

  • Hardcoded the owner address to make sure (given the owner is the same on mainnet and aeneid). Pauser differs with the chain so kept them as variable on initializeV2()
  • Created the script to deploy the new implementation (it's very similar to the one used before with the change of version number)

I don't see the schedule/cancel/execute scripts and txs in this repo. Do they go here or elsewhere?

Copy link
Contributor

@Ramarti Ramarti left a comment

Choose a reason for hiding this comment

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

LGTM

  • We can do the upgrade transactions in a different PR
  • Default min fee might be lower if this is merged after the staking changes

@Spablob Spablob marked this pull request as ready for review December 9, 2025 21:21
Copy link
Contributor

@0xHansLee 0xHansLee left a comment

Choose a reason for hiding this comment

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

Could you provide some more contexts on adding pausing to only stake function? I wonder if we don't need to add it to other functions, e.g. create validator, redelegate, and unstake.

/// @param maxCommissionChangeRate The maximum commission change rate of the validator.
/// @param supportsUnlocked Whether the validator supports unlocked staking.
/// @param data Additional data for the validator.
function createValidator(
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to add the whenNotPaused modifier here?

Copy link
Author

Choose a reason for hiding this comment

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

createValidator and redelegate we can consider - what do you think @Ramarti ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you provide why you consider to add the pausing only to create validator and redelegate?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see your point @0xHansLee .
Our initial thought was to start with whatever stops a possible loss of funds from the users.
Revisiting this I think we could go with 2 options

  • Every non admin methos is pausable but unstake
  • Every non admin method is pausable

Always allow users to withdraw during an attack vs the attack may be exploiting the unstake logic so nothing should come out.

I think we can start with everything pausable and post in the Forum, see how community feels

Copy link
Author

Choose a reason for hiding this comment

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

Adjusted so that "Every non admin method is pausable": 354e206

Copy link
Contributor

Choose a reason for hiding this comment

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

It would depend on which kind of attack we intend to mitigate via a pause.

The first option, supporting immediate withdrawal, would likely be needed in a situation where there is a problem with the staking system itself. On the other hand, if we need to block withdrawals via unstake, it is more likely due to issues such as private key leakage or compromised permissions of a contract account involved in staking. In such cases, a pause would need to be triggered before the funds are transferred to another account with malicious or unintended authority.

In my humble opinion, it seems more reasonable to focus on the latter rather than the former. Since the staking system is based on the Cosmos SDK, I believe the likelihood of critical issues originating from the staking system itself is relatively low.

Copy link
Contributor

Choose a reason for hiding this comment

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

After talking with the security council, we are leaning to pause everything but admin methods as the safer method. We are waiting on legal input for confirmation.

@Spablob Spablob requested a review from stevemilk as a code owner December 17, 2025 11:43
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.

3 participants