devnet-ready ← konrad0960:voting-power-feature
opened 10:10PM - 01 Dec 25 UTC
## Description
Voting power feature
Purpose: Track validator voting power usi…ng an Exponential Moving Average (EMA) of their stake over time, preventing sudden stake changes from immediately affecting governance weight.
Key Components:
- EMA-based voting power calculation (updated each epoch)
- Per-subnet enable/disable with 14-day grace period
- Configurable alpha parameter for EMA smoothness
- Voting power transfers on hotkey swap
- EVM precompile for smart contract access
Extrinsics: enable_voting_power_tracking, disable_voting_power_tracking, sudo_set_voting_power_ema_alpha
Storage: VotingPower, VotingPowerTrackingEnabled, VotingPowerDisableAtBlock, VotingPowerEmaAlpha
## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] 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
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have run `./scripts/fix_rust.sh` to ensure my code is formatted and linted correctly
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules
## Additional Notes
I’ve attempted to run the VotingPower precompile EVM tests locally but encountered multiple Node.js compatibility issues with the polkadot-api dependencies.
Being unable to resolve them I want to give CI a try
That being said the unit tests written cover the core logic.