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

Wraps account and staking state in who for OnStakingUpdate methods #4402

Draft
wants to merge 1 commit into
base: gpestana/stake-tracker_integration
Choose a base branch
from

Conversation

gpestana
Copy link
Contributor

@gpestana gpestana commented May 7, 2024

No description provided.

@gpestana gpestana marked this pull request as draft May 7, 2024 13:23
@gpestana gpestana changed the title Wraps who into its staking state in OnStakingUpdate Wraps account and staking state in who for OnStakingUpdate methods May 7, 2024
@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-clippy
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6149327

gpestana added a commit that referenced this pull request May 10, 2024
- Changes the target list score type from balance to `u128`
(`ExtendedBalance`)
  - simplifies `balance/ vote_weight/ extended_balance` conversions
  - relies less on the currency total issuance call
  - ensures approval stake calculations/storage is safe 
- Simplifies stake tracker logic
  - removes a few redundant checks
  - split `on_stake_update` code
- Ensures `VoterUpdateMode` is taken into consideration in try-state
checks
  - use voter mode lazy in benchmarks
  - update weights + check the diff with voter lazy 
- Docs improvements
- All tests passing after merging validator disabling and virtual
stakers

**new**
- ensures duplicate nominations are dedup before calculating the
approvals stake
- chills nominator after total slash to ensure the target can be
reaped/kill without leaving nominations behind.
- ensures that switching from validator to nominator and back is correct
- a nominator may have an entry in the targetlist (if it was a validator
+ has nominations)
  - ensure target node is removed if balance is 0 and it is a nominator.
- addresses
paritytech-secops/srlabs_findings#383

---
**Other experiments:** (not included)
- #4402 (passing the
status of the staker with who in the OnStakingUpdate interface is less
clean, it turns out)
- #4361

---------

Co-authored-by: command-bot <>
Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

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

I generally think this is a good idea, depending on how much is the merge cost.

@gpestana
Copy link
Contributor Author

I'm inclined to drop this PR because it ended up not simplifying massively the stake-tracker pallet code. In any case, I will wait until the stake-tracker code is finished and stable and make a decision.

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