Documentation
¶
Index ¶
- Constants
- func ZeroPadding(x []byte, n uint) []byte
- type Extrinsic
- type ImportedSegment
- type Item
- type Package
- func (wp *Package) ComputeAuthorizerHashes(serviceState service.ServiceState) (authorizationCode []byte, impliedAuthorizerHash crypto.Hash, err error)
- func (wp *Package) GetAuthorizationCode(serviceState service.ServiceState) ([]byte, error)
- func (wp *Package) ValidateGas() error
- func (wp *Package) ValidateLimits() error
- func (wp *Package) ValidateSize() error
- type PackageBundle
- type PackageBundleBuilder
- type Segment
- type SegmentRootLookup
Constants ¶
const ( MaxSizeServiceCode = 4_000_000 // WC = 4,000,000: The maximum size of service code in octets. MaxNumberOfImports = 3_072 // WM = 3,072: The maximum number of imports in a work-package MaxNumberOfExports // WX = 3,072: The maximum number of exports in a work-package MaxNumberOfItems = 16 // I = 16: The maximum amount of work items in a package. MaxNumberOfDependencyItems = 8 //J = 8 : The maximum sum of dependency items in a work-report MaxNumberOfExtrinsics = 128 // T = 128: The maximum number of extrinsics in a work-package. SegmentsPerPage = 64 MaxSizeOfEncodedWorkPackage = 12 * 1 << 20 // WB = 12*2^20 = 12MB: The maximum size of an encoded work-package together with its extrinsic data and import implications, in octets. MaxAllocatedGasRefine = 5_000_000_000 // GR = 5,000,000,000: The gas allocated to invoke a work-package’s Refine logic. )
Variables ¶
This section is empty.
Functions ¶
func ZeroPadding ¶
ZeroPadding Pn(. . . ) The octet-array zero-padding function (14.17 v0.5.2)
Types ¶
type ImportedSegment ¶
type Item ¶
type Item struct {
ServiceId block.ServiceId // s ∈ N_S
CodeHash crypto.Hash // h ∈ H
Payload []byte // y ∈ Y
GasLimitRefine uint64 // g ∈ N_G
GasLimitAccumulate uint64 // a ∈ N_G
ImportedSegments []ImportedSegment // i ∈ ⟦{H ∪ (H⊞), N}⟧
Extrinsics []Extrinsic // x ∈ ⟦(H, N)⟧
ExportedSegments uint16 // e ∈ N
}
Item represents I (14.2 v0.5.4)
func (*Item) ToWorkResult ¶
func (w *Item) ToWorkResult(output block.WorkResultOutputOrError, gasUsed uint64) block.WorkResult
ToWorkResult item-to-result function C (14.8 v0.5.4)
type Package ¶
type Package struct {
AuthorizationToken []byte // j ∈ Y
AuthorizerService uint32 // h ∈ N_S
AuthCodeHash crypto.Hash // u ∈ H
Parameterization []byte // p ∈ Y
Context block.RefinementContext // x ∈ X
WorkItems []Item // w ∈ ⟦I⟧
}
Package represents P (14.2 v0.5.4)
func (*Package) ComputeAuthorizerHashes ¶
func (wp *Package) ComputeAuthorizerHashes( serviceState service.ServiceState, ) (authorizationCode []byte, impliedAuthorizerHash crypto.Hash, err error)
ComputeAuthorizerHashes (14.9 v0.5.4)
func (*Package) GetAuthorizationCode ¶
func (wp *Package) GetAuthorizationCode(serviceState service.ServiceState) ([]byte, error)
GetAuthorizationCode E(↕pm, pc) = Λ(δ[p.h], (p.x)^t, p.u) (14.9 v0.6.3)
func (*Package) ValidateLimits ¶
ValidateLimits (14.4 v0.6.3)
type PackageBundle ¶
type PackageBundle struct {
// contains filtered or unexported fields
}
PackageBundle represents the auditable bundle
func (*PackageBundle) EncodedPackage ¶
func (b *PackageBundle) EncodedPackage() ([]byte, error)
EncodedPackage returns the encoded package from cache if present, if not marshals it
func (*PackageBundle) ItemImportedSegments ¶
func (b *PackageBundle) ItemImportedSegments(itemIndex int) ([]Segment, error)
ItemImportedSegments holds the actual segments for a work-item or the result of S(w ∈ I)
func (*PackageBundle) MarshalJAM ¶
func (b *PackageBundle) MarshalJAM() ([]byte, error)
MarshalJAM returns the encoded bundle from cache if present and if not marshals the entire bundle and keeps it cached
func (*PackageBundle) Package ¶
func (b *PackageBundle) Package() Package
func (*PackageBundle) UnmarshalJAM ¶
func (b *PackageBundle) UnmarshalJAM(reader io.Reader) error
type PackageBundleBuilder ¶
type PackageBundleBuilder struct {
// contains filtered or unexported fields
}
func NewPackageBundleBuilder ¶
func (*PackageBundleBuilder) Build ¶
func (b *PackageBundleBuilder) Build() (bundle *PackageBundle, err error)