Crate jam_types

Source
Expand description

JAM types used within the PVM instances (service code and authorizer code).

Macros§

chain_params

Structs§

AccumulateItem
The result and surrounding context of a single Refinement operation passed in to the Accumulation logic.
AuthOutput
Output data of Is Authorized operation, passed into both Refinement and Accumulation.
AuthParam
Authorization parameter.
AuthQueueLen
Number of authorizations in a queue allocated to a core.
Authorization
Data constituting the Authorization Token in a Work Package.
Authorizer
The authorizer tuple which together identifies a means of determining whether a Work Package is acceptable to execute on a core.
AuthorizerHash
Hash of an encoded Authorizer value.
CodeHash
Hash of PVM program code.
ExtrinsicHash
Hash of a piece of extrinsic data.
ExtrinsicSpec
Specification of a single piece of extrinsic data.
FixedVec
Vector type with a fixed length.
HeaderHash
Hash of an encoded block header.
ImportSpec
Import segments specification, which identifies a single exported segment.
InvokeArgs
Args for invoking an inner PVM.
MaxImports
Maximum number of imports in a Work Package.
MaxWorkItems
Maximum number of Work Items in a Work Package.
Memo
Transfer memo data, included with balance transfers between services.
OpaqueBandersnatchPublic
Plain-old-data struct of the same length as an encoded Bandersnatch public key.
OpaqueEd25519Public
Plain-old-data struct of the same length as an encoded Ed25519 public key.
OpaqueValKeyset
Plain-old-data struct of the same length and layout to ValKeyset struct. This does not bring in any cryptography.
OpaqueValidatorMetadata
Additional information on a validator, opaque to the actual usage.
Parameters
Baseline parameters for the JAM protocol.
PayloadHash
Hash of a Work Item’s WorkPayload.
RefineContext
Various pieces of information helpful to contextualize the Refinement process.
SegmentHash
Hash of a Segment value.
SegmentLen
Number of bytes in a segment. This is fixed.
SegmentSliceLen
Returns the number of bytes in a segment slice.
SegmentTreeRoot
Hash of a segment tree root node.
ServiceInfo
Information concerning a particular service’s state.
TransferRecord
A single deferred transfer of balance and/or data, passed in to the invocation of On Transfer.
ValCount
Total number of validators in the JAM.
VecMap
An mapping of key/value pairs stored as pairs ordered by their key in a Vec.
VecSet
An set of items stored in order in a Vec.
WorkItem
A definition of work to be done by the Refinement logic of a service and transformed into a WorkOutput for its Accumulation logic.
WorkOutput
Output data of Refinement operation, passed into Accumulation.
WorkPackage
A work-package, a collection of work-items together with authorization and contextual information. This is processed in-core with Is-Authorized and Refine logic to produce a work-report.
WorkPackageHash
Hash of an encoded Work Package.
WorkPayload
Payload data defining a Work Item.

Enums§

RootIdentifier
Reference to a sequence of import segments, which when combined with an index forms a commitment to a specific segment of data.

Constants§

JAM_COMMON_ERA
Beginning of the Jam “Common Era” (1200 UTC on January 1, 2025), as seconds after the Unix epoch.
MEMO_LEN
Length of a transfer memo in bytes.
POINT_LEN
Number of bytes in an erasure-coding point.
SEGMENT_LEN
Number of bytes in a segment. This is fixed.

Traits§

BoundedMap
Trait for vector types which have a bounded length allowing element-wise transformation.
Get
A trait for querying a single value from a type.
MapLike
A data-structure providing the storage and lookup of key/value pairs with exclusive keys.
SetLike
A data-structure providing the storage of non-duplicated items and the querying of their inclusion.
ToAtomic

Functions§

auth_queue_len
Number of authorizations in a queue allocated to a core.
basic_piece_len
Number of bytes in a basic EC piece.
basic_piece_points
Number of points in a piece.
max_dependencies
Maximum number of dependencies (total of prerequisites and SR lookup entries).
max_exports
Maximum number of exports in a Work Package.
max_extrinsics
Maximum number of extrinsics in a Work Package.
max_imports
Maximum number of imports in a Work Package.
max_input
Maximum size of a Work Package together with all extrinsic data and imported segments.
max_work_items
Maximum number of Work Items in a Work Package.
min_turnaround_period
Minimum period in blocks between going from becoming Available to Zombie, and then again from Zombie to non-existent.
pieces_per_segment
Returns the number of pieces in a segment.
segment_len
Number of bytes in a segment. This is fixed.
segment_slice_len
Returns the number of bytes in a segment slice.
val_count
Total number of validators in the JAM.

Type Aliases§

AuthQueue
A queue of AuthorizerHashs, each of which will be rotated into the authorizer pool for a core.
Balance
Type to represent a balance.
CoreIndex
Type to represent the index of a compute core.
Hash
A basic 256-bit data value.
OpaqueValKeysets
The opaque keys for each validator.
Segment
A segment of data.
ServiceId
Type to represent the index of a service.
SignedGas
Type to represent some gas which may be below zero. This is used primarily for the invoke hostcall API which must be able to return a negative gas amount in case of a gas overrun.
Slot
Type that represents a time slot of six seconds.
ValIndex
Type to represent the index of a validator.
WorkItemImportsVec
A sequence of import specifications.