Documentation
¶
Index ¶
- func AccumulationPriorityQueue(r types.ReadyQueueItem) (output []types.WorkReport)
- func DeferredTransfers() error
- func ExtractWorkReportHashes(w []types.WorkReport) (output []types.WorkPackageHash)
- func GetAccumulatedHashes() (output []types.WorkPackageHash)
- func GetDependencyFromWorkReport(report types.WorkReport) (output types.ReadyRecord)
- func ProcessAccumulation() error
- func ProcessPreimageExtrinsics() error
- func Provide(d types.ServiceAccountState, eps types.ServiceBlobs) (types.ServiceAccountState, error)
- func QueueEditingFunction(r types.ReadyQueueItem, x []types.WorkPackageHash) (newQueue types.ReadyQueueItem)
- func R[T comparable](o, a, b T) T
- func ShouldIntegratePreimage(d types.ServiceAccountState, s types.ServiceID, h types.OpaqueHash, ...) bool
- func UpdateAccumulatableWorkReports()
- func UpdateDeltaWithExtrinsicPreimage(eps types.PreimagesExtrinsic, deltaDoubleDagger types.ServiceAccountState, ...) (types.ServiceAccountState, error)
- func UpdateImmediatelyAccumulateWorkReports()
- func UpdateQueuedWorkReports()
- func ValidatePreimageExtrinsics(eps types.PreimagesExtrinsic, delta types.ServiceAccountState, ...) error
- type OuterAccumulationInput
- type OuterAccumulationOutput
- type ParallelizedAccumulationInput
- type ParallelizedAccumulationOutput
- type SingleServiceAccumulationInput
- type SingleServiceAccumulationOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccumulationPriorityQueue ¶
func AccumulationPriorityQueue(r types.ReadyQueueItem) (output []types.WorkReport)
func DeferredTransfers ¶
func DeferredTransfers() error
(v0.6.4) 12.3 Deferred Transfers And State Integration.
func ExtractWorkReportHashes ¶
func ExtractWorkReportHashes(w []types.WorkReport) (output []types.WorkPackageHash)
func GetAccumulatedHashes ¶
func GetAccumulatedHashes() (output []types.WorkPackageHash)
(12.2) ©ξ ≡ ⋃x∈ξ This function extracts all known (past) accumulated WorkPackageHashes.
func GetDependencyFromWorkReport ¶
func GetDependencyFromWorkReport(report types.WorkReport) (output types.ReadyRecord)
(12.6) D(w) ≡ (w, {(wx)p} ∪ K(wl)) Extract all dependencies from single work report
func ProcessAccumulation ¶
func ProcessAccumulation() error
func ProcessPreimageExtrinsics ¶
func ProcessPreimageExtrinsics() error
ProcessPreimageExtrinsics is the main unified function for handling preimage extrinsics It combines filtering and delta state updates in a single call for external use v0.7.0 (12.38-12.43)
func Provide ¶
func Provide(d types.ServiceAccountState, eps types.ServiceBlobs) (types.ServiceAccountState, error)
Provide is the preimage integration function (different from IntegratePreimage despite re-using the word "integrate") It transforms a dictionary of service states and a set of service/hash pairs into a new dictionary of service states. (map[N_s]A, (N_s, Y)) -> map[N_s]A v0.6.5 (12.18)
func QueueEditingFunction ¶
func QueueEditingFunction(r types.ReadyQueueItem, x []types.WorkPackageHash) (newQueue types.ReadyQueueItem)
(12.7)
(⟦(W, {H})⟧, {H}) → ⟦(W, {H})⟧
E∶ (r, x) ↦ (w, d ∖ x) W (w, d) <− r,
(ws)h ~∈ x - For each work report (w) with dependency set (d) - If w’s own hash (ws)h is *not* in x (i.e. not yet accumulated), - Remove from d any dependencies already present in x (i.e., prune known satisfied deps) - Return the pruned ReadyQueueItem (w, d \ x)
func ShouldIntegratePreimage ¶
func ShouldIntegratePreimage(d types.ServiceAccountState, s types.ServiceID, h types.OpaqueHash, l types.U32, keyVals *types.StateKeyVals, parseToState bool) bool
v0.6.4 (12.36) R function determines whether a preimage should be integrated
func UpdateAccumulatableWorkReports ¶
func UpdateAccumulatableWorkReports()
(12.10) let m = Ht mod E(12.10) (12.11) W∗ ≡ W! ⌢ Q(q) (12.12) q = E(ϑm... ⌢ ϑ...m ⌢ WQ, P (W!))
func UpdateDeltaWithExtrinsicPreimage ¶
func UpdateDeltaWithExtrinsicPreimage(eps types.PreimagesExtrinsic, deltaDoubleDagger types.ServiceAccountState, tauPrime types.TimeSlot) (types.ServiceAccountState, error)
UpdateDeltaWithExtrinsicPreimage updates the deltaDoubleDagger state with filtered preimages It integrates preimages into deltaDoubleDagger using the provided tauPrime time slot v0.6.4 (12.39)
func UpdateImmediatelyAccumulateWorkReports ¶
func UpdateImmediatelyAccumulateWorkReports()
(12.4) W! ≡ [w S w <− W, S(wx)pS = 0 ∧ wl = {}] This function identifies and stores work reports that are immediately eligible for accumulation, i.e.:
- (wx)p == 0: the report has no unresolved prerequisites
- wl == {} : there is no segment root lookup required
These work reports are independent and can be accumulated without waiting.
func UpdateQueuedWorkReports ¶
func UpdateQueuedWorkReports()
(12.5) WQ ≡ E([D(w) S w <− W, S(wx)pS > 0 ∨ wl ≠ {}], ©ξ ) Get all workreport with dependency, and cs in QueuedWorkReports
func ValidatePreimageExtrinsics ¶
func ValidatePreimageExtrinsics(eps types.PreimagesExtrinsic, delta types.ServiceAccountState, keyVals *types.StateKeyVals) error
v0.7.0 (12.39, 12.40) for all: E_P: Y(δ, s, H(d), |d|) Validate Preimage Extrinsics with prior state service preimage and lookupDict
Types ¶
type OuterAccumulationInput ¶
type OuterAccumulationInput struct {
GasLimit types.Gas // g gas-limit
DeferredTransfers []types.DeferredTransfer // t deferred transfers
WorkReports []types.WorkReport // r a sequence of work-reports
InitPartialStateSet types.PartialStateSet // e an initial partial-state
ServicesWithFreeAccumulation types.AlwaysAccumulateMap // f a dictionary of services enjoying free accumulation
}
type OuterAccumulationOutput ¶
type OuterAccumulationOutput struct {
NumberOfWorkResultsAccumulated types.U64
PartialStateSet types.PartialStateSet // e a posterior state-context
AccumulatedServiceOutput types.AccumulatedServiceOutput // b service/hash pairs
ServiceGasUsedList types.ServiceGasUsedList // u service/gas pairs
}
func OuterAccumulation ¶
func OuterAccumulation(input OuterAccumulationInput) (output OuterAccumulationOutput, err error)
(12.16) ∆+ outer accumulation function
type ParallelizedAccumulationInput ¶
type ParallelizedAccumulationInput struct {
PartialStateSet types.PartialStateSet // e initial state-context
DeferredTransfers []types.DeferredTransfer // t deferred transfers
WorkReports []types.WorkReport // r a sequence of work-reports
AlwaysAccumulateMap types.AlwaysAccumulateMap // f a dictionary of privileged always-accumulate services
}
type ParallelizedAccumulationOutput ¶
type ParallelizedAccumulationOutput struct {
PartialStateSet types.PartialStateSet // e a posterior state-context
DeferredTransfers []types.DeferredTransfer // t resultant deferred transfers
AccumulatedServiceOutput types.AccumulatedServiceOutput // b service/hash pairs
ServiceGasUsedList types.ServiceGasUsedList // u service/gas pairs
}
func ParallelizedAccumulation ¶
func ParallelizedAccumulation(input ParallelizedAccumulationInput) (output ParallelizedAccumulationOutput, err error)
Parallelize parts and partial state modification needs confirm what is the correct way to process
type SingleServiceAccumulationInput ¶
type SingleServiceAccumulationInput struct {
PartialStateSet types.PartialStateSet // e initial state-context
DeferredTransfers []types.DeferredTransfer // t deferred transfers
WorkReports []types.WorkReport // r a sequence of work-reports
AlwaysAccumulateMap types.AlwaysAccumulateMap // f a dictionary of privileged always-accumulate services
ServiceID types.ServiceID // s a service index
UnmatchedKeyVals types.StateKeyVals // storage key-value pairs that were not matched yet
}
func (SingleServiceAccumulationInput) CloneForService ¶
func (in SingleServiceAccumulationInput) CloneForService(s types.ServiceID) SingleServiceAccumulationInput
Deep copy single service accumulation input for goroutine parallelization
type SingleServiceAccumulationOutput ¶
type SingleServiceAccumulationOutput struct {
PartialStateSet types.PartialStateSet // an alterations state-context
DeferredTransfers []types.DeferredTransfer // a sequence of transfers
AccumulationOutput *types.OpaqueHash // a possible accumulation-output
GasUsed types.Gas // the actual PVM gas used
ServiceBlobs types.ServiceBlobs // a hash service pair of the accumulated service
UnmatchedKeyVals types.StateKeyVals // storage key-value pairs that were not matched yet
}
func SingleServiceAccumulation ¶
func SingleServiceAccumulation(input SingleServiceAccumulationInput) (output SingleServiceAccumulationOutput, err error)
(12.20) ∆1 single-service accumulation function