pallet-bounties: allow bounties to never expire (#7723)
# Description Fixes polkadot-fellows/runtimes#509 The Bounties expiration and renewal heavily depends on manual interactions through UI. This PR refactors the duration of the bounty to be an optional configuration constant. If set to None, bounties remain active indefinitely, removing the need for calling`extend_bounty_expiry` and preventing automatic curator slashing for inactivity, which often penalises unnecessarily. ## Integration Remove [BountyUpdatePeriod](https://github.com/polkadot-fellows/runtimes/blob/db4bb534cb411c0d6a2fe57eb331e6ec93ace825/relay/polkadot/src/lib.rs#L774) ## Review Notes Modifies how bounty expiry is handled <details> <summary>Code Diff Summary</summary> ```diff - #[pallet::constant] - type BountyUpdatePeriod: Get<BlockNumberFor<Self, I>>; + #[pallet::constant] + type BountyUpdatePeriod: Get<Option<BlockNumberFor<Self, I>>>; - *update_due = (Self::treasury_block_number() + T::BountyUpdatePeriod::get()).max(*update_due); + *update_due = Self::treasury_block_number().saturating_add( + T::BountyUpdatePeriod::get().unwrap_or(BlockNumberFor::<T, I>::MAX) + ); ``` </details>
parent
35e6befc
Branches
Pipeline
#519360
waiting for manual action
with stages
in
1 hour, 28 minutes, and 24 seconds
Stage:
Stage:
Stage:
Stage:
Stage:
Showing
- prdoc/pr_7723.prdoc 14 additions, 0 deletionsprdoc/pr_7723.prdoc
- substrate/frame/bounties/src/benchmarking.rs 15 additions, 4 deletionssubstrate/frame/bounties/src/benchmarking.rs
- substrate/frame/bounties/src/lib.rs 11 additions, 6 deletionssubstrate/frame/bounties/src/lib.rs
- substrate/frame/bounties/src/tests.rs 68 additions, 3 deletionssubstrate/frame/bounties/src/tests.rs
- substrate/frame/child-bounties/src/benchmarking.rs 18 additions, 4 deletionssubstrate/frame/child-bounties/src/benchmarking.rs
Please register or sign in to comment