@typeberry/lib 0.5.0 → 0.5.1-52ed6dc
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/index.cjs +1002 -968
- package/index.d.ts +470 -161
- package/index.mjs +26870 -0
- package/package.json +5 -3
- package/index.js +0 -26836
package/index.d.ts
CHANGED
|
@@ -142,14 +142,12 @@ declare namespace index$A {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
declare enum GpVersion {
|
|
145
|
-
V0_6_7 = "0.6.7",
|
|
146
145
|
V0_7_0 = "0.7.0",
|
|
147
146
|
V0_7_1 = "0.7.1",
|
|
148
147
|
V0_7_2 = "0.7.2"
|
|
149
148
|
}
|
|
150
149
|
declare enum TestSuite {
|
|
151
|
-
W3F_DAVXY = "w3f-davxy"
|
|
152
|
-
JAMDUNA = "jamduna"
|
|
150
|
+
W3F_DAVXY = "w3f-davxy"
|
|
153
151
|
}
|
|
154
152
|
declare const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
|
|
155
153
|
declare const DEFAULT_VERSION = GpVersion.V0_7_2;
|
|
@@ -161,7 +159,6 @@ declare class Compatibility {
|
|
|
161
159
|
static is(...version: GpVersion[]): boolean;
|
|
162
160
|
static isSuite(suite: TestSuite, version?: GpVersion): boolean;
|
|
163
161
|
static isGreaterOrEqual(version: GpVersion): boolean;
|
|
164
|
-
static isLessThan(version: GpVersion): boolean;
|
|
165
162
|
/**
|
|
166
163
|
* Allows selecting different values for different Gray Paper versions from one record.
|
|
167
164
|
*
|
|
@@ -957,7 +954,7 @@ declare class Skipper {
|
|
|
957
954
|
}
|
|
958
955
|
|
|
959
956
|
/** Infer the type that is described by given descriptor `T` */
|
|
960
|
-
type DescribedBy<T> = T extends Descriptor<infer V> ? V : never;
|
|
957
|
+
type DescribedBy<T> = T extends Descriptor<infer V, infer _> ? V : never;
|
|
961
958
|
/**
|
|
962
959
|
* Converts a class `T` into an object with the same fields as the class.
|
|
963
960
|
*/
|
|
@@ -1209,6 +1206,21 @@ declare const custom: <T>({ name, sizeHint, }: {
|
|
|
1209
1206
|
name: string;
|
|
1210
1207
|
sizeHint: SizeHint;
|
|
1211
1208
|
}, encode: (e: Encoder, x: T) => void, decode: (d: Decoder) => T, skip: (s: Skipper) => void) => Descriptor<T>;
|
|
1209
|
+
/**
|
|
1210
|
+
* Descriptor record for union variants.
|
|
1211
|
+
* Each variant can have its own view type, but the union itself won't expose views.
|
|
1212
|
+
*/
|
|
1213
|
+
type UnionDescriptorRecord<TKind extends number, T extends {
|
|
1214
|
+
kind: TKind;
|
|
1215
|
+
}> = {
|
|
1216
|
+
[K in TKind]: Descriptor<Omit<Extract<T, {
|
|
1217
|
+
kind: K;
|
|
1218
|
+
}>, "kind">, unknown>;
|
|
1219
|
+
};
|
|
1220
|
+
/** Tagged union type encoding. */
|
|
1221
|
+
declare const union: <TKind extends number, T extends {
|
|
1222
|
+
kind: TKind;
|
|
1223
|
+
}, TVariants extends UnionDescriptorRecord<TKind, T> = UnionDescriptorRecord<TKind, T>>(name: string, variants: TVariants) => Descriptor<T>;
|
|
1212
1224
|
/** Choose a descriptor depending on the encoding/decoding context. */
|
|
1213
1225
|
declare const select: <T, V = T>({ name, sizeHint, }: {
|
|
1214
1226
|
name: string;
|
|
@@ -1265,13 +1277,17 @@ declare const descriptors_u24: typeof u24;
|
|
|
1265
1277
|
declare const descriptors_u32: typeof u32;
|
|
1266
1278
|
declare const descriptors_u64: typeof u64;
|
|
1267
1279
|
declare const descriptors_u8: typeof u8;
|
|
1280
|
+
declare const descriptors_union: typeof union;
|
|
1268
1281
|
declare const descriptors_varU32: typeof varU32;
|
|
1269
1282
|
declare const descriptors_varU64: typeof varU64;
|
|
1270
1283
|
declare namespace descriptors {
|
|
1271
|
-
export { descriptors_Class as Class, descriptors_TYPICAL_DICTIONARY_LENGTH as TYPICAL_DICTIONARY_LENGTH, descriptors_bitVecFixLen as bitVecFixLen, descriptors_bitVecVarLen as bitVecVarLen, descriptors_blob as blob, descriptors_bool as bool, descriptors_bytes as bytes, descriptors_custom as custom, descriptors_dictionary as dictionary, descriptors_forEachDescriptor as forEachDescriptor, descriptors_i16 as i16, descriptors_i24 as i24, descriptors_i32 as i32, descriptors_i64 as i64, descriptors_i8 as i8, descriptors_nothing as nothing, descriptors_object as object, descriptors_optional as optional, descriptors_pair as pair, descriptors_readonlyArray as readonlyArray, descriptors_select as select, descriptors_sequenceFixLen as sequenceFixLen, descriptors_sequenceVarLen as sequenceVarLen, descriptors_string as string, descriptors_u16 as u16, descriptors_u24 as u24, descriptors_u32 as u32, descriptors_u64 as u64, descriptors_u8 as u8, descriptors_varU32 as varU32, descriptors_varU64 as varU64 };
|
|
1284
|
+
export { descriptors_Class as Class, descriptors_TYPICAL_DICTIONARY_LENGTH as TYPICAL_DICTIONARY_LENGTH, descriptors_bitVecFixLen as bitVecFixLen, descriptors_bitVecVarLen as bitVecVarLen, descriptors_blob as blob, descriptors_bool as bool, descriptors_bytes as bytes, descriptors_custom as custom, descriptors_dictionary as dictionary, descriptors_forEachDescriptor as forEachDescriptor, descriptors_i16 as i16, descriptors_i24 as i24, descriptors_i32 as i32, descriptors_i64 as i64, descriptors_i8 as i8, descriptors_nothing as nothing, descriptors_object as object, descriptors_optional as optional, descriptors_pair as pair, descriptors_readonlyArray as readonlyArray, descriptors_select as select, descriptors_sequenceFixLen as sequenceFixLen, descriptors_sequenceVarLen as sequenceVarLen, descriptors_string as string, descriptors_u16 as u16, descriptors_u24 as u24, descriptors_u32 as u32, descriptors_u64 as u64, descriptors_u8 as u8, descriptors_union as union, descriptors_varU32 as varU32, descriptors_varU64 as varU64 };
|
|
1272
1285
|
export type { descriptors_SequenceVarLenOptions as SequenceVarLenOptions };
|
|
1273
1286
|
}
|
|
1274
1287
|
|
|
1288
|
+
declare const codec: typeof descriptors;
|
|
1289
|
+
|
|
1290
|
+
declare const index$x_Class: typeof Class;
|
|
1275
1291
|
type index$x_ClassConstructor<T> = ClassConstructor<T>;
|
|
1276
1292
|
type index$x_Codec<T> = Codec<T>;
|
|
1277
1293
|
type index$x_CodecRecord<T> = CodecRecord<T>;
|
|
@@ -1293,20 +1309,53 @@ type index$x_ObjectView<T> = ObjectView<T>;
|
|
|
1293
1309
|
declare const index$x_ObjectView: typeof ObjectView;
|
|
1294
1310
|
type index$x_OptionalRecord<T> = OptionalRecord<T>;
|
|
1295
1311
|
type index$x_PropertyKeys<T> = PropertyKeys<T>;
|
|
1312
|
+
type index$x_SequenceVarLenOptions = SequenceVarLenOptions;
|
|
1296
1313
|
type index$x_SequenceView<T, V = T> = SequenceView<T, V>;
|
|
1297
1314
|
declare const index$x_SequenceView: typeof SequenceView;
|
|
1298
1315
|
type index$x_SimpleDescriptorRecord<T> = SimpleDescriptorRecord<T>;
|
|
1299
1316
|
type index$x_SizeHint = SizeHint;
|
|
1317
|
+
declare const index$x_TYPICAL_DICTIONARY_LENGTH: typeof TYPICAL_DICTIONARY_LENGTH;
|
|
1300
1318
|
type index$x_ViewField<T, V> = ViewField<T, V>;
|
|
1301
1319
|
declare const index$x_ViewField: typeof ViewField;
|
|
1302
1320
|
type index$x_ViewOf<T, D extends DescriptorRecord<T>> = ViewOf<T, D>;
|
|
1303
1321
|
declare const index$x_addSizeHints: typeof addSizeHints;
|
|
1322
|
+
declare const index$x_bitVecFixLen: typeof bitVecFixLen;
|
|
1323
|
+
declare const index$x_bitVecVarLen: typeof bitVecVarLen;
|
|
1324
|
+
declare const index$x_blob: typeof blob;
|
|
1325
|
+
declare const index$x_bool: typeof bool;
|
|
1326
|
+
declare const index$x_bytes: typeof bytes;
|
|
1327
|
+
declare const index$x_codec: typeof codec;
|
|
1328
|
+
declare const index$x_custom: typeof custom;
|
|
1304
1329
|
declare const index$x_decodeVariableLengthExtraBytes: typeof decodeVariableLengthExtraBytes;
|
|
1330
|
+
declare const index$x_dictionary: typeof dictionary;
|
|
1331
|
+
declare const index$x_forEachDescriptor: typeof forEachDescriptor;
|
|
1332
|
+
declare const index$x_i16: typeof i16;
|
|
1333
|
+
declare const index$x_i24: typeof i24;
|
|
1334
|
+
declare const index$x_i32: typeof i32;
|
|
1335
|
+
declare const index$x_i64: typeof i64;
|
|
1336
|
+
declare const index$x_i8: typeof i8;
|
|
1337
|
+
declare const index$x_nothing: typeof nothing;
|
|
1338
|
+
declare const index$x_object: typeof object;
|
|
1339
|
+
declare const index$x_optional: typeof optional;
|
|
1340
|
+
declare const index$x_pair: typeof pair;
|
|
1341
|
+
declare const index$x_readonlyArray: typeof readonlyArray;
|
|
1342
|
+
declare const index$x_select: typeof select;
|
|
1343
|
+
declare const index$x_sequenceFixLen: typeof sequenceFixLen;
|
|
1344
|
+
declare const index$x_sequenceVarLen: typeof sequenceVarLen;
|
|
1345
|
+
declare const index$x_string: typeof string;
|
|
1305
1346
|
declare const index$x_tryAsExactBytes: typeof tryAsExactBytes;
|
|
1347
|
+
declare const index$x_u16: typeof u16;
|
|
1348
|
+
declare const index$x_u24: typeof u24;
|
|
1349
|
+
declare const index$x_u32: typeof u32;
|
|
1350
|
+
declare const index$x_u64: typeof u64;
|
|
1351
|
+
declare const index$x_u8: typeof u8;
|
|
1352
|
+
declare const index$x_union: typeof union;
|
|
1306
1353
|
declare const index$x_validateLength: typeof validateLength;
|
|
1354
|
+
declare const index$x_varU32: typeof varU32;
|
|
1355
|
+
declare const index$x_varU64: typeof varU64;
|
|
1307
1356
|
declare namespace index$x {
|
|
1308
|
-
export { index$x_Decoder as Decoder, index$x_Descriptor as Descriptor, index$x_Encoder as Encoder, index$x_EndOfDataError as EndOfDataError, index$x_ObjectView as ObjectView, index$x_SequenceView as SequenceView, index$x_ViewField as ViewField, index$x_addSizeHints as addSizeHints,
|
|
1309
|
-
export type { index$x_ClassConstructor as ClassConstructor, index$x_Codec as Codec, index$x_CodecRecord as CodecRecord, index$x_CodecWithView as CodecWithView, index$x_Decode as Decode, index$x_DescribedBy as DescribedBy, index$x_DescriptorRecord as DescriptorRecord, index$x_Encode as Encode, index$x_LengthRange as LengthRange, index$x_OptionalRecord as OptionalRecord, Options$1 as Options, index$x_PropertyKeys as PropertyKeys, index$x_SimpleDescriptorRecord as SimpleDescriptorRecord, index$x_SizeHint as SizeHint, index$x_ViewOf as ViewOf };
|
|
1357
|
+
export { index$x_Class as Class, index$x_Decoder as Decoder, index$x_Descriptor as Descriptor, index$x_Encoder as Encoder, index$x_EndOfDataError as EndOfDataError, index$x_ObjectView as ObjectView, index$x_SequenceView as SequenceView, index$x_TYPICAL_DICTIONARY_LENGTH as TYPICAL_DICTIONARY_LENGTH, index$x_ViewField as ViewField, index$x_addSizeHints as addSizeHints, index$x_bitVecFixLen as bitVecFixLen, index$x_bitVecVarLen as bitVecVarLen, index$x_blob as blob, index$x_bool as bool, index$x_bytes as bytes, index$x_codec as codec, index$x_custom as custom, index$x_decodeVariableLengthExtraBytes as decodeVariableLengthExtraBytes, index$x_dictionary as dictionary, index$x_forEachDescriptor as forEachDescriptor, index$x_i16 as i16, index$x_i24 as i24, index$x_i32 as i32, index$x_i64 as i64, index$x_i8 as i8, index$x_nothing as nothing, index$x_object as object, index$x_optional as optional, index$x_pair as pair, index$x_readonlyArray as readonlyArray, index$x_select as select, index$x_sequenceFixLen as sequenceFixLen, index$x_sequenceVarLen as sequenceVarLen, index$x_string as string, index$x_tryAsExactBytes as tryAsExactBytes, index$x_u16 as u16, index$x_u24 as u24, index$x_u32 as u32, index$x_u64 as u64, index$x_u8 as u8, index$x_union as union, index$x_validateLength as validateLength, index$x_varU32 as varU32, index$x_varU64 as varU64 };
|
|
1358
|
+
export type { index$x_ClassConstructor as ClassConstructor, index$x_Codec as Codec, index$x_CodecRecord as CodecRecord, index$x_CodecWithView as CodecWithView, index$x_Decode as Decode, index$x_DescribedBy as DescribedBy, index$x_DescriptorRecord as DescriptorRecord, index$x_Encode as Encode, index$x_LengthRange as LengthRange, index$x_OptionalRecord as OptionalRecord, Options$1 as Options, index$x_PropertyKeys as PropertyKeys, index$x_SequenceVarLenOptions as SequenceVarLenOptions, index$x_SimpleDescriptorRecord as SimpleDescriptorRecord, index$x_SizeHint as SizeHint, index$x_ViewOf as ViewOf };
|
|
1310
1359
|
}
|
|
1311
1360
|
|
|
1312
1361
|
/**
|
|
@@ -1963,6 +2012,8 @@ declare class TruncatedHashDictionary<T extends OpaqueHash, V> {
|
|
|
1963
2012
|
set(key: T | TruncatedHash, value: V): void;
|
|
1964
2013
|
/** Remove a value that matches the key on `TRUNCATED_HASH_SIZE`. */
|
|
1965
2014
|
delete(key: T | TruncatedHash): void;
|
|
2015
|
+
/** Iterator over keys of the dictionary. */
|
|
2016
|
+
keys(): Iterator<TruncatedHash, any, any> & Iterable<TruncatedHash>;
|
|
1966
2017
|
/** Iterator over values of the dictionary. */
|
|
1967
2018
|
values(): Iterator<V, any, any> & Iterable<V>;
|
|
1968
2019
|
/** Iterator over entries of the dictionary (with truncated keys) */
|
|
@@ -2008,21 +2059,43 @@ declare namespace index$v {
|
|
|
2008
2059
|
}
|
|
2009
2060
|
|
|
2010
2061
|
declare namespace bandersnatch_d_exports {
|
|
2011
|
-
export { batch_verify_tickets, __wbg_init$2 as default, derive_public_key, initSync$2 as initSync, ring_commitment, verify_seal };
|
|
2062
|
+
export { batch_verify_tickets, __wbg_init$2 as default, derive_public_key, generate_seal, initSync$2 as initSync, ring_commitment, verify_seal, vrf_output_hash };
|
|
2012
2063
|
export type { InitInput$2 as InitInput, InitOutput$2 as InitOutput, SyncInitInput$2 as SyncInitInput };
|
|
2013
2064
|
}
|
|
2014
2065
|
/* tslint:disable */
|
|
2015
2066
|
/* eslint-disable */
|
|
2016
2067
|
/**
|
|
2017
|
-
*
|
|
2068
|
+
* Compute VRF output hash from a secret seed and input data.
|
|
2069
|
+
*
|
|
2070
|
+
* This function derives a deterministic VRF output hash without generating a proof.
|
|
2071
|
+
* Unlike `generate_seal`, this produces only the output hash, not a verifiable signature.
|
|
2072
|
+
*
|
|
2073
|
+
* # Arguments
|
|
2074
|
+
* * `secret_seed` - Seed used to derive the secret key
|
|
2075
|
+
* * `input` - VRF input data to be hashed
|
|
2076
|
+
*
|
|
2077
|
+
* # Returns
|
|
2078
|
+
* A byte vector with the following format:
|
|
2079
|
+
* - On success (33 bytes):
|
|
2080
|
+
* - Byte 0: Status code `0` (RESULT_OK)
|
|
2081
|
+
* - Bytes 1-32: VRF output hash (32 bytes)
|
|
2082
|
+
* - On error (1 byte):
|
|
2083
|
+
* - Byte 0: Status code `1` (RESULT_ERR)
|
|
2084
|
+
*
|
|
2085
|
+
* Returns an error if the input cannot be converted to a valid VRF input point.
|
|
2018
2086
|
*/
|
|
2019
|
-
declare function
|
|
2087
|
+
declare function vrf_output_hash(secret_seed: Uint8Array, input: Uint8Array): Uint8Array;
|
|
2020
2088
|
/**
|
|
2021
|
-
*
|
|
2089
|
+
* Verify multiple tickets at once as defined in:
|
|
2090
|
+
* https://graypaper.fluffylabs.dev/#/68eaa1f/0f3e000f3e00?v=0.6.4
|
|
2022
2091
|
*
|
|
2023
|
-
*
|
|
2092
|
+
* NOTE: the aux_data of VRF function is empty!
|
|
2024
2093
|
*/
|
|
2025
|
-
declare function
|
|
2094
|
+
declare function batch_verify_tickets(ring_size: number, commitment: Uint8Array, tickets_data: Uint8Array, vrf_input_data_len: number): Uint8Array;
|
|
2095
|
+
/**
|
|
2096
|
+
* Generate ring commitment given concatenation of ring keys.
|
|
2097
|
+
*/
|
|
2098
|
+
declare function ring_commitment(keys: Uint8Array): Uint8Array;
|
|
2026
2099
|
/**
|
|
2027
2100
|
* Seal verification as defined in:
|
|
2028
2101
|
* https://graypaper.fluffylabs.dev/#/68eaa1f/0eff000eff00?v=0.6.4
|
|
@@ -2031,19 +2104,41 @@ declare function derive_public_key(seed: Uint8Array): Uint8Array;
|
|
|
2031
2104
|
*/
|
|
2032
2105
|
declare function verify_seal(signer_key: Uint8Array, seal_data: Uint8Array, payload: Uint8Array, aux_data: Uint8Array): Uint8Array;
|
|
2033
2106
|
/**
|
|
2034
|
-
*
|
|
2035
|
-
* https://graypaper.fluffylabs.dev/#/68eaa1f/0f3e000f3e00?v=0.6.4
|
|
2107
|
+
* Generate seal that is verifiable using `verify_seal` function.
|
|
2036
2108
|
*
|
|
2037
|
-
*
|
|
2109
|
+
* # Arguments
|
|
2110
|
+
* * `secret_seed` - Seed used to derive the secret key
|
|
2111
|
+
* * `input` - VRF input data
|
|
2112
|
+
* * `aux_data` - Auxiliary data for the VRF proof
|
|
2113
|
+
*
|
|
2114
|
+
* # Returns
|
|
2115
|
+
* A byte vector with the following format:
|
|
2116
|
+
* - On success (97 bytes):
|
|
2117
|
+
* - Byte 0: Status code `0` (RESULT_OK)
|
|
2118
|
+
* - Bytes 1-32: Serialized VRF output (32 bytes, compressed) NOTE: not output hash!
|
|
2119
|
+
* - Bytes 33-96: Serialized IETF VRF proof (64 bytes, compressed)
|
|
2120
|
+
* - On error (1 byte):
|
|
2121
|
+
* - Byte 0: Status code `1` (RESULT_ERR)
|
|
2122
|
+
*
|
|
2123
|
+
* Returns an error if the input cannot be converted to a valid VRF input point
|
|
2124
|
+
* or if serialization of the output or proof fails.
|
|
2038
2125
|
*/
|
|
2039
|
-
declare function
|
|
2126
|
+
declare function generate_seal(secret_seed: Uint8Array, input: Uint8Array, aux_data: Uint8Array): Uint8Array;
|
|
2127
|
+
/**
|
|
2128
|
+
* Derive Private and Public Key from Seed
|
|
2129
|
+
*
|
|
2130
|
+
* returns: `Vec<u8>` containing the exit (1 byte) status followed by the (32 bytes) public key
|
|
2131
|
+
*/
|
|
2132
|
+
declare function derive_public_key(seed: Uint8Array): Uint8Array;
|
|
2040
2133
|
type InitInput$2 = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
2041
2134
|
interface InitOutput$2 {
|
|
2042
2135
|
readonly memory: WebAssembly.Memory;
|
|
2043
|
-
readonly
|
|
2136
|
+
readonly batch_verify_tickets: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
2044
2137
|
readonly derive_public_key: (a: number, b: number) => [number, number];
|
|
2138
|
+
readonly generate_seal: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
2139
|
+
readonly ring_commitment: (a: number, b: number) => [number, number];
|
|
2045
2140
|
readonly verify_seal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
|
|
2046
|
-
readonly
|
|
2141
|
+
readonly vrf_output_hash: (a: number, b: number, c: number, d: number) => [number, number];
|
|
2047
2142
|
readonly __wbindgen_export_0: WebAssembly.Table;
|
|
2048
2143
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
2049
2144
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
@@ -2693,7 +2788,7 @@ declare const encodeUnsealedHeader: (view: HeaderView) => BytesBlob;
|
|
|
2693
2788
|
/**
|
|
2694
2789
|
* The header of the JAM block.
|
|
2695
2790
|
*
|
|
2696
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
2791
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/0c66000c7200?v=0.7.2
|
|
2697
2792
|
*/
|
|
2698
2793
|
declare class Header extends WithDebug {
|
|
2699
2794
|
static Codec: Descriptor<Header & CodecRecord<Header>, ViewOf<Header & CodecRecord<Header>, {
|
|
@@ -2715,9 +2810,9 @@ declare class Header extends WithDebug {
|
|
|
2715
2810
|
attempt: Descriptor<number & WithBytesRepresentation<1> & WithOpaque<"TicketAttempt[0|1|2]">, U8>;
|
|
2716
2811
|
}>>>;
|
|
2717
2812
|
}> | null>;
|
|
2718
|
-
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
2719
2813
|
bandersnatchBlockAuthorIndex: Descriptor<number & WithBytesRepresentation<2> & WithOpaque<"ValidatorIndex[u16]">, Bytes<2>>;
|
|
2720
2814
|
entropySource: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
2815
|
+
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
2721
2816
|
seal: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
2722
2817
|
}>>;
|
|
2723
2818
|
static create(h: CodecRecord<Header>): Header & CodecRecord<Header>;
|
|
@@ -2726,35 +2821,35 @@ declare class Header extends WithDebug {
|
|
|
2726
2821
|
*
|
|
2727
2822
|
* In case of the genesis block, the hash will be zero.
|
|
2728
2823
|
*/
|
|
2729
|
-
parentHeaderHash: HeaderHash;
|
|
2824
|
+
readonly parentHeaderHash: HeaderHash;
|
|
2730
2825
|
/** `H_r`: The state trie root hash before executing that block. */
|
|
2731
|
-
priorStateRoot: StateRootHash;
|
|
2826
|
+
readonly priorStateRoot: StateRootHash;
|
|
2732
2827
|
/** `H_x`: The hash of block extrinsic. */
|
|
2733
|
-
extrinsicHash: ExtrinsicHash;
|
|
2828
|
+
readonly extrinsicHash: ExtrinsicHash;
|
|
2734
2829
|
/** `H_t`: JAM time-slot index. */
|
|
2735
|
-
timeSlotIndex: TimeSlot;
|
|
2830
|
+
readonly timeSlotIndex: TimeSlot;
|
|
2736
2831
|
/**
|
|
2737
2832
|
* `H_e`: Key and entropy relevant to the following epoch in case the ticket
|
|
2738
2833
|
* contest does not complete adequately.
|
|
2739
2834
|
*/
|
|
2740
|
-
epochMarker: EpochMarker | null;
|
|
2835
|
+
readonly epochMarker: EpochMarker | null;
|
|
2741
2836
|
/**
|
|
2742
2837
|
* `H_w`: Winning tickets provides the series of 600 slot sealing "tickets"
|
|
2743
2838
|
* for the next epoch.
|
|
2744
2839
|
*/
|
|
2745
|
-
ticketsMarker: TicketsMarker | null;
|
|
2840
|
+
readonly ticketsMarker: TicketsMarker | null;
|
|
2746
2841
|
/** `H_i`: Block author's index in the current validator set. */
|
|
2747
|
-
bandersnatchBlockAuthorIndex: ValidatorIndex;
|
|
2842
|
+
readonly bandersnatchBlockAuthorIndex: ValidatorIndex;
|
|
2748
2843
|
/** `H_v`: Entropy-yielding VRF signature. */
|
|
2749
|
-
entropySource: BandersnatchVrfSignature;
|
|
2844
|
+
readonly entropySource: BandersnatchVrfSignature;
|
|
2750
2845
|
/** `H_o`: Sequence of keys of newly misbehaving validators. */
|
|
2751
|
-
offendersMarker: Ed25519Key[];
|
|
2846
|
+
readonly offendersMarker: Ed25519Key[];
|
|
2752
2847
|
/**
|
|
2753
2848
|
* `H_s`: Block seal.
|
|
2754
2849
|
*
|
|
2755
2850
|
* https://graypaper.fluffylabs.dev/#/579bd12/0d0c010d1101
|
|
2756
2851
|
*/
|
|
2757
|
-
seal: BandersnatchVrfSignature;
|
|
2852
|
+
readonly seal: BandersnatchVrfSignature;
|
|
2758
2853
|
private constructor();
|
|
2759
2854
|
/** Create an empty header with some dummy values. */
|
|
2760
2855
|
static empty(): Header;
|
|
@@ -2781,9 +2876,9 @@ declare const headerViewWithHashCodec: Descriptor<WithHash<OpaqueHash & WithOpaq
|
|
|
2781
2876
|
attempt: Descriptor<number & WithBytesRepresentation<1> & WithOpaque<"TicketAttempt[0|1|2]">, U8>;
|
|
2782
2877
|
}>>>;
|
|
2783
2878
|
}> | null>;
|
|
2784
|
-
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
2785
2879
|
bandersnatchBlockAuthorIndex: Descriptor<number & WithBytesRepresentation<2> & WithOpaque<"ValidatorIndex[u16]">, Bytes<2>>;
|
|
2786
2880
|
entropySource: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
2881
|
+
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
2787
2882
|
seal: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
2788
2883
|
}>>, ViewOf<WithHash<OpaqueHash & WithOpaque<"HeaderHash">, ViewOf<Header & CodecRecord<Header>, {
|
|
2789
2884
|
parentHeaderHash: Descriptor<Bytes<32> & WithOpaque<"HeaderHash">, Bytes<32>>;
|
|
@@ -2804,9 +2899,9 @@ declare const headerViewWithHashCodec: Descriptor<WithHash<OpaqueHash & WithOpaq
|
|
|
2804
2899
|
attempt: Descriptor<number & WithBytesRepresentation<1> & WithOpaque<"TicketAttempt[0|1|2]">, U8>;
|
|
2805
2900
|
}>>>;
|
|
2806
2901
|
}> | null>;
|
|
2807
|
-
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
2808
2902
|
bandersnatchBlockAuthorIndex: Descriptor<number & WithBytesRepresentation<2> & WithOpaque<"ValidatorIndex[u16]">, Bytes<2>>;
|
|
2809
2903
|
entropySource: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
2904
|
+
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
2810
2905
|
seal: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
2811
2906
|
}>>, {
|
|
2812
2907
|
hash: Descriptor<Bytes<32> & WithOpaque<"HeaderHash">, Bytes<32>>;
|
|
@@ -2829,9 +2924,9 @@ declare const headerViewWithHashCodec: Descriptor<WithHash<OpaqueHash & WithOpaq
|
|
|
2829
2924
|
attempt: Descriptor<number & WithBytesRepresentation<1> & WithOpaque<"TicketAttempt[0|1|2]">, U8>;
|
|
2830
2925
|
}>>>;
|
|
2831
2926
|
}> | null>;
|
|
2832
|
-
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
2833
2927
|
bandersnatchBlockAuthorIndex: Descriptor<number & WithBytesRepresentation<2> & WithOpaque<"ValidatorIndex[u16]">, Bytes<2>>;
|
|
2834
2928
|
entropySource: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
2929
|
+
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
2835
2930
|
seal: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
2836
2931
|
}>, ViewOf<Header & CodecRecord<Header>, {
|
|
2837
2932
|
parentHeaderHash: Descriptor<Bytes<32> & WithOpaque<"HeaderHash">, Bytes<32>>;
|
|
@@ -2852,9 +2947,9 @@ declare const headerViewWithHashCodec: Descriptor<WithHash<OpaqueHash & WithOpaq
|
|
|
2852
2947
|
attempt: Descriptor<number & WithBytesRepresentation<1> & WithOpaque<"TicketAttempt[0|1|2]">, U8>;
|
|
2853
2948
|
}>>>;
|
|
2854
2949
|
}> | null>;
|
|
2855
|
-
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
2856
2950
|
bandersnatchBlockAuthorIndex: Descriptor<number & WithBytesRepresentation<2> & WithOpaque<"ValidatorIndex[u16]">, Bytes<2>>;
|
|
2857
2951
|
entropySource: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
2952
|
+
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
2858
2953
|
seal: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
2859
2954
|
}>>;
|
|
2860
2955
|
}>>;
|
|
@@ -3045,13 +3140,29 @@ declare enum WorkExecResultKind {
|
|
|
3045
3140
|
/** `BIG`: the code was too big (beyond the maximum allowed size `W_C`) */
|
|
3046
3141
|
codeOversize = 6
|
|
3047
3142
|
}
|
|
3143
|
+
type WorkExecResultUnion = {
|
|
3144
|
+
kind: WorkExecResultKind.ok;
|
|
3145
|
+
okBlob: BytesBlob;
|
|
3146
|
+
} | {
|
|
3147
|
+
kind: WorkExecResultKind.outOfGas;
|
|
3148
|
+
} | {
|
|
3149
|
+
kind: WorkExecResultKind.panic;
|
|
3150
|
+
} | {
|
|
3151
|
+
kind: WorkExecResultKind.incorrectNumberOfExports;
|
|
3152
|
+
} | {
|
|
3153
|
+
kind: WorkExecResultKind.digestTooBig;
|
|
3154
|
+
} | {
|
|
3155
|
+
kind: WorkExecResultKind.badCode;
|
|
3156
|
+
} | {
|
|
3157
|
+
kind: WorkExecResultKind.codeOversize;
|
|
3158
|
+
};
|
|
3048
3159
|
/** The execution result of some work-package. */
|
|
3049
3160
|
declare class WorkExecResult extends WithDebug {
|
|
3050
3161
|
/** The execution result tag. */
|
|
3051
3162
|
readonly kind: WorkExecResultKind;
|
|
3052
3163
|
/** Optional octet sequence - available only if `kind === ok` */
|
|
3053
3164
|
readonly okBlob: BytesBlob | null;
|
|
3054
|
-
static Codec: Descriptor<WorkExecResult,
|
|
3165
|
+
static Codec: Descriptor<WorkExecResult, WorkExecResultUnion>;
|
|
3055
3166
|
constructor(
|
|
3056
3167
|
/** The execution result tag. */
|
|
3057
3168
|
kind: WorkExecResultKind,
|
|
@@ -3126,7 +3237,7 @@ declare class WorkResult {
|
|
|
3126
3237
|
codeHash: Descriptor<Bytes<32> & WithOpaque<"CodeHash">, Bytes<32>>;
|
|
3127
3238
|
payloadHash: Descriptor<Bytes<32>, Bytes<32>>;
|
|
3128
3239
|
gas: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, Bytes<8>>;
|
|
3129
|
-
result: Descriptor<WorkExecResult,
|
|
3240
|
+
result: Descriptor<WorkExecResult, WorkExecResultUnion>;
|
|
3130
3241
|
load: Descriptor<WorkRefineLoad, ViewOf<WorkRefineLoad, {
|
|
3131
3242
|
gasUsed: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
3132
3243
|
importedSegments: Descriptor<U32, U32>;
|
|
@@ -3290,7 +3401,7 @@ declare function workItemExtrinsicsCodec(workItems: WorkItem[]): Descriptor<read
|
|
|
3290
3401
|
/**
|
|
3291
3402
|
* Work Item which is a part of some work package.
|
|
3292
3403
|
*
|
|
3293
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
3404
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/1a86001a9100?v=0.7.2
|
|
3294
3405
|
*/
|
|
3295
3406
|
declare class WorkItem extends WithDebug {
|
|
3296
3407
|
/** `s`: related service */
|
|
@@ -3457,16 +3568,16 @@ declare class WorkPackageSpec extends WithDebug {
|
|
|
3457
3568
|
/**
|
|
3458
3569
|
* A report of execution of some work package.
|
|
3459
3570
|
*
|
|
3460
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
3571
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/13bb0113c301?v=0.7.2
|
|
3461
3572
|
*/
|
|
3462
|
-
declare class
|
|
3573
|
+
declare class WorkReport extends WithDebug {
|
|
3463
3574
|
/** `s`: Work package specification. */
|
|
3464
3575
|
readonly workPackageSpec: WorkPackageSpec;
|
|
3465
|
-
/** `
|
|
3576
|
+
/** `c`: Refinement context. */
|
|
3466
3577
|
readonly context: RefineContext;
|
|
3467
|
-
/**
|
|
3578
|
+
/** *`c`*: Core index on which the work is done. */
|
|
3468
3579
|
readonly coreIndex: CoreIndex;
|
|
3469
|
-
/**
|
|
3580
|
+
/** *`a`*: Hash of the authorizer. */
|
|
3470
3581
|
readonly authorizerHash: AuthorizerHash;
|
|
3471
3582
|
/** `o`: Authorization output. */
|
|
3472
3583
|
readonly authorizationOutput: BytesBlob;
|
|
@@ -3477,17 +3588,71 @@ declare class WorkReportNoCodec extends WithDebug {
|
|
|
3477
3588
|
readonly segmentRootLookup: readonly WorkPackageInfo[];
|
|
3478
3589
|
/** `r`: The results of evaluation of each of the items in the work package. */
|
|
3479
3590
|
readonly results: FixedSizeArray<WorkResult, WorkItemsCount>;
|
|
3480
|
-
/**
|
|
3591
|
+
/** *`g`*: Gas used during authorization. */
|
|
3481
3592
|
readonly authorizationGasUsed: ServiceGas;
|
|
3482
|
-
static
|
|
3593
|
+
static Codec: Descriptor<WorkReport, ViewOf<WorkReport, {
|
|
3594
|
+
workPackageSpec: Descriptor<WorkPackageSpec, ViewOf<WorkPackageSpec, {
|
|
3595
|
+
hash: Descriptor<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>;
|
|
3596
|
+
length: Descriptor<U32, Bytes<4>>;
|
|
3597
|
+
erasureRoot: Descriptor<Bytes<32>, Bytes<32>>;
|
|
3598
|
+
exportsRoot: Descriptor<Bytes<32> & WithOpaque<"ExportsRootHash">, Bytes<32>>;
|
|
3599
|
+
exportsCount: Descriptor<U16, Bytes<2>>;
|
|
3600
|
+
}>>;
|
|
3601
|
+
context: Descriptor<RefineContext, ViewOf<RefineContext, {
|
|
3602
|
+
anchor: Descriptor<Bytes<32> & WithOpaque<"HeaderHash">, Bytes<32>>;
|
|
3603
|
+
stateRoot: Descriptor<Bytes<32> & WithOpaque<"StateRootHash">, Bytes<32>>;
|
|
3604
|
+
beefyRoot: Descriptor<Bytes<32> & WithOpaque<"BeefyHash">, Bytes<32>>;
|
|
3605
|
+
lookupAnchor: Descriptor<Bytes<32> & WithOpaque<"HeaderHash">, Bytes<32>>;
|
|
3606
|
+
lookupAnchorSlot: Descriptor<number & WithBytesRepresentation<4> & WithOpaque<"TimeSlot[u32]">, Bytes<4>>;
|
|
3607
|
+
prerequisites: Descriptor<(Bytes<32> & WithOpaque<"WorkPackageHash">)[], SequenceView<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>>;
|
|
3608
|
+
}>>;
|
|
3609
|
+
coreIndex: Descriptor<number & WithBytesRepresentation<2> & WithOpaque<"CoreIndex[u16]">, U32>;
|
|
3610
|
+
authorizerHash: Descriptor<Bytes<32> & WithOpaque<"AuthorizerHash">, Bytes<32>>;
|
|
3611
|
+
authorizationGasUsed: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
3612
|
+
authorizationOutput: Descriptor<BytesBlob, BytesBlob>;
|
|
3613
|
+
segmentRootLookup: Descriptor<readonly WorkPackageInfo[], SequenceView<WorkPackageInfo, ViewOf<WorkPackageInfo, {
|
|
3614
|
+
workPackageHash: Descriptor<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>;
|
|
3615
|
+
segmentTreeRoot: Descriptor<Bytes<32> & WithOpaque<"ExportsRootHash">, Bytes<32>>;
|
|
3616
|
+
}>>>;
|
|
3617
|
+
results: Descriptor<FixedSizeArray<WorkResult, U8>, SequenceView<WorkResult, ViewOf<WorkResult, {
|
|
3618
|
+
serviceId: Descriptor<number & WithBytesRepresentation<4> & WithOpaque<"ServiceId[u32]">, Bytes<4>>;
|
|
3619
|
+
codeHash: Descriptor<Bytes<32> & WithOpaque<"CodeHash">, Bytes<32>>;
|
|
3620
|
+
payloadHash: Descriptor<Bytes<32>, Bytes<32>>;
|
|
3621
|
+
gas: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, Bytes<8>>;
|
|
3622
|
+
result: Descriptor<WorkExecResult, {
|
|
3623
|
+
kind: WorkExecResultKind.ok;
|
|
3624
|
+
okBlob: BytesBlob;
|
|
3625
|
+
} | {
|
|
3626
|
+
kind: WorkExecResultKind.outOfGas;
|
|
3627
|
+
} | {
|
|
3628
|
+
kind: WorkExecResultKind.panic;
|
|
3629
|
+
} | {
|
|
3630
|
+
kind: WorkExecResultKind.incorrectNumberOfExports;
|
|
3631
|
+
} | {
|
|
3632
|
+
kind: WorkExecResultKind.digestTooBig;
|
|
3633
|
+
} | {
|
|
3634
|
+
kind: WorkExecResultKind.badCode;
|
|
3635
|
+
} | {
|
|
3636
|
+
kind: WorkExecResultKind.codeOversize;
|
|
3637
|
+
}>;
|
|
3638
|
+
load: Descriptor<WorkRefineLoad, ViewOf<WorkRefineLoad, {
|
|
3639
|
+
gasUsed: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
3640
|
+
importedSegments: Descriptor<U32, U32>;
|
|
3641
|
+
extrinsicCount: Descriptor<U32, U32>;
|
|
3642
|
+
extrinsicSize: Descriptor<U32, U32>;
|
|
3643
|
+
exportedSegments: Descriptor<U32, U32>;
|
|
3644
|
+
}>>;
|
|
3645
|
+
}>>>;
|
|
3646
|
+
}>>;
|
|
3647
|
+
static create({ workPackageSpec, context, coreIndex, authorizerHash, authorizationOutput, segmentRootLookup, results, authorizationGasUsed, }: CodecRecord<WorkReport>): WorkReport;
|
|
3483
3648
|
protected constructor(
|
|
3484
3649
|
/** `s`: Work package specification. */
|
|
3485
3650
|
workPackageSpec: WorkPackageSpec,
|
|
3486
|
-
/** `
|
|
3651
|
+
/** `c`: Refinement context. */
|
|
3487
3652
|
context: RefineContext,
|
|
3488
|
-
/**
|
|
3653
|
+
/** *`c`*: Core index on which the work is done. */
|
|
3489
3654
|
coreIndex: CoreIndex,
|
|
3490
|
-
/**
|
|
3655
|
+
/** *`a`*: Hash of the authorizer. */
|
|
3491
3656
|
authorizerHash: AuthorizerHash,
|
|
3492
3657
|
/** `o`: Authorization output. */
|
|
3493
3658
|
authorizationOutput: BytesBlob,
|
|
@@ -3498,63 +3663,18 @@ declare class WorkReportNoCodec extends WithDebug {
|
|
|
3498
3663
|
segmentRootLookup: readonly WorkPackageInfo[],
|
|
3499
3664
|
/** `r`: The results of evaluation of each of the items in the work package. */
|
|
3500
3665
|
results: FixedSizeArray<WorkResult, WorkItemsCount>,
|
|
3501
|
-
/**
|
|
3666
|
+
/** *`g`*: Gas used during authorization. */
|
|
3502
3667
|
authorizationGasUsed: ServiceGas);
|
|
3503
3668
|
}
|
|
3504
|
-
declare const WorkReportCodec: Descriptor<WorkReportNoCodec, ViewOf<WorkReportNoCodec, {
|
|
3505
|
-
workPackageSpec: Descriptor<WorkPackageSpec, ViewOf<WorkPackageSpec, {
|
|
3506
|
-
hash: Descriptor<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>;
|
|
3507
|
-
length: Descriptor<U32, Bytes<4>>;
|
|
3508
|
-
erasureRoot: Descriptor<Bytes<32>, Bytes<32>>;
|
|
3509
|
-
exportsRoot: Descriptor<Bytes<32> & WithOpaque<"ExportsRootHash">, Bytes<32>>;
|
|
3510
|
-
exportsCount: Descriptor<U16, Bytes<2>>;
|
|
3511
|
-
}>>;
|
|
3512
|
-
context: Descriptor<RefineContext, ViewOf<RefineContext, {
|
|
3513
|
-
anchor: Descriptor<Bytes<32> & WithOpaque<"HeaderHash">, Bytes<32>>;
|
|
3514
|
-
stateRoot: Descriptor<Bytes<32> & WithOpaque<"StateRootHash">, Bytes<32>>;
|
|
3515
|
-
beefyRoot: Descriptor<Bytes<32> & WithOpaque<"BeefyHash">, Bytes<32>>;
|
|
3516
|
-
lookupAnchor: Descriptor<Bytes<32> & WithOpaque<"HeaderHash">, Bytes<32>>;
|
|
3517
|
-
lookupAnchorSlot: Descriptor<number & WithBytesRepresentation<4> & WithOpaque<"TimeSlot[u32]">, Bytes<4>>;
|
|
3518
|
-
prerequisites: Descriptor<(Bytes<32> & WithOpaque<"WorkPackageHash">)[], SequenceView<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>>;
|
|
3519
|
-
}>>;
|
|
3520
|
-
coreIndex: Descriptor<number & WithBytesRepresentation<2> & WithOpaque<"CoreIndex[u16]">, U32>;
|
|
3521
|
-
authorizerHash: Descriptor<Bytes<32> & WithOpaque<"AuthorizerHash">, Bytes<32>>;
|
|
3522
|
-
authorizationGasUsed: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
3523
|
-
authorizationOutput: Descriptor<BytesBlob, BytesBlob>;
|
|
3524
|
-
segmentRootLookup: Descriptor<readonly WorkPackageInfo[], SequenceView<WorkPackageInfo, ViewOf<WorkPackageInfo, {
|
|
3525
|
-
workPackageHash: Descriptor<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>;
|
|
3526
|
-
segmentTreeRoot: Descriptor<Bytes<32> & WithOpaque<"ExportsRootHash">, Bytes<32>>;
|
|
3527
|
-
}>>>;
|
|
3528
|
-
results: Descriptor<FixedSizeArray<WorkResult, U8>, SequenceView<WorkResult, ViewOf<WorkResult, {
|
|
3529
|
-
serviceId: Descriptor<number & WithBytesRepresentation<4> & WithOpaque<"ServiceId[u32]">, Bytes<4>>;
|
|
3530
|
-
codeHash: Descriptor<Bytes<32> & WithOpaque<"CodeHash">, Bytes<32>>;
|
|
3531
|
-
payloadHash: Descriptor<Bytes<32>, Bytes<32>>;
|
|
3532
|
-
gas: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, Bytes<8>>;
|
|
3533
|
-
result: Descriptor<WorkExecResult, WorkExecResult>;
|
|
3534
|
-
load: Descriptor<WorkRefineLoad, ViewOf<WorkRefineLoad, {
|
|
3535
|
-
gasUsed: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
3536
|
-
importedSegments: Descriptor<U32, U32>;
|
|
3537
|
-
extrinsicCount: Descriptor<U32, U32>;
|
|
3538
|
-
extrinsicSize: Descriptor<U32, U32>;
|
|
3539
|
-
exportedSegments: Descriptor<U32, U32>;
|
|
3540
|
-
}>>;
|
|
3541
|
-
}>>>;
|
|
3542
|
-
}>>;
|
|
3543
|
-
declare class WorkReport extends WorkReportNoCodec {
|
|
3544
|
-
static Codec: typeof WorkReportCodec;
|
|
3545
|
-
}
|
|
3546
3669
|
|
|
3547
3670
|
type workReport_WorkPackageSpec = WorkPackageSpec;
|
|
3548
3671
|
declare const workReport_WorkPackageSpec: typeof WorkPackageSpec;
|
|
3549
3672
|
type workReport_WorkReport = WorkReport;
|
|
3550
3673
|
declare const workReport_WorkReport: typeof WorkReport;
|
|
3551
|
-
type workReport_WorkReportNoCodec = WorkReportNoCodec;
|
|
3552
|
-
declare const workReport_WorkReportNoCodec: typeof WorkReportNoCodec;
|
|
3553
3674
|
declare namespace workReport {
|
|
3554
3675
|
export {
|
|
3555
3676
|
workReport_WorkPackageSpec as WorkPackageSpec,
|
|
3556
3677
|
workReport_WorkReport as WorkReport,
|
|
3557
|
-
workReport_WorkReportNoCodec as WorkReportNoCodec,
|
|
3558
3678
|
};
|
|
3559
3679
|
}
|
|
3560
3680
|
|
|
@@ -3566,7 +3686,7 @@ declare namespace workReport {
|
|
|
3566
3686
|
* Since GP defines that value explicitly as "two or three",
|
|
3567
3687
|
* we do that as well.
|
|
3568
3688
|
*
|
|
3569
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
3689
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/152b01152d01?v=0.7.2
|
|
3570
3690
|
*/
|
|
3571
3691
|
type REQUIRED_CREDENTIALS = 2 | 3;
|
|
3572
3692
|
declare const REQUIRED_CREDENTIALS_RANGE: number[];
|
|
@@ -3586,7 +3706,7 @@ declare class Credential extends WithDebug {
|
|
|
3586
3706
|
/**
|
|
3587
3707
|
* Tuple of work-report, a credential and it's corresponding timeslot.
|
|
3588
3708
|
*
|
|
3589
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
3709
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/15df00150301?v=0.7.2
|
|
3590
3710
|
*/
|
|
3591
3711
|
declare class ReportGuarantee extends WithDebug {
|
|
3592
3712
|
/** The work-report being guaranteed. */
|
|
@@ -3598,11 +3718,11 @@ declare class ReportGuarantee extends WithDebug {
|
|
|
3598
3718
|
* validator index and a signature.
|
|
3599
3719
|
* Credentials must be ordered by their validator index.
|
|
3600
3720
|
*
|
|
3601
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
3721
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/152b01152d01?v=0.7.2
|
|
3602
3722
|
*/
|
|
3603
3723
|
readonly credentials: KnownSizeArray<Credential, `${REQUIRED_CREDENTIALS}`>;
|
|
3604
3724
|
static Codec: Descriptor<ReportGuarantee, ViewOf<ReportGuarantee, {
|
|
3605
|
-
report: Descriptor<
|
|
3725
|
+
report: Descriptor<WorkReport, ViewOf<WorkReport, {
|
|
3606
3726
|
workPackageSpec: Descriptor<WorkPackageSpec, ViewOf<WorkPackageSpec, {
|
|
3607
3727
|
hash: Descriptor<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>;
|
|
3608
3728
|
length: Descriptor<U32, Bytes<4>>;
|
|
@@ -3631,7 +3751,22 @@ declare class ReportGuarantee extends WithDebug {
|
|
|
3631
3751
|
codeHash: Descriptor<Bytes<32> & WithOpaque<"CodeHash">, Bytes<32>>;
|
|
3632
3752
|
payloadHash: Descriptor<Bytes<32>, Bytes<32>>;
|
|
3633
3753
|
gas: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, Bytes<8>>;
|
|
3634
|
-
result: Descriptor<WorkExecResult,
|
|
3754
|
+
result: Descriptor<WorkExecResult, {
|
|
3755
|
+
kind: WorkExecResultKind.ok;
|
|
3756
|
+
okBlob: BytesBlob;
|
|
3757
|
+
} | {
|
|
3758
|
+
kind: WorkExecResultKind.outOfGas;
|
|
3759
|
+
} | {
|
|
3760
|
+
kind: WorkExecResultKind.panic;
|
|
3761
|
+
} | {
|
|
3762
|
+
kind: WorkExecResultKind.incorrectNumberOfExports;
|
|
3763
|
+
} | {
|
|
3764
|
+
kind: WorkExecResultKind.digestTooBig;
|
|
3765
|
+
} | {
|
|
3766
|
+
kind: WorkExecResultKind.badCode;
|
|
3767
|
+
} | {
|
|
3768
|
+
kind: WorkExecResultKind.codeOversize;
|
|
3769
|
+
}>;
|
|
3635
3770
|
load: Descriptor<WorkRefineLoad, ViewOf<WorkRefineLoad, {
|
|
3636
3771
|
gasUsed: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
3637
3772
|
importedSegments: Descriptor<U32, U32>;
|
|
@@ -3657,11 +3792,11 @@ declare const GuaranteesExtrinsicBounds = "[0..CoresCount)";
|
|
|
3657
3792
|
* Each core index (within work-report) must be unique and guarantees
|
|
3658
3793
|
* must be in ascending order of this.
|
|
3659
3794
|
*
|
|
3660
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
3795
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/15d10015d400?v=0.7.2
|
|
3661
3796
|
*/
|
|
3662
3797
|
type GuaranteesExtrinsic = KnownSizeArray<ReportGuarantee, typeof GuaranteesExtrinsicBounds>;
|
|
3663
3798
|
declare const guaranteesExtrinsicCodec: Descriptor<readonly ReportGuarantee[] & WithOpaque<"[0..CoresCount)">, SequenceView<ReportGuarantee, ViewOf<ReportGuarantee, {
|
|
3664
|
-
report: Descriptor<
|
|
3799
|
+
report: Descriptor<WorkReport, ViewOf<WorkReport, {
|
|
3665
3800
|
workPackageSpec: Descriptor<WorkPackageSpec, ViewOf<WorkPackageSpec, {
|
|
3666
3801
|
hash: Descriptor<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>;
|
|
3667
3802
|
length: Descriptor<U32, Bytes<4>>;
|
|
@@ -3690,7 +3825,22 @@ declare const guaranteesExtrinsicCodec: Descriptor<readonly ReportGuarantee[] &
|
|
|
3690
3825
|
codeHash: Descriptor<Bytes<32> & WithOpaque<"CodeHash">, Bytes<32>>;
|
|
3691
3826
|
payloadHash: Descriptor<Bytes<32>, Bytes<32>>;
|
|
3692
3827
|
gas: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, Bytes<8>>;
|
|
3693
|
-
result: Descriptor<WorkExecResult,
|
|
3828
|
+
result: Descriptor<WorkExecResult, {
|
|
3829
|
+
kind: WorkExecResultKind.ok;
|
|
3830
|
+
okBlob: BytesBlob;
|
|
3831
|
+
} | {
|
|
3832
|
+
kind: WorkExecResultKind.outOfGas;
|
|
3833
|
+
} | {
|
|
3834
|
+
kind: WorkExecResultKind.panic;
|
|
3835
|
+
} | {
|
|
3836
|
+
kind: WorkExecResultKind.incorrectNumberOfExports;
|
|
3837
|
+
} | {
|
|
3838
|
+
kind: WorkExecResultKind.digestTooBig;
|
|
3839
|
+
} | {
|
|
3840
|
+
kind: WorkExecResultKind.badCode;
|
|
3841
|
+
} | {
|
|
3842
|
+
kind: WorkExecResultKind.codeOversize;
|
|
3843
|
+
}>;
|
|
3694
3844
|
load: Descriptor<WorkRefineLoad, ViewOf<WorkRefineLoad, {
|
|
3695
3845
|
gasUsed: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
3696
3846
|
importedSegments: Descriptor<U32, U32>;
|
|
@@ -3806,7 +3956,7 @@ declare class Extrinsic extends WithDebug {
|
|
|
3806
3956
|
blob: Descriptor<BytesBlob, BytesBlob>;
|
|
3807
3957
|
}>>>;
|
|
3808
3958
|
guarantees: Descriptor<readonly ReportGuarantee[] & WithOpaque<"[0..CoresCount)">, SequenceView<ReportGuarantee, ViewOf<ReportGuarantee, {
|
|
3809
|
-
report: Descriptor<
|
|
3959
|
+
report: Descriptor<WorkReport, ViewOf<WorkReport, {
|
|
3810
3960
|
workPackageSpec: Descriptor<WorkPackageSpec, ViewOf<WorkPackageSpec, {
|
|
3811
3961
|
hash: Descriptor<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>;
|
|
3812
3962
|
length: Descriptor<U32, Bytes<4>>;
|
|
@@ -3835,7 +3985,22 @@ declare class Extrinsic extends WithDebug {
|
|
|
3835
3985
|
codeHash: Descriptor<Bytes<32> & WithOpaque<"CodeHash">, Bytes<32>>;
|
|
3836
3986
|
payloadHash: Descriptor<Bytes<32>, Bytes<32>>;
|
|
3837
3987
|
gas: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, Bytes<8>>;
|
|
3838
|
-
result: Descriptor<WorkExecResult,
|
|
3988
|
+
result: Descriptor<WorkExecResult, {
|
|
3989
|
+
kind: WorkExecResultKind.ok;
|
|
3990
|
+
okBlob: BytesBlob;
|
|
3991
|
+
} | {
|
|
3992
|
+
kind: WorkExecResultKind.outOfGas;
|
|
3993
|
+
} | {
|
|
3994
|
+
kind: WorkExecResultKind.panic;
|
|
3995
|
+
} | {
|
|
3996
|
+
kind: WorkExecResultKind.incorrectNumberOfExports;
|
|
3997
|
+
} | {
|
|
3998
|
+
kind: WorkExecResultKind.digestTooBig;
|
|
3999
|
+
} | {
|
|
4000
|
+
kind: WorkExecResultKind.badCode;
|
|
4001
|
+
} | {
|
|
4002
|
+
kind: WorkExecResultKind.codeOversize;
|
|
4003
|
+
}>;
|
|
3839
4004
|
load: Descriptor<WorkRefineLoad, ViewOf<WorkRefineLoad, {
|
|
3840
4005
|
gasUsed: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
3841
4006
|
importedSegments: Descriptor<U32, U32>;
|
|
@@ -3916,9 +4081,9 @@ declare class Block extends WithDebug {
|
|
|
3916
4081
|
attempt: Descriptor<number & WithBytesRepresentation<1> & WithOpaque<"TicketAttempt[0|1|2]">, U8>;
|
|
3917
4082
|
}>>>;
|
|
3918
4083
|
}> | null>;
|
|
3919
|
-
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
3920
4084
|
bandersnatchBlockAuthorIndex: Descriptor<number & WithBytesRepresentation<2> & WithOpaque<"ValidatorIndex[u16]">, Bytes<2>>;
|
|
3921
4085
|
entropySource: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
4086
|
+
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
3922
4087
|
seal: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
3923
4088
|
}>>;
|
|
3924
4089
|
extrinsic: Descriptor<Extrinsic, ViewOf<Extrinsic, {
|
|
@@ -3931,7 +4096,7 @@ declare class Block extends WithDebug {
|
|
|
3931
4096
|
blob: Descriptor<BytesBlob, BytesBlob>;
|
|
3932
4097
|
}>>>;
|
|
3933
4098
|
guarantees: Descriptor<readonly ReportGuarantee[] & WithOpaque<"[0..CoresCount)">, SequenceView<ReportGuarantee, ViewOf<ReportGuarantee, {
|
|
3934
|
-
report: Descriptor<
|
|
4099
|
+
report: Descriptor<WorkReport, ViewOf<WorkReport, {
|
|
3935
4100
|
workPackageSpec: Descriptor<WorkPackageSpec, ViewOf<WorkPackageSpec, {
|
|
3936
4101
|
hash: Descriptor<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>;
|
|
3937
4102
|
length: Descriptor<U32, Bytes<4>>;
|
|
@@ -3960,7 +4125,22 @@ declare class Block extends WithDebug {
|
|
|
3960
4125
|
codeHash: Descriptor<Bytes<32> & WithOpaque<"CodeHash">, Bytes<32>>;
|
|
3961
4126
|
payloadHash: Descriptor<Bytes<32>, Bytes<32>>;
|
|
3962
4127
|
gas: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, Bytes<8>>;
|
|
3963
|
-
result: Descriptor<WorkExecResult,
|
|
4128
|
+
result: Descriptor<WorkExecResult, {
|
|
4129
|
+
kind: WorkExecResultKind.ok;
|
|
4130
|
+
okBlob: BytesBlob;
|
|
4131
|
+
} | {
|
|
4132
|
+
kind: WorkExecResultKind.outOfGas;
|
|
4133
|
+
} | {
|
|
4134
|
+
kind: WorkExecResultKind.panic;
|
|
4135
|
+
} | {
|
|
4136
|
+
kind: WorkExecResultKind.incorrectNumberOfExports;
|
|
4137
|
+
} | {
|
|
4138
|
+
kind: WorkExecResultKind.digestTooBig;
|
|
4139
|
+
} | {
|
|
4140
|
+
kind: WorkExecResultKind.badCode;
|
|
4141
|
+
} | {
|
|
4142
|
+
kind: WorkExecResultKind.codeOversize;
|
|
4143
|
+
}>;
|
|
3964
4144
|
load: Descriptor<WorkRefineLoad, ViewOf<WorkRefineLoad, {
|
|
3965
4145
|
gasUsed: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
3966
4146
|
importedSegments: Descriptor<U32, U32>;
|
|
@@ -4273,10 +4453,8 @@ declare class JipChainSpec extends WithDebug {
|
|
|
4273
4453
|
|
|
4274
4454
|
/** Block authorship options. */
|
|
4275
4455
|
declare class AuthorshipOptions {
|
|
4276
|
-
/** Use fake seal verification instead of running bandersnatch. */
|
|
4277
|
-
readonly omitSealVerification: boolean;
|
|
4278
4456
|
static fromJson: FromJsonWithParser<unknown, AuthorshipOptions>;
|
|
4279
|
-
static new(
|
|
4457
|
+
static new(): AuthorshipOptions;
|
|
4280
4458
|
private constructor();
|
|
4281
4459
|
}
|
|
4282
4460
|
|
|
@@ -4658,7 +4836,7 @@ declare class NotYetAccumulatedReport extends WithDebug {
|
|
|
4658
4836
|
*/
|
|
4659
4837
|
readonly dependencies: KnownSizeArray<WorkPackageHash, `[0..${MAX_REPORT_DEPENDENCIES})`>;
|
|
4660
4838
|
static Codec: Descriptor<NotYetAccumulatedReport, ViewOf<NotYetAccumulatedReport, {
|
|
4661
|
-
report: Descriptor<
|
|
4839
|
+
report: Descriptor<WorkReport, ViewOf<WorkReport, {
|
|
4662
4840
|
workPackageSpec: Descriptor<WorkPackageSpec, ViewOf<WorkPackageSpec, {
|
|
4663
4841
|
hash: Descriptor<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>;
|
|
4664
4842
|
length: Descriptor<U32, Bytes<4>>;
|
|
@@ -4687,7 +4865,22 @@ declare class NotYetAccumulatedReport extends WithDebug {
|
|
|
4687
4865
|
codeHash: Descriptor<Bytes<32> & WithOpaque<"CodeHash">, Bytes<32>>;
|
|
4688
4866
|
payloadHash: Descriptor<Bytes<32>, Bytes<32>>;
|
|
4689
4867
|
gas: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, Bytes<8>>;
|
|
4690
|
-
result: Descriptor<WorkExecResult,
|
|
4868
|
+
result: Descriptor<WorkExecResult, {
|
|
4869
|
+
kind: WorkExecResultKind.ok;
|
|
4870
|
+
okBlob: BytesBlob;
|
|
4871
|
+
} | {
|
|
4872
|
+
kind: WorkExecResultKind.outOfGas;
|
|
4873
|
+
} | {
|
|
4874
|
+
kind: WorkExecResultKind.panic;
|
|
4875
|
+
} | {
|
|
4876
|
+
kind: WorkExecResultKind.incorrectNumberOfExports;
|
|
4877
|
+
} | {
|
|
4878
|
+
kind: WorkExecResultKind.digestTooBig;
|
|
4879
|
+
} | {
|
|
4880
|
+
kind: WorkExecResultKind.badCode;
|
|
4881
|
+
} | {
|
|
4882
|
+
kind: WorkExecResultKind.codeOversize;
|
|
4883
|
+
}>;
|
|
4691
4884
|
load: Descriptor<WorkRefineLoad, ViewOf<WorkRefineLoad, {
|
|
4692
4885
|
gasUsed: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
4693
4886
|
importedSegments: Descriptor<U32, U32>;
|
|
@@ -4707,7 +4900,7 @@ declare class NotYetAccumulatedReport extends WithDebug {
|
|
|
4707
4900
|
*/
|
|
4708
4901
|
type AccumulationQueue = PerEpochBlock<readonly NotYetAccumulatedReport[]>;
|
|
4709
4902
|
declare const accumulationQueueCodec: Descriptor<readonly (readonly NotYetAccumulatedReport[])[] & WithOpaque<"EpochLength">, SequenceView<readonly NotYetAccumulatedReport[], SequenceView<NotYetAccumulatedReport, ViewOf<NotYetAccumulatedReport, {
|
|
4710
|
-
report: Descriptor<
|
|
4903
|
+
report: Descriptor<WorkReport, ViewOf<WorkReport, {
|
|
4711
4904
|
workPackageSpec: Descriptor<WorkPackageSpec, ViewOf<WorkPackageSpec, {
|
|
4712
4905
|
hash: Descriptor<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>;
|
|
4713
4906
|
length: Descriptor<U32, Bytes<4>>;
|
|
@@ -4736,7 +4929,22 @@ declare const accumulationQueueCodec: Descriptor<readonly (readonly NotYetAccumu
|
|
|
4736
4929
|
codeHash: Descriptor<Bytes<32> & WithOpaque<"CodeHash">, Bytes<32>>;
|
|
4737
4930
|
payloadHash: Descriptor<Bytes<32>, Bytes<32>>;
|
|
4738
4931
|
gas: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, Bytes<8>>;
|
|
4739
|
-
result: Descriptor<WorkExecResult,
|
|
4932
|
+
result: Descriptor<WorkExecResult, {
|
|
4933
|
+
kind: WorkExecResultKind.ok;
|
|
4934
|
+
okBlob: BytesBlob;
|
|
4935
|
+
} | {
|
|
4936
|
+
kind: WorkExecResultKind.outOfGas;
|
|
4937
|
+
} | {
|
|
4938
|
+
kind: WorkExecResultKind.panic;
|
|
4939
|
+
} | {
|
|
4940
|
+
kind: WorkExecResultKind.incorrectNumberOfExports;
|
|
4941
|
+
} | {
|
|
4942
|
+
kind: WorkExecResultKind.digestTooBig;
|
|
4943
|
+
} | {
|
|
4944
|
+
kind: WorkExecResultKind.badCode;
|
|
4945
|
+
} | {
|
|
4946
|
+
kind: WorkExecResultKind.codeOversize;
|
|
4947
|
+
}>;
|
|
4740
4948
|
load: Descriptor<WorkRefineLoad, ViewOf<WorkRefineLoad, {
|
|
4741
4949
|
gasUsed: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
4742
4950
|
importedSegments: Descriptor<U32, U32>;
|
|
@@ -4764,7 +4972,7 @@ declare class AvailabilityAssignment extends WithDebug {
|
|
|
4764
4972
|
/** Time slot at which the report becomes obsolete. */
|
|
4765
4973
|
readonly timeout: TimeSlot;
|
|
4766
4974
|
static Codec: Descriptor<AvailabilityAssignment, ViewOf<AvailabilityAssignment, {
|
|
4767
|
-
workReport: Descriptor<
|
|
4975
|
+
workReport: Descriptor<WorkReport, ViewOf<WorkReport, {
|
|
4768
4976
|
workPackageSpec: Descriptor<WorkPackageSpec, ViewOf<WorkPackageSpec, {
|
|
4769
4977
|
hash: Descriptor<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>;
|
|
4770
4978
|
length: Descriptor<U32, Bytes<4>>;
|
|
@@ -4793,7 +5001,22 @@ declare class AvailabilityAssignment extends WithDebug {
|
|
|
4793
5001
|
codeHash: Descriptor<Bytes<32> & WithOpaque<"CodeHash">, Bytes<32>>;
|
|
4794
5002
|
payloadHash: Descriptor<Bytes<32>, Bytes<32>>;
|
|
4795
5003
|
gas: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, Bytes<8>>;
|
|
4796
|
-
result: Descriptor<WorkExecResult,
|
|
5004
|
+
result: Descriptor<WorkExecResult, {
|
|
5005
|
+
kind: WorkExecResultKind.ok;
|
|
5006
|
+
okBlob: BytesBlob;
|
|
5007
|
+
} | {
|
|
5008
|
+
kind: WorkExecResultKind.outOfGas;
|
|
5009
|
+
} | {
|
|
5010
|
+
kind: WorkExecResultKind.panic;
|
|
5011
|
+
} | {
|
|
5012
|
+
kind: WorkExecResultKind.incorrectNumberOfExports;
|
|
5013
|
+
} | {
|
|
5014
|
+
kind: WorkExecResultKind.digestTooBig;
|
|
5015
|
+
} | {
|
|
5016
|
+
kind: WorkExecResultKind.badCode;
|
|
5017
|
+
} | {
|
|
5018
|
+
kind: WorkExecResultKind.codeOversize;
|
|
5019
|
+
}>;
|
|
4797
5020
|
load: Descriptor<WorkRefineLoad, ViewOf<WorkRefineLoad, {
|
|
4798
5021
|
gasUsed: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
4799
5022
|
importedSegments: Descriptor<U32, U32>;
|
|
@@ -4809,7 +5032,7 @@ declare class AvailabilityAssignment extends WithDebug {
|
|
|
4809
5032
|
private constructor();
|
|
4810
5033
|
}
|
|
4811
5034
|
declare const availabilityAssignmentsCodec: Descriptor<readonly (AvailabilityAssignment | null)[] & WithOpaque<"number of cores">, SequenceView<AvailabilityAssignment | null, ViewOf<AvailabilityAssignment, {
|
|
4812
|
-
workReport: Descriptor<
|
|
5035
|
+
workReport: Descriptor<WorkReport, ViewOf<WorkReport, {
|
|
4813
5036
|
workPackageSpec: Descriptor<WorkPackageSpec, ViewOf<WorkPackageSpec, {
|
|
4814
5037
|
hash: Descriptor<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>;
|
|
4815
5038
|
length: Descriptor<U32, Bytes<4>>;
|
|
@@ -4838,7 +5061,22 @@ declare const availabilityAssignmentsCodec: Descriptor<readonly (AvailabilityAss
|
|
|
4838
5061
|
codeHash: Descriptor<Bytes<32> & WithOpaque<"CodeHash">, Bytes<32>>;
|
|
4839
5062
|
payloadHash: Descriptor<Bytes<32>, Bytes<32>>;
|
|
4840
5063
|
gas: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, Bytes<8>>;
|
|
4841
|
-
result: Descriptor<WorkExecResult,
|
|
5064
|
+
result: Descriptor<WorkExecResult, {
|
|
5065
|
+
kind: WorkExecResultKind.ok;
|
|
5066
|
+
okBlob: BytesBlob;
|
|
5067
|
+
} | {
|
|
5068
|
+
kind: WorkExecResultKind.outOfGas;
|
|
5069
|
+
} | {
|
|
5070
|
+
kind: WorkExecResultKind.panic;
|
|
5071
|
+
} | {
|
|
5072
|
+
kind: WorkExecResultKind.incorrectNumberOfExports;
|
|
5073
|
+
} | {
|
|
5074
|
+
kind: WorkExecResultKind.digestTooBig;
|
|
5075
|
+
} | {
|
|
5076
|
+
kind: WorkExecResultKind.badCode;
|
|
5077
|
+
} | {
|
|
5078
|
+
kind: WorkExecResultKind.codeOversize;
|
|
5079
|
+
}>;
|
|
4842
5080
|
load: Descriptor<WorkRefineLoad, ViewOf<WorkRefineLoad, {
|
|
4843
5081
|
gasUsed: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
4844
5082
|
importedSegments: Descriptor<U32, U32>;
|
|
@@ -5305,7 +5543,7 @@ declare class ValidatorStatistics {
|
|
|
5305
5543
|
* Single core statistics.
|
|
5306
5544
|
* Updated per block, based on incoming work reports (`w`).
|
|
5307
5545
|
*
|
|
5308
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
5546
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/197902197902?v=0.7.2
|
|
5309
5547
|
* https://github.com/gavofyork/graypaper/blob/9bffb08f3ea7b67832019176754df4fb36b9557d/text/statistics.tex#L65
|
|
5310
5548
|
*/
|
|
5311
5549
|
declare class CoreStatistics {
|
|
@@ -5343,7 +5581,7 @@ declare class CoreStatistics {
|
|
|
5343
5581
|
* Service statistics.
|
|
5344
5582
|
* Updated per block, based on available work reports (`W`).
|
|
5345
5583
|
*
|
|
5346
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
5584
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/19e20219e202?v=0.7.2
|
|
5347
5585
|
*/
|
|
5348
5586
|
declare class ServiceStatistics {
|
|
5349
5587
|
/** `p.0` */
|
|
@@ -6204,7 +6442,7 @@ declare function serializeStateUpdate(spec: ChainSpec, blake2b: Blake2b, update:
|
|
|
6204
6442
|
* State entries may be wrapped into `SerializedState` to access the contained values.
|
|
6205
6443
|
*/
|
|
6206
6444
|
declare class StateEntries {
|
|
6207
|
-
private readonly
|
|
6445
|
+
private readonly dictionary;
|
|
6208
6446
|
static Codec: Descriptor<StateEntries, StateEntries>;
|
|
6209
6447
|
/** Turn in-memory state into it's serialized form. */
|
|
6210
6448
|
static serializeInMemory(spec: ChainSpec, blake2b: Blake2b, state: InMemoryState): StateEntries;
|
|
@@ -6225,6 +6463,12 @@ declare class StateEntries {
|
|
|
6225
6463
|
private constructor();
|
|
6226
6464
|
/** When comparing, we can safely ignore `trieCache` and just use entries. */
|
|
6227
6465
|
[TEST_COMPARE_USING](): any;
|
|
6466
|
+
/** Iterator over entries */
|
|
6467
|
+
entries(): Generator<[TruncatedHash, BytesBlob]>;
|
|
6468
|
+
/** Iterator over entries keys */
|
|
6469
|
+
keys(): Generator<TruncatedHash>;
|
|
6470
|
+
/** Iterator over entries values */
|
|
6471
|
+
values(): Generator<BytesBlob>;
|
|
6228
6472
|
/** Dump state entries to JSON string (format compatible with stf vectors). */
|
|
6229
6473
|
toString(): string;
|
|
6230
6474
|
[Symbol.iterator](): Generator<[TruncatedHash, BytesBlob], any, any>;
|
|
@@ -6922,9 +7166,9 @@ declare class Initialize extends WithDebug {
|
|
|
6922
7166
|
attempt: Descriptor<number & WithBytesRepresentation<1> & WithOpaque<"TicketAttempt[0|1|2]">, U8>;
|
|
6923
7167
|
}>>>;
|
|
6924
7168
|
}> | null>;
|
|
6925
|
-
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
6926
7169
|
bandersnatchBlockAuthorIndex: Descriptor<number & WithBytesRepresentation<2> & WithOpaque<"ValidatorIndex[u16]">, Bytes<2>>;
|
|
6927
7170
|
entropySource: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
7171
|
+
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
6928
7172
|
seal: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
6929
7173
|
}>>;
|
|
6930
7174
|
keyvals: Descriptor<KeyValue[], SequenceView<KeyValue, ViewOf<KeyValue, {
|
|
@@ -7229,12 +7473,12 @@ declare class DirectWorkerConfig<TParams = void, TBlocks = BlocksDb, TStates = S
|
|
|
7229
7473
|
readonly workerParams: TParams;
|
|
7230
7474
|
private readonly blocksDb;
|
|
7231
7475
|
private readonly statesDb;
|
|
7232
|
-
static new<T, B, S>({ nodeName, chainSpec, blocksDb, statesDb, params, }: {
|
|
7476
|
+
static new<T, B, S>({ nodeName, chainSpec, blocksDb, statesDb, workerParams: params, }: {
|
|
7233
7477
|
nodeName: string;
|
|
7234
7478
|
chainSpec: ChainSpec;
|
|
7235
7479
|
blocksDb: B;
|
|
7236
7480
|
statesDb: S;
|
|
7237
|
-
|
|
7481
|
+
workerParams: T;
|
|
7238
7482
|
}): DirectWorkerConfig<T, B, S>;
|
|
7239
7483
|
private constructor();
|
|
7240
7484
|
openDatabase(_options?: {
|
|
@@ -9174,6 +9418,8 @@ type Input = {
|
|
|
9174
9418
|
* https://graypaper.fluffylabs.dev/#/cc517d7/18dd0018dd00?v=0.6.5
|
|
9175
9419
|
*/
|
|
9176
9420
|
transferStatistics: Map<ServiceId, CountAndGasUsed>;
|
|
9421
|
+
reporters: readonly Ed25519Key[];
|
|
9422
|
+
currentValidatorData: State["currentValidatorData"];
|
|
9177
9423
|
};
|
|
9178
9424
|
type CountAndGasUsed = {
|
|
9179
9425
|
count: U32;
|
|
@@ -9240,14 +9486,19 @@ type AccumulateResult = {
|
|
|
9240
9486
|
accumulationOutputLog: SortedArray<AccumulationOutput>;
|
|
9241
9487
|
};
|
|
9242
9488
|
|
|
9489
|
+
type AccumulateOptions = {
|
|
9490
|
+
pvm: PvmBackend;
|
|
9491
|
+
accumulateSequentially: boolean;
|
|
9492
|
+
};
|
|
9493
|
+
|
|
9243
9494
|
declare const ACCUMULATION_ERROR = "duplicate service created";
|
|
9244
9495
|
type ACCUMULATION_ERROR = typeof ACCUMULATION_ERROR;
|
|
9245
9496
|
declare class Accumulate {
|
|
9246
9497
|
readonly chainSpec: ChainSpec;
|
|
9247
9498
|
readonly blake2b: Blake2b;
|
|
9248
9499
|
readonly state: AccumulateState;
|
|
9249
|
-
readonly
|
|
9250
|
-
constructor(chainSpec: ChainSpec, blake2b: Blake2b, state: AccumulateState,
|
|
9500
|
+
readonly options: AccumulateOptions;
|
|
9501
|
+
constructor(chainSpec: ChainSpec, blake2b: Blake2b, state: AccumulateState, options: AccumulateOptions);
|
|
9251
9502
|
/**
|
|
9252
9503
|
* Returns an index that determines how many WorkReports can be processed before exceeding a given gasLimit.
|
|
9253
9504
|
*
|
|
@@ -9686,40 +9937,53 @@ interface HeaderChain {
|
|
|
9686
9937
|
* by validators).
|
|
9687
9938
|
*
|
|
9688
9939
|
* After enough assurances the work-report is considered available,
|
|
9689
|
-
* and the work
|
|
9940
|
+
* and the work-digests transform the state of their associated
|
|
9690
9941
|
* service by virtue of accumulation, covered in section 12.
|
|
9691
9942
|
* The report may also be timed-out, implying it may be replaced
|
|
9692
9943
|
* by another report without accumulation.
|
|
9693
9944
|
*
|
|
9694
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
9945
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/138801138d01?v=0.7.2
|
|
9695
9946
|
*/
|
|
9696
9947
|
type ReportsInput = {
|
|
9697
9948
|
/**
|
|
9698
9949
|
* A work-package, is transformed by validators acting as
|
|
9699
9950
|
* guarantors into its corresponding work-report, which
|
|
9700
|
-
* similarly comprises several work
|
|
9951
|
+
* similarly comprises several work-digests and then
|
|
9701
9952
|
* presented on-chain within the guarantees extrinsic.
|
|
9702
9953
|
*
|
|
9703
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
9954
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/138001138401?v=0.7.2
|
|
9704
9955
|
*/
|
|
9705
9956
|
guarantees: GuaranteesExtrinsicView;
|
|
9706
9957
|
/** Current time slot, excerpted from block header. */
|
|
9707
9958
|
slot: TimeSlot;
|
|
9708
9959
|
/** `eta_prime`: New entropy, after potential epoch transition. */
|
|
9709
9960
|
newEntropy: SafroleStateUpdate["entropy"];
|
|
9710
|
-
/**
|
|
9961
|
+
/**
|
|
9962
|
+
* β† - Partial update of recent blocks.
|
|
9963
|
+
*
|
|
9964
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/0f56020f6b02?v=0.7.2
|
|
9965
|
+
*/
|
|
9711
9966
|
recentBlocksPartialUpdate: RecentHistoryStateUpdate["recentBlocks"];
|
|
9712
9967
|
/**
|
|
9713
9968
|
* ρ‡ - Availability assignment resulting from assurances transition
|
|
9714
|
-
*
|
|
9969
|
+
*
|
|
9970
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/141302144402?v=0.7.2
|
|
9715
9971
|
*/
|
|
9716
9972
|
assurancesAvailAssignment: AssurancesStateUpdate["availabilityAssignment"];
|
|
9717
9973
|
/**
|
|
9718
9974
|
* ψ′O - Ed25519 keys of validators that were proven to judge incorrectly.
|
|
9719
9975
|
*
|
|
9720
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
9976
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/134201134201?v=0.7.2
|
|
9721
9977
|
*/
|
|
9722
9978
|
offenders: HashSet<Ed25519Key>;
|
|
9979
|
+
/**
|
|
9980
|
+
* `κ' kappa prime` - Current validator data.
|
|
9981
|
+
*/
|
|
9982
|
+
currentValidatorData: SafroleStateUpdate["currentValidatorData"];
|
|
9983
|
+
/**
|
|
9984
|
+
* `λ' lambda prime` - Previous validator data.
|
|
9985
|
+
*/
|
|
9986
|
+
previousValidatorData: SafroleStateUpdate["previousValidatorData"];
|
|
9723
9987
|
};
|
|
9724
9988
|
|
|
9725
9989
|
type GuarantorAssignment = {
|
|
@@ -9727,7 +9991,7 @@ type GuarantorAssignment = {
|
|
|
9727
9991
|
ed25519: Ed25519Key;
|
|
9728
9992
|
};
|
|
9729
9993
|
|
|
9730
|
-
type ReportsState = Pick<State, "availabilityAssignment" | "
|
|
9994
|
+
type ReportsState = Pick<State, "availabilityAssignment" | "entropy" | "getService" | "recentBlocks" | "accumulationQueue" | "recentlyAccumulated"> & WithStateView<Pick<StateView, "authPoolsView">>;
|
|
9731
9995
|
/** Reports state update. */
|
|
9732
9996
|
type ReportsStateUpdate = Pick<ReportsState, "availabilityAssignment">;
|
|
9733
9997
|
type ReportsOutput = {
|
|
@@ -9739,7 +10003,7 @@ type ReportsOutput = {
|
|
|
9739
10003
|
* This dictionary has the same number of items as in the input guarantees extrinsic.
|
|
9740
10004
|
*/
|
|
9741
10005
|
reported: HashDictionary<WorkPackageHash, WorkPackageInfo>;
|
|
9742
|
-
/** A set `
|
|
10006
|
+
/** A set `M` of work package reporters. */
|
|
9743
10007
|
reporters: KnownSizeArray<Ed25519Key, "Guarantees * Credentials (at most `cores*3`)">;
|
|
9744
10008
|
};
|
|
9745
10009
|
declare class Reports {
|
|
@@ -9758,9 +10022,9 @@ declare class Reports {
|
|
|
9758
10022
|
* Get the guarantor assignment (both core and validator data)
|
|
9759
10023
|
* depending on the rotation.
|
|
9760
10024
|
*
|
|
9761
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
10025
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/15df0115df01?v=0.7.2
|
|
9762
10026
|
*/
|
|
9763
|
-
getGuarantorAssignment(headerTimeSlot: TimeSlot, guaranteeTimeSlot: TimeSlot, newEntropy: SafroleStateUpdate["entropy"]): Result<PerValidator<GuarantorAssignment>, ReportsError>;
|
|
10027
|
+
getGuarantorAssignment(headerTimeSlot: TimeSlot, guaranteeTimeSlot: TimeSlot, newEntropy: SafroleStateUpdate["entropy"], currentValidatorData: SafroleStateUpdate["currentValidatorData"], previousValidatorData: SafroleStateUpdate["previousValidatorData"]): Result<PerValidator<GuarantorAssignment>, ReportsError>;
|
|
9764
10028
|
}
|
|
9765
10029
|
|
|
9766
10030
|
declare class DbHeaderChain implements HeaderChain {
|
|
@@ -9809,11 +10073,11 @@ declare class OnChain {
|
|
|
9809
10073
|
private readonly authorization;
|
|
9810
10074
|
private readonly statistics;
|
|
9811
10075
|
private isReadyForNextEpoch;
|
|
9812
|
-
constructor(chainSpec: ChainSpec, state: State & WithStateView, hasher: TransitionHasher,
|
|
10076
|
+
constructor(chainSpec: ChainSpec, state: State & WithStateView, hasher: TransitionHasher, options: AccumulateOptions, headerChain: HeaderChain);
|
|
9813
10077
|
/** Pre-populate things worth caching for the next epoch. */
|
|
9814
10078
|
prepareForNextEpoch(): Promise<void>;
|
|
9815
10079
|
private verifySeal;
|
|
9816
|
-
transition(block: BlockView, headerHash: HeaderHash
|
|
10080
|
+
transition(block: BlockView, headerHash: HeaderHash): Promise<Result<Ok, StfError>>;
|
|
9817
10081
|
private getUsedAuthorizerHashes;
|
|
9818
10082
|
}
|
|
9819
10083
|
|
|
@@ -9885,20 +10149,35 @@ declare class AccumulateExternalities implements PartialState, AccountsWrite, Ac
|
|
|
9885
10149
|
/**
|
|
9886
10150
|
* The set of wrangled operand tuples, used as an operand to the PVM Accumulation function.
|
|
9887
10151
|
*
|
|
9888
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
10152
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/176b00176b00?v=0.7.2
|
|
9889
10153
|
*/
|
|
9890
10154
|
declare class Operand extends WithDebug {
|
|
9891
10155
|
static Codec: Descriptor<Operand, ViewOf<Operand, {
|
|
9892
10156
|
hash: Descriptor<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>;
|
|
9893
10157
|
exportsRoot: Descriptor<Bytes<32> & WithOpaque<"ExportsRootHash">, Bytes<32>>;
|
|
9894
10158
|
authorizerHash: Descriptor<Bytes<32> & WithOpaque<"AuthorizerHash">, Bytes<32>>;
|
|
9895
|
-
authorizationOutput: Descriptor<BytesBlob, BytesBlob>;
|
|
9896
10159
|
payloadHash: Descriptor<Bytes<32>, Bytes<32>>;
|
|
9897
10160
|
gas: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
9898
|
-
result: Descriptor<WorkExecResult,
|
|
10161
|
+
result: Descriptor<WorkExecResult, {
|
|
10162
|
+
kind: WorkExecResultKind.ok;
|
|
10163
|
+
okBlob: BytesBlob;
|
|
10164
|
+
} | {
|
|
10165
|
+
kind: WorkExecResultKind.outOfGas;
|
|
10166
|
+
} | {
|
|
10167
|
+
kind: WorkExecResultKind.panic;
|
|
10168
|
+
} | {
|
|
10169
|
+
kind: WorkExecResultKind.incorrectNumberOfExports;
|
|
10170
|
+
} | {
|
|
10171
|
+
kind: WorkExecResultKind.digestTooBig;
|
|
10172
|
+
} | {
|
|
10173
|
+
kind: WorkExecResultKind.badCode;
|
|
10174
|
+
} | {
|
|
10175
|
+
kind: WorkExecResultKind.codeOversize;
|
|
10176
|
+
}>;
|
|
10177
|
+
authorizationOutput: Descriptor<BytesBlob, BytesBlob>;
|
|
9899
10178
|
}>>;
|
|
9900
10179
|
/**
|
|
9901
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
10180
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/18680118eb01?v=0.7.2
|
|
9902
10181
|
*/
|
|
9903
10182
|
hash: WorkPackageHash;
|
|
9904
10183
|
exportsRoot: ExportsRootHash;
|
|
@@ -9997,6 +10276,7 @@ type index$7_ACCUMULATION_ERROR = ACCUMULATION_ERROR;
|
|
|
9997
10276
|
type index$7_Accumulate = Accumulate;
|
|
9998
10277
|
declare const index$7_Accumulate: typeof Accumulate;
|
|
9999
10278
|
type index$7_AccumulateInput = AccumulateInput;
|
|
10279
|
+
type index$7_AccumulateOptions = AccumulateOptions;
|
|
10000
10280
|
type index$7_AccumulateResult = AccumulateResult;
|
|
10001
10281
|
type index$7_AccumulateRoot = AccumulateRoot;
|
|
10002
10282
|
type index$7_AccumulateState = AccumulateState;
|
|
@@ -10071,7 +10351,7 @@ declare const index$7_copyAndUpdateState: typeof copyAndUpdateState;
|
|
|
10071
10351
|
declare const index$7_stfError: typeof stfError;
|
|
10072
10352
|
declare namespace index$7 {
|
|
10073
10353
|
export { index$7_Accumulate as Accumulate, index$7_Assurances as Assurances, index$7_AssurancesError as AssurancesError, index$7_Authorization as Authorization, index$7_BlockVerifier as BlockVerifier, index$7_BlockVerifierError as BlockVerifierError, index$7_DbHeaderChain as DbHeaderChain, index$7_DeferredTransfers as DeferredTransfers, index$7_DeferredTransfersErrorCode as DeferredTransfersErrorCode, index$7_Disputes as Disputes, index$7_GAS_TO_INVOKE_WORK_REPORT as GAS_TO_INVOKE_WORK_REPORT, index$7_OnChain as OnChain, index$7_Preimages as Preimages, index$7_PreimagesErrorCode as PreimagesErrorCode, index$7_REPORT_TIMEOUT_GRACE_PERIOD as REPORT_TIMEOUT_GRACE_PERIOD, index$7_RecentHistory as RecentHistory, index$7_Reports as Reports, index$7_ReportsError as ReportsError, index$7_Statistics as Statistics, index$7_StfErrorKind as StfErrorKind, index$7_TransitionHasher as TransitionHasher, index$7_copyAndUpdateState as copyAndUpdateState, index$8 as externalities, index$7_stfError as stfError };
|
|
10074
|
-
export type { index$7_ACCUMULATION_ERROR as ACCUMULATION_ERROR, index$7_AccumulateInput as AccumulateInput, index$7_AccumulateResult as AccumulateResult, index$7_AccumulateRoot as AccumulateRoot, index$7_AccumulateState as AccumulateState, index$7_AccumulateStateUpdate as AccumulateStateUpdate, index$7_AssurancesInput as AssurancesInput, index$7_AssurancesState as AssurancesState, index$7_AssurancesStateUpdate as AssurancesStateUpdate, index$7_AuthorizationInput as AuthorizationInput, index$7_AuthorizationState as AuthorizationState, index$7_AuthorizationStateUpdate as AuthorizationStateUpdate, index$7_CountAndGasUsed as CountAndGasUsed, index$7_DeferredTransfersResult as DeferredTransfersResult, index$7_DeferredTransfersState as DeferredTransfersState, index$7_DisputesState as DisputesState, index$7_DisputesStateUpdate as DisputesStateUpdate, index$7_HeaderChain as HeaderChain, index$7_Input as Input, index$7_Ok as Ok, index$7_PreimagesInput as PreimagesInput, index$7_PreimagesState as PreimagesState, index$7_PreimagesStateUpdate as PreimagesStateUpdate, index$7_RecentHistoryInput as RecentHistoryInput, index$7_RecentHistoryPartialInput as RecentHistoryPartialInput, index$7_RecentHistoryState as RecentHistoryState, index$7_RecentHistoryStateUpdate as RecentHistoryStateUpdate, index$7_ReportsInput as ReportsInput, index$7_ReportsOutput as ReportsOutput, index$7_ReportsState as ReportsState, index$7_ReportsStateUpdate as ReportsStateUpdate, index$7_StatisticsState as StatisticsState, index$7_StatisticsStateUpdate as StatisticsStateUpdate, index$7_StfError as StfError };
|
|
10354
|
+
export type { index$7_ACCUMULATION_ERROR as ACCUMULATION_ERROR, index$7_AccumulateInput as AccumulateInput, index$7_AccumulateOptions as AccumulateOptions, index$7_AccumulateResult as AccumulateResult, index$7_AccumulateRoot as AccumulateRoot, index$7_AccumulateState as AccumulateState, index$7_AccumulateStateUpdate as AccumulateStateUpdate, index$7_AssurancesInput as AssurancesInput, index$7_AssurancesState as AssurancesState, index$7_AssurancesStateUpdate as AssurancesStateUpdate, index$7_AuthorizationInput as AuthorizationInput, index$7_AuthorizationState as AuthorizationState, index$7_AuthorizationStateUpdate as AuthorizationStateUpdate, index$7_CountAndGasUsed as CountAndGasUsed, index$7_DeferredTransfersResult as DeferredTransfersResult, index$7_DeferredTransfersState as DeferredTransfersState, index$7_DisputesState as DisputesState, index$7_DisputesStateUpdate as DisputesStateUpdate, index$7_HeaderChain as HeaderChain, index$7_Input as Input, index$7_Ok as Ok, index$7_PreimagesInput as PreimagesInput, index$7_PreimagesState as PreimagesState, index$7_PreimagesStateUpdate as PreimagesStateUpdate, index$7_RecentHistoryInput as RecentHistoryInput, index$7_RecentHistoryPartialInput as RecentHistoryPartialInput, index$7_RecentHistoryState as RecentHistoryState, index$7_RecentHistoryStateUpdate as RecentHistoryStateUpdate, index$7_ReportsInput as ReportsInput, index$7_ReportsOutput as ReportsOutput, index$7_ReportsState as ReportsState, index$7_ReportsStateUpdate as ReportsStateUpdate, index$7_StatisticsState as StatisticsState, index$7_StatisticsStateUpdate as StatisticsStateUpdate, index$7_StfError as StfError };
|
|
10075
10355
|
}
|
|
10076
10356
|
|
|
10077
10357
|
declare enum ImporterErrorKind {
|
|
@@ -10093,8 +10373,8 @@ declare class Importer {
|
|
|
10093
10373
|
constructor(spec: ChainSpec, pvm: PvmBackend, hasher: TransitionHasher, logger: Logger, blocks: BlocksDb, states: StatesDb<SerializedState<LeafDb>>);
|
|
10094
10374
|
/** Do some extra work for preparation for the next epoch. */
|
|
10095
10375
|
prepareForNextEpoch(): Promise<void>;
|
|
10096
|
-
importBlockWithStateRoot(block: BlockView
|
|
10097
|
-
importBlock(block: BlockView
|
|
10376
|
+
importBlockWithStateRoot(block: BlockView): Promise<Result<StateRootHash, ImporterError>>;
|
|
10377
|
+
importBlock(block: BlockView): Promise<Result<WithHash<HeaderHash, HeaderView>, ImporterError>>;
|
|
10098
10378
|
private importBlockInternal;
|
|
10099
10379
|
getBestStateRootHash(): (OpaqueHash & WithOpaque<"StateRootHash">) | null;
|
|
10100
10380
|
getBestBlockHash(): OpaqueHash & WithOpaque<"HeaderHash">;
|
|
@@ -10132,9 +10412,9 @@ declare const protocol: LousyProtocol<{
|
|
|
10132
10412
|
attempt: Descriptor<number & WithBytesRepresentation<1> & WithOpaque<"TicketAttempt[0|1|2]">, U8>;
|
|
10133
10413
|
}>>>;
|
|
10134
10414
|
}> | null>;
|
|
10135
|
-
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
10136
10415
|
bandersnatchBlockAuthorIndex: Descriptor<number & WithBytesRepresentation<2> & WithOpaque<"ValidatorIndex[u16]">, Bytes<2>>;
|
|
10137
10416
|
entropySource: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
10417
|
+
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
10138
10418
|
seal: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
10139
10419
|
}>>;
|
|
10140
10420
|
extrinsic: Descriptor<Extrinsic, ViewOf<Extrinsic, {
|
|
@@ -10147,7 +10427,7 @@ declare const protocol: LousyProtocol<{
|
|
|
10147
10427
|
blob: Descriptor<BytesBlob, BytesBlob>;
|
|
10148
10428
|
}>>>;
|
|
10149
10429
|
guarantees: Descriptor<readonly ReportGuarantee[] & WithOpaque<"[0..CoresCount)">, SequenceView<ReportGuarantee, ViewOf<ReportGuarantee, {
|
|
10150
|
-
report: Descriptor<
|
|
10430
|
+
report: Descriptor<WorkReport, ViewOf<WorkReport, {
|
|
10151
10431
|
workPackageSpec: Descriptor<WorkPackageSpec, ViewOf<WorkPackageSpec, {
|
|
10152
10432
|
hash: Descriptor<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>;
|
|
10153
10433
|
length: Descriptor<U32, Bytes<4>>;
|
|
@@ -10176,7 +10456,22 @@ declare const protocol: LousyProtocol<{
|
|
|
10176
10456
|
codeHash: Descriptor<Bytes<32> & WithOpaque<"CodeHash">, Bytes<32>>;
|
|
10177
10457
|
payloadHash: Descriptor<Bytes<32>, Bytes<32>>;
|
|
10178
10458
|
gas: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, Bytes<8>>;
|
|
10179
|
-
result: Descriptor<WorkExecResult,
|
|
10459
|
+
result: Descriptor<WorkExecResult, {
|
|
10460
|
+
kind: WorkExecResultKind.ok;
|
|
10461
|
+
okBlob: BytesBlob;
|
|
10462
|
+
} | {
|
|
10463
|
+
kind: WorkExecResultKind.outOfGas;
|
|
10464
|
+
} | {
|
|
10465
|
+
kind: WorkExecResultKind.panic;
|
|
10466
|
+
} | {
|
|
10467
|
+
kind: WorkExecResultKind.incorrectNumberOfExports;
|
|
10468
|
+
} | {
|
|
10469
|
+
kind: WorkExecResultKind.digestTooBig;
|
|
10470
|
+
} | {
|
|
10471
|
+
kind: WorkExecResultKind.badCode;
|
|
10472
|
+
} | {
|
|
10473
|
+
kind: WorkExecResultKind.codeOversize;
|
|
10474
|
+
}>;
|
|
10180
10475
|
load: Descriptor<WorkRefineLoad, ViewOf<WorkRefineLoad, {
|
|
10181
10476
|
gasUsed: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
10182
10477
|
importedSegments: Descriptor<U32, U32>;
|
|
@@ -10241,9 +10536,9 @@ declare const protocol: LousyProtocol<{
|
|
|
10241
10536
|
attempt: Descriptor<number & WithBytesRepresentation<1> & WithOpaque<"TicketAttempt[0|1|2]">, U8>;
|
|
10242
10537
|
}>>>;
|
|
10243
10538
|
}> | null>;
|
|
10244
|
-
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
10245
10539
|
bandersnatchBlockAuthorIndex: Descriptor<number & WithBytesRepresentation<2> & WithOpaque<"ValidatorIndex[u16]">, Bytes<2>>;
|
|
10246
10540
|
entropySource: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
10541
|
+
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
10247
10542
|
seal: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
10248
10543
|
}>>;
|
|
10249
10544
|
extrinsic: Descriptor<Extrinsic, ViewOf<Extrinsic, {
|
|
@@ -10256,7 +10551,7 @@ declare const protocol: LousyProtocol<{
|
|
|
10256
10551
|
blob: Descriptor<BytesBlob, BytesBlob>;
|
|
10257
10552
|
}>>>;
|
|
10258
10553
|
guarantees: Descriptor<readonly ReportGuarantee[] & WithOpaque<"[0..CoresCount)">, SequenceView<ReportGuarantee, ViewOf<ReportGuarantee, {
|
|
10259
|
-
report: Descriptor<
|
|
10554
|
+
report: Descriptor<WorkReport, ViewOf<WorkReport, {
|
|
10260
10555
|
workPackageSpec: Descriptor<WorkPackageSpec, ViewOf<WorkPackageSpec, {
|
|
10261
10556
|
hash: Descriptor<Bytes<32> & WithOpaque<"WorkPackageHash">, Bytes<32>>;
|
|
10262
10557
|
length: Descriptor<U32, Bytes<4>>;
|
|
@@ -10285,7 +10580,22 @@ declare const protocol: LousyProtocol<{
|
|
|
10285
10580
|
codeHash: Descriptor<Bytes<32> & WithOpaque<"CodeHash">, Bytes<32>>;
|
|
10286
10581
|
payloadHash: Descriptor<Bytes<32>, Bytes<32>>;
|
|
10287
10582
|
gas: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, Bytes<8>>;
|
|
10288
|
-
result: Descriptor<WorkExecResult,
|
|
10583
|
+
result: Descriptor<WorkExecResult, {
|
|
10584
|
+
kind: WorkExecResultKind.ok;
|
|
10585
|
+
okBlob: BytesBlob;
|
|
10586
|
+
} | {
|
|
10587
|
+
kind: WorkExecResultKind.outOfGas;
|
|
10588
|
+
} | {
|
|
10589
|
+
kind: WorkExecResultKind.panic;
|
|
10590
|
+
} | {
|
|
10591
|
+
kind: WorkExecResultKind.incorrectNumberOfExports;
|
|
10592
|
+
} | {
|
|
10593
|
+
kind: WorkExecResultKind.digestTooBig;
|
|
10594
|
+
} | {
|
|
10595
|
+
kind: WorkExecResultKind.badCode;
|
|
10596
|
+
} | {
|
|
10597
|
+
kind: WorkExecResultKind.codeOversize;
|
|
10598
|
+
}>;
|
|
10289
10599
|
load: Descriptor<WorkRefineLoad, ViewOf<WorkRefineLoad, {
|
|
10290
10600
|
gasUsed: Descriptor<bigint & WithBytesRepresentation<8> & WithOpaque<"ServiceGas[u64]">, U64>;
|
|
10291
10601
|
importedSegments: Descriptor<U32, U32>;
|
|
@@ -10358,9 +10668,9 @@ declare const protocol: LousyProtocol<{
|
|
|
10358
10668
|
attempt: Descriptor<number & WithBytesRepresentation<1> & WithOpaque<"TicketAttempt[0|1|2]">, U8>;
|
|
10359
10669
|
}>>>;
|
|
10360
10670
|
}> | null>;
|
|
10361
|
-
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
10362
10671
|
bandersnatchBlockAuthorIndex: Descriptor<number & WithBytesRepresentation<2> & WithOpaque<"ValidatorIndex[u16]">, Bytes<2>>;
|
|
10363
10672
|
entropySource: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
10673
|
+
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
10364
10674
|
seal: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
10365
10675
|
}>>, ViewOf<WithHash<OpaqueHash & WithOpaque<"HeaderHash">, ViewOf<Header & CodecRecord<Header>, {
|
|
10366
10676
|
parentHeaderHash: Descriptor<Bytes<32> & WithOpaque<"HeaderHash">, Bytes<32>>;
|
|
@@ -10381,9 +10691,9 @@ declare const protocol: LousyProtocol<{
|
|
|
10381
10691
|
attempt: Descriptor<number & WithBytesRepresentation<1> & WithOpaque<"TicketAttempt[0|1|2]">, U8>;
|
|
10382
10692
|
}>>>;
|
|
10383
10693
|
}> | null>;
|
|
10384
|
-
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
10385
10694
|
bandersnatchBlockAuthorIndex: Descriptor<number & WithBytesRepresentation<2> & WithOpaque<"ValidatorIndex[u16]">, Bytes<2>>;
|
|
10386
10695
|
entropySource: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
10696
|
+
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
10387
10697
|
seal: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
10388
10698
|
}>>, {
|
|
10389
10699
|
hash: Descriptor<Bytes<32> & WithOpaque<"HeaderHash">, Bytes<32>>;
|
|
@@ -10406,9 +10716,9 @@ declare const protocol: LousyProtocol<{
|
|
|
10406
10716
|
attempt: Descriptor<number & WithBytesRepresentation<1> & WithOpaque<"TicketAttempt[0|1|2]">, U8>;
|
|
10407
10717
|
}>>>;
|
|
10408
10718
|
}> | null>;
|
|
10409
|
-
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
10410
10719
|
bandersnatchBlockAuthorIndex: Descriptor<number & WithBytesRepresentation<2> & WithOpaque<"ValidatorIndex[u16]">, Bytes<2>>;
|
|
10411
10720
|
entropySource: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
10721
|
+
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
10412
10722
|
seal: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
10413
10723
|
}>, ViewOf<Header & CodecRecord<Header>, {
|
|
10414
10724
|
parentHeaderHash: Descriptor<Bytes<32> & WithOpaque<"HeaderHash">, Bytes<32>>;
|
|
@@ -10429,9 +10739,9 @@ declare const protocol: LousyProtocol<{
|
|
|
10429
10739
|
attempt: Descriptor<number & WithBytesRepresentation<1> & WithOpaque<"TicketAttempt[0|1|2]">, U8>;
|
|
10430
10740
|
}>>>;
|
|
10431
10741
|
}> | null>;
|
|
10432
|
-
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
10433
10742
|
bandersnatchBlockAuthorIndex: Descriptor<number & WithBytesRepresentation<2> & WithOpaque<"ValidatorIndex[u16]">, Bytes<2>>;
|
|
10434
10743
|
entropySource: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
10744
|
+
offendersMarker: Descriptor<(Bytes<32> & WithOpaque<"Ed25519Key">)[], SequenceView<Bytes<32> & WithOpaque<"Ed25519Key">, Bytes<32>>>;
|
|
10435
10745
|
seal: Descriptor<Bytes<96> & WithOpaque<"BandersnatchVrfSignature">, Bytes<96>>;
|
|
10436
10746
|
}>>;
|
|
10437
10747
|
}>>;
|
|
@@ -10441,13 +10751,11 @@ declare const protocol: LousyProtocol<{
|
|
|
10441
10751
|
type ImporterInternal = Internal<typeof protocol>;
|
|
10442
10752
|
type ImporterApi = Api<typeof protocol>;
|
|
10443
10753
|
declare class ImporterConfig {
|
|
10444
|
-
readonly omitSealVerification: boolean;
|
|
10445
10754
|
readonly pvm: PvmBackend;
|
|
10446
10755
|
static Codec: Descriptor<ImporterConfig, ViewOf<ImporterConfig, {
|
|
10447
|
-
omitSealVerification: Descriptor<boolean, boolean>;
|
|
10448
10756
|
pvm: Descriptor<PvmBackend, U8>;
|
|
10449
10757
|
}>>;
|
|
10450
|
-
static create({
|
|
10758
|
+
static create({ pvm }: CodecRecord<ImporterConfig>): ImporterConfig;
|
|
10451
10759
|
private constructor();
|
|
10452
10760
|
}
|
|
10453
10761
|
|
|
@@ -11267,4 +11575,5 @@ declare namespace index {
|
|
|
11267
11575
|
};
|
|
11268
11576
|
}
|
|
11269
11577
|
|
|
11270
|
-
export { index$s as block, index$q as block_json, index$y as bytes, index$x as codec, index$v as collections, index$t as config, index$p as config_node, index$u as crypto, index$k as database, index$j as erasure_coding, index$h as fuzz_proto, index$w as hash, index$9 as jam_host_calls, index$r as json_parser, index$f as logger, index$n as mmr, index$B as numbers, index$A as ordering, index$e as pvm, index$d as pvm_host_calls, index$3 as pvm_interpreter, index$2 as shuffling, index$m as state, index$1 as state_json, index$l as state_merkleization, index as state_vectors, index$7 as transition, index$o as trie, index$6 as typeberry, index$z as utils, index$g as workers };
|
|
11578
|
+
export { TEST_COMPARE_USING, __OPAQUE_TYPE__, __REPRESENTATION_BYTES__, index$s as block, index$q as block_json, index$y as bytes, index$x as codec, index$v as collections, index$t as config, index$p as config_node, index$u as crypto, index$k as database, index$j as erasure_coding, index$h as fuzz_proto, index$w as hash, index$9 as jam_host_calls, index$r as json_parser, index$f as logger, index$n as mmr, index$B as numbers, index$A as ordering, index$e as pvm, index$d as pvm_host_calls, index$3 as pvm_interpreter, index$2 as shuffling, index$m as state, index$1 as state_json, index$l as state_merkleization, index as state_vectors, index$7 as transition, index$o as trie, index$6 as typeberry, index$z as utils, index$g as workers };
|
|
11579
|
+
export type { WithBytesRepresentation, WithOpaque };
|