Skip to content
Unverified Commit 933e1598 authored by Gonçalo Pestana's avatar Gonçalo Pestana Committed by GitHub
Browse files

Adds target approvals buffering below a threshold (#5168)

This PR adds target stake updates buffering to `stake-tracker`. It
exposes a configuration that defines a threshold below which the target
score *should not* be updated automatically in the target list. The
`Config::ScoreStrictUpdateThreshold` defines said threshold. If a target
stake update is below the threshold, the stake update is buffered in the
`UnsettledTargetScore` storage map while the target list is not
affected. Multiple approvals updates can be buffered for the same
target. Calling `Call::settle` will setttle the buffered approvals tally
for a given target. Setting `Config::ScoreStrictUpdateThreshold` to
`None` disables the stake approvals buffering.

- [x] benchmarks
- [x] `try-state` checks considering the unsettled score
- [x] docs

---------

Co-authored-by: command-bot <>
parent 06b68215
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