Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Capacity gas.Gas `json:"capacity"` Target gas.Gas `json:"target"` MinPrice gas.Price `json:"minPrice"` ExcessConversionConstant gas.Gas `json:"excessConversionConstant"` }
Config contains all the static parameters of the dynamic fee mechanism.
type State ¶
State represents the current on-chain values used in the dynamic fee mechanism.
func (State) AdvanceTime ¶
AdvanceTime adds (s.Current - target) * seconds to Excess.
If Excess would underflow, it is set to 0. If Excess would overflow, it is set to MaxUint64.
func (State) CostOf ¶
CostOf calculates how much to charge based on the dynamic fee mechanism for seconds.
This implements the ACP-77 cost over time formula:
func (State) SecondsRemaining ¶
SecondsRemaining calculates the maximum number of seconds that a validator can pay fees before their fundsRemaining would be exhausted based on the dynamic fee mechanism. The result is capped at maxSeconds.