@typeberry/jam 0.1.3-8258907 → 0.1.3-b0374a8
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/bootstrap-generator.mjs +279 -249
- package/bootstrap-generator.mjs.map +1 -1
- package/bootstrap-importer.mjs +408 -323
- package/bootstrap-importer.mjs.map +1 -1
- package/bootstrap-network.mjs +279 -249
- package/bootstrap-network.mjs.map +1 -1
- package/index.js +408 -323
- package/index.js.map +1 -1
- package/package.json +1 -1
package/bootstrap-network.mjs
CHANGED
|
@@ -25512,7 +25512,7 @@ class Skipper {
|
|
|
25512
25512
|
*
|
|
25513
25513
|
* Descriptors can be composed to form more complex typings.
|
|
25514
25514
|
*/
|
|
25515
|
-
class
|
|
25515
|
+
class Descriptor {
|
|
25516
25516
|
name;
|
|
25517
25517
|
sizeHint;
|
|
25518
25518
|
encode;
|
|
@@ -25522,11 +25522,11 @@ class descriptor_Descriptor {
|
|
|
25522
25522
|
View;
|
|
25523
25523
|
/** New descriptor with specialized `View`. */
|
|
25524
25524
|
static withView(name, sizeHint, encode, decode, skip, view) {
|
|
25525
|
-
return new
|
|
25525
|
+
return new Descriptor(name, sizeHint, encode, decode, skip, view);
|
|
25526
25526
|
}
|
|
25527
25527
|
/** Create a new descriptor without a specialized `View`. */
|
|
25528
25528
|
static new(name, sizeHint, encode, decode, skip) {
|
|
25529
|
-
return new
|
|
25529
|
+
return new Descriptor(name, sizeHint, encode, decode, skip, null);
|
|
25530
25530
|
}
|
|
25531
25531
|
constructor(
|
|
25532
25532
|
/** Descriptive name of the coded data. */
|
|
@@ -25563,7 +25563,7 @@ class descriptor_Descriptor {
|
|
|
25563
25563
|
}
|
|
25564
25564
|
/** Return a new descriptor that converts data into some other type. */
|
|
25565
25565
|
convert(input, output) {
|
|
25566
|
-
return new
|
|
25566
|
+
return new Descriptor(this.name, this.sizeHint, (e, elem) => this.encode(e, input(elem)), (d) => output(this.decode(d)), this.skip, this.View);
|
|
25567
25567
|
}
|
|
25568
25568
|
/** Safely cast the descriptor value to a opaque type. */
|
|
25569
25569
|
asOpaque() {
|
|
@@ -26261,51 +26261,51 @@ var descriptors_codec;
|
|
|
26261
26261
|
return (len) => {
|
|
26262
26262
|
let ret = cache.get(len);
|
|
26263
26263
|
if (ret === undefined) {
|
|
26264
|
-
ret =
|
|
26264
|
+
ret = Descriptor.new(`Bytes<${len}>`, exactHint(len), (e, v) => e.bytes(v), (d) => d.bytes(len), (s) => s.bytes(len));
|
|
26265
26265
|
cache.set(len, ret);
|
|
26266
26266
|
}
|
|
26267
26267
|
return ret;
|
|
26268
26268
|
};
|
|
26269
26269
|
})();
|
|
26270
26270
|
/** Variable-length U32. */
|
|
26271
|
-
codec.varU32 =
|
|
26271
|
+
codec.varU32 = Descriptor.new("var_u32", { bytes: 4, isExact: false }, (e, v) => e.varU32(v), (d) => d.varU32(), (d) => d.varU32());
|
|
26272
26272
|
/** Variable-length U64. */
|
|
26273
|
-
codec.varU64 =
|
|
26273
|
+
codec.varU64 = Descriptor.new("var_u64", { bytes: 8, isExact: false }, (e, v) => e.varU64(v), (d) => d.varU64(), (d) => d.varU64());
|
|
26274
26274
|
/** Unsigned 64-bit number. */
|
|
26275
|
-
codec.u64 =
|
|
26275
|
+
codec.u64 = Descriptor.withView("u64", exactHint(8), (e, v) => e.i64(v), (d) => d.u64(), (d) => d.u64(), codec.bytes(8));
|
|
26276
26276
|
/** Unsigned 32-bit number. */
|
|
26277
|
-
codec.u32 =
|
|
26277
|
+
codec.u32 = Descriptor.withView("u32", exactHint(4), (e, v) => e.i32(v), (d) => d.u32(), (d) => d.u32(), codec.bytes(4));
|
|
26278
26278
|
/** Unsigned 24-bit number. */
|
|
26279
|
-
codec.u24 =
|
|
26279
|
+
codec.u24 = Descriptor.withView("u24", exactHint(3), (e, v) => e.i24(v), (d) => d.u24(), (d) => d.u24(), codec.bytes(3));
|
|
26280
26280
|
/** Unsigned 16-bit number. */
|
|
26281
|
-
codec.u16 =
|
|
26281
|
+
codec.u16 = Descriptor.withView("u16", exactHint(2), (e, v) => e.i16(v), (d) => d.u16(), (d) => d.u16(), codec.bytes(2));
|
|
26282
26282
|
/** Unsigned 8-bit number. */
|
|
26283
|
-
codec.u8 =
|
|
26283
|
+
codec.u8 = Descriptor.new("u8", exactHint(1), (e, v) => e.i8(v), (d) => d.u8(), (d) => d.u8());
|
|
26284
26284
|
/** Signed 64-bit number. */
|
|
26285
|
-
codec.i64 =
|
|
26285
|
+
codec.i64 = Descriptor.withView("u64", exactHint(8), (e, v) => e.i64(v), (d) => d.i64(), (s) => s.u64(), codec.bytes(8));
|
|
26286
26286
|
/** Signed 32-bit number. */
|
|
26287
|
-
codec.i32 =
|
|
26287
|
+
codec.i32 = Descriptor.withView("i32", exactHint(4), (e, v) => e.i32(v), (d) => d.i32(), (s) => s.u32(), codec.bytes(4));
|
|
26288
26288
|
/** Signed 24-bit number. */
|
|
26289
|
-
codec.i24 =
|
|
26289
|
+
codec.i24 = Descriptor.withView("i24", exactHint(3), (e, v) => e.i24(v), (d) => d.i24(), (s) => s.u24(), codec.bytes(3));
|
|
26290
26290
|
/** Signed 16-bit number. */
|
|
26291
|
-
codec.i16 =
|
|
26291
|
+
codec.i16 = Descriptor.withView("i16", exactHint(2), (e, v) => e.i16(v), (d) => d.i16(), (s) => s.u16(), codec.bytes(2));
|
|
26292
26292
|
/** Signed 8-bit number. */
|
|
26293
|
-
codec.i8 =
|
|
26293
|
+
codec.i8 = Descriptor.new("i8", exactHint(1), (e, v) => e.i8(v), (d) => d.i8(), (s) => s.u8());
|
|
26294
26294
|
/** 1-byte boolean value. */
|
|
26295
|
-
codec.bool =
|
|
26295
|
+
codec.bool = Descriptor.new("bool", exactHint(1), (e, v) => e.bool(v), (d) => d.bool(), (s) => s.bool());
|
|
26296
26296
|
/** Variable-length bytes blob. */
|
|
26297
|
-
codec.blob =
|
|
26297
|
+
codec.blob = Descriptor.new("BytesBlob", { bytes: TYPICAL_SEQUENCE_LENGTH, isExact: false }, (e, v) => e.bytesBlob(v), (d) => d.bytesBlob(), (s) => s.bytesBlob());
|
|
26298
26298
|
/** String encoded as variable-length bytes blob. */
|
|
26299
|
-
codec.string =
|
|
26299
|
+
codec.string = Descriptor.withView("string", { bytes: TYPICAL_SEQUENCE_LENGTH, isExact: false }, (e, v) => e.bytesBlob(bytes_BytesBlob.blobFrom(new TextEncoder().encode(v))), (d) => new TextDecoder("utf8", { fatal: true }).decode(d.bytesBlob().raw), (s) => s.bytesBlob(), codec.blob);
|
|
26300
26300
|
/** Variable-length bit vector. */
|
|
26301
|
-
codec.bitVecVarLen =
|
|
26301
|
+
codec.bitVecVarLen = Descriptor.new("BitVec[?]", { bytes: TYPICAL_SEQUENCE_LENGTH >>> 3, isExact: false }, (e, v) => e.bitVecVarLen(v), (d) => d.bitVecVarLen(), (s) => s.bitVecVarLen());
|
|
26302
26302
|
/** Fixed-length bit vector. */
|
|
26303
|
-
codec.bitVecFixLen = (bitLen) =>
|
|
26303
|
+
codec.bitVecFixLen = (bitLen) => Descriptor.new(`BitVec[${bitLen}]`, exactHint(bitLen >>> 3), (e, v) => e.bitVecFixLen(v), (d) => d.bitVecFixLen(bitLen), (s) => s.bitVecFixLen(bitLen));
|
|
26304
26304
|
/** Optionality wrapper for given type. */
|
|
26305
26305
|
codec.optional = (type) => {
|
|
26306
|
-
const self =
|
|
26306
|
+
const self = Descriptor.new(`Optional<${type.name}>`, addSizeHints({ bytes: 1, isExact: false }, type.sizeHint), (e, v) => e.optional(type, v), (d) => d.optional(type), (s) => s.optional(type));
|
|
26307
26307
|
if (hasUniqueView(type)) {
|
|
26308
|
-
return
|
|
26308
|
+
return Descriptor.withView(self.name, self.sizeHint, self.encode, self.decode, self.skip, codec.optional(type.View));
|
|
26309
26309
|
}
|
|
26310
26310
|
return self;
|
|
26311
26311
|
};
|
|
@@ -26316,7 +26316,7 @@ var descriptors_codec;
|
|
|
26316
26316
|
}) => {
|
|
26317
26317
|
const name = `Sequence<${type.name}>[?]`;
|
|
26318
26318
|
const typicalLength = options.typicalLength ?? TYPICAL_SEQUENCE_LENGTH;
|
|
26319
|
-
return
|
|
26319
|
+
return Descriptor.withView(name, { bytes: typicalLength * type.sizeHint.bytes, isExact: false }, (e, v) => {
|
|
26320
26320
|
validateLength(options, v.length, name);
|
|
26321
26321
|
e.sequenceVarLen(type, v);
|
|
26322
26322
|
}, (d) => {
|
|
@@ -26330,10 +26330,10 @@ var descriptors_codec;
|
|
|
26330
26330
|
}, sequenceViewVarLen(type, options));
|
|
26331
26331
|
};
|
|
26332
26332
|
/** Fixed-length sequence of given type. */
|
|
26333
|
-
codec.sequenceFixLen = (type, len) =>
|
|
26333
|
+
codec.sequenceFixLen = (type, len) => Descriptor.withView(`Sequence<${type.name}>[${len}]`, { bytes: len * type.sizeHint.bytes, isExact: type.sizeHint.isExact }, (e, v) => e.sequenceFixLen(type, v), (d) => d.sequenceFixLen(type, len), (s) => s.sequenceFixLen(type, len), sequenceViewFixLen(type, { fixedLength: len }));
|
|
26334
26334
|
/** Small dictionary codec. */
|
|
26335
26335
|
codec.dictionary = (key, value, { sortKeys, fixedLength, }) => {
|
|
26336
|
-
const self =
|
|
26336
|
+
const self = Descriptor.new(`Dictionary<${key.name}, ${value.name}>[${fixedLength ?? "?"}]`, {
|
|
26337
26337
|
bytes: fixedLength !== undefined
|
|
26338
26338
|
? fixedLength * addSizeHints(key.sizeHint, value.sizeHint).bytes
|
|
26339
26339
|
: TYPICAL_DICTIONARY_LENGTH * (addSizeHints(key.sizeHint, value.sizeHint).bytes ?? 0),
|
|
@@ -26372,13 +26372,13 @@ var descriptors_codec;
|
|
|
26372
26372
|
s.sequenceFixLen(value, len);
|
|
26373
26373
|
});
|
|
26374
26374
|
if (hasUniqueView(value)) {
|
|
26375
|
-
return
|
|
26375
|
+
return Descriptor.withView(self.name, self.sizeHint, self.encode, self.decode, self.skip, codec.dictionary(key, value.View, { sortKeys, fixedLength }));
|
|
26376
26376
|
}
|
|
26377
26377
|
return self;
|
|
26378
26378
|
};
|
|
26379
26379
|
/** Encoding of pair of two values. */
|
|
26380
26380
|
codec.pair = (a, b) => {
|
|
26381
|
-
const self =
|
|
26381
|
+
const self = Descriptor.new(`Pair<${a.name}, ${b.name}>`, addSizeHints(a.sizeHint, b.sizeHint), (e, elem) => {
|
|
26382
26382
|
a.encode(e, elem[0]);
|
|
26383
26383
|
b.encode(e, elem[1]);
|
|
26384
26384
|
}, (d) => {
|
|
@@ -26390,14 +26390,14 @@ var descriptors_codec;
|
|
|
26390
26390
|
b.skip(s);
|
|
26391
26391
|
});
|
|
26392
26392
|
if (hasUniqueView(a) && hasUniqueView(b)) {
|
|
26393
|
-
return
|
|
26393
|
+
return Descriptor.withView(self.name, self.sizeHint, self.encode, self.decode, self.skip, codec.pair(a.View, b.View));
|
|
26394
26394
|
}
|
|
26395
26395
|
return self;
|
|
26396
26396
|
};
|
|
26397
26397
|
/** Custom encoding / decoding logic. */
|
|
26398
|
-
codec.custom = ({ name, sizeHint = { bytes: 0, isExact: false }, }, encode, decode, skip) =>
|
|
26398
|
+
codec.custom = ({ name, sizeHint = { bytes: 0, isExact: false }, }, encode, decode, skip) => Descriptor.new(name, sizeHint, encode, decode, skip);
|
|
26399
26399
|
/** Choose a descriptor depending on the encoding/decoding context. */
|
|
26400
|
-
codec.select = ({ name, sizeHint, }, chooser) =>
|
|
26400
|
+
codec.select = ({ name, sizeHint, }, chooser) => Descriptor.withView(name, sizeHint, (e, x) => chooser(e.getContext()).encode(e, x), (d) => chooser(d.getContext()).decode(d), (s) => chooser(s.decoder.getContext()).skip(s), chooser(null).View);
|
|
26401
26401
|
/**
|
|
26402
26402
|
* A descriptor for a more complex POJO.
|
|
26403
26403
|
*
|
|
@@ -26434,7 +26434,7 @@ var descriptors_codec;
|
|
|
26434
26434
|
};
|
|
26435
26435
|
const view = objectView(Class, descriptors, sizeHint, skipper);
|
|
26436
26436
|
// and create the descriptor for the entire class.
|
|
26437
|
-
return
|
|
26437
|
+
return Descriptor.withView(Class.name, sizeHint, (e, t) => {
|
|
26438
26438
|
forEachDescriptor(descriptors, (key, descriptor) => {
|
|
26439
26439
|
const value = t[key];
|
|
26440
26440
|
descriptor.encode(e, value);
|
|
@@ -26485,7 +26485,7 @@ function objectView(Class, descriptors, sizeHint, skipper) {
|
|
|
26485
26485
|
});
|
|
26486
26486
|
}
|
|
26487
26487
|
});
|
|
26488
|
-
return
|
|
26488
|
+
return Descriptor.new(`View<${Class.name}>`, sizeHint, (e, t) => {
|
|
26489
26489
|
const encoded = t.encoded();
|
|
26490
26490
|
e.bytes(bytes_Bytes.fromBlob(encoded.raw, encoded.length));
|
|
26491
26491
|
}, (d) => {
|
|
@@ -26504,7 +26504,7 @@ function sequenceViewVarLen(type, options) {
|
|
|
26504
26504
|
validateLength(options, length, name);
|
|
26505
26505
|
return s.sequenceFixLen(type, length);
|
|
26506
26506
|
};
|
|
26507
|
-
return
|
|
26507
|
+
return Descriptor.new(name, sizeHint, (e, t) => {
|
|
26508
26508
|
validateLength(options, t.length, name);
|
|
26509
26509
|
const encoded = t.encoded();
|
|
26510
26510
|
e.bytes(bytes_Bytes.fromBlob(encoded.raw, encoded.length));
|
|
@@ -26520,7 +26520,7 @@ function sequenceViewFixLen(type, { fixedLength }) {
|
|
|
26520
26520
|
const skipper = (s) => s.sequenceFixLen(type, fixedLength);
|
|
26521
26521
|
const view = type.name !== type.View.name ? `, ${type.View.name}` : "";
|
|
26522
26522
|
const name = `SeqView<${type.name}${view}>[${fixedLength}]`;
|
|
26523
|
-
return
|
|
26523
|
+
return Descriptor.new(name, sizeHint, (e, t) => {
|
|
26524
26524
|
const encoded = t.encoded();
|
|
26525
26525
|
e.bytes(bytes_Bytes.fromBlob(encoded.raw, encoded.length));
|
|
26526
26526
|
}, (d) => {
|
|
@@ -28821,7 +28821,7 @@ const codecFixedSizeArray = (val, len) => {
|
|
|
28821
28821
|
};
|
|
28822
28822
|
/** Codec for a hash-dictionary. */
|
|
28823
28823
|
const codecHashDictionary = (value, extractKey, { typicalLength = TYPICAL_DICTIONARY_LENGTH, compare = (a, b) => extractKey(a).compare(extractKey(b)), } = {}) => {
|
|
28824
|
-
return
|
|
28824
|
+
return Descriptor.new(`HashDictionary<${value.name}>[?]`, {
|
|
28825
28825
|
bytes: typicalLength * value.sizeHint.bytes,
|
|
28826
28826
|
isExact: false,
|
|
28827
28827
|
}, (e, v) => {
|
|
@@ -31883,6 +31883,13 @@ const W_T = 128;
|
|
|
31883
31883
|
/** `W_M`: The maximum number of exports in a work-package. */
|
|
31884
31884
|
const W_X = 3_072;
|
|
31885
31885
|
// TODO [ToDr] Not sure where these should live yet :(
|
|
31886
|
+
/**
|
|
31887
|
+
* `S`: The minimum public service index.
|
|
31888
|
+
* Services of indices below these may only be created by the Registrar.
|
|
31889
|
+
*
|
|
31890
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/447a00447a00?v=0.7.2
|
|
31891
|
+
*/
|
|
31892
|
+
const MIN_PUBLIC_SERVICE_INDEX = (/* unused pure expression or super */ null && (2 ** 16));
|
|
31886
31893
|
/**
|
|
31887
31894
|
* `J`: The maximum sum of dependency items in a work-report.
|
|
31888
31895
|
*
|
|
@@ -31894,9 +31901,209 @@ const AUTHORIZATION_QUEUE_SIZE = Q;
|
|
|
31894
31901
|
/** `O`: Maximal authorization pool size. */
|
|
31895
31902
|
const MAX_AUTH_POOL_SIZE = O;
|
|
31896
31903
|
|
|
31904
|
+
;// CONCATENATED MODULE: ./packages/core/pvm-interpreter/ops/math-consts.ts
|
|
31905
|
+
const MAX_VALUE = 4294967295;
|
|
31906
|
+
const math_consts_MAX_VALUE_U64 = (/* unused pure expression or super */ null && (2n ** 63n));
|
|
31907
|
+
const MIN_VALUE = (/* unused pure expression or super */ null && (-(2 ** 31)));
|
|
31908
|
+
const MAX_SHIFT_U32 = 32;
|
|
31909
|
+
const MAX_SHIFT_U64 = 64n;
|
|
31910
|
+
|
|
31911
|
+
;// CONCATENATED MODULE: ./packages/jam/state/service.ts
|
|
31912
|
+
|
|
31913
|
+
|
|
31914
|
+
|
|
31915
|
+
|
|
31916
|
+
|
|
31917
|
+
|
|
31918
|
+
/**
|
|
31919
|
+
* `B_S`: The basic minimum balance which all services require.
|
|
31920
|
+
*
|
|
31921
|
+
* https://graypaper.fluffylabs.dev/#/7e6ff6a/445800445800?v=0.6.7
|
|
31922
|
+
*/
|
|
31923
|
+
const BASE_SERVICE_BALANCE = 100n;
|
|
31924
|
+
/**
|
|
31925
|
+
* `B_I`: The additional minimum balance required per item of elective service state.
|
|
31926
|
+
*
|
|
31927
|
+
* https://graypaper.fluffylabs.dev/#/7e6ff6a/445000445000?v=0.6.7
|
|
31928
|
+
*/
|
|
31929
|
+
const ELECTIVE_ITEM_BALANCE = 10n;
|
|
31930
|
+
/**
|
|
31931
|
+
* `B_L`: The additional minimum balance required per octet of elective service state.
|
|
31932
|
+
*
|
|
31933
|
+
* https://graypaper.fluffylabs.dev/#/7e6ff6a/445400445400?v=0.6.7
|
|
31934
|
+
*/
|
|
31935
|
+
const ELECTIVE_BYTE_BALANCE = 1n;
|
|
31936
|
+
const zeroSizeHint = {
|
|
31937
|
+
bytes: 0,
|
|
31938
|
+
isExact: true,
|
|
31939
|
+
};
|
|
31940
|
+
/** 0-byte read, return given default value */
|
|
31941
|
+
const ignoreValueWithDefault = (defaultValue) => Descriptor.new("ignoreValue", zeroSizeHint, (_e, _v) => { }, (_d) => defaultValue, (_s) => { });
|
|
31942
|
+
/** Encode and decode object with leading version number. */
|
|
31943
|
+
const codecWithVersion = (val) => Descriptor.new("withVersion", {
|
|
31944
|
+
bytes: val.sizeHint.bytes + 8,
|
|
31945
|
+
isExact: false,
|
|
31946
|
+
}, (e, v) => {
|
|
31947
|
+
e.varU64(0n);
|
|
31948
|
+
val.encode(e, v);
|
|
31949
|
+
}, (d) => {
|
|
31950
|
+
const version = d.varU64();
|
|
31951
|
+
if (version !== 0n) {
|
|
31952
|
+
throw new Error("Non-zero version is not supported!");
|
|
31953
|
+
}
|
|
31954
|
+
return val.decode(d);
|
|
31955
|
+
}, (s) => {
|
|
31956
|
+
s.varU64();
|
|
31957
|
+
val.skip(s);
|
|
31958
|
+
});
|
|
31959
|
+
/**
|
|
31960
|
+
* Service account details.
|
|
31961
|
+
*
|
|
31962
|
+
* https://graypaper.fluffylabs.dev/#/7e6ff6a/108301108301?v=0.6.7
|
|
31963
|
+
*/
|
|
31964
|
+
class ServiceAccountInfo extends WithDebug {
|
|
31965
|
+
codeHash;
|
|
31966
|
+
balance;
|
|
31967
|
+
accumulateMinGas;
|
|
31968
|
+
onTransferMinGas;
|
|
31969
|
+
storageUtilisationBytes;
|
|
31970
|
+
gratisStorage;
|
|
31971
|
+
storageUtilisationCount;
|
|
31972
|
+
created;
|
|
31973
|
+
lastAccumulation;
|
|
31974
|
+
parentService;
|
|
31975
|
+
static Codec = descriptors_codec.Class(ServiceAccountInfo, {
|
|
31976
|
+
codeHash: descriptors_codec.bytes(hash_HASH_SIZE).asOpaque(),
|
|
31977
|
+
balance: descriptors_codec.u64,
|
|
31978
|
+
accumulateMinGas: descriptors_codec.u64.convert((x) => x, tryAsServiceGas),
|
|
31979
|
+
onTransferMinGas: descriptors_codec.u64.convert((x) => x, tryAsServiceGas),
|
|
31980
|
+
storageUtilisationBytes: descriptors_codec.u64,
|
|
31981
|
+
gratisStorage: descriptors_codec.u64,
|
|
31982
|
+
storageUtilisationCount: descriptors_codec.u32,
|
|
31983
|
+
created: descriptors_codec.u32.convert((x) => x, common_tryAsTimeSlot),
|
|
31984
|
+
lastAccumulation: descriptors_codec.u32.convert((x) => x, common_tryAsTimeSlot),
|
|
31985
|
+
parentService: descriptors_codec.u32.convert((x) => x, tryAsServiceId),
|
|
31986
|
+
});
|
|
31987
|
+
static create(a) {
|
|
31988
|
+
return new ServiceAccountInfo(a.codeHash, a.balance, a.accumulateMinGas, a.onTransferMinGas, a.storageUtilisationBytes, a.gratisStorage, a.storageUtilisationCount, a.created, a.lastAccumulation, a.parentService);
|
|
31989
|
+
}
|
|
31990
|
+
/**
|
|
31991
|
+
* `a_t = max(0, BS + BI * a_i + BL * a_o - a_f)`
|
|
31992
|
+
* https://graypaper.fluffylabs.dev/#/7e6ff6a/119e01119e01?v=0.6.7
|
|
31993
|
+
*/
|
|
31994
|
+
static calculateThresholdBalance(items, bytes, gratisStorage) {
|
|
31995
|
+
const storageCost = BASE_SERVICE_BALANCE + ELECTIVE_ITEM_BALANCE * BigInt(items) + ELECTIVE_BYTE_BALANCE * bytes - gratisStorage;
|
|
31996
|
+
if (storageCost < 0n) {
|
|
31997
|
+
return tryAsU64(0);
|
|
31998
|
+
}
|
|
31999
|
+
if (storageCost >= 2n ** 64n) {
|
|
32000
|
+
return tryAsU64(2n ** 64n - 1n);
|
|
32001
|
+
}
|
|
32002
|
+
return tryAsU64(storageCost);
|
|
32003
|
+
}
|
|
32004
|
+
constructor(
|
|
32005
|
+
/** `a_c`: Hash of the service code. */
|
|
32006
|
+
codeHash,
|
|
32007
|
+
/** `a_b`: Current account balance. */
|
|
32008
|
+
balance,
|
|
32009
|
+
/** `a_g`: Minimal gas required to execute Accumulate entrypoint. */
|
|
32010
|
+
accumulateMinGas,
|
|
32011
|
+
/** `a_m`: Minimal gas required to execute On Transfer entrypoint. */
|
|
32012
|
+
onTransferMinGas,
|
|
32013
|
+
/** `a_o`: Total number of octets in storage. */
|
|
32014
|
+
storageUtilisationBytes,
|
|
32015
|
+
/** `a_f`: Cost-free storage. Decreases both storage item count and total byte size. */
|
|
32016
|
+
gratisStorage,
|
|
32017
|
+
/** `a_i`: Number of items in storage. */
|
|
32018
|
+
storageUtilisationCount,
|
|
32019
|
+
/** `a_r`: Creation account time slot. */
|
|
32020
|
+
created,
|
|
32021
|
+
/** `a_a`: Most recent accumulation time slot. */
|
|
32022
|
+
lastAccumulation,
|
|
32023
|
+
/** `a_p`: Parent service ID. */
|
|
32024
|
+
parentService) {
|
|
32025
|
+
super();
|
|
32026
|
+
this.codeHash = codeHash;
|
|
32027
|
+
this.balance = balance;
|
|
32028
|
+
this.accumulateMinGas = accumulateMinGas;
|
|
32029
|
+
this.onTransferMinGas = onTransferMinGas;
|
|
32030
|
+
this.storageUtilisationBytes = storageUtilisationBytes;
|
|
32031
|
+
this.gratisStorage = gratisStorage;
|
|
32032
|
+
this.storageUtilisationCount = storageUtilisationCount;
|
|
32033
|
+
this.created = created;
|
|
32034
|
+
this.lastAccumulation = lastAccumulation;
|
|
32035
|
+
this.parentService = parentService;
|
|
32036
|
+
}
|
|
32037
|
+
}
|
|
32038
|
+
class PreimageItem extends WithDebug {
|
|
32039
|
+
hash;
|
|
32040
|
+
blob;
|
|
32041
|
+
static Codec = descriptors_codec.Class(PreimageItem, {
|
|
32042
|
+
hash: descriptors_codec.bytes(hash_HASH_SIZE).asOpaque(),
|
|
32043
|
+
blob: descriptors_codec.blob,
|
|
32044
|
+
});
|
|
32045
|
+
static create({ hash, blob }) {
|
|
32046
|
+
return new PreimageItem(hash, blob);
|
|
32047
|
+
}
|
|
32048
|
+
constructor(hash, blob) {
|
|
32049
|
+
super();
|
|
32050
|
+
this.hash = hash;
|
|
32051
|
+
this.blob = blob;
|
|
32052
|
+
}
|
|
32053
|
+
}
|
|
32054
|
+
class StorageItem extends WithDebug {
|
|
32055
|
+
key;
|
|
32056
|
+
value;
|
|
32057
|
+
static Codec = descriptors_codec.Class(StorageItem, {
|
|
32058
|
+
key: descriptors_codec.blob.convert((i) => i, (o) => opaque_asOpaqueType(o)),
|
|
32059
|
+
value: descriptors_codec.blob,
|
|
32060
|
+
});
|
|
32061
|
+
static create({ key, value }) {
|
|
32062
|
+
return new StorageItem(key, value);
|
|
32063
|
+
}
|
|
32064
|
+
constructor(key, value) {
|
|
32065
|
+
super();
|
|
32066
|
+
this.key = key;
|
|
32067
|
+
this.value = value;
|
|
32068
|
+
}
|
|
32069
|
+
}
|
|
32070
|
+
const MAX_LOOKUP_HISTORY_SLOTS = 3;
|
|
32071
|
+
function service_tryAsLookupHistorySlots(items) {
|
|
32072
|
+
const knownSize = sized_array_asKnownSize(items);
|
|
32073
|
+
if (knownSize.length > MAX_LOOKUP_HISTORY_SLOTS) {
|
|
32074
|
+
throw new Error(`Lookup history items must contain 0-${MAX_LOOKUP_HISTORY_SLOTS} timeslots.`);
|
|
32075
|
+
}
|
|
32076
|
+
return knownSize;
|
|
32077
|
+
}
|
|
32078
|
+
/** https://graypaper.fluffylabs.dev/#/5f542d7/115400115800 */
|
|
32079
|
+
class LookupHistoryItem {
|
|
32080
|
+
hash;
|
|
32081
|
+
length;
|
|
32082
|
+
slots;
|
|
32083
|
+
constructor(hash, length,
|
|
32084
|
+
/**
|
|
32085
|
+
* Preimage availability history as a sequence of time slots.
|
|
32086
|
+
* See PreimageStatus and the following GP fragment for more details.
|
|
32087
|
+
* https://graypaper.fluffylabs.dev/#/5f542d7/11780011a500 */
|
|
32088
|
+
slots) {
|
|
32089
|
+
this.hash = hash;
|
|
32090
|
+
this.length = length;
|
|
32091
|
+
this.slots = slots;
|
|
32092
|
+
}
|
|
32093
|
+
static isRequested(item) {
|
|
32094
|
+
if ("slots" in item) {
|
|
32095
|
+
return item.slots.length === 0;
|
|
32096
|
+
}
|
|
32097
|
+
return item.length === 0;
|
|
32098
|
+
}
|
|
32099
|
+
}
|
|
32100
|
+
|
|
31897
32101
|
;// CONCATENATED MODULE: ./packages/jam/state/privileged-services.ts
|
|
31898
32102
|
|
|
31899
32103
|
|
|
32104
|
+
|
|
32105
|
+
|
|
32106
|
+
|
|
31900
32107
|
/** Dictionary entry of services that auto-accumulate every block. */
|
|
31901
32108
|
class AutoAccumulate {
|
|
31902
32109
|
service;
|
|
@@ -31918,39 +32125,50 @@ class AutoAccumulate {
|
|
|
31918
32125
|
}
|
|
31919
32126
|
}
|
|
31920
32127
|
/**
|
|
31921
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
32128
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/114402114402?v=0.7.2
|
|
31922
32129
|
*/
|
|
31923
32130
|
class PrivilegedServices {
|
|
31924
32131
|
manager;
|
|
31925
|
-
|
|
31926
|
-
|
|
32132
|
+
delegator;
|
|
32133
|
+
registrar;
|
|
32134
|
+
assigners;
|
|
31927
32135
|
autoAccumulateServices;
|
|
32136
|
+
/** https://graypaper.fluffylabs.dev/#/ab2cdbd/3bbd023bcb02?v=0.7.2 */
|
|
31928
32137
|
static Codec = descriptors_codec.Class(PrivilegedServices, {
|
|
31929
32138
|
manager: descriptors_codec.u32.asOpaque(),
|
|
31930
|
-
|
|
31931
|
-
|
|
32139
|
+
assigners: codecPerCore(descriptors_codec.u32.asOpaque()),
|
|
32140
|
+
delegator: descriptors_codec.u32.asOpaque(),
|
|
32141
|
+
registrar: compatibility_Compatibility.isGreaterOrEqual(compatibility_GpVersion.V0_7_1)
|
|
32142
|
+
? descriptors_codec.u32.asOpaque()
|
|
32143
|
+
: ignoreValueWithDefault(tryAsServiceId(2 ** 32 - 1)),
|
|
31932
32144
|
autoAccumulateServices: readonlyArray(descriptors_codec.sequenceVarLen(AutoAccumulate.Codec)),
|
|
31933
32145
|
});
|
|
31934
|
-
static create(
|
|
31935
|
-
return new PrivilegedServices(manager,
|
|
32146
|
+
static create(a) {
|
|
32147
|
+
return new PrivilegedServices(a.manager, a.delegator, a.registrar, a.assigners, a.autoAccumulateServices);
|
|
31936
32148
|
}
|
|
31937
32149
|
constructor(
|
|
31938
32150
|
/**
|
|
31939
|
-
*
|
|
31940
|
-
* the service able to effect an alteration of χ from block to block,
|
|
32151
|
+
* `χ_M`: Manages alteration of χ from block to block,
|
|
31941
32152
|
* as well as bestow services with storage deposit credits.
|
|
31942
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
32153
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/111502111902?v=0.7.2
|
|
31943
32154
|
*/
|
|
31944
32155
|
manager,
|
|
31945
|
-
/**
|
|
31946
|
-
|
|
31947
|
-
/**
|
|
31948
|
-
|
|
31949
|
-
|
|
32156
|
+
/** `χ_V`: Managers validator keys. */
|
|
32157
|
+
delegator,
|
|
32158
|
+
/**
|
|
32159
|
+
* `χ_R`: Manages the creation of services in protected range.
|
|
32160
|
+
*
|
|
32161
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/111b02111d02?v=0.7.2
|
|
32162
|
+
*/
|
|
32163
|
+
registrar,
|
|
32164
|
+
/** `χ_A`: Manages authorization queue one for each core. */
|
|
32165
|
+
assigners,
|
|
32166
|
+
/** `χ_Z`: Dictionary of services that auto-accumulate every block with their gas limit. */
|
|
31950
32167
|
autoAccumulateServices) {
|
|
31951
32168
|
this.manager = manager;
|
|
31952
|
-
this.
|
|
31953
|
-
this.
|
|
32169
|
+
this.delegator = delegator;
|
|
32170
|
+
this.registrar = registrar;
|
|
32171
|
+
this.assigners = assigners;
|
|
31954
32172
|
this.autoAccumulateServices = autoAccumulateServices;
|
|
31955
32173
|
}
|
|
31956
32174
|
}
|
|
@@ -32038,7 +32256,7 @@ class RecentBlocks extends WithDebug {
|
|
|
32038
32256
|
*/
|
|
32039
32257
|
class RecentBlocksHistory extends WithDebug {
|
|
32040
32258
|
current;
|
|
32041
|
-
static Codec =
|
|
32259
|
+
static Codec = Descriptor.new("RecentBlocksHistory", RecentBlocks.Codec.sizeHint, (encoder, value) => RecentBlocks.Codec.encode(encoder, value.asCurrent()), (decoder) => {
|
|
32042
32260
|
const recentBlocks = RecentBlocks.Codec.decode(decoder);
|
|
32043
32261
|
return RecentBlocksHistory.create(recentBlocks);
|
|
32044
32262
|
}, (skip) => {
|
|
@@ -32235,196 +32453,6 @@ class safrole_data_SafroleData {
|
|
|
32235
32453
|
}
|
|
32236
32454
|
}
|
|
32237
32455
|
|
|
32238
|
-
;// CONCATENATED MODULE: ./packages/jam/state/service.ts
|
|
32239
|
-
|
|
32240
|
-
|
|
32241
|
-
|
|
32242
|
-
|
|
32243
|
-
|
|
32244
|
-
|
|
32245
|
-
/**
|
|
32246
|
-
* `B_S`: The basic minimum balance which all services require.
|
|
32247
|
-
*
|
|
32248
|
-
* https://graypaper.fluffylabs.dev/#/7e6ff6a/445800445800?v=0.6.7
|
|
32249
|
-
*/
|
|
32250
|
-
const BASE_SERVICE_BALANCE = 100n;
|
|
32251
|
-
/**
|
|
32252
|
-
* `B_I`: The additional minimum balance required per item of elective service state.
|
|
32253
|
-
*
|
|
32254
|
-
* https://graypaper.fluffylabs.dev/#/7e6ff6a/445000445000?v=0.6.7
|
|
32255
|
-
*/
|
|
32256
|
-
const ELECTIVE_ITEM_BALANCE = 10n;
|
|
32257
|
-
/**
|
|
32258
|
-
* `B_L`: The additional minimum balance required per octet of elective service state.
|
|
32259
|
-
*
|
|
32260
|
-
* https://graypaper.fluffylabs.dev/#/7e6ff6a/445400445400?v=0.6.7
|
|
32261
|
-
*/
|
|
32262
|
-
const ELECTIVE_BYTE_BALANCE = 1n;
|
|
32263
|
-
const zeroSizeHint = {
|
|
32264
|
-
bytes: 0,
|
|
32265
|
-
isExact: true,
|
|
32266
|
-
};
|
|
32267
|
-
/** 0-byte read, return given default value */
|
|
32268
|
-
const ignoreValueWithDefault = (defaultValue) => Descriptor.new("ignoreValue", zeroSizeHint, (_e, _v) => { }, (_d) => defaultValue, (_s) => { });
|
|
32269
|
-
/** Encode and decode object with leading version number. */
|
|
32270
|
-
const codecWithVersion = (val) => descriptor_Descriptor.new("withVersion", {
|
|
32271
|
-
bytes: val.sizeHint.bytes + 8,
|
|
32272
|
-
isExact: false,
|
|
32273
|
-
}, (e, v) => {
|
|
32274
|
-
e.varU64(0n);
|
|
32275
|
-
val.encode(e, v);
|
|
32276
|
-
}, (d) => {
|
|
32277
|
-
const version = d.varU64();
|
|
32278
|
-
if (version !== 0n) {
|
|
32279
|
-
throw new Error("Non-zero version is not supported!");
|
|
32280
|
-
}
|
|
32281
|
-
return val.decode(d);
|
|
32282
|
-
}, (s) => {
|
|
32283
|
-
s.varU64();
|
|
32284
|
-
val.skip(s);
|
|
32285
|
-
});
|
|
32286
|
-
/**
|
|
32287
|
-
* Service account details.
|
|
32288
|
-
*
|
|
32289
|
-
* https://graypaper.fluffylabs.dev/#/7e6ff6a/108301108301?v=0.6.7
|
|
32290
|
-
*/
|
|
32291
|
-
class ServiceAccountInfo extends WithDebug {
|
|
32292
|
-
codeHash;
|
|
32293
|
-
balance;
|
|
32294
|
-
accumulateMinGas;
|
|
32295
|
-
onTransferMinGas;
|
|
32296
|
-
storageUtilisationBytes;
|
|
32297
|
-
gratisStorage;
|
|
32298
|
-
storageUtilisationCount;
|
|
32299
|
-
created;
|
|
32300
|
-
lastAccumulation;
|
|
32301
|
-
parentService;
|
|
32302
|
-
static Codec = descriptors_codec.Class(ServiceAccountInfo, {
|
|
32303
|
-
codeHash: descriptors_codec.bytes(hash_HASH_SIZE).asOpaque(),
|
|
32304
|
-
balance: descriptors_codec.u64,
|
|
32305
|
-
accumulateMinGas: descriptors_codec.u64.convert((x) => x, tryAsServiceGas),
|
|
32306
|
-
onTransferMinGas: descriptors_codec.u64.convert((x) => x, tryAsServiceGas),
|
|
32307
|
-
storageUtilisationBytes: descriptors_codec.u64,
|
|
32308
|
-
gratisStorage: descriptors_codec.u64,
|
|
32309
|
-
storageUtilisationCount: descriptors_codec.u32,
|
|
32310
|
-
created: descriptors_codec.u32.convert((x) => x, common_tryAsTimeSlot),
|
|
32311
|
-
lastAccumulation: descriptors_codec.u32.convert((x) => x, common_tryAsTimeSlot),
|
|
32312
|
-
parentService: descriptors_codec.u32.convert((x) => x, tryAsServiceId),
|
|
32313
|
-
});
|
|
32314
|
-
static create(a) {
|
|
32315
|
-
return new ServiceAccountInfo(a.codeHash, a.balance, a.accumulateMinGas, a.onTransferMinGas, a.storageUtilisationBytes, a.gratisStorage, a.storageUtilisationCount, a.created, a.lastAccumulation, a.parentService);
|
|
32316
|
-
}
|
|
32317
|
-
/**
|
|
32318
|
-
* `a_t = max(0, BS + BI * a_i + BL * a_o - a_f)`
|
|
32319
|
-
* https://graypaper.fluffylabs.dev/#/7e6ff6a/119e01119e01?v=0.6.7
|
|
32320
|
-
*/
|
|
32321
|
-
static calculateThresholdBalance(items, bytes, gratisStorage) {
|
|
32322
|
-
const storageCost = BASE_SERVICE_BALANCE + ELECTIVE_ITEM_BALANCE * BigInt(items) + ELECTIVE_BYTE_BALANCE * bytes - gratisStorage;
|
|
32323
|
-
if (storageCost < 0n) {
|
|
32324
|
-
return tryAsU64(0);
|
|
32325
|
-
}
|
|
32326
|
-
if (storageCost >= 2n ** 64n) {
|
|
32327
|
-
return tryAsU64(2n ** 64n - 1n);
|
|
32328
|
-
}
|
|
32329
|
-
return tryAsU64(storageCost);
|
|
32330
|
-
}
|
|
32331
|
-
constructor(
|
|
32332
|
-
/** `a_c`: Hash of the service code. */
|
|
32333
|
-
codeHash,
|
|
32334
|
-
/** `a_b`: Current account balance. */
|
|
32335
|
-
balance,
|
|
32336
|
-
/** `a_g`: Minimal gas required to execute Accumulate entrypoint. */
|
|
32337
|
-
accumulateMinGas,
|
|
32338
|
-
/** `a_m`: Minimal gas required to execute On Transfer entrypoint. */
|
|
32339
|
-
onTransferMinGas,
|
|
32340
|
-
/** `a_o`: Total number of octets in storage. */
|
|
32341
|
-
storageUtilisationBytes,
|
|
32342
|
-
/** `a_f`: Cost-free storage. Decreases both storage item count and total byte size. */
|
|
32343
|
-
gratisStorage,
|
|
32344
|
-
/** `a_i`: Number of items in storage. */
|
|
32345
|
-
storageUtilisationCount,
|
|
32346
|
-
/** `a_r`: Creation account time slot. */
|
|
32347
|
-
created,
|
|
32348
|
-
/** `a_a`: Most recent accumulation time slot. */
|
|
32349
|
-
lastAccumulation,
|
|
32350
|
-
/** `a_p`: Parent service ID. */
|
|
32351
|
-
parentService) {
|
|
32352
|
-
super();
|
|
32353
|
-
this.codeHash = codeHash;
|
|
32354
|
-
this.balance = balance;
|
|
32355
|
-
this.accumulateMinGas = accumulateMinGas;
|
|
32356
|
-
this.onTransferMinGas = onTransferMinGas;
|
|
32357
|
-
this.storageUtilisationBytes = storageUtilisationBytes;
|
|
32358
|
-
this.gratisStorage = gratisStorage;
|
|
32359
|
-
this.storageUtilisationCount = storageUtilisationCount;
|
|
32360
|
-
this.created = created;
|
|
32361
|
-
this.lastAccumulation = lastAccumulation;
|
|
32362
|
-
this.parentService = parentService;
|
|
32363
|
-
}
|
|
32364
|
-
}
|
|
32365
|
-
class PreimageItem extends WithDebug {
|
|
32366
|
-
hash;
|
|
32367
|
-
blob;
|
|
32368
|
-
static Codec = descriptors_codec.Class(PreimageItem, {
|
|
32369
|
-
hash: descriptors_codec.bytes(hash_HASH_SIZE).asOpaque(),
|
|
32370
|
-
blob: descriptors_codec.blob,
|
|
32371
|
-
});
|
|
32372
|
-
static create({ hash, blob }) {
|
|
32373
|
-
return new PreimageItem(hash, blob);
|
|
32374
|
-
}
|
|
32375
|
-
constructor(hash, blob) {
|
|
32376
|
-
super();
|
|
32377
|
-
this.hash = hash;
|
|
32378
|
-
this.blob = blob;
|
|
32379
|
-
}
|
|
32380
|
-
}
|
|
32381
|
-
class StorageItem extends WithDebug {
|
|
32382
|
-
key;
|
|
32383
|
-
value;
|
|
32384
|
-
static Codec = descriptors_codec.Class(StorageItem, {
|
|
32385
|
-
key: descriptors_codec.blob.convert((i) => i, (o) => opaque_asOpaqueType(o)),
|
|
32386
|
-
value: descriptors_codec.blob,
|
|
32387
|
-
});
|
|
32388
|
-
static create({ key, value }) {
|
|
32389
|
-
return new StorageItem(key, value);
|
|
32390
|
-
}
|
|
32391
|
-
constructor(key, value) {
|
|
32392
|
-
super();
|
|
32393
|
-
this.key = key;
|
|
32394
|
-
this.value = value;
|
|
32395
|
-
}
|
|
32396
|
-
}
|
|
32397
|
-
const MAX_LOOKUP_HISTORY_SLOTS = 3;
|
|
32398
|
-
function service_tryAsLookupHistorySlots(items) {
|
|
32399
|
-
const knownSize = sized_array_asKnownSize(items);
|
|
32400
|
-
if (knownSize.length > MAX_LOOKUP_HISTORY_SLOTS) {
|
|
32401
|
-
throw new Error(`Lookup history items must contain 0-${MAX_LOOKUP_HISTORY_SLOTS} timeslots.`);
|
|
32402
|
-
}
|
|
32403
|
-
return knownSize;
|
|
32404
|
-
}
|
|
32405
|
-
/** https://graypaper.fluffylabs.dev/#/5f542d7/115400115800 */
|
|
32406
|
-
class LookupHistoryItem {
|
|
32407
|
-
hash;
|
|
32408
|
-
length;
|
|
32409
|
-
slots;
|
|
32410
|
-
constructor(hash, length,
|
|
32411
|
-
/**
|
|
32412
|
-
* Preimage availability history as a sequence of time slots.
|
|
32413
|
-
* See PreimageStatus and the following GP fragment for more details.
|
|
32414
|
-
* https://graypaper.fluffylabs.dev/#/5f542d7/11780011a500 */
|
|
32415
|
-
slots) {
|
|
32416
|
-
this.hash = hash;
|
|
32417
|
-
this.length = length;
|
|
32418
|
-
this.slots = slots;
|
|
32419
|
-
}
|
|
32420
|
-
static isRequested(item) {
|
|
32421
|
-
if ("slots" in item) {
|
|
32422
|
-
return item.slots.length === 0;
|
|
32423
|
-
}
|
|
32424
|
-
return item.length === 0;
|
|
32425
|
-
}
|
|
32426
|
-
}
|
|
32427
|
-
|
|
32428
32456
|
;// CONCATENATED MODULE: ./packages/jam/state/state.ts
|
|
32429
32457
|
/**
|
|
32430
32458
|
* In addition to the entropy accumulator η_0, we retain
|
|
@@ -32861,6 +32889,7 @@ class StatisticsData {
|
|
|
32861
32889
|
|
|
32862
32890
|
|
|
32863
32891
|
|
|
32892
|
+
|
|
32864
32893
|
|
|
32865
32894
|
|
|
32866
32895
|
var in_memory_state_UpdateError;
|
|
@@ -33264,8 +33293,9 @@ class InMemoryState extends WithDebug {
|
|
|
33264
33293
|
epochRoot: bytes_Bytes.zero(BANDERSNATCH_RING_ROOT_BYTES).asOpaque(),
|
|
33265
33294
|
privilegedServices: PrivilegedServices.create({
|
|
33266
33295
|
manager: tryAsServiceId(0),
|
|
33267
|
-
|
|
33268
|
-
|
|
33296
|
+
assigners: tryAsPerCore(new Array(spec.coresCount).fill(tryAsServiceId(0)), spec),
|
|
33297
|
+
delegator: tryAsServiceId(0),
|
|
33298
|
+
registrar: tryAsServiceId(MAX_VALUE),
|
|
33269
33299
|
autoAccumulateServices: [],
|
|
33270
33300
|
}),
|
|
33271
33301
|
accumulationOutputLog: SortedArray.fromArray(accumulationOutputComparator, []),
|
|
@@ -33501,7 +33531,7 @@ var serialize_serialize;
|
|
|
33501
33531
|
* determine the boundary of the bytes, so it can only be used
|
|
33502
33532
|
* as the last element of the codec and can't be used in sequences!
|
|
33503
33533
|
*/
|
|
33504
|
-
const dumpCodec =
|
|
33534
|
+
const dumpCodec = Descriptor.new("Dump", { bytes: 64, isExact: false }, (e, v) => e.bytes(bytes_Bytes.fromBlob(v.raw, v.raw.length)), (d) => bytes_BytesBlob.blobFrom(d.bytes(d.source.length - d.bytesRead()).raw), (s) => s.bytes(s.decoder.source.length - s.decoder.bytesRead()));
|
|
33505
33535
|
|
|
33506
33536
|
;// CONCATENATED MODULE: ./packages/jam/state-merkleization/serialized-state.ts
|
|
33507
33537
|
|
|
@@ -34812,7 +34842,7 @@ const codecMap = (value, extractKey, { typicalLength = TYPICAL_DICTIONARY_LENGTH
|
|
|
34812
34842
|
}
|
|
34813
34843
|
return Ordering.Equal;
|
|
34814
34844
|
}, } = {}) => {
|
|
34815
|
-
return
|
|
34845
|
+
return Descriptor.new(`Map<${value.name}>[?]`, {
|
|
34816
34846
|
bytes: typicalLength * value.sizeHint.bytes,
|
|
34817
34847
|
isExact: false,
|
|
34818
34848
|
}, (e, v) => {
|