Documentation ¶
Index ¶
- Constants
- func BumpIndex(serviceIndex block.ServiceId) block.ServiceId
- func CheckIndex(serviceIndex block.ServiceId, serviceState ServiceState) block.ServiceId
- func DeriveIndex(serviceIndex block.ServiceId, serviceState ServiceState) block.ServiceId
- type DeferredTransfer
- type Memo
- type PreImageMetaKey
- type PreimageHistoricalTimeslots
- type PreimageLength
- type PrivilegedServices
- type ServiceAccount
- func (sa ServiceAccount) AddPreimage(p []byte, currentTimeslot jamtime.Timeslot) error
- func (sa ServiceAccount) Code() []byte
- func (sa ServiceAccount) LookupPreimage(t jamtime.Timeslot, h crypto.Hash) []byte
- func (sa ServiceAccount) ThresholdBalance() uint64
- func (sa ServiceAccount) TotalItems() uint32
- func (sa ServiceAccount) TotalStorageSize() uint64
- type ServiceState
Constants ¶
const ( BasicMinimumBalance = 100 // (BS) The basic minimum balance which all services require. AdditionalMinimumBalancePerItem = 10 // (BI) The additional minimum balance required per item of elective service state. AdditionalMinimumBalancePerOctet = 1 // (BL) The additional minimum balance required per octet of elective service state. TransferMemoSizeBytes = 128 // (M) Size of the transfer memo in bytes. CoreGasAccumulation = 100_000 // GA = 100,000: Total gas allocated to a core for Accumulation TotalGasAccumulation = 341_000_000 // GT = 341,000,000: Total gas allocated across all cores for Accumulation )
Variables ¶
This section is empty.
Functions ¶
func CheckIndex ¶
func CheckIndex(serviceIndex block.ServiceId, serviceState ServiceState) block.ServiceId
CheckIndex Equation 260: checks if the identifier is unique across all services
func DeriveIndex ¶
func DeriveIndex(serviceIndex block.ServiceId, serviceState ServiceState) block.ServiceId
Types ¶
type DeferredTransfer ¶
type DeferredTransfer struct { SenderServiceIndex block.ServiceId // sender service index (s) ReceiverServiceIndex block.ServiceId // receiver service index (d) Balance uint64 // balance value (a) Memo Memo // memo (m) GasLimit uint64 // gas limit (g) }
DeferredTransfer Equation (12.14 v0.5.0): T ≡ (s ∈ Ns, d ∈ Ns, a ∈ Nb, m ∈ Ym, g ∈ Ng)
type Memo ¶
type Memo [TransferMemoSizeBytes]byte
type PreImageMetaKey ¶
type PreImageMetaKey struct { Hash crypto.Hash // Hash of the preimage () Length PreimageLength // Length (presupposed) of the preimage () }
type PreimageLength ¶
type PreimageLength uint32
type PrivilegedServices ¶
type PrivilegedServices struct { ManagerServiceId block.ServiceId // Manager service ID (m) - the service able to effect an alteration of PrivilegedServices from block to block. Also called Empower service. AssignServiceId block.ServiceId // Assign service ID (a) - the service able to effect an alteration of the PendingAuthorizersQueues. DesignateServiceId block.ServiceId // Designate service ID (v) - the service able to effect an alteration of the NextValidators in ValidatorState. AmountOfGasPerServiceId map[block.ServiceId]uint64 // Amount of gas per service ID (g) - small dictionary containing the indices of services which automatically accumulate in each block together with a basic amount of gas with which each accumulates. }
type ServiceAccount ¶
type ServiceAccount struct { Storage map[crypto.Hash][]byte // Dictionary of key-value pairs for storage (s) PreimageLookup map[crypto.Hash][]byte // Dictionary of preimage lookups (p) PreimageMeta map[PreImageMetaKey]PreimageHistoricalTimeslots // Metadata for preimageLookup (l) - TODO: There is a MaxTimeslotsForPreimage. CodeHash crypto.Hash // Hash of the service code (c) Balance uint64 // Balance of the service (b) GasLimitForAccumulator uint64 // Gas limit for accumulation (g) GasLimitOnTransfer uint64 // Gas limit for on_transfer (m) }
ServiceAccount represents a service account in the JAM state
func (ServiceAccount) AddPreimage ¶
func (sa ServiceAccount) AddPreimage(p []byte, currentTimeslot jamtime.Timeslot) error
AddPreimage adds a preimage to the service account's preimage lookup and metadata (9.6 v0.5.0) ∀a ∈ A, (h ↦ p) ∈ ap ⇒ h = H(p) ∧ {h, |p|} ∈ K(al)
func (ServiceAccount) Code ¶
func (sa ServiceAccount) Code() []byte
Code returns the actual code of the service account as per Equation (9.4 v0.5.0)
func (ServiceAccount) LookupPreimage ¶
LookupPreimage implements the historical lookup function (Λ) as defined in Equation (9.7 v0.5.0).
func (ServiceAccount) ThresholdBalance ¶
func (sa ServiceAccount) ThresholdBalance() uint64
ThresholdBalance (9.8 v0.5.0) ∀a ∈ V(δ): at
func (ServiceAccount) TotalItems ¶
func (sa ServiceAccount) TotalItems() uint32
TotalItems (9.8 v0.5.0) ∀a ∈ V(δ): ai
func (ServiceAccount) TotalStorageSize ¶
func (sa ServiceAccount) TotalStorageSize() uint64
TotalStorageSize (9.8 v0.5.0) ∀a ∈ V(δ): al
type ServiceState ¶
type ServiceState map[block.ServiceId]ServiceAccount