@typeberry/lib 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/core/json-parser/descriptors.d.ts.map +1 -1
- package/packages/core/json-parser/descriptors.js +3 -0
- package/packages/core/json-parser/index.test.js +30 -0
- package/packages/core/networking/package.json +1 -1
- package/packages/core/telemetry/package.json +1 -1
- package/packages/core/utils/compatibility.d.ts +0 -1
- package/packages/core/utils/compatibility.d.ts.map +1 -1
- package/packages/core/utils/compatibility.js +1 -2
- package/packages/core/utils/compatibility.test.js +6 -10
- package/packages/jam/block/index.d.ts +11 -11
- package/packages/jam/block/index.d.ts.map +1 -1
- package/packages/jam/block/index.js +11 -11
- package/packages/jam/block-json/block.d.ts +25 -25
- package/packages/jam/database-lmdb/states.test.js +3 -5
- package/packages/jam/fuzz-proto/v1/types.d.ts +1 -1
- package/packages/jam/jam-host-calls/accumulate/bless.d.ts.map +1 -1
- package/packages/jam/jam-host-calls/accumulate/bless.js +6 -10
- package/packages/jam/jam-host-calls/accumulate/bless.test.js +32 -72
- package/packages/jam/jam-host-calls/accumulate/new.d.ts.map +1 -1
- package/packages/jam/jam-host-calls/accumulate/new.js +2 -4
- package/packages/jam/jam-host-calls/accumulate/new.test.js +4 -5
- package/packages/jam/jam-host-calls/general/fetch.d.ts +1 -57
- package/packages/jam/jam-host-calls/general/fetch.d.ts.map +1 -1
- package/packages/jam/jam-host-calls/general/fetch.js +6 -29
- package/packages/jam/jam-host-calls/general/fetch.test.js +2 -58
- package/packages/jam/jamnp-s/protocol/ce-133-work-package-submission.d.ts +4 -4
- package/packages/jam/jamnp-s/protocol/ce-135-work-report-distribution.d.ts +13 -13
- package/packages/jam/jamnp-s/protocol/up-0-block-announcement.d.ts +1 -1
- package/packages/jam/node/package.json +1 -1
- package/packages/jam/node/reader.d.ts +25 -25
- package/packages/jam/node/workers.d.ts +183 -183
- package/packages/jam/state/accumulation-queue.d.ts +26 -26
- package/packages/jam/state/assurances.d.ts +26 -26
- package/packages/jam/state/privileged-services.d.ts +1 -1
- package/packages/jam/state/privileged-services.d.ts.map +1 -1
- package/packages/jam/state/privileged-services.js +1 -6
- package/packages/jam/state/service.d.ts +1 -1
- package/packages/jam/state/service.d.ts.map +1 -1
- package/packages/jam/state/statistics.d.ts +0 -8
- package/packages/jam/state/statistics.d.ts.map +1 -1
- package/packages/jam/state/statistics.js +14 -44
- package/packages/jam/state/statistics.test.js +1 -8
- package/packages/jam/state/test.utils.d.ts +1 -1
- package/packages/jam/state/test.utils.d.ts.map +1 -1
- package/packages/jam/state/test.utils.js +4 -22
- package/packages/jam/state-json/accounts.d.ts +10 -0
- package/packages/jam/state-json/accounts.d.ts.map +1 -1
- package/packages/jam/state-json/accounts.js +47 -19
- package/packages/jam/state-json/dump.d.ts.map +1 -1
- package/packages/jam/state-json/dump.js +5 -9
- package/packages/jam/state-json/dump.test.js +2 -10
- package/packages/jam/state-json/statistics.d.ts +1 -1
- package/packages/jam/state-json/statistics.d.ts.map +1 -1
- package/packages/jam/state-json/statistics.js +1 -13
- package/packages/jam/state-merkleization/in-memory-state-codec.d.ts +29 -31
- package/packages/jam/state-merkleization/in-memory-state-codec.d.ts.map +1 -1
- package/packages/jam/state-merkleization/serialize.d.ts +4 -4
- package/packages/jam/state-merkleization/serialize.d.ts.map +1 -1
- package/packages/jam/state-merkleization/serialize.js +5 -8
- package/packages/jam/state-merkleization/serialized-state-view.d.ts.map +1 -1
- package/packages/jam/state-merkleization/state-entries.test.js +1 -7
- package/packages/jam/state-vectors/index.d.ts +75 -75
- package/packages/jam/transition/accumulate/accumulate-state.d.ts +1 -2
- package/packages/jam/transition/accumulate/accumulate-state.d.ts.map +1 -1
- package/packages/jam/transition/accumulate/accumulate-utils.d.ts.map +1 -1
- package/packages/jam/transition/accumulate/accumulate-utils.js +2 -6
- package/packages/jam/transition/accumulate/accumulate-utils.test.js +2 -4
- package/packages/jam/transition/accumulate/accumulate.d.ts.map +1 -1
- package/packages/jam/transition/accumulate/accumulate.js +11 -20
- package/packages/jam/transition/accumulate/index.d.ts +0 -1
- package/packages/jam/transition/accumulate/index.d.ts.map +1 -1
- package/packages/jam/transition/accumulate/index.js +0 -1
- package/packages/jam/transition/accumulate/operand.d.ts +7 -7
- package/packages/jam/transition/chain-stf.d.ts +3 -5
- package/packages/jam/transition/chain-stf.d.ts.map +1 -1
- package/packages/jam/transition/chain-stf.js +5 -29
- package/packages/jam/transition/disputes/disputes.test.data2.d.ts +3 -3
- package/packages/jam/transition/disputes/disputes.test.data2.d.ts.map +1 -1
- package/packages/jam/transition/externalities/accumulate-externalities.d.ts.map +1 -1
- package/packages/jam/transition/externalities/accumulate-externalities.js +22 -49
- package/packages/jam/transition/externalities/accumulate-externalities.test.js +8 -72
- package/packages/jam/transition/externalities/fetch-externalities.d.ts +3 -22
- package/packages/jam/transition/externalities/fetch-externalities.d.ts.map +1 -1
- package/packages/jam/transition/externalities/fetch-externalities.js +3 -55
- package/packages/jam/transition/externalities/fetch-externalities.test.js +199 -112
- package/packages/jam/transition/statistics.d.ts +0 -7
- package/packages/jam/transition/statistics.d.ts.map +1 -1
- package/packages/jam/transition/statistics.js +2 -11
- package/packages/jam/transition/statistics.test.js +0 -40
- package/packages/workers/block-authorship/generator.test.d.ts +2 -0
- package/packages/workers/block-authorship/generator.test.d.ts.map +1 -0
- package/packages/workers/block-authorship/generator.test.js +200 -0
- package/packages/workers/block-authorship/package.json +1 -1
- package/packages/workers/block-authorship/protocol.d.ts +50 -50
- package/packages/workers/importer/package.json +1 -1
- package/packages/workers/importer/protocol.d.ts +54 -54
- package/packages/workers/jam-network/protocol.d.ts +79 -79
- package/packages/jam/transition/accumulate/deferred-transfers.d.ts +0 -36
- package/packages/jam/transition/accumulate/deferred-transfers.d.ts.map +0 -1
- package/packages/jam/transition/accumulate/deferred-transfers.js +0 -94
|
@@ -25,14 +25,14 @@ export declare class NotYetAccumulatedReport extends WithDebug {
|
|
|
25
25
|
readonly dependencies: KnownSizeArray<WorkPackageHash, `[0..${MAX_REPORT_DEPENDENCIES})`>;
|
|
26
26
|
static Codec: import("@typeberry/codec").Descriptor<NotYetAccumulatedReport, import("@typeberry/codec").ViewOf<NotYetAccumulatedReport, {
|
|
27
27
|
report: import("@typeberry/codec").Descriptor<WorkReport, import("@typeberry/codec").ViewOf<WorkReport, {
|
|
28
|
-
workPackageSpec: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
28
|
+
workPackageSpec: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkPackageSpec, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkPackageSpec, {
|
|
29
29
|
hash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"WorkPackageHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
30
30
|
length: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/bytes").Bytes<4>>;
|
|
31
31
|
erasureRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32>, import("@typeberry/bytes").Bytes<32>>;
|
|
32
32
|
exportsRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"ExportsRootHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
33
33
|
exportsCount: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U16, import("@typeberry/bytes").Bytes<2>>;
|
|
34
34
|
}>>;
|
|
35
|
-
context: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
35
|
+
context: import("@typeberry/codec").Descriptor<import("@typeberry/block").RefineContext, import("@typeberry/codec").ViewOf<import("@typeberry/block").RefineContext, {
|
|
36
36
|
anchor: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"HeaderHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
37
37
|
stateRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"StateRootHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
38
38
|
beefyRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"BeefyHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
@@ -44,32 +44,32 @@ export declare class NotYetAccumulatedReport extends WithDebug {
|
|
|
44
44
|
authorizerHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"AuthorizerHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
45
45
|
authorizationGasUsed: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/numbers").U64>;
|
|
46
46
|
authorizationOutput: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").BytesBlob, import("@typeberry/bytes").BytesBlob>;
|
|
47
|
-
segmentRootLookup: import("@typeberry/codec").Descriptor<readonly import("@typeberry/block
|
|
47
|
+
segmentRootLookup: import("@typeberry/codec").Descriptor<readonly import("@typeberry/block").WorkPackageInfo[], import("@typeberry/codec").SequenceView<import("@typeberry/block").WorkPackageInfo, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkPackageInfo, {
|
|
48
48
|
workPackageHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"WorkPackageHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
49
49
|
segmentTreeRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"ExportsRootHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
50
50
|
}>>>;
|
|
51
|
-
results: import("@typeberry/codec").Descriptor<import("@typeberry/collections").FixedSizeArray<import("@typeberry/block
|
|
51
|
+
results: import("@typeberry/codec").Descriptor<import("@typeberry/collections").FixedSizeArray<import("@typeberry/block").WorkResult, import("@typeberry/numbers").U8>, import("@typeberry/codec").SequenceView<import("@typeberry/block").WorkResult, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkResult, {
|
|
52
52
|
serviceId: import("@typeberry/codec").Descriptor<number & import("@typeberry/numbers").WithBytesRepresentation<4> & import("@typeberry/utils").WithOpaque<"ServiceId[u32]">, import("@typeberry/bytes").Bytes<4>>;
|
|
53
53
|
codeHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"CodeHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
54
54
|
payloadHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32>, import("@typeberry/bytes").Bytes<32>>;
|
|
55
55
|
gas: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/bytes").Bytes<8>>;
|
|
56
|
-
result: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
57
|
-
kind: import("@typeberry/block
|
|
56
|
+
result: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkExecResult, {
|
|
57
|
+
kind: import("@typeberry/block").WorkExecResultKind.ok;
|
|
58
58
|
okBlob: import("@typeberry/bytes").BytesBlob;
|
|
59
59
|
} | {
|
|
60
|
-
kind: import("@typeberry/block
|
|
60
|
+
kind: import("@typeberry/block").WorkExecResultKind.outOfGas;
|
|
61
61
|
} | {
|
|
62
|
-
kind: import("@typeberry/block
|
|
62
|
+
kind: import("@typeberry/block").WorkExecResultKind.panic;
|
|
63
63
|
} | {
|
|
64
|
-
kind: import("@typeberry/block
|
|
64
|
+
kind: import("@typeberry/block").WorkExecResultKind.incorrectNumberOfExports;
|
|
65
65
|
} | {
|
|
66
|
-
kind: import("@typeberry/block
|
|
66
|
+
kind: import("@typeberry/block").WorkExecResultKind.digestTooBig;
|
|
67
67
|
} | {
|
|
68
|
-
kind: import("@typeberry/block
|
|
68
|
+
kind: import("@typeberry/block").WorkExecResultKind.badCode;
|
|
69
69
|
} | {
|
|
70
|
-
kind: import("@typeberry/block
|
|
70
|
+
kind: import("@typeberry/block").WorkExecResultKind.codeOversize;
|
|
71
71
|
}>;
|
|
72
|
-
load: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
72
|
+
load: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkRefineLoad, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkRefineLoad, {
|
|
73
73
|
gasUsed: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/numbers").U64>;
|
|
74
74
|
importedSegments: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/numbers").U32>;
|
|
75
75
|
extrinsicCount: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/numbers").U32>;
|
|
@@ -89,14 +89,14 @@ export declare class NotYetAccumulatedReport extends WithDebug {
|
|
|
89
89
|
export type AccumulationQueue = PerEpochBlock<readonly NotYetAccumulatedReport[]>;
|
|
90
90
|
export declare const accumulationQueueCodec: import("@typeberry/codec").Descriptor<readonly (readonly NotYetAccumulatedReport[])[] & import("@typeberry/utils").WithOpaque<"EpochLength">, import("@typeberry/codec").SequenceView<readonly NotYetAccumulatedReport[], import("@typeberry/codec").SequenceView<NotYetAccumulatedReport, import("@typeberry/codec").ViewOf<NotYetAccumulatedReport, {
|
|
91
91
|
report: import("@typeberry/codec").Descriptor<WorkReport, import("@typeberry/codec").ViewOf<WorkReport, {
|
|
92
|
-
workPackageSpec: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
92
|
+
workPackageSpec: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkPackageSpec, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkPackageSpec, {
|
|
93
93
|
hash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"WorkPackageHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
94
94
|
length: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/bytes").Bytes<4>>;
|
|
95
95
|
erasureRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32>, import("@typeberry/bytes").Bytes<32>>;
|
|
96
96
|
exportsRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"ExportsRootHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
97
97
|
exportsCount: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U16, import("@typeberry/bytes").Bytes<2>>;
|
|
98
98
|
}>>;
|
|
99
|
-
context: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
99
|
+
context: import("@typeberry/codec").Descriptor<import("@typeberry/block").RefineContext, import("@typeberry/codec").ViewOf<import("@typeberry/block").RefineContext, {
|
|
100
100
|
anchor: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"HeaderHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
101
101
|
stateRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"StateRootHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
102
102
|
beefyRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"BeefyHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
@@ -108,32 +108,32 @@ export declare const accumulationQueueCodec: import("@typeberry/codec").Descript
|
|
|
108
108
|
authorizerHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"AuthorizerHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
109
109
|
authorizationGasUsed: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/numbers").U64>;
|
|
110
110
|
authorizationOutput: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").BytesBlob, import("@typeberry/bytes").BytesBlob>;
|
|
111
|
-
segmentRootLookup: import("@typeberry/codec").Descriptor<readonly import("@typeberry/block
|
|
111
|
+
segmentRootLookup: import("@typeberry/codec").Descriptor<readonly import("@typeberry/block").WorkPackageInfo[], import("@typeberry/codec").SequenceView<import("@typeberry/block").WorkPackageInfo, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkPackageInfo, {
|
|
112
112
|
workPackageHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"WorkPackageHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
113
113
|
segmentTreeRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"ExportsRootHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
114
114
|
}>>>;
|
|
115
|
-
results: import("@typeberry/codec").Descriptor<import("@typeberry/collections").FixedSizeArray<import("@typeberry/block
|
|
115
|
+
results: import("@typeberry/codec").Descriptor<import("@typeberry/collections").FixedSizeArray<import("@typeberry/block").WorkResult, import("@typeberry/numbers").U8>, import("@typeberry/codec").SequenceView<import("@typeberry/block").WorkResult, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkResult, {
|
|
116
116
|
serviceId: import("@typeberry/codec").Descriptor<number & import("@typeberry/numbers").WithBytesRepresentation<4> & import("@typeberry/utils").WithOpaque<"ServiceId[u32]">, import("@typeberry/bytes").Bytes<4>>;
|
|
117
117
|
codeHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"CodeHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
118
118
|
payloadHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32>, import("@typeberry/bytes").Bytes<32>>;
|
|
119
119
|
gas: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/bytes").Bytes<8>>;
|
|
120
|
-
result: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
121
|
-
kind: import("@typeberry/block
|
|
120
|
+
result: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkExecResult, {
|
|
121
|
+
kind: import("@typeberry/block").WorkExecResultKind.ok;
|
|
122
122
|
okBlob: import("@typeberry/bytes").BytesBlob;
|
|
123
123
|
} | {
|
|
124
|
-
kind: import("@typeberry/block
|
|
124
|
+
kind: import("@typeberry/block").WorkExecResultKind.outOfGas;
|
|
125
125
|
} | {
|
|
126
|
-
kind: import("@typeberry/block
|
|
126
|
+
kind: import("@typeberry/block").WorkExecResultKind.panic;
|
|
127
127
|
} | {
|
|
128
|
-
kind: import("@typeberry/block
|
|
128
|
+
kind: import("@typeberry/block").WorkExecResultKind.incorrectNumberOfExports;
|
|
129
129
|
} | {
|
|
130
|
-
kind: import("@typeberry/block
|
|
130
|
+
kind: import("@typeberry/block").WorkExecResultKind.digestTooBig;
|
|
131
131
|
} | {
|
|
132
|
-
kind: import("@typeberry/block
|
|
132
|
+
kind: import("@typeberry/block").WorkExecResultKind.badCode;
|
|
133
133
|
} | {
|
|
134
|
-
kind: import("@typeberry/block
|
|
134
|
+
kind: import("@typeberry/block").WorkExecResultKind.codeOversize;
|
|
135
135
|
}>;
|
|
136
|
-
load: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
136
|
+
load: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkRefineLoad, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkRefineLoad, {
|
|
137
137
|
gasUsed: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/numbers").U64>;
|
|
138
138
|
importedSegments: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/numbers").U32>;
|
|
139
139
|
extrinsicCount: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/numbers").U32>;
|
|
@@ -17,14 +17,14 @@ export declare class AvailabilityAssignment extends WithDebug {
|
|
|
17
17
|
readonly timeout: TimeSlot;
|
|
18
18
|
static Codec: import("@typeberry/codec").Descriptor<AvailabilityAssignment, import("@typeberry/codec").ViewOf<AvailabilityAssignment, {
|
|
19
19
|
workReport: import("@typeberry/codec").Descriptor<WorkReport, import("@typeberry/codec").ViewOf<WorkReport, {
|
|
20
|
-
workPackageSpec: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
20
|
+
workPackageSpec: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkPackageSpec, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkPackageSpec, {
|
|
21
21
|
hash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"WorkPackageHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
22
22
|
length: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/bytes").Bytes<4>>;
|
|
23
23
|
erasureRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32>, import("@typeberry/bytes").Bytes<32>>;
|
|
24
24
|
exportsRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"ExportsRootHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
25
25
|
exportsCount: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U16, import("@typeberry/bytes").Bytes<2>>;
|
|
26
26
|
}>>;
|
|
27
|
-
context: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
27
|
+
context: import("@typeberry/codec").Descriptor<import("@typeberry/block").RefineContext, import("@typeberry/codec").ViewOf<import("@typeberry/block").RefineContext, {
|
|
28
28
|
anchor: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"HeaderHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
29
29
|
stateRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"StateRootHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
30
30
|
beefyRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"BeefyHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
@@ -36,32 +36,32 @@ export declare class AvailabilityAssignment extends WithDebug {
|
|
|
36
36
|
authorizerHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"AuthorizerHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
37
37
|
authorizationGasUsed: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/numbers").U64>;
|
|
38
38
|
authorizationOutput: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").BytesBlob, import("@typeberry/bytes").BytesBlob>;
|
|
39
|
-
segmentRootLookup: import("@typeberry/codec").Descriptor<readonly import("@typeberry/block
|
|
39
|
+
segmentRootLookup: import("@typeberry/codec").Descriptor<readonly import("@typeberry/block").WorkPackageInfo[], import("@typeberry/codec").SequenceView<import("@typeberry/block").WorkPackageInfo, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkPackageInfo, {
|
|
40
40
|
workPackageHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"WorkPackageHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
41
41
|
segmentTreeRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"ExportsRootHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
42
42
|
}>>>;
|
|
43
|
-
results: import("@typeberry/codec").Descriptor<import("@typeberry/collections").FixedSizeArray<import("@typeberry/block
|
|
43
|
+
results: import("@typeberry/codec").Descriptor<import("@typeberry/collections").FixedSizeArray<import("@typeberry/block").WorkResult, import("@typeberry/numbers").U8>, import("@typeberry/codec").SequenceView<import("@typeberry/block").WorkResult, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkResult, {
|
|
44
44
|
serviceId: import("@typeberry/codec").Descriptor<number & import("@typeberry/numbers").WithBytesRepresentation<4> & import("@typeberry/utils").WithOpaque<"ServiceId[u32]">, import("@typeberry/bytes").Bytes<4>>;
|
|
45
45
|
codeHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"CodeHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
46
46
|
payloadHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32>, import("@typeberry/bytes").Bytes<32>>;
|
|
47
47
|
gas: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/bytes").Bytes<8>>;
|
|
48
|
-
result: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
49
|
-
kind: import("@typeberry/block
|
|
48
|
+
result: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkExecResult, {
|
|
49
|
+
kind: import("@typeberry/block").WorkExecResultKind.ok;
|
|
50
50
|
okBlob: import("@typeberry/bytes").BytesBlob;
|
|
51
51
|
} | {
|
|
52
|
-
kind: import("@typeberry/block
|
|
52
|
+
kind: import("@typeberry/block").WorkExecResultKind.outOfGas;
|
|
53
53
|
} | {
|
|
54
|
-
kind: import("@typeberry/block
|
|
54
|
+
kind: import("@typeberry/block").WorkExecResultKind.panic;
|
|
55
55
|
} | {
|
|
56
|
-
kind: import("@typeberry/block
|
|
56
|
+
kind: import("@typeberry/block").WorkExecResultKind.incorrectNumberOfExports;
|
|
57
57
|
} | {
|
|
58
|
-
kind: import("@typeberry/block
|
|
58
|
+
kind: import("@typeberry/block").WorkExecResultKind.digestTooBig;
|
|
59
59
|
} | {
|
|
60
|
-
kind: import("@typeberry/block
|
|
60
|
+
kind: import("@typeberry/block").WorkExecResultKind.badCode;
|
|
61
61
|
} | {
|
|
62
|
-
kind: import("@typeberry/block
|
|
62
|
+
kind: import("@typeberry/block").WorkExecResultKind.codeOversize;
|
|
63
63
|
}>;
|
|
64
|
-
load: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
64
|
+
load: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkRefineLoad, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkRefineLoad, {
|
|
65
65
|
gasUsed: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/numbers").U64>;
|
|
66
66
|
importedSegments: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/numbers").U32>;
|
|
67
67
|
extrinsicCount: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/numbers").U32>;
|
|
@@ -77,14 +77,14 @@ export declare class AvailabilityAssignment extends WithDebug {
|
|
|
77
77
|
}
|
|
78
78
|
export declare const availabilityAssignmentsCodec: import("@typeberry/codec").Descriptor<readonly (AvailabilityAssignment | null)[] & import("@typeberry/utils").WithOpaque<"number of cores">, import("@typeberry/codec").SequenceView<AvailabilityAssignment | null, import("@typeberry/codec").ViewOf<AvailabilityAssignment, {
|
|
79
79
|
workReport: import("@typeberry/codec").Descriptor<WorkReport, import("@typeberry/codec").ViewOf<WorkReport, {
|
|
80
|
-
workPackageSpec: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
80
|
+
workPackageSpec: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkPackageSpec, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkPackageSpec, {
|
|
81
81
|
hash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"WorkPackageHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
82
82
|
length: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/bytes").Bytes<4>>;
|
|
83
83
|
erasureRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32>, import("@typeberry/bytes").Bytes<32>>;
|
|
84
84
|
exportsRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"ExportsRootHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
85
85
|
exportsCount: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U16, import("@typeberry/bytes").Bytes<2>>;
|
|
86
86
|
}>>;
|
|
87
|
-
context: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
87
|
+
context: import("@typeberry/codec").Descriptor<import("@typeberry/block").RefineContext, import("@typeberry/codec").ViewOf<import("@typeberry/block").RefineContext, {
|
|
88
88
|
anchor: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"HeaderHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
89
89
|
stateRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"StateRootHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
90
90
|
beefyRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"BeefyHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
@@ -96,32 +96,32 @@ export declare const availabilityAssignmentsCodec: import("@typeberry/codec").De
|
|
|
96
96
|
authorizerHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"AuthorizerHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
97
97
|
authorizationGasUsed: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/numbers").U64>;
|
|
98
98
|
authorizationOutput: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").BytesBlob, import("@typeberry/bytes").BytesBlob>;
|
|
99
|
-
segmentRootLookup: import("@typeberry/codec").Descriptor<readonly import("@typeberry/block
|
|
99
|
+
segmentRootLookup: import("@typeberry/codec").Descriptor<readonly import("@typeberry/block").WorkPackageInfo[], import("@typeberry/codec").SequenceView<import("@typeberry/block").WorkPackageInfo, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkPackageInfo, {
|
|
100
100
|
workPackageHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"WorkPackageHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
101
101
|
segmentTreeRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"ExportsRootHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
102
102
|
}>>>;
|
|
103
|
-
results: import("@typeberry/codec").Descriptor<import("@typeberry/collections").FixedSizeArray<import("@typeberry/block
|
|
103
|
+
results: import("@typeberry/codec").Descriptor<import("@typeberry/collections").FixedSizeArray<import("@typeberry/block").WorkResult, import("@typeberry/numbers").U8>, import("@typeberry/codec").SequenceView<import("@typeberry/block").WorkResult, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkResult, {
|
|
104
104
|
serviceId: import("@typeberry/codec").Descriptor<number & import("@typeberry/numbers").WithBytesRepresentation<4> & import("@typeberry/utils").WithOpaque<"ServiceId[u32]">, import("@typeberry/bytes").Bytes<4>>;
|
|
105
105
|
codeHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"CodeHash">, import("@typeberry/bytes").Bytes<32>>;
|
|
106
106
|
payloadHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32>, import("@typeberry/bytes").Bytes<32>>;
|
|
107
107
|
gas: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/bytes").Bytes<8>>;
|
|
108
|
-
result: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
109
|
-
kind: import("@typeberry/block
|
|
108
|
+
result: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkExecResult, {
|
|
109
|
+
kind: import("@typeberry/block").WorkExecResultKind.ok;
|
|
110
110
|
okBlob: import("@typeberry/bytes").BytesBlob;
|
|
111
111
|
} | {
|
|
112
|
-
kind: import("@typeberry/block
|
|
112
|
+
kind: import("@typeberry/block").WorkExecResultKind.outOfGas;
|
|
113
113
|
} | {
|
|
114
|
-
kind: import("@typeberry/block
|
|
114
|
+
kind: import("@typeberry/block").WorkExecResultKind.panic;
|
|
115
115
|
} | {
|
|
116
|
-
kind: import("@typeberry/block
|
|
116
|
+
kind: import("@typeberry/block").WorkExecResultKind.incorrectNumberOfExports;
|
|
117
117
|
} | {
|
|
118
|
-
kind: import("@typeberry/block
|
|
118
|
+
kind: import("@typeberry/block").WorkExecResultKind.digestTooBig;
|
|
119
119
|
} | {
|
|
120
|
-
kind: import("@typeberry/block
|
|
120
|
+
kind: import("@typeberry/block").WorkExecResultKind.badCode;
|
|
121
121
|
} | {
|
|
122
|
-
kind: import("@typeberry/block
|
|
122
|
+
kind: import("@typeberry/block").WorkExecResultKind.codeOversize;
|
|
123
123
|
}>;
|
|
124
|
-
load: import("@typeberry/codec").Descriptor<import("@typeberry/block
|
|
124
|
+
load: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkRefineLoad, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkRefineLoad, {
|
|
125
125
|
gasUsed: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/numbers").U64>;
|
|
126
126
|
importedSegments: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/numbers").U32>;
|
|
127
127
|
extrinsicCount: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/numbers").U32>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"privileged-services.d.ts","sourceRoot":"","sources":["../../../../../packages/jam/state/privileged-services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"privileged-services.d.ts","sourceRoot":"","sources":["../../../../../packages/jam/state/privileged-services.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,KAAK,WAAW,EAAS,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEzD;;GAEG;AACH,qBAAa,kBAAkB;IAiB3B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS;IAC3B,sCAAsC;IACtC,QAAQ,CAAC,SAAS,EAAE,SAAS;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,SAAS;IAC7B,4DAA4D;IAC5D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC;IACtC,2FAA2F;IAC3F,QAAQ,CAAC,sBAAsB,EAAE,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC;IAjC7D,sEAAsE;IACtE,MAAM,CAAC,KAAK;;;;;;QAQT;IAEH,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC;IAIhD,OAAO;CAoBR"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { tryAsServiceId } from "#@typeberry/block";
|
|
2
1
|
import { codec } from "#@typeberry/codec";
|
|
3
|
-
import { Compatibility, GpVersion } from "#@typeberry/utils";
|
|
4
2
|
import { codecPerCore } from "./common.js";
|
|
5
|
-
import { ignoreValueWithDefault } from "./service.js";
|
|
6
3
|
/**
|
|
7
4
|
* https://graypaper.fluffylabs.dev/#/ab2cdbd/114402114402?v=0.7.2
|
|
8
5
|
*/
|
|
@@ -17,9 +14,7 @@ export class PrivilegedServices {
|
|
|
17
14
|
manager: codec.u32.asOpaque(),
|
|
18
15
|
assigners: codecPerCore(codec.u32.asOpaque()),
|
|
19
16
|
delegator: codec.u32.asOpaque(),
|
|
20
|
-
registrar:
|
|
21
|
-
? codec.u32.asOpaque()
|
|
22
|
-
: ignoreValueWithDefault(tryAsServiceId(2 ** 32 - 1)),
|
|
17
|
+
registrar: codec.u32.asOpaque(),
|
|
23
18
|
autoAccumulateServices: codec.dictionary(codec.u32.asOpaque(), codec.u64.asOpaque(), {
|
|
24
19
|
sortKeys: (a, b) => a - b,
|
|
25
20
|
}),
|
|
@@ -26,7 +26,7 @@ export declare const ELECTIVE_BYTE_BALANCE = 1n;
|
|
|
26
26
|
/** 0-byte read, return given default value */
|
|
27
27
|
export declare const ignoreValueWithDefault: <T>(defaultValue: T) => Descriptor<T, T>;
|
|
28
28
|
/** Encode and decode object with leading version number. */
|
|
29
|
-
export declare const codecWithVersion: <T>(val: Descriptor<T>) => Descriptor<T>;
|
|
29
|
+
export declare const codecWithVersion: <T, V>(val: Descriptor<T, V>) => Descriptor<T, V>;
|
|
30
30
|
/**
|
|
31
31
|
* Service account details.
|
|
32
32
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../packages/jam/state/service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,QAAQ,E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AG,OAAO;CAM1E"}
|
|
@@ -97,10 +97,6 @@ export declare class ServiceStatistics {
|
|
|
97
97
|
accumulateCount: U32;
|
|
98
98
|
/** `a.1` */
|
|
99
99
|
accumulateGasUsed: ServiceGas;
|
|
100
|
-
/** `t.0` @deprecated since 0.7.1 */
|
|
101
|
-
onTransfersCount: U32;
|
|
102
|
-
/** `t.1` @deprecated since 0.7.1 */
|
|
103
|
-
onTransfersGasUsed: ServiceGas;
|
|
104
100
|
static Codec: Descriptor<ServiceStatistics, import("@typeberry/codec").ViewOf<ServiceStatistics, {
|
|
105
101
|
providedCount: Descriptor<U16, U32>;
|
|
106
102
|
providedSize: Descriptor<U32, U32>;
|
|
@@ -112,8 +108,6 @@ export declare class ServiceStatistics {
|
|
|
112
108
|
exports: Descriptor<U16, U32>;
|
|
113
109
|
accumulateCount: Descriptor<U32, U32>;
|
|
114
110
|
accumulateGasUsed: Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">>;
|
|
115
|
-
onTransfersCount: Descriptor<U32, U32>;
|
|
116
|
-
onTransfersGasUsed: Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">>;
|
|
117
111
|
}>>;
|
|
118
112
|
static create(v: CodecRecord<ServiceStatistics>): ServiceStatistics;
|
|
119
113
|
private constructor();
|
|
@@ -163,8 +157,6 @@ export declare class StatisticsData {
|
|
|
163
157
|
exports: Descriptor<U16, U32>;
|
|
164
158
|
accumulateCount: Descriptor<U32, U32>;
|
|
165
159
|
accumulateGasUsed: Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">>;
|
|
166
|
-
onTransfersCount: Descriptor<U32, U32>;
|
|
167
|
-
onTransfersGasUsed: Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">>;
|
|
168
160
|
}>>>;
|
|
169
161
|
}>>;
|
|
170
162
|
static create(v: CodecRecord<StatisticsData>): StatisticsData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statistics.d.ts","sourceRoot":"","sources":["../../../../../packages/jam/state/statistics.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EAEf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,WAAW,EAAS,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAgC,KAAK,GAAG,EAAE,KAAK,GAAG,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"statistics.d.ts","sourceRoot":"","sources":["../../../../../packages/jam/state/statistics.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EAEf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,WAAW,EAAS,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAgC,KAAK,GAAG,EAAE,KAAK,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEzD;;;;GAIG;AACH,qBAAa,mBAAmB;IAsB5B,sDAAsD;IAC/C,MAA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IACL,eAAe,EAAE,GAAG;IAC3B,YAAY;IACL,iBAAiB,EAAE,UAAU;IAhDtC,MAAM,CAAC,KAAK;;;;;;;;;;;QAWT;IAEH,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,iBAAiB,CAAC;IAe/C,OAAO;IAuBP,MAAM,CAAC,KAAK;CAMb;AAED,oFAAoF;AACpF,qBAAa,cAAc;aAeP,OAAO,EAAE,YAAY,CAAC,mBAAmB,CAAC;aAC1C,QAAQ,EAAE,YAAY,CAAC,mBAAmB,CAAC;aAC3C,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC;aAC9B,QAAQ,EAAE,GAAG,CAAC,SAAS,EAAE,iBAAiB,CAAC;IAjB7D,MAAM,CAAC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAOT;IAEH,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC;IAI5C,OAAO;CAMR;AAED,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { codecPerValidator, tryAsServiceGas, } from "#@typeberry/block";
|
|
2
2
|
import { codec } from "#@typeberry/codec";
|
|
3
3
|
import { tryAsU16, tryAsU32, tryAsU64 } from "#@typeberry/numbers";
|
|
4
|
-
import { Compatibility, GpVersion } from "#@typeberry/utils";
|
|
5
4
|
import { codecPerCore } from "./common.js";
|
|
6
|
-
import { ignoreValueWithDefault } from "./service.js";
|
|
7
5
|
/**
|
|
8
6
|
* Activity Record of a single validator.
|
|
9
7
|
*
|
|
@@ -134,42 +132,20 @@ export class ServiceStatistics {
|
|
|
134
132
|
extrinsicCount;
|
|
135
133
|
accumulateCount;
|
|
136
134
|
accumulateGasUsed;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
exports: codecVarU16,
|
|
149
|
-
accumulateCount: codec.varU32,
|
|
150
|
-
accumulateGasUsed: codecVarGas,
|
|
151
|
-
onTransfersCount: codec.varU32,
|
|
152
|
-
onTransfersGasUsed: codecVarGas,
|
|
153
|
-
}),
|
|
154
|
-
versions: {
|
|
155
|
-
[GpVersion.V0_7_1]: codec.Class(ServiceStatistics, {
|
|
156
|
-
providedCount: codecVarU16,
|
|
157
|
-
providedSize: codec.varU32,
|
|
158
|
-
refinementCount: codec.varU32,
|
|
159
|
-
refinementGasUsed: codecVarGas,
|
|
160
|
-
imports: codecVarU16,
|
|
161
|
-
extrinsicCount: codecVarU16,
|
|
162
|
-
extrinsicSize: codec.varU32,
|
|
163
|
-
exports: codecVarU16,
|
|
164
|
-
accumulateCount: codec.varU32,
|
|
165
|
-
accumulateGasUsed: codecVarGas,
|
|
166
|
-
onTransfersCount: ignoreValueWithDefault(tryAsU32(0)),
|
|
167
|
-
onTransfersGasUsed: ignoreValueWithDefault(tryAsServiceGas(0)),
|
|
168
|
-
}),
|
|
169
|
-
},
|
|
135
|
+
static Codec = codec.Class(ServiceStatistics, {
|
|
136
|
+
providedCount: codecVarU16,
|
|
137
|
+
providedSize: codec.varU32,
|
|
138
|
+
refinementCount: codec.varU32,
|
|
139
|
+
refinementGasUsed: codecVarGas,
|
|
140
|
+
imports: codecVarU16,
|
|
141
|
+
extrinsicCount: codecVarU16,
|
|
142
|
+
extrinsicSize: codec.varU32,
|
|
143
|
+
exports: codecVarU16,
|
|
144
|
+
accumulateCount: codec.varU32,
|
|
145
|
+
accumulateGasUsed: codecVarGas,
|
|
170
146
|
});
|
|
171
147
|
static create(v) {
|
|
172
|
-
return new ServiceStatistics(v.providedCount, v.providedSize, v.refinementCount, v.refinementGasUsed, v.imports, v.exports, v.extrinsicSize, v.extrinsicCount, v.accumulateCount, v.accumulateGasUsed
|
|
148
|
+
return new ServiceStatistics(v.providedCount, v.providedSize, v.refinementCount, v.refinementGasUsed, v.imports, v.exports, v.extrinsicSize, v.extrinsicCount, v.accumulateCount, v.accumulateGasUsed);
|
|
173
149
|
}
|
|
174
150
|
constructor(
|
|
175
151
|
/** `p.0` */
|
|
@@ -191,11 +167,7 @@ export class ServiceStatistics {
|
|
|
191
167
|
/** `a.0` */
|
|
192
168
|
accumulateCount,
|
|
193
169
|
/** `a.1` */
|
|
194
|
-
accumulateGasUsed
|
|
195
|
-
/** `t.0` @deprecated since 0.7.1 */
|
|
196
|
-
onTransfersCount,
|
|
197
|
-
/** `t.1` @deprecated since 0.7.1 */
|
|
198
|
-
onTransfersGasUsed) {
|
|
170
|
+
accumulateGasUsed) {
|
|
199
171
|
this.providedCount = providedCount;
|
|
200
172
|
this.providedSize = providedSize;
|
|
201
173
|
this.refinementCount = refinementCount;
|
|
@@ -206,14 +178,12 @@ export class ServiceStatistics {
|
|
|
206
178
|
this.extrinsicCount = extrinsicCount;
|
|
207
179
|
this.accumulateCount = accumulateCount;
|
|
208
180
|
this.accumulateGasUsed = accumulateGasUsed;
|
|
209
|
-
this.onTransfersCount = onTransfersCount;
|
|
210
|
-
this.onTransfersGasUsed = onTransfersGasUsed;
|
|
211
181
|
}
|
|
212
182
|
static empty() {
|
|
213
183
|
const zero = tryAsU32(0);
|
|
214
184
|
const zero16 = tryAsU16(0);
|
|
215
185
|
const zeroGas = tryAsServiceGas(0);
|
|
216
|
-
return new ServiceStatistics(zero16, zero, zero, zeroGas, zero16, zero16, zero, zero16, zero, zeroGas
|
|
186
|
+
return new ServiceStatistics(zero16, zero, zero, zeroGas, zero16, zero16, zero, zero16, zero, zeroGas);
|
|
217
187
|
}
|
|
218
188
|
}
|
|
219
189
|
/** `pi`: Statistics of each validator, cores statistics and services statistics. */
|
|
@@ -2,16 +2,9 @@ import { describe, it } from "node:test";
|
|
|
2
2
|
import { BytesBlob } from "#@typeberry/bytes";
|
|
3
3
|
import { Decoder } from "#@typeberry/codec";
|
|
4
4
|
import { tinyChainSpec } from "#@typeberry/config";
|
|
5
|
-
import { Compatibility, GpVersion } from "#@typeberry/utils";
|
|
6
5
|
import { StatisticsData } from "./statistics.js";
|
|
7
6
|
describe("Statistics", () => {
|
|
8
|
-
const STATISTICS =
|
|
9
|
-
fallback: "0x010000000300000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000100000000000000030000000600000000000000000000000000000000000000010000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000810e0000000000000000000100000000000001000000000000000000",
|
|
10
|
-
versions: {
|
|
11
|
-
// varu32 for serviceid + no onTransfer
|
|
12
|
-
[GpVersion.V0_7_1]: "0x010000000300000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000100000000000000030000000600000000000000000000000000000000000000010000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000810e000000000000000000010000000000000100000000000000",
|
|
13
|
-
},
|
|
14
|
-
});
|
|
7
|
+
const STATISTICS = "0x010000000300000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000100000000000000030000000600000000000000000000000000000000000000010000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000810e000000000000000000010000000000000100000000000000";
|
|
15
8
|
it("should decode statistics data with no error", () => {
|
|
16
9
|
Decoder.decodeObject(StatisticsData.Codec, BytesBlob.parseBlob(STATISTICS), tinyChainSpec);
|
|
17
10
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InMemoryState } from "./index.js";
|
|
2
2
|
export declare const testState: () => InMemoryState;
|
|
3
|
-
export declare const TEST_STATE_ROOT
|
|
3
|
+
export declare const TEST_STATE_ROOT = "0x6bf5545f35877d3c3f7066287daf2c96a37e22cab92426b188e2afd38ec87a9a";
|
|
4
4
|
export declare const TEST_STATE: string[][];
|
|
5
5
|
//# sourceMappingURL=test.utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.utils.d.ts","sourceRoot":"","sources":["../../../../../packages/jam/state/test.utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"test.utils.d.ts","sourceRoot":"","sources":["../../../../../packages/jam/state/test.utils.ts"],"names":[],"mappings":"AAmBA,OAAO,EAUL,aAAa,EAYd,MAAM,YAAY,CAAC;AAKpB,eAAO,MAAM,SAAS,QAAO,aAuT5B,CAAC;AAqCF,eAAO,MAAM,eAAe,uEAAuE,CAAC;AAEpG,eAAO,MAAM,UAAU,YAsGtB,CAAC"}
|