@typeberry/lib 0.5.3-c402c56 → 0.5.3-edc7483
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 +8 -4
- package/packages/core/hash/hash.d.ts.map +1 -1
- package/packages/core/hash/hash.js +1 -0
- package/packages/core/numbers/index.d.ts +4 -0
- package/packages/core/numbers/index.d.ts.map +1 -1
- package/packages/core/numbers/index.js +4 -4
- package/packages/core/pvm-host-calls/host-calls-executor.d.ts +23 -17
- package/packages/core/pvm-host-calls/host-calls-executor.d.ts.map +1 -1
- package/packages/core/pvm-host-calls/host-calls-executor.js +23 -31
- package/packages/core/pvm-interpreter/ops/math-consts.d.ts +2 -3
- package/packages/core/pvm-interpreter/ops/math-consts.d.ts.map +1 -1
- package/packages/core/pvm-interpreter/ops/math-consts.js +2 -3
- package/packages/core/pvm-interpreter/ops/math-ops.js +3 -3
- package/packages/core/pvm-interpreter/ops/math-utils.js +13 -13
- package/packages/core/pvm-interpreter/ops/math-utils.test.js +17 -16
- package/packages/jam/block/work-item.d.ts +13 -4
- package/packages/jam/block/work-item.d.ts.map +1 -1
- package/packages/jam/block/work-result.d.ts +3 -5
- package/packages/jam/block/work-result.d.ts.map +1 -1
- package/packages/jam/block/work-result.js +6 -0
- package/packages/jam/block-json/work-result.d.ts.map +1 -1
- package/packages/jam/block-json/work-result.js +6 -6
- package/packages/jam/database-lmdb/states.test.js +4 -3
- package/packages/jam/executor/index.d.ts +4 -0
- package/packages/jam/executor/index.d.ts.map +1 -0
- package/packages/jam/executor/index.js +2 -0
- package/packages/jam/{transition/accumulate → executor}/pvm-executor.d.ts +19 -16
- package/packages/jam/executor/pvm-executor.d.ts.map +1 -0
- package/packages/jam/{transition/accumulate → executor}/pvm-executor.js +46 -3
- package/packages/jam/in-core/externalities/refine.d.ts +24 -0
- package/packages/jam/in-core/externalities/refine.d.ts.map +1 -0
- package/packages/jam/in-core/externalities/refine.js +36 -0
- package/packages/jam/in-core/in-core.d.ts +60 -0
- package/packages/jam/in-core/in-core.d.ts.map +1 -0
- package/packages/jam/in-core/in-core.js +294 -0
- package/packages/jam/in-core/in-core.test.d.ts +2 -0
- package/packages/jam/in-core/in-core.test.d.ts.map +1 -0
- package/packages/jam/in-core/in-core.test.js +81 -0
- package/packages/jam/in-core/index.d.ts +2 -0
- package/packages/jam/in-core/index.d.ts.map +1 -0
- package/packages/jam/in-core/index.js +1 -0
- package/packages/jam/jam-host-calls/accumulate/bless.test.js +4 -5
- package/packages/jam/jamnp-s/protocol/ce-133-work-package-submission.d.ts +3 -3
- package/packages/jam/jamnp-s/protocol/ce-133-work-package-submission.d.ts.map +1 -1
- package/packages/jam/jamnp-s/protocol/ce-135-work-report-distribution.test.js +2 -2
- package/packages/jam/node/jam-config.d.ts +4 -1
- package/packages/jam/node/jam-config.d.ts.map +1 -1
- package/packages/jam/node/jam-config.js +6 -2
- package/packages/jam/node/main.d.ts.map +1 -1
- package/packages/jam/node/main.js +5 -4
- package/packages/jam/rpc-validation/types.d.ts +7 -3
- package/packages/jam/rpc-validation/types.d.ts.map +1 -1
- package/packages/jam/rpc-validation/validation.d.ts +254 -36
- package/packages/jam/rpc-validation/validation.d.ts.map +1 -1
- package/packages/jam/rpc-validation/validation.js +20 -2
- package/packages/jam/state/in-memory-state.d.ts.map +1 -1
- package/packages/jam/state/in-memory-state.js +2 -3
- package/packages/jam/state/test.utils.d.ts.map +1 -1
- package/packages/jam/state/test.utils.js +2 -3
- package/packages/jam/transition/accumulate/accumulate-data.d.ts.map +1 -1
- package/packages/jam/transition/accumulate/accumulate-data.js +1 -2
- package/packages/jam/transition/accumulate/accumulate-queue.test.js +2 -2
- package/packages/jam/transition/accumulate/accumulate-utils.test.js +2 -2
- package/packages/jam/transition/accumulate/accumulate.d.ts.map +1 -1
- package/packages/jam/transition/accumulate/accumulate.js +8 -13
- package/packages/jam/transition/accumulate/accumulate.test.js +2 -2
- package/packages/jam/transition/accumulate/accumulation-result-merge-utils.d.ts.map +1 -1
- package/packages/jam/transition/accumulate/accumulation-result-merge-utils.js +1 -2
- package/packages/jam/transition/accumulate/accumulation-result-merge-utils.test.js +1 -2
- package/packages/jam/transition/accumulate/deferred-transfers.d.ts +1 -1
- package/packages/jam/transition/accumulate/deferred-transfers.d.ts.map +1 -1
- package/packages/jam/transition/accumulate/deferred-transfers.js +6 -7
- package/packages/jam/transition/disputes/disputes.test.data2.js +2 -2
- package/packages/jam/transition/externalities/fetch-externalities.d.ts +7 -1
- package/packages/jam/transition/externalities/fetch-externalities.d.ts.map +1 -1
- package/packages/jam/transition/externalities/fetch-externalities.js +4 -0
- package/packages/jam/transition/externalities/fetch-externalities.test.js +2 -2
- package/packages/jam/transition/hasher.test.js +2 -2
- package/packages/jam/transition/reports/test.utils.d.ts.map +1 -1
- package/packages/jam/transition/reports/test.utils.js +2 -2
- package/packages/workers/block-authorship/main.d.ts.map +1 -1
- package/packages/workers/block-authorship/main.js +23 -4
- package/packages/workers/block-authorship/protocol.d.ts +3 -1
- package/packages/workers/block-authorship/protocol.d.ts.map +1 -1
- package/packages/workers/block-authorship/protocol.js +6 -3
- package/packages/jam/transition/accumulate/pvm-executor.d.ts.map +0 -1
|
@@ -3,6 +3,7 @@ export declare const JSON_RPC_VERSION = "2.0";
|
|
|
3
3
|
export declare namespace validation {
|
|
4
4
|
const hash: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
5
5
|
const slot: z.ZodNumber;
|
|
6
|
+
const coreIndex: z.ZodNumber;
|
|
6
7
|
const blobArray: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
7
8
|
const serviceId: z.ZodNumber;
|
|
8
9
|
const preimageLength: z.ZodNumber;
|
|
@@ -11,6 +12,10 @@ export declare namespace validation {
|
|
|
11
12
|
header_hash: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
12
13
|
slot: z.ZodNumber;
|
|
13
14
|
}, z.z.core.$strip>;
|
|
15
|
+
const refineResult: z.ZodObject<{
|
|
16
|
+
report: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
17
|
+
exports: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
18
|
+
}, z.z.core.$strip>;
|
|
14
19
|
const parameters: z.ZodObject<{
|
|
15
20
|
V1: z.ZodObject<{
|
|
16
21
|
deposit_per_account: z.ZodNumber;
|
|
@@ -60,6 +65,212 @@ export declare namespace validation {
|
|
|
60
65
|
input: z.ZodTuple<[z.ZodString], null>;
|
|
61
66
|
output: z.ZodBoolean;
|
|
62
67
|
};
|
|
68
|
+
/** Non-standard typeberry extension methods. */
|
|
69
|
+
const customSchemas: {
|
|
70
|
+
typeberry_refineWorkPackage: {
|
|
71
|
+
input: z.ZodTuple<[z.ZodNumber, z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodArray<z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>>], null>;
|
|
72
|
+
output: z.ZodObject<{
|
|
73
|
+
report: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
74
|
+
exports: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
75
|
+
}, z.z.core.$strip>;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
/** JIP-2 (standardized) methods */
|
|
79
|
+
const jip2Schemas: {
|
|
80
|
+
beefyRoot: {
|
|
81
|
+
input: z.ZodTuple<[], null>;
|
|
82
|
+
output: z.ZodAny;
|
|
83
|
+
};
|
|
84
|
+
submitPreimage: {
|
|
85
|
+
input: z.ZodTuple<[], null>;
|
|
86
|
+
output: z.ZodAny;
|
|
87
|
+
};
|
|
88
|
+
submitWorkPackage: {
|
|
89
|
+
input: z.ZodTuple<[], null>;
|
|
90
|
+
output: z.ZodAny;
|
|
91
|
+
};
|
|
92
|
+
workReport: {
|
|
93
|
+
input: z.ZodTuple<[], null>;
|
|
94
|
+
output: z.ZodAny;
|
|
95
|
+
};
|
|
96
|
+
submitWorkPackageBundle: {
|
|
97
|
+
input: z.ZodTuple<[], null>;
|
|
98
|
+
output: z.ZodAny;
|
|
99
|
+
};
|
|
100
|
+
workPackageStatus: {
|
|
101
|
+
input: z.ZodTuple<[], null>;
|
|
102
|
+
output: z.ZodAny;
|
|
103
|
+
};
|
|
104
|
+
subscribeWorkPackageStatus: {
|
|
105
|
+
input: z.ZodTuple<[], null>;
|
|
106
|
+
output: z.ZodAny;
|
|
107
|
+
};
|
|
108
|
+
fetchWorkPackageSegments: {
|
|
109
|
+
input: z.ZodTuple<[], null>;
|
|
110
|
+
output: z.ZodAny;
|
|
111
|
+
};
|
|
112
|
+
fetchSegments: {
|
|
113
|
+
input: z.ZodTuple<[], null>;
|
|
114
|
+
output: z.ZodAny;
|
|
115
|
+
};
|
|
116
|
+
syncState: {
|
|
117
|
+
input: z.ZodTuple<[], null>;
|
|
118
|
+
output: z.ZodAny;
|
|
119
|
+
};
|
|
120
|
+
subscribeSyncStatus: {
|
|
121
|
+
input: z.ZodTuple<[], null>;
|
|
122
|
+
output: z.ZodAny;
|
|
123
|
+
};
|
|
124
|
+
bestBlock: {
|
|
125
|
+
input: z.ZodTuple<[], null>;
|
|
126
|
+
output: z.ZodObject<{
|
|
127
|
+
header_hash: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
128
|
+
slot: z.ZodNumber;
|
|
129
|
+
}, z.z.core.$strip>;
|
|
130
|
+
};
|
|
131
|
+
finalizedBlock: {
|
|
132
|
+
input: z.ZodTuple<[], null>;
|
|
133
|
+
output: z.ZodObject<{
|
|
134
|
+
header_hash: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
135
|
+
slot: z.ZodNumber;
|
|
136
|
+
}, z.z.core.$strip>;
|
|
137
|
+
};
|
|
138
|
+
listServices: {
|
|
139
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>], null>;
|
|
140
|
+
output: z.ZodArray<z.ZodNumber>;
|
|
141
|
+
};
|
|
142
|
+
parameters: {
|
|
143
|
+
input: z.ZodTuple<[], null>;
|
|
144
|
+
output: z.ZodObject<{
|
|
145
|
+
V1: z.ZodObject<{
|
|
146
|
+
deposit_per_account: z.ZodNumber;
|
|
147
|
+
deposit_per_item: z.ZodNumber;
|
|
148
|
+
deposit_per_byte: z.ZodNumber;
|
|
149
|
+
min_turnaround_period: z.ZodNumber;
|
|
150
|
+
epoch_period: z.ZodNumber;
|
|
151
|
+
max_accumulate_gas: z.ZodNumber;
|
|
152
|
+
max_is_authorized_gas: z.ZodNumber;
|
|
153
|
+
max_refine_gas: z.ZodNumber;
|
|
154
|
+
block_gas_limit: z.ZodNumber;
|
|
155
|
+
recent_block_count: z.ZodNumber;
|
|
156
|
+
max_work_items: z.ZodNumber;
|
|
157
|
+
max_dependencies: z.ZodNumber;
|
|
158
|
+
max_tickets_per_block: z.ZodNumber;
|
|
159
|
+
max_lookup_anchor_age: z.ZodNumber;
|
|
160
|
+
tickets_attempts_number: z.ZodNumber;
|
|
161
|
+
auth_window: z.ZodNumber;
|
|
162
|
+
auth_queue_len: z.ZodNumber;
|
|
163
|
+
rotation_period: z.ZodNumber;
|
|
164
|
+
max_extrinsics: z.ZodNumber;
|
|
165
|
+
availability_timeout: z.ZodNumber;
|
|
166
|
+
val_count: z.ZodNumber;
|
|
167
|
+
max_input: z.ZodNumber;
|
|
168
|
+
max_refine_code_size: z.ZodNumber;
|
|
169
|
+
basic_piece_len: z.ZodNumber;
|
|
170
|
+
max_imports: z.ZodNumber;
|
|
171
|
+
max_is_authorized_code_size: z.ZodNumber;
|
|
172
|
+
max_exports: z.ZodNumber;
|
|
173
|
+
max_refine_memory: z.ZodNumber;
|
|
174
|
+
max_is_authorized_memory: z.ZodNumber;
|
|
175
|
+
segment_piece_count: z.ZodNumber;
|
|
176
|
+
max_report_elective_data: z.ZodNumber;
|
|
177
|
+
transfer_memo_size: z.ZodNumber;
|
|
178
|
+
epoch_tail_start: z.ZodNumber;
|
|
179
|
+
core_count: z.ZodNumber;
|
|
180
|
+
slot_period_sec: z.ZodNumber;
|
|
181
|
+
max_authorizer_code_size: z.ZodNumber;
|
|
182
|
+
max_service_code_size: z.ZodNumber;
|
|
183
|
+
}, z.z.core.$strip>;
|
|
184
|
+
}, z.z.core.$strip>;
|
|
185
|
+
};
|
|
186
|
+
parent: {
|
|
187
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>], null>;
|
|
188
|
+
output: z.ZodObject<{
|
|
189
|
+
header_hash: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
190
|
+
slot: z.ZodNumber;
|
|
191
|
+
}, z.z.core.$strip>;
|
|
192
|
+
};
|
|
193
|
+
serviceData: {
|
|
194
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNumber], null>;
|
|
195
|
+
output: z.ZodUnion<readonly [z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNull]>;
|
|
196
|
+
};
|
|
197
|
+
servicePreimage: {
|
|
198
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNumber, z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>], null>;
|
|
199
|
+
output: z.ZodUnion<readonly [z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNull]>;
|
|
200
|
+
};
|
|
201
|
+
serviceRequest: {
|
|
202
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNumber, z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNumber], null>;
|
|
203
|
+
output: z.ZodUnion<readonly [z.ZodReadonly<z.ZodArray<z.ZodNumber>>, z.ZodNull]>;
|
|
204
|
+
};
|
|
205
|
+
serviceValue: {
|
|
206
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNumber, z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>], null>;
|
|
207
|
+
output: z.ZodUnion<readonly [z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNull]>;
|
|
208
|
+
};
|
|
209
|
+
stateRoot: {
|
|
210
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>], null>;
|
|
211
|
+
output: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
212
|
+
};
|
|
213
|
+
statistics: {
|
|
214
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>], null>;
|
|
215
|
+
output: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
216
|
+
};
|
|
217
|
+
subscribeBestBlock: {
|
|
218
|
+
input: z.ZodTuple<[], null>;
|
|
219
|
+
output: z.ZodString;
|
|
220
|
+
};
|
|
221
|
+
subscribeFinalizedBlock: {
|
|
222
|
+
input: z.ZodTuple<[], null>;
|
|
223
|
+
output: z.ZodString;
|
|
224
|
+
};
|
|
225
|
+
subscribeServiceData: {
|
|
226
|
+
input: z.ZodTuple<[z.ZodNumber, z.ZodBoolean], null>;
|
|
227
|
+
output: z.ZodString;
|
|
228
|
+
};
|
|
229
|
+
subscribeServicePreimage: {
|
|
230
|
+
input: z.ZodTuple<[z.ZodNumber, z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodBoolean], null>;
|
|
231
|
+
output: z.ZodString;
|
|
232
|
+
};
|
|
233
|
+
subscribeServiceRequest: {
|
|
234
|
+
input: z.ZodTuple<[z.ZodNumber, z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNumber, z.ZodBoolean], null>;
|
|
235
|
+
output: z.ZodString;
|
|
236
|
+
};
|
|
237
|
+
subscribeServiceValue: {
|
|
238
|
+
input: z.ZodTuple<[z.ZodNumber, z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodBoolean], null>;
|
|
239
|
+
output: z.ZodString;
|
|
240
|
+
};
|
|
241
|
+
subscribeStatistics: {
|
|
242
|
+
input: z.ZodTuple<[z.ZodBoolean], null>;
|
|
243
|
+
output: z.ZodString;
|
|
244
|
+
};
|
|
245
|
+
unsubscribeBestBlock: {
|
|
246
|
+
input: z.ZodTuple<[z.ZodString], null>;
|
|
247
|
+
output: z.ZodBoolean;
|
|
248
|
+
};
|
|
249
|
+
unsubscribeFinalizedBlock: {
|
|
250
|
+
input: z.ZodTuple<[z.ZodString], null>;
|
|
251
|
+
output: z.ZodBoolean;
|
|
252
|
+
};
|
|
253
|
+
unsubscribeServiceData: {
|
|
254
|
+
input: z.ZodTuple<[z.ZodString], null>;
|
|
255
|
+
output: z.ZodBoolean;
|
|
256
|
+
};
|
|
257
|
+
unsubscribeServicePreimage: {
|
|
258
|
+
input: z.ZodTuple<[z.ZodString], null>;
|
|
259
|
+
output: z.ZodBoolean;
|
|
260
|
+
};
|
|
261
|
+
unsubscribeServiceRequest: {
|
|
262
|
+
input: z.ZodTuple<[z.ZodString], null>;
|
|
263
|
+
output: z.ZodBoolean;
|
|
264
|
+
};
|
|
265
|
+
unsubscribeServiceValue: {
|
|
266
|
+
input: z.ZodTuple<[z.ZodString], null>;
|
|
267
|
+
output: z.ZodBoolean;
|
|
268
|
+
};
|
|
269
|
+
unsubscribeStatistics: {
|
|
270
|
+
input: z.ZodTuple<[z.ZodString], null>;
|
|
271
|
+
output: z.ZodBoolean;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
63
274
|
const schemas: {
|
|
64
275
|
readonly beefyRoot: {
|
|
65
276
|
input: z.ZodTuple<[], null>;
|
|
@@ -106,26 +317,26 @@ export declare namespace validation {
|
|
|
106
317
|
output: z.ZodAny;
|
|
107
318
|
};
|
|
108
319
|
readonly bestBlock: {
|
|
109
|
-
|
|
110
|
-
|
|
320
|
+
input: z.ZodTuple<[], null>;
|
|
321
|
+
output: z.ZodObject<{
|
|
111
322
|
header_hash: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
112
323
|
slot: z.ZodNumber;
|
|
113
324
|
}, z.z.core.$strip>;
|
|
114
325
|
};
|
|
115
326
|
readonly finalizedBlock: {
|
|
116
|
-
|
|
117
|
-
|
|
327
|
+
input: z.ZodTuple<[], null>;
|
|
328
|
+
output: z.ZodObject<{
|
|
118
329
|
header_hash: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
119
330
|
slot: z.ZodNumber;
|
|
120
331
|
}, z.z.core.$strip>;
|
|
121
332
|
};
|
|
122
333
|
readonly listServices: {
|
|
123
|
-
|
|
124
|
-
|
|
334
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>], null>;
|
|
335
|
+
output: z.ZodArray<z.ZodNumber>;
|
|
125
336
|
};
|
|
126
337
|
readonly parameters: {
|
|
127
|
-
|
|
128
|
-
|
|
338
|
+
input: z.ZodTuple<[], null>;
|
|
339
|
+
output: z.ZodObject<{
|
|
129
340
|
V1: z.ZodObject<{
|
|
130
341
|
deposit_per_account: z.ZodNumber;
|
|
131
342
|
deposit_per_item: z.ZodNumber;
|
|
@@ -168,63 +379,63 @@ export declare namespace validation {
|
|
|
168
379
|
}, z.z.core.$strip>;
|
|
169
380
|
};
|
|
170
381
|
readonly parent: {
|
|
171
|
-
|
|
172
|
-
|
|
382
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>], null>;
|
|
383
|
+
output: z.ZodObject<{
|
|
173
384
|
header_hash: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
174
385
|
slot: z.ZodNumber;
|
|
175
386
|
}, z.z.core.$strip>;
|
|
176
387
|
};
|
|
177
388
|
readonly serviceData: {
|
|
178
|
-
|
|
179
|
-
|
|
389
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNumber], null>;
|
|
390
|
+
output: z.ZodUnion<readonly [z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNull]>;
|
|
180
391
|
};
|
|
181
392
|
readonly servicePreimage: {
|
|
182
|
-
|
|
183
|
-
|
|
393
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNumber, z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>], null>;
|
|
394
|
+
output: z.ZodUnion<readonly [z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNull]>;
|
|
184
395
|
};
|
|
185
396
|
readonly serviceRequest: {
|
|
186
|
-
|
|
187
|
-
|
|
397
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNumber, z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNumber], null>;
|
|
398
|
+
output: z.ZodUnion<readonly [z.ZodReadonly<z.ZodArray<z.ZodNumber>>, z.ZodNull]>;
|
|
188
399
|
};
|
|
189
400
|
readonly serviceValue: {
|
|
190
|
-
|
|
191
|
-
|
|
401
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNumber, z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>], null>;
|
|
402
|
+
output: z.ZodUnion<readonly [z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNull]>;
|
|
192
403
|
};
|
|
193
404
|
readonly stateRoot: {
|
|
194
|
-
|
|
195
|
-
|
|
405
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>], null>;
|
|
406
|
+
output: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
196
407
|
};
|
|
197
408
|
readonly statistics: {
|
|
198
|
-
|
|
199
|
-
|
|
409
|
+
input: z.ZodTuple<[z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>], null>;
|
|
410
|
+
output: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
200
411
|
};
|
|
201
412
|
readonly subscribeBestBlock: {
|
|
202
|
-
|
|
203
|
-
|
|
413
|
+
input: z.ZodTuple<[], null>;
|
|
414
|
+
output: z.ZodString;
|
|
204
415
|
};
|
|
205
416
|
readonly subscribeFinalizedBlock: {
|
|
206
|
-
|
|
207
|
-
|
|
417
|
+
input: z.ZodTuple<[], null>;
|
|
418
|
+
output: z.ZodString;
|
|
208
419
|
};
|
|
209
420
|
readonly subscribeServiceData: {
|
|
210
|
-
|
|
211
|
-
|
|
421
|
+
input: z.ZodTuple<[z.ZodNumber, z.ZodBoolean], null>;
|
|
422
|
+
output: z.ZodString;
|
|
212
423
|
};
|
|
213
424
|
readonly subscribeServicePreimage: {
|
|
214
|
-
|
|
215
|
-
|
|
425
|
+
input: z.ZodTuple<[z.ZodNumber, z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodBoolean], null>;
|
|
426
|
+
output: z.ZodString;
|
|
216
427
|
};
|
|
217
428
|
readonly subscribeServiceRequest: {
|
|
218
|
-
|
|
219
|
-
|
|
429
|
+
input: z.ZodTuple<[z.ZodNumber, z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodNumber, z.ZodBoolean], null>;
|
|
430
|
+
output: z.ZodString;
|
|
220
431
|
};
|
|
221
432
|
readonly subscribeServiceValue: {
|
|
222
|
-
|
|
223
|
-
|
|
433
|
+
input: z.ZodTuple<[z.ZodNumber, z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodBoolean], null>;
|
|
434
|
+
output: z.ZodString;
|
|
224
435
|
};
|
|
225
436
|
readonly subscribeStatistics: {
|
|
226
|
-
|
|
227
|
-
|
|
437
|
+
input: z.ZodTuple<[z.ZodBoolean], null>;
|
|
438
|
+
output: z.ZodString;
|
|
228
439
|
};
|
|
229
440
|
readonly unsubscribeBestBlock: {
|
|
230
441
|
input: z.ZodTuple<[z.ZodString], null>;
|
|
@@ -254,6 +465,13 @@ export declare namespace validation {
|
|
|
254
465
|
input: z.ZodTuple<[z.ZodString], null>;
|
|
255
466
|
output: z.ZodBoolean;
|
|
256
467
|
};
|
|
468
|
+
readonly typeberry_refineWorkPackage: {
|
|
469
|
+
input: z.ZodTuple<[z.ZodNumber, z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>, z.ZodArray<z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>>], null>;
|
|
470
|
+
output: z.ZodObject<{
|
|
471
|
+
report: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
472
|
+
exports: z.ZodCodec<z.ZodBase64, z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
473
|
+
}, z.z.core.$strip>;
|
|
474
|
+
};
|
|
257
475
|
};
|
|
258
476
|
const jsonRpcRequest: z.ZodObject<{
|
|
259
477
|
jsonrpc: z.ZodLiteral<"2.0">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../../packages/jam/rpc-validation/validation.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AACtC,yBAAiB,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../../packages/jam/rpc-validation/validation.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AACtC,yBAAiB,UAAU,CAAC;IAMnB,MAAM,IAAI,gGAOhB,CAAC;IACK,MAAM,IAAI,aAAM,CAAC;IACjB,MAAM,SAAS,aAAM,CAAC;IACtB,MAAM,SAAS,gGAGpB,CAAC;IACI,MAAM,SAAS,aAAM,CAAC;IACtB,MAAM,cAAc,aAAM,CAAC;IAC3B,MAAM,MAAM,sBAAc,CAAC;IAC3B,MAAM,eAAe;;;uBAG1B,CAAC;IAEI,MAAM,YAAY;;;uBAGvB,CAAC;IAEI,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAwCrB,CAAC;IAEI,MAAM,oBAAoB;;;KAGhC,CAAC;IAEK,MAAM,iBAAiB;;;KAG7B,CAAC;IAEF,gDAAgD;IACzC,MAAM,aAAa;;;;;;;;KAKzB,CAAC;IAEF,mCAAmC;IAC5B,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2FvB,CAAC;IAEK,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAG8D,CAAC;IAE5E,MAAM,cAAc;;;;;uBAKzB,CAAC;IAEI,MAAM,mBAAmB;;;;uBAAoC,CAAC;CACtE;AAED,eAAO,MAAM,oBAAoB;;;;;;;;CAQqE,CAAC"}
|
|
@@ -3,13 +3,15 @@ import z from "zod";
|
|
|
3
3
|
export const JSON_RPC_VERSION = "2.0";
|
|
4
4
|
export var validation;
|
|
5
5
|
(function (validation) {
|
|
6
|
-
const
|
|
6
|
+
const u16 = z.number().int().min(0).max(0xffff);
|
|
7
|
+
const u32 = z.number().int().min(0).max(0xffff_ffff);
|
|
7
8
|
const uint8Array = z.custom((v) => v instanceof Uint8Array); // this is needed because a simple z.instanceof(Uint8Array) automatically narrows the type down to Uint8Array<ArrayBuffer> whereas our Bytes.raw are effectively Uint8Array<ArrayBufferLike>
|
|
8
9
|
validation.hash = z.codec(z.base64(), uint8Array.refine((v) => v.length === HASH_SIZE, "Invalid hash length."), {
|
|
9
10
|
decode: (v) => Uint8Array.from(Buffer.from(v, "base64")),
|
|
10
11
|
encode: (v) => Buffer.from(v).toString("base64"),
|
|
11
12
|
});
|
|
12
13
|
validation.slot = u32;
|
|
14
|
+
validation.coreIndex = u16;
|
|
13
15
|
validation.blobArray = z.codec(z.base64(), uint8Array, {
|
|
14
16
|
decode: (v) => Uint8Array.from(Buffer.from(v, "base64")),
|
|
15
17
|
encode: (v) => Buffer.from(v).toString("base64"),
|
|
@@ -21,6 +23,10 @@ export var validation;
|
|
|
21
23
|
header_hash: validation.hash,
|
|
22
24
|
slot: validation.slot,
|
|
23
25
|
});
|
|
26
|
+
validation.refineResult = z.object({
|
|
27
|
+
report: validation.blobArray,
|
|
28
|
+
exports: validation.blobArray,
|
|
29
|
+
});
|
|
24
30
|
validation.parameters = z.object({
|
|
25
31
|
V1: z.object({
|
|
26
32
|
deposit_per_account: z.number(),
|
|
@@ -70,7 +76,15 @@ export var validation;
|
|
|
70
76
|
input: z.tuple([z.string()]),
|
|
71
77
|
output: z.boolean(),
|
|
72
78
|
};
|
|
73
|
-
|
|
79
|
+
/** Non-standard typeberry extension methods. */
|
|
80
|
+
validation.customSchemas = {
|
|
81
|
+
typeberry_refineWorkPackage: {
|
|
82
|
+
input: z.tuple([validation.coreIndex, validation.blobArray, z.array(validation.blobArray)]),
|
|
83
|
+
output: validation.refineResult,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
/** JIP-2 (standardized) methods */
|
|
87
|
+
validation.jip2Schemas = {
|
|
74
88
|
beefyRoot: validation.notImplementedSchema,
|
|
75
89
|
submitPreimage: validation.notImplementedSchema,
|
|
76
90
|
submitWorkPackage: validation.notImplementedSchema,
|
|
@@ -162,6 +176,10 @@ export var validation;
|
|
|
162
176
|
unsubscribeServiceValue: validation.unsubscribeSchema,
|
|
163
177
|
unsubscribeStatistics: validation.unsubscribeSchema,
|
|
164
178
|
};
|
|
179
|
+
validation.schemas = {
|
|
180
|
+
...validation.customSchemas,
|
|
181
|
+
...validation.jip2Schemas,
|
|
182
|
+
};
|
|
165
183
|
validation.jsonRpcRequest = z.object({
|
|
166
184
|
jsonrpc: z.literal(JSON_RPC_VERSION),
|
|
167
185
|
method: z.string(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-state.d.ts","sourceRoot":"","sources":["../../../../../packages/jam/state/in-memory-state.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,QAAQ,EAMd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAEL,cAAc,EACd,cAAc,EAEd,KAAK,cAAc,EACnB,WAAW,EAEZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAgC,KAAK,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAE5G,OAAO,
|
|
1
|
+
{"version":3,"file":"in-memory-state.d.ts","sourceRoot":"","sources":["../../../../../packages/jam/state/in-memory-state.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,QAAQ,EAMd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAEL,cAAc,EACd,cAAc,EAEd,KAAK,cAAc,EACnB,WAAW,EAEZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAgC,KAAK,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAE5G,OAAO,EAA2B,KAAK,GAAG,EAAE,MAAM,oBAAoB,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eAAO,MAAM,gBAAgB,+aAE3B,CAAC;AAEH,0DAA0D;AAC1D,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC;AAEjF,KAAK,UAAU,CAAC,CAAC,IAAI;KAElB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,GAAG,KAAK,GAAG,CAAC;CAClD,CAAC,MAAM,CAAC,CAAC,CAAC"}
|
|
@@ -5,8 +5,7 @@ import { asKnownSize, FixedSizeArray, HashDictionary, HashSet, SortedArray, Sort
|
|
|
5
5
|
import { BANDERSNATCH_KEY_BYTES, BLS_KEY_BYTES, ED25519_KEY_BYTES } from "#@typeberry/crypto";
|
|
6
6
|
import { BANDERSNATCH_RING_ROOT_BYTES } from "#@typeberry/crypto/bandersnatch.js";
|
|
7
7
|
import { HASH_SIZE } from "#@typeberry/hash";
|
|
8
|
-
import { tryAsU32 } from "#@typeberry/numbers";
|
|
9
|
-
import { MAX_VALUE } from "#@typeberry/pvm-interpreter/ops/math-consts.js";
|
|
8
|
+
import { MAX_VALUE_U32, tryAsU32 } from "#@typeberry/numbers";
|
|
10
9
|
import { asOpaqueType, assertNever, check, OK, Result, WithDebug } from "#@typeberry/utils";
|
|
11
10
|
import { accumulationOutputComparator } from "./accumulation-output.js";
|
|
12
11
|
import { AUTHORIZATION_QUEUE_SIZE } from "./auth.js";
|
|
@@ -451,7 +450,7 @@ export class InMemoryState extends WithDebug {
|
|
|
451
450
|
manager: tryAsServiceId(0),
|
|
452
451
|
assigners: tryAsPerCore(new Array(spec.coresCount).fill(tryAsServiceId(0)), spec),
|
|
453
452
|
delegator: tryAsServiceId(0),
|
|
454
|
-
registrar: tryAsServiceId(
|
|
453
|
+
registrar: tryAsServiceId(MAX_VALUE_U32),
|
|
455
454
|
autoAccumulateServices: new Map(),
|
|
456
455
|
}),
|
|
457
456
|
accumulationOutputLog: SortedArray.fromArray(accumulationOutputComparator, []),
|
|
@@ -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":"AAoBA,OAAO,EAUL,aAAa,EAYd,MAAM,YAAY,CAAC;AAKpB,eAAO,MAAM,SAAS,QAAO,aAyT5B,CAAC;AAqCF,eAAO,MAAM,eAAe,QAK1B,CAAC;AAEH,eAAO,MAAM,UAAU,YAkHtB,CAAC"}
|
|
@@ -6,8 +6,7 @@ import { asKnownSize, FixedSizeArray, HashDictionary, HashSet, SortedArray, Sort
|
|
|
6
6
|
import { tinyChainSpec } from "#@typeberry/config";
|
|
7
7
|
import { BANDERSNATCH_RING_ROOT_BYTES } from "#@typeberry/crypto/bandersnatch.js";
|
|
8
8
|
import { HASH_SIZE } from "#@typeberry/hash";
|
|
9
|
-
import { tryAsU16, tryAsU32, tryAsU64 } from "#@typeberry/numbers";
|
|
10
|
-
import { MAX_VALUE } from "#@typeberry/pvm-interpreter/ops/math-consts.js";
|
|
9
|
+
import { MAX_VALUE_U32, tryAsU16, tryAsU32, tryAsU64 } from "#@typeberry/numbers";
|
|
11
10
|
import { Compatibility, GpVersion } from "#@typeberry/utils";
|
|
12
11
|
import { AUTHORIZATION_QUEUE_SIZE, AvailabilityAssignment, accumulationOutputComparator, BlockState, CoreStatistics, DisputesRecords, ENTROPY_ENTRIES, hashComparator, InMemoryService, InMemoryState, LookupHistoryItem, PreimageItem, PrivilegedServices, RecentBlocks, SafroleSealingKeysData, ServiceAccountInfo, ServiceStatistics, StatisticsData, tryAsPerCore, ValidatorData, ValidatorStatistics, } from "./index.js";
|
|
13
12
|
const spec = tinyChainSpec;
|
|
@@ -271,7 +270,7 @@ export const testState = () => {
|
|
|
271
270
|
manager: tryAsServiceId(0),
|
|
272
271
|
assigners: tryAsPerCore(new Array(spec.coresCount).fill(tryAsServiceId(0)), spec),
|
|
273
272
|
delegator: tryAsServiceId(0),
|
|
274
|
-
registrar: tryAsServiceId(
|
|
273
|
+
registrar: tryAsServiceId(MAX_VALUE_U32),
|
|
275
274
|
autoAccumulateServices: new Map(),
|
|
276
275
|
}),
|
|
277
276
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accumulate-data.d.ts","sourceRoot":"","sources":["../../../../../../packages/jam/transition/accumulate/accumulate-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAmB,MAAM,kBAAkB,CAAC;AACpF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"accumulate-data.d.ts","sourceRoot":"","sources":["../../../../../../packages/jam/transition/accumulate/accumulate-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAmB,MAAM,kBAAkB,CAAC;AACpF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAmC,KAAK,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAavC;;;;;GAKG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAqC;IAC5E,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAoC;IACzE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;IACzC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA6B;gBAG/D,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,EAC9B,SAAS,EAAE,eAAe,EAAE,EAC5B,iCAAiC,EAAE,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC;IAwC/D;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAahC,oCAAoC;IACpC,OAAO,CAAC,eAAe;IAYvB;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAmB1B;;OAEG;IAEH;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;IA8CxB,0DAA0D;IAC1D,WAAW,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,EAAE;IAI5C,2DAA2D;IAC3D,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,eAAe,EAAE;IAIrD,0EAA0E;IAC1E,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,GAAG;IAI3C,mDAAmD;IACnD,WAAW,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU;IAI7C;;;;OAIG;IACH,aAAa,IAAI,SAAS,EAAE;CAG7B"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { tryAsServiceGas } from "#@typeberry/block";
|
|
2
|
-
import { sumU64, tryAsU32 } from "#@typeberry/numbers";
|
|
3
|
-
import { MAX_VALUE_U64 } from "#@typeberry/pvm-interpreter/ops/math-consts.js";
|
|
2
|
+
import { MAX_VALUE_U64, sumU64, tryAsU32 } from "#@typeberry/numbers";
|
|
4
3
|
import { Operand } from "./operand.js";
|
|
5
4
|
class AccumulateDataItem {
|
|
6
5
|
operands;
|
|
@@ -3,7 +3,7 @@ import { tryAsCoreIndex, tryAsPerEpochBlock, tryAsServiceGas, tryAsServiceId, tr
|
|
|
3
3
|
import { RefineContext, WorkPackageInfo } from "#@typeberry/block/refine-context.js";
|
|
4
4
|
import { tryAsWorkItemsCount } from "#@typeberry/block/work-package.js";
|
|
5
5
|
import { WorkPackageSpec, WorkReport } from "#@typeberry/block/work-report.js";
|
|
6
|
-
import { WorkExecResult,
|
|
6
|
+
import { WorkExecResult, WorkRefineLoad, WorkResult } from "#@typeberry/block/work-result.js";
|
|
7
7
|
import { Bytes, BytesBlob } from "#@typeberry/bytes";
|
|
8
8
|
import { asKnownSize, FixedSizeArray, HashSet } from "#@typeberry/collections";
|
|
9
9
|
import { tinyChainSpec } from "#@typeberry/config";
|
|
@@ -43,7 +43,7 @@ describe("accumulate-queue", () => {
|
|
|
43
43
|
importedSegments: tryAsU32(0),
|
|
44
44
|
}),
|
|
45
45
|
payloadHash: Bytes.zero(HASH_SIZE).asOpaque(),
|
|
46
|
-
result:
|
|
46
|
+
result: WorkExecResult.ok(BytesBlob.empty()),
|
|
47
47
|
serviceId: tryAsServiceId(0),
|
|
48
48
|
}),
|
|
49
49
|
], tryAsWorkItemsCount(1)),
|
|
@@ -4,7 +4,7 @@ import { tryAsCoreIndex, tryAsServiceGas, tryAsServiceId, tryAsTimeSlot } from "
|
|
|
4
4
|
import { RefineContext } from "#@typeberry/block/refine-context.js";
|
|
5
5
|
import { tryAsWorkItemsCount } from "#@typeberry/block/work-package.js";
|
|
6
6
|
import { WorkPackageSpec, WorkReport } from "#@typeberry/block/work-report.js";
|
|
7
|
-
import { WorkExecResult,
|
|
7
|
+
import { WorkExecResult, WorkRefineLoad, WorkResult } from "#@typeberry/block/work-result.js";
|
|
8
8
|
import { Bytes, BytesBlob } from "#@typeberry/bytes";
|
|
9
9
|
import { FixedSizeArray, HashSet } from "#@typeberry/collections";
|
|
10
10
|
import { tinyChainSpec } from "#@typeberry/config";
|
|
@@ -52,7 +52,7 @@ describe("accumulate-utils", () => {
|
|
|
52
52
|
importedSegments: tryAsU32(0),
|
|
53
53
|
}),
|
|
54
54
|
payloadHash: Bytes.zero(HASH_SIZE).asOpaque(),
|
|
55
|
-
result:
|
|
55
|
+
result: WorkExecResult.ok(BytesBlob.empty()),
|
|
56
56
|
serviceId: tryAsServiceId(0),
|
|
57
57
|
}),
|
|
58
58
|
], tryAsWorkItemsCount(1)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accumulate.d.ts","sourceRoot":"","sources":["../../../../../../packages/jam/transition/accumulate/accumulate.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EAIf,MAAM,kBAAkB,CAAC;AAM1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"accumulate.d.ts","sourceRoot":"","sources":["../../../../../../packages/jam/transition/accumulate/accumulate.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EAIf,MAAM,kBAAkB,CAAC;AAM1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,KAAK,OAAO,EAA8B,MAAM,iBAAiB,CAAC;AAiB3E,OAAO,EAAyC,MAAM,EAAa,MAAM,kBAAkB,CAAC;AAM5F,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EAGrB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC;AA2B3D,qBAAa,UAAU;aAEH,SAAS,EAAE,SAAS;aACpB,OAAO,EAAE,OAAO;aAChB,KAAK,EAAE,eAAe;aACtB,OAAO,EAAE,iBAAiB;gBAH1B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,iBAAiB;IAO5C;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAkB7B;;;;OAIG;YACW,uBAAuB;IAqGrC;;;;OAIG;YACW,uBAAuB;IAoDrC;;;;;;;OAOG;YACW,4BAA4B;IA8D1C;;;;;;;OAOG;YACW,sBAAsB;IAsEpC,OAAO,CAAC,gBAAgB;IAuCxB,OAAO,CAAC,kBAAkB;IAsB1B;;;;;;;;;OASG;YACW,oBAAoB;IA6ClC;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAkDlC;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IAcnB;;;;;;OAMG;IACI,6BAA6B,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO;IAKhE,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;CAwGrH"}
|
|
@@ -3,12 +3,11 @@ import { W_C } from "#@typeberry/block/gp-constants.js";
|
|
|
3
3
|
import { Bytes } from "#@typeberry/bytes";
|
|
4
4
|
import { codec, Encoder } from "#@typeberry/codec";
|
|
5
5
|
import { ArrayView, HashSet, SortedArray } from "#@typeberry/collections";
|
|
6
|
+
import { PvmExecutor, ReturnStatus } from "#@typeberry/executor";
|
|
6
7
|
import { HASH_SIZE } from "#@typeberry/hash";
|
|
7
8
|
import { AccumulationStateUpdate, PartiallyUpdatedState, } from "#@typeberry/jam-host-calls/externalities/state-update.js";
|
|
8
9
|
import { Logger } from "#@typeberry/logger";
|
|
9
|
-
import { sumU64, tryAsU32 } from "#@typeberry/numbers";
|
|
10
|
-
import { Status, tryAsGas } from "#@typeberry/pvm-interface";
|
|
11
|
-
import { MAX_VALUE_U64 } from "#@typeberry/pvm-interpreter/ops/math-consts.js";
|
|
10
|
+
import { MAX_VALUE_U64, sumU64, tryAsU32 } from "#@typeberry/numbers";
|
|
12
11
|
import { accumulationOutputComparator, hashComparator, ServiceAccountInfo, tryAsPerCore, } from "#@typeberry/state";
|
|
13
12
|
import { assertEmpty, Compatibility, GpVersion, Result, TestSuite } from "#@typeberry/utils";
|
|
14
13
|
import { AccumulateExternalities } from "../externalities/accumulate-externalities.js";
|
|
@@ -18,7 +17,6 @@ import { AccumulateQueue, pruneQueue } from "./accumulate-queue.js";
|
|
|
18
17
|
import { GAS_TO_INVOKE_WORK_REPORT, } from "./accumulate-state.js";
|
|
19
18
|
import { generateNextServiceId, getWorkPackageHashes } from "./accumulate-utils.js";
|
|
20
19
|
import { mergePerallelAccumulationResults, } from "./accumulation-result-merge-utils.js";
|
|
21
|
-
import { PvmExecutor } from "./pvm-executor.js";
|
|
22
20
|
export const ACCUMULATION_ERROR = "duplicate service created";
|
|
23
21
|
var PvmInvocationError;
|
|
24
22
|
(function (PvmInvocationError) {
|
|
@@ -102,28 +100,25 @@ export class Accumulate {
|
|
|
102
100
|
serviceId,
|
|
103
101
|
argsLength: tryAsU32(transfers.length + operands.length),
|
|
104
102
|
});
|
|
105
|
-
const result = await executor.run(invocationArgs,
|
|
103
|
+
const result = await executor.run(invocationArgs, gas);
|
|
106
104
|
const [newState, checkpoint] = partialState.getStateUpdates();
|
|
107
105
|
/**
|
|
108
106
|
* PVM invocation returned and error so we return the checkpoint
|
|
109
107
|
*
|
|
110
108
|
* https://graypaper.fluffylabs.dev/#/7e6ff6a/300002300002?v=0.6.7
|
|
111
109
|
*/
|
|
112
|
-
if (result.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
logger.trace `[${serviceId}] accumulate finished with ${Status[status]} reverting to checkpoint.`;
|
|
116
|
-
return Result.ok({ stateUpdate: checkpoint, consumedGas: tryAsServiceGas(result.consumedGas) });
|
|
117
|
-
}
|
|
118
|
-
logger.trace `[${serviceId}] accumulate finished with ${Status[status]}`;
|
|
110
|
+
if (result.status !== ReturnStatus.OK) {
|
|
111
|
+
logger.trace `[${serviceId}] accumulate finished with ${ReturnStatus[result.status]} reverting to checkpoint.`;
|
|
112
|
+
return Result.ok({ stateUpdate: checkpoint, consumedGas: tryAsServiceGas(result.consumedGas) });
|
|
119
113
|
}
|
|
114
|
+
logger.trace `[${serviceId}] accumulate finished with ${ReturnStatus[result.status]}`;
|
|
120
115
|
/**
|
|
121
116
|
* PVM invocation returned a hash so we override whatever `yield` host call
|
|
122
117
|
* provided.
|
|
123
118
|
*
|
|
124
119
|
* https://graypaper.fluffylabs.dev/#/7e6ff6a/301202301202?v=0.6.7
|
|
125
120
|
*/
|
|
126
|
-
if (result.
|
|
121
|
+
if (result.memorySlice.length === HASH_SIZE) {
|
|
127
122
|
const memorySlice = Bytes.fromBlob(result.memorySlice, HASH_SIZE);
|
|
128
123
|
newState.yieldedRoot = memorySlice.asOpaque();
|
|
129
124
|
}
|