Skip to content

Conversation

shamil-gadelshin
Copy link
Collaborator

Description

This PR reintroduces staking jobs for all staking operations. All staking operations will be delayed until the end of the block or the next DRAND pulse. The jobs within each type (like add_stake jobs) will be sorted using the last DRAND pulse randomness.

Affected extrinsics:

  • add_stake
  • add_stake_limit
  • remove_stake
  • remove_stake_limit
  • remove_stake_full_limit (creates either remove_stake or remove_stake_limit staking job)
  • unstake_all
  • unstake_all_alpha
  • swap_stake
  • move_stake
  • transfer_stake

Comment: swap_stake, move_stake and transfer_stake will be likely modified using transactional::with_transaction as suggested by @gztensor

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run cargo fmt and cargo clippy to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

gztensor
gztensor previously approved these changes Aug 6, 2025
JohnReedV
JohnReedV previously approved these changes Aug 7, 2025
@basfroman
Copy link
Contributor

Hey @shamil-gadelshin, do we want to add logic swap_stake_limit -> swap_stake_limit_aggregate in this PR?

@shamil-gadelshin
Copy link
Collaborator Author

Hey @shamil-gadelshin, do we want to add logic swap_stake_limit -> swap_stake_limit_aggregate in this PR?

Yes, we do. Thanks for the advice.

@shamil-gadelshin shamil-gadelshin dismissed stale reviews from JohnReedV and gztensor via df9ae51 August 11, 2025 13:59
@shamil-gadelshin
Copy link
Collaborator Author

The last update contains EVM versions of staking extrinsics (ensured by custom EVM origin).

@shamil-gadelshin
Copy link
Collaborator Author

The last update contains the missing swap_stake_limit_aggregate spotted by @basfroman

Copy link
Contributor

@open-junius open-junius left a comment

Choose a reason for hiding this comment

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

precompile and custom origin looks good.

@basfroman
Copy link
Contributor

The last update contains the missing swap_stake_limit_aggregate spotted by @basfroman

Perfect. I'll update my PR tomorrow.
Any plan when you want to merge it?

@shamil-gadelshin
Copy link
Collaborator Author

The last update contains the missing swap_stake_limit_aggregate spotted by @basfroman

Perfect. I'll update my PR tomorrow. Any plan when you want to merge it?

We should get the results of #1955 first
So, it will be at least a couple of weeks now.

@shamil-gadelshin shamil-gadelshin marked this pull request as draft September 3, 2025 15:26
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.

5 participants