In referendums, the voting stake is only locked for balances transfer
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Summary
In runtime-modules/referendum/src/lib.rs, in fn vote the voting stake is only locked for balances transfer, but not for paying fees, tips or transaction costs; enabling users to use up their staked balance for these actions. We suggest to change the limits of the staking lock to WithdrawReasons::all().
Issue description
In runtime-modules/referendum/src/lib.rs, in fn vote the voting stake is only locked for balances transfer, but not for paying fees, tips or transaction costs:
T::StakingHandler::lock_with_reasons(account_id, *stake, WithdrawReason::Transfer.into());
This enables voters to still use the balance locked as a voting stake for paying (system) transaction costs, reserving funds, paying higher-level fees or tips for transaction inclusion.
Risk
Users that participate in voting in referendums could still use their staked balance for paying transaction costs, fees, etc. This undermines the purpose of staking and could encourage users to act dishonestly without punishment.
Mitigation
We suggest to change the limits of the staking lock to WithdrawReasons::all().
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in runtime-modules/referendum/src/lib.rs at fn vote and inspect the lock_with_reasons call and its withdrawal-reason argument. Confirm the voting stake is restricted from fees, tips, transaction costs, and other withdrawals, then verify the lock uses all withdrawal reasons.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- blockchain, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100