Skip to content
Snippets Groups Projects
Unverified Commit e4f7814c authored by Tiago Tavares ⭕️'s avatar Tiago Tavares ⭕️ Committed by GitHub
Browse files

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>:mag: 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
No related merge requests found
Pipeline #519360 waiting for manual action with stages
in 1 hour, 28 minutes, and 24 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment