Bandwidth module doesn't have own messages that trigger state transition. State transition is happen in such cases:
- calculate total bandwidth amount for all cyberlinks messages in transaction using current price and consume neuron's bandwidth
- add consumed bandwidth to block bandwidth (in-memory)
- calculate bandwidth for message using current price and consume neuron's bandwidth
- add consumed bandwidth to block bandwidth (in-memory)
Note: billing happens in the graph module for contracts because contracts creates messages not grouped into transactions (ante handler are not processing them)
- Update account's bandwidth for an account with changed stake collected by
CollectAddressesWithStakeChange
hook (e.g transfer of investmint).
Note: minting of new volts (using investmint) will trigger the account's bandwidth update with an increased max bandwidth value
- Save the total amount (sum aggregated in-memory before) of consumed bandwidth by all neurons on a given block (to storage & in-memory).
- Remove value for a block that is out of
RecoveryWindow
block period and not perform in bandwidth load calculation (to storage & in-memory).
- If block height number's remainder of division by
AdjustPrice
parameter is equal to zero- calculate and save price based on current load (or apply
BasePrice
if load less thanBasePrice
).
- calculate and save price based on current load (or apply
- If neuron have volts in genesis
- initialize and save account bandwidth with max value