You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Staking reward curve is currently a static PiecewiseLinear, calculated once and only once in the block.
Instead, it should be a static, lazily cached value, not built unless needed, and re-built
in the case that input parameters have changed. The ideal_stake should be determined by the amount of parachain slots being bid on: this should be around (75 - 25.min(slots / 4))%.
We should probably introduce a new trait Curve, which declares the calculate_for_fraction_times_denominator function. PiecewiseLinear can impl this and staking pallet can require RewardCurve to impl it. We might get away with a simple RefCell to manage the cache and ensure that it can be updated as needed. Either way, we must ensure that the pieces are not recalculated on repeated calls.