go-cyber/x/bandwidth/spec/02_state.md

State

Account Bandwidth

AccountBandwidth is used for tracking bandwidth of accounts in the network.

AccountBandwidth type has the following structure:

type AccountBandwidth struct {
    address          string     // address of neuron
	remainedValue    uint64     // current bandwidth value 
	lastUpdatedBlock uint64     // last block when last time updated
	maxValue         uint64     // max current bandwidth value of neuron
}

Last price

Value is used to store up-to-date price of bandwidth.

type Price struct {
    price          sdk.Dec   // current multiplier for bandwidth billing
}

Block bandwidth

Storing used bandwidth for each block. Used for calculation of load using sum of used bandwidth in blocks at recovery period window. Used for reverting transactions with cyberlinks if rise more than MaxBlockBandwidth

sdk.Uint64ToBigEndian(value) // where value is amount of bandwidth used by all neurons in given block

Desirable bandwidth

Desirable bandwidth represents amount of cyberlinks that network would like to process.

sdk.Uint64ToBigEndian(value) // where value is total current supply of mvolt (uint64)

Keys

  • Account bandwidth: 0x01 | []byte(address) -> ProtocolBuffer(AccountBandwidth)
  • Block bandwidth: 0x02 | sdk.Uint64ToBigEndian(blockNumber) -> sdk.Uint64ToBigEndian(value)
  • Last bandwidth price: 0x00 | []byte("lastBandwidthPrice") -> ProtocolBuffer(Price)
  • Desirable bandwidth: 0x00 | []byte("desirableBandwidth") -> sdk.Uint64ToBigEndian(value)
  • ModuleName, StoreKey: bandwidth

Synonyms

go-cyber/x/cyberbank/spec/02_state
space-pussy/x/bandwidth/spec/02_state
State Account Bandwidth AccountBandwidth is used for tracking bandwidth of accounts in the network. AccountBandwidth type has the following structure: Last price Value is used to store up-to-date price of bandwidth. Block bandwidth Storing used bandwidth for each block. Used for calculation of load…
space-pussy/x/resources/spec/02_state
State Periodic Vesting Account (auth) A vesting account implementation that vests coins according to a custom vesting schedule. Period (auth) Keys ModuleName, RouterKey, QuerierRoute: `energy`
space-pussy/x/grid/spec/02_state
State Route Route is used for tracking amount of volts and amperes routed to given account. Route type has the following structure: Value Value is used to store up-to-date summarized value of all routes routed to given destination. ------- Keys Route: `0x00 | Source | Destination ->…
go-cyber/x/liquidity/spec/02_state
State The liquidity module `x/liquidity` keeps track of the Pool and PoolBatch states. The state represents your app at a given moment. Pool Pool stores information about the liquidity pool. Pool type has the following structure. The parameters of the Pool state are: Pool: `0x11 |…
space-pussy/x/cyberbank/spec/02_state
go-cyber/x/resources/spec/02_state
State Periodic Vesting Account (auth) A vesting account implementation that vests coins according to a custom vesting schedule. Period (auth) Keys ModuleName, RouterKey: `energy`
go-cyber/x/grid/spec/02_state
State Route Route is used for tracking amount of volts and amperes routed to given account. Route type has the following structure: Value Value is used to store up-to-date summarized value of all routes routed to given destination. ------- Keys Route: `0x00 | Source | Destination ->…
go-cyber/x/clock/spec/02_state
State State Objects The `x/clock` module only manages the following object in state: ClockContract. This object is used to store the address of the contract and its jail status. The jail status is used to determine if the contract should be executed at the end of every block. If…

Neighbours