@typeberry/jam 0.1.2-7ebe1f6 → 0.1.2-80d53fd
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/README.md +0 -1
- package/block-generator/bootstrap-generator.mjs.map +1 -1
- package/block-generator/index.js +78 -117
- package/block-generator/index.js.map +1 -1
- package/bootstrap-generator.mjs.map +1 -1
- package/bootstrap-importer.mjs.map +1 -1
- package/bootstrap-network.mjs.map +1 -1
- package/importer/index.js +89 -126
- package/importer/index.js.map +1 -1
- package/index.js +110 -128
- package/index.js.map +1 -1
- package/jam-network/bootstrap-network.mjs +2 -2
- package/jam-network/bootstrap-network.mjs.map +1 -1
- package/jam-network/index.js +70 -97
- package/jam-network/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-generator.mjs","mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;;;;;;;;ACJA;AACA;AACA;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;ACAA;AACA;;;;AEDA;AACA;AACA;AACA","sources":["../external module \"tsx/esm/api\"",".././
|
|
1
|
+
{"version":3,"file":"bootstrap-generator.mjs","mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;;;;;;;;ACJA;AACA;AACA;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;ACAA;AACA;;;;AEDA;AACA;AACA;AACA","sources":["../external module \"tsx/esm/api\"",".././workers/block-generator/bootstrap-generator.mjs","../webpack/bootstrap","../webpack/runtime/async module","../webpack/runtime/define property getters","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/compat","../webpack/before-startup","../webpack/startup","../webpack/after-startup"],"sourcesContent":["var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nmodule.exports = x({ [\"tsImport\"]: () => (__WEBPACK_EXTERNAL_MODULE_tsx_esm_api_3a632928__.tsImport) });","import { tsImport } from \"tsx/esm/api\";\n\nawait tsImport(\"./index.ts\", import.meta.url);\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","var webpackQueues = typeof Symbol === \"function\" ? Symbol(\"webpack queues\") : \"__webpack_queues__\";\nvar webpackExports = typeof Symbol === \"function\" ? Symbol(\"webpack exports\") : \"__webpack_exports__\";\nvar webpackError = typeof Symbol === \"function\" ? Symbol(\"webpack error\") : \"__webpack_error__\";\nvar resolveQueue = (queue) => {\n\tif(queue && queue.d < 1) {\n\t\tqueue.d = 1;\n\t\tqueue.forEach((fn) => (fn.r--));\n\t\tqueue.forEach((fn) => (fn.r-- ? fn.r++ : fn()));\n\t}\n}\nvar wrapDeps = (deps) => (deps.map((dep) => {\n\tif(dep !== null && typeof dep === \"object\") {\n\t\tif(dep[webpackQueues]) return dep;\n\t\tif(dep.then) {\n\t\t\tvar queue = [];\n\t\t\tqueue.d = 0;\n\t\t\tdep.then((r) => {\n\t\t\t\tobj[webpackExports] = r;\n\t\t\t\tresolveQueue(queue);\n\t\t\t}, (e) => {\n\t\t\t\tobj[webpackError] = e;\n\t\t\t\tresolveQueue(queue);\n\t\t\t});\n\t\t\tvar obj = {};\n\t\t\tobj[webpackQueues] = (fn) => (fn(queue));\n\t\t\treturn obj;\n\t\t}\n\t}\n\tvar ret = {};\n\tret[webpackQueues] = x => {};\n\tret[webpackExports] = dep;\n\treturn ret;\n}));\n__webpack_require__.a = (module, body, hasAwait) => {\n\tvar queue;\n\thasAwait && ((queue = []).d = -1);\n\tvar depQueues = new Set();\n\tvar exports = module.exports;\n\tvar currentDeps;\n\tvar outerResolve;\n\tvar reject;\n\tvar promise = new Promise((resolve, rej) => {\n\t\treject = rej;\n\t\touterResolve = resolve;\n\t});\n\tpromise[webpackExports] = exports;\n\tpromise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise[\"catch\"](x => {}));\n\tmodule.exports = promise;\n\tbody((deps) => {\n\t\tcurrentDeps = wrapDeps(deps);\n\t\tvar fn;\n\t\tvar getResult = () => (currentDeps.map((d) => {\n\t\t\tif(d[webpackError]) throw d[webpackError];\n\t\t\treturn d[webpackExports];\n\t\t}))\n\t\tvar promise = new Promise((resolve) => {\n\t\t\tfn = () => (resolve(getResult));\n\t\t\tfn.r = 0;\n\t\t\tvar fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))));\n\t\t\tcurrentDeps.map((dep) => (dep[webpackQueues](fnQueue)));\n\t\t});\n\t\treturn fn.r ? promise : getResult();\n\t}, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue)));\n\tqueue && queue.d < 0 && (queue.d = 0);\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\\/\\/\\/\\w:/) ? 1 : 0, -1) + \"/\";","","// startup\n// Load entry module and return exports\n// This entry module used 'module' so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(305);\n",""],"names":[],"sourceRoot":""}
|
package/block-generator/index.js
CHANGED
|
@@ -3575,7 +3575,6 @@ var GpVersion;
|
|
|
3575
3575
|
GpVersion["V0_6_7"] = "0.6.7";
|
|
3576
3576
|
GpVersion["V0_7_0"] = "0.7.0";
|
|
3577
3577
|
GpVersion["V0_7_1"] = "0.7.1-preview";
|
|
3578
|
-
GpVersion["V0_7_2"] = "0.7.2-preview";
|
|
3579
3578
|
})(GpVersion || (GpVersion = {}));
|
|
3580
3579
|
var TestSuite;
|
|
3581
3580
|
(function (TestSuite) {
|
|
@@ -3583,7 +3582,7 @@ var TestSuite;
|
|
|
3583
3582
|
TestSuite["JAMDUNA"] = "jamduna";
|
|
3584
3583
|
})(TestSuite || (TestSuite = {}));
|
|
3585
3584
|
const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
|
|
3586
|
-
const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1
|
|
3585
|
+
const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1];
|
|
3587
3586
|
const env = typeof process === "undefined" ? {} : process.env;
|
|
3588
3587
|
const DEFAULT_VERSION = GpVersion.V0_7_0;
|
|
3589
3588
|
let CURRENT_VERSION = parseCurrentVersion(env.GP_VERSION) ?? DEFAULT_VERSION;
|
|
@@ -3592,26 +3591,20 @@ function parseCurrentVersion(env) {
|
|
|
3592
3591
|
if (env === undefined) {
|
|
3593
3592
|
return undefined;
|
|
3594
3593
|
}
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
case GpVersion.V0_7_1:
|
|
3599
|
-
case GpVersion.V0_7_2:
|
|
3600
|
-
return env;
|
|
3601
|
-
default:
|
|
3602
|
-
throw new Error(`Configured environment variable GP_VERSION is unknown: '${env}'. Use one of: ${ALL_VERSIONS_IN_ORDER}`);
|
|
3594
|
+
const version = env;
|
|
3595
|
+
if (!Object.values(GpVersion).includes(version)) {
|
|
3596
|
+
throw new Error(`Configured environment variable GP_VERSION is unknown: '${env}'. Use one of: ${ALL_VERSIONS_IN_ORDER}`);
|
|
3603
3597
|
}
|
|
3598
|
+
return version;
|
|
3604
3599
|
}
|
|
3605
3600
|
function parseCurrentSuite(env) {
|
|
3606
3601
|
if (env === undefined)
|
|
3607
3602
|
return undefined;
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
return env;
|
|
3612
|
-
default:
|
|
3613
|
-
throw new Error(`Configured environment variable TEST_SUITE is unknown: '${env}'. Use one of: ${Object.values(TestSuite)}`);
|
|
3603
|
+
const val = env;
|
|
3604
|
+
if (!Object.values(TestSuite).includes(val)) {
|
|
3605
|
+
throw new Error(`Configured environment variable TEST_SUITE is unknown: '${env}'. Use one of: ${Object.values(TestSuite)}`);
|
|
3614
3606
|
}
|
|
3607
|
+
return val;
|
|
3615
3608
|
}
|
|
3616
3609
|
class Compatibility {
|
|
3617
3610
|
static override(version) {
|
|
@@ -7970,45 +7963,6 @@ const assurancesExtrinsicCodec = codecWithContext((context) => {
|
|
|
7970
7963
|
}, AssurancesExtrinsicBounds);
|
|
7971
7964
|
});
|
|
7972
7965
|
|
|
7973
|
-
;// CONCATENATED MODULE: ./packages/jam/block/common.ts
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
/** Attempt to convert a number into `TimeSlot`. */
|
|
7979
|
-
const common_tryAsTimeSlot = (v) => opaque_asOpaqueType(numbers_tryAsU32(v));
|
|
7980
|
-
/** Attempt to convert a number into `ValidatorIndex`. */
|
|
7981
|
-
const tryAsValidatorIndex = (v) => opaque_asOpaqueType(numbers_tryAsU16(v));
|
|
7982
|
-
/** Attempt to convert a number into `ServiceId`. */
|
|
7983
|
-
const common_tryAsServiceId = (v) => opaque_asOpaqueType(numbers_tryAsU32(v));
|
|
7984
|
-
const common_tryAsServiceGas = (v) => opaque_asOpaqueType(numbers_tryAsU64(v));
|
|
7985
|
-
/** Attempt to convert a number into `CoreIndex`. */
|
|
7986
|
-
const common_tryAsCoreIndex = (v) => opaque_asOpaqueType(numbers_tryAsU16(v));
|
|
7987
|
-
/** Attempt to convert a number into `Epoch`. */
|
|
7988
|
-
const tryAsEpoch = (v) => asOpaqueType(tryAsU32(v));
|
|
7989
|
-
function tryAsPerValidator(array, spec) {
|
|
7990
|
-
debug_check `
|
|
7991
|
-
${array.length === spec.validatorsCount}
|
|
7992
|
-
Invalid per-validator array length. Expected ${spec.validatorsCount}, got: ${array.length}
|
|
7993
|
-
`;
|
|
7994
|
-
return sized_array_asKnownSize(array);
|
|
7995
|
-
}
|
|
7996
|
-
const codecPerValidator = (val) => codecWithContext((context) => {
|
|
7997
|
-
return codecKnownSizeArray(val, {
|
|
7998
|
-
fixedLength: context.validatorsCount,
|
|
7999
|
-
});
|
|
8000
|
-
});
|
|
8001
|
-
function tryAsPerEpochBlock(array, spec) {
|
|
8002
|
-
debug_check `
|
|
8003
|
-
${array.length === spec.epochLength}
|
|
8004
|
-
Invalid per-epoch-block array length. Expected ${spec.epochLength}, got: ${array.length}
|
|
8005
|
-
`;
|
|
8006
|
-
return sized_array_asKnownSize(array);
|
|
8007
|
-
}
|
|
8008
|
-
const codecPerEpochBlock = (val) => codecWithContext((context) => {
|
|
8009
|
-
return codecKnownSizeArray(val, { fixedLength: context.epochLength });
|
|
8010
|
-
});
|
|
8011
|
-
|
|
8012
7966
|
;// CONCATENATED MODULE: ./packages/jam/block/disputes.ts
|
|
8013
7967
|
|
|
8014
7968
|
|
|
@@ -8198,6 +8152,45 @@ class DisputesExtrinsic extends WithDebug {
|
|
|
8198
8152
|
}
|
|
8199
8153
|
}
|
|
8200
8154
|
|
|
8155
|
+
;// CONCATENATED MODULE: ./packages/jam/block/common.ts
|
|
8156
|
+
|
|
8157
|
+
|
|
8158
|
+
|
|
8159
|
+
|
|
8160
|
+
/** Attempt to convert a number into `TimeSlot`. */
|
|
8161
|
+
const tryAsTimeSlot = (v) => opaque_asOpaqueType(numbers_tryAsU32(v));
|
|
8162
|
+
/** Attempt to convert a number into `ValidatorIndex`. */
|
|
8163
|
+
const tryAsValidatorIndex = (v) => opaque_asOpaqueType(numbers_tryAsU16(v));
|
|
8164
|
+
/** Attempt to convert a number into `ServiceId`. */
|
|
8165
|
+
const common_tryAsServiceId = (v) => opaque_asOpaqueType(numbers_tryAsU32(v));
|
|
8166
|
+
const common_tryAsServiceGas = (v) => opaque_asOpaqueType(numbers_tryAsU64(v));
|
|
8167
|
+
/** Attempt to convert a number into `CoreIndex`. */
|
|
8168
|
+
const common_tryAsCoreIndex = (v) => opaque_asOpaqueType(numbers_tryAsU16(v));
|
|
8169
|
+
/** Attempt to convert a number into `Epoch`. */
|
|
8170
|
+
const tryAsEpoch = (v) => asOpaqueType(tryAsU32(v));
|
|
8171
|
+
function tryAsPerValidator(array, spec) {
|
|
8172
|
+
debug_check `
|
|
8173
|
+
${array.length === spec.validatorsCount}
|
|
8174
|
+
Invalid per-validator array length. Expected ${spec.validatorsCount}, got: ${array.length}
|
|
8175
|
+
`;
|
|
8176
|
+
return sized_array_asKnownSize(array);
|
|
8177
|
+
}
|
|
8178
|
+
const codecPerValidator = (val) => codecWithContext((context) => {
|
|
8179
|
+
return codecKnownSizeArray(val, {
|
|
8180
|
+
fixedLength: context.validatorsCount,
|
|
8181
|
+
});
|
|
8182
|
+
});
|
|
8183
|
+
function tryAsPerEpochBlock(array, spec) {
|
|
8184
|
+
debug_check `
|
|
8185
|
+
${array.length === spec.epochLength}
|
|
8186
|
+
Invalid per-epoch-block array length. Expected ${spec.epochLength}, got: ${array.length}
|
|
8187
|
+
`;
|
|
8188
|
+
return sized_array_asKnownSize(array);
|
|
8189
|
+
}
|
|
8190
|
+
const codecPerEpochBlock = (val) => codecWithContext((context) => {
|
|
8191
|
+
return codecKnownSizeArray(val, { fixedLength: context.epochLength });
|
|
8192
|
+
});
|
|
8193
|
+
|
|
8201
8194
|
;// CONCATENATED MODULE: ./packages/jam/block/refine-context.ts
|
|
8202
8195
|
|
|
8203
8196
|
|
|
@@ -9096,8 +9089,8 @@ const legacyDescriptor = {
|
|
|
9096
9089
|
*
|
|
9097
9090
|
* https://graypaper.fluffylabs.dev/#/579bd12/0c66000c7200
|
|
9098
9091
|
*/
|
|
9099
|
-
class
|
|
9100
|
-
static Codec = descriptors_codec.Class(
|
|
9092
|
+
class Header extends WithDebug {
|
|
9093
|
+
static Codec = descriptors_codec.Class(Header, Compatibility.isLessThan(GpVersion.V0_7_0)
|
|
9101
9094
|
? legacyDescriptor
|
|
9102
9095
|
: {
|
|
9103
9096
|
parentHeaderHash: descriptors_codec.bytes(hash_HASH_SIZE).asOpaque(),
|
|
@@ -9112,7 +9105,7 @@ class header_Header extends WithDebug {
|
|
|
9112
9105
|
seal: descriptors_codec.bytes(bandersnatch_BANDERSNATCH_VRF_SIGNATURE_BYTES).asOpaque(),
|
|
9113
9106
|
});
|
|
9114
9107
|
static create(h) {
|
|
9115
|
-
return Object.assign(
|
|
9108
|
+
return Object.assign(Header.empty(), h);
|
|
9116
9109
|
}
|
|
9117
9110
|
/**
|
|
9118
9111
|
* `H_p`: Hash of the parent header.
|
|
@@ -9125,7 +9118,7 @@ class header_Header extends WithDebug {
|
|
|
9125
9118
|
/** `H_x`: The hash of block extrinsic. */
|
|
9126
9119
|
extrinsicHash = bytes_Bytes.zero(hash_HASH_SIZE).asOpaque();
|
|
9127
9120
|
/** `H_t`: JAM time-slot index. */
|
|
9128
|
-
timeSlotIndex =
|
|
9121
|
+
timeSlotIndex = tryAsTimeSlot(0);
|
|
9129
9122
|
/**
|
|
9130
9123
|
* `H_e`: Key and entropy relevant to the following epoch in case the ticket
|
|
9131
9124
|
* contest does not complete adequately.
|
|
@@ -9153,7 +9146,7 @@ class header_Header extends WithDebug {
|
|
|
9153
9146
|
}
|
|
9154
9147
|
/** Create an empty header with some dummy values. */
|
|
9155
9148
|
static empty() {
|
|
9156
|
-
return new
|
|
9149
|
+
return new Header();
|
|
9157
9150
|
}
|
|
9158
9151
|
}
|
|
9159
9152
|
/**
|
|
@@ -9166,7 +9159,7 @@ class header_Header extends WithDebug {
|
|
|
9166
9159
|
class HeaderViewWithHash extends WithHash {
|
|
9167
9160
|
static Codec = descriptors_codec.Class(HeaderViewWithHash, {
|
|
9168
9161
|
hash: descriptors_codec.bytes(hash_HASH_SIZE).asOpaque(),
|
|
9169
|
-
data:
|
|
9162
|
+
data: Header.Codec.View,
|
|
9170
9163
|
});
|
|
9171
9164
|
static create({ hash, data }) {
|
|
9172
9165
|
return new WithHash(hash, data);
|
|
@@ -9214,8 +9207,6 @@ const preimagesExtrinsicCodec = descriptors_codec.sequenceVarLen(Preimage.Codec)
|
|
|
9214
9207
|
|
|
9215
9208
|
|
|
9216
9209
|
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
9210
|
/**
|
|
9220
9211
|
* Extrinsic part of the block - the input data being external to the system.
|
|
9221
9212
|
*
|
|
@@ -9283,7 +9274,7 @@ class Block extends WithDebug {
|
|
|
9283
9274
|
header;
|
|
9284
9275
|
extrinsic;
|
|
9285
9276
|
static Codec = descriptors_codec.Class(Block, {
|
|
9286
|
-
header:
|
|
9277
|
+
header: Header.Codec,
|
|
9287
9278
|
extrinsic: Extrinsic.Codec,
|
|
9288
9279
|
});
|
|
9289
9280
|
static create({ header, extrinsic }) {
|
|
@@ -9299,24 +9290,6 @@ class Block extends WithDebug {
|
|
|
9299
9290
|
this.extrinsic = extrinsic;
|
|
9300
9291
|
}
|
|
9301
9292
|
}
|
|
9302
|
-
function emptyBlock(slot = tryAsTimeSlot(0)) {
|
|
9303
|
-
const header = Header.empty();
|
|
9304
|
-
header.timeSlotIndex = slot;
|
|
9305
|
-
return Block.create({
|
|
9306
|
-
header,
|
|
9307
|
-
extrinsic: Extrinsic.create({
|
|
9308
|
-
tickets: asKnownSize([]),
|
|
9309
|
-
preimages: [],
|
|
9310
|
-
assurances: asKnownSize([]),
|
|
9311
|
-
guarantees: asKnownSize([]),
|
|
9312
|
-
disputes: {
|
|
9313
|
-
verdicts: [],
|
|
9314
|
-
culprits: [],
|
|
9315
|
-
faults: [],
|
|
9316
|
-
},
|
|
9317
|
-
}),
|
|
9318
|
-
});
|
|
9319
|
-
}
|
|
9320
9293
|
|
|
9321
9294
|
;// CONCATENATED MODULE: ./packages/jam/block/index.ts
|
|
9322
9295
|
|
|
@@ -9398,7 +9371,7 @@ class LmdbBlocks {
|
|
|
9398
9371
|
if (data === undefined) {
|
|
9399
9372
|
return null;
|
|
9400
9373
|
}
|
|
9401
|
-
return decoder_Decoder.decodeObject(
|
|
9374
|
+
return decoder_Decoder.decodeObject(Header.Codec.View, data, this.chainSpec);
|
|
9402
9375
|
}
|
|
9403
9376
|
getExtrinsic(hash) {
|
|
9404
9377
|
const data = this.extrinsics.get(hash.raw);
|
|
@@ -10240,8 +10213,8 @@ class ServiceAccountInfo extends WithDebug {
|
|
|
10240
10213
|
storageUtilisationBytes: descriptors_codec.u64,
|
|
10241
10214
|
gratisStorage: descriptors_codec.u64,
|
|
10242
10215
|
storageUtilisationCount: descriptors_codec.u32,
|
|
10243
|
-
created: descriptors_codec.u32.convert((x) => x,
|
|
10244
|
-
lastAccumulation: descriptors_codec.u32.convert((x) => x,
|
|
10216
|
+
created: descriptors_codec.u32.convert((x) => x, tryAsTimeSlot),
|
|
10217
|
+
lastAccumulation: descriptors_codec.u32.convert((x) => x, tryAsTimeSlot),
|
|
10245
10218
|
parentService: descriptors_codec.u32.convert((x) => x, common_tryAsServiceId),
|
|
10246
10219
|
});
|
|
10247
10220
|
static create(a) {
|
|
@@ -11179,7 +11152,7 @@ class InMemoryState extends WithDebug {
|
|
|
11179
11152
|
wonkySet: SortedSet.fromSortedArray(hashComparator, []),
|
|
11180
11153
|
punishSet: SortedSet.fromSortedArray(hashComparator, []),
|
|
11181
11154
|
}),
|
|
11182
|
-
timeslot:
|
|
11155
|
+
timeslot: tryAsTimeSlot(0),
|
|
11183
11156
|
entropy: sized_array_FixedSizeArray.fill(() => bytes_Bytes.zero(hash_HASH_SIZE).asOpaque(), ENTROPY_ENTRIES),
|
|
11184
11157
|
authPools: tryAsPerCore(Array.from({ length: spec.coresCount }, () => sized_array_asKnownSize([])), spec),
|
|
11185
11158
|
authQueues: tryAsPerCore(Array.from({ length: spec.coresCount }, () => sized_array_FixedSizeArray.fill(() => bytes_Bytes.zero(hash_HASH_SIZE).asOpaque(), AUTHORIZATION_QUEUE_SIZE)), spec),
|
|
@@ -11610,7 +11583,7 @@ class SerializedService {
|
|
|
11610
11583
|
if (rawSlots === undefined) {
|
|
11611
11584
|
return null;
|
|
11612
11585
|
}
|
|
11613
|
-
return tryAsLookupHistorySlots(rawSlots.map(
|
|
11586
|
+
return tryAsLookupHistorySlots(rawSlots.map(tryAsTimeSlot));
|
|
11614
11587
|
}
|
|
11615
11588
|
}
|
|
11616
11589
|
|
|
@@ -13007,8 +12980,8 @@ function print(level, levelAndName, strings, data) {
|
|
|
13007
12980
|
return;
|
|
13008
12981
|
}
|
|
13009
12982
|
const lvlText = Level[level].padEnd(5);
|
|
13010
|
-
const val = strings.map((v, idx) => `${v}${
|
|
13011
|
-
const msg = `${lvlText} [${levelAndName[1]}] ${val
|
|
12983
|
+
const val = strings.map((v, idx) => `${v}${data[idx]}`);
|
|
12984
|
+
const msg = `${lvlText} [${levelAndName[1]}] ${val}`;
|
|
13012
12985
|
if (level === Level.WARN) {
|
|
13013
12986
|
console.warn(msg);
|
|
13014
12987
|
}
|
|
@@ -13979,7 +13952,7 @@ class State {
|
|
|
13979
13952
|
|
|
13980
13953
|
|
|
13981
13954
|
|
|
13982
|
-
;// CONCATENATED MODULE: ./
|
|
13955
|
+
;// CONCATENATED MODULE: ./workers/generic/finished.ts
|
|
13983
13956
|
|
|
13984
13957
|
class Finished extends State {
|
|
13985
13958
|
constructor() {
|
|
@@ -13995,7 +13968,7 @@ class Finished extends State {
|
|
|
13995
13968
|
}
|
|
13996
13969
|
}
|
|
13997
13970
|
|
|
13998
|
-
;// CONCATENATED MODULE: ./
|
|
13971
|
+
;// CONCATENATED MODULE: ./workers/generic/main-init.ts
|
|
13999
13972
|
|
|
14000
13973
|
|
|
14001
13974
|
function stateMachineMain(name, readyName, ready) {
|
|
@@ -14018,7 +13991,7 @@ class MainInit extends State {
|
|
|
14018
13991
|
}
|
|
14019
13992
|
}
|
|
14020
13993
|
|
|
14021
|
-
;// CONCATENATED MODULE: ./
|
|
13994
|
+
;// CONCATENATED MODULE: ./workers/generic/worker-init.ts
|
|
14022
13995
|
|
|
14023
13996
|
class WorkerInit extends State {
|
|
14024
13997
|
workerReadyName;
|
|
@@ -14040,7 +14013,7 @@ class WorkerInit extends State {
|
|
|
14040
14013
|
}
|
|
14041
14014
|
}
|
|
14042
14015
|
|
|
14043
|
-
;// CONCATENATED MODULE: ./
|
|
14016
|
+
;// CONCATENATED MODULE: ./workers/generic/worker-spawn.ts
|
|
14044
14017
|
|
|
14045
14018
|
|
|
14046
14019
|
|
|
@@ -14052,7 +14025,7 @@ async function spawnWorkerGeneric(bootstrapPath, logger, mainReadyName, mainRead
|
|
|
14052
14025
|
return channel;
|
|
14053
14026
|
}
|
|
14054
14027
|
|
|
14055
|
-
;// CONCATENATED MODULE: ./
|
|
14028
|
+
;// CONCATENATED MODULE: ./workers/generic/index.ts
|
|
14056
14029
|
|
|
14057
14030
|
|
|
14058
14031
|
|
|
@@ -15498,17 +15471,6 @@ class page_range_PageRange {
|
|
|
15498
15471
|
}
|
|
15499
15472
|
return new page_range_PageRange(start, length);
|
|
15500
15473
|
}
|
|
15501
|
-
/** Returns true if the page range is wrapped (`start` >= `end`) and is not empty */
|
|
15502
|
-
isWrapped() {
|
|
15503
|
-
return this.start >= this.end && !this.isEmpty();
|
|
15504
|
-
}
|
|
15505
|
-
/** Checks if given page number is within the range */
|
|
15506
|
-
isInRange(page) {
|
|
15507
|
-
if (this.isWrapped()) {
|
|
15508
|
-
return page >= this.start || page < this.end;
|
|
15509
|
-
}
|
|
15510
|
-
return page >= this.start && page < this.end;
|
|
15511
|
-
}
|
|
15512
15474
|
/** Checks if a range is empty (`length === 0`) */
|
|
15513
15475
|
isEmpty() {
|
|
15514
15476
|
return this.length === 0;
|
|
@@ -15888,11 +15850,10 @@ class memory_builder_MemoryBuilder {
|
|
|
15888
15850
|
startHeapIndex (${startHeapIndex}) has to be less than or equal to endHeapIndex (${endHeapIndex})
|
|
15889
15851
|
`;
|
|
15890
15852
|
this.ensureNotFinalized();
|
|
15891
|
-
const
|
|
15892
|
-
const
|
|
15893
|
-
const
|
|
15894
|
-
|
|
15895
|
-
if (heapPagesRange.isInRange(pageNumber)) {
|
|
15853
|
+
const range = MemoryRange.fromStartAndLength(startHeapIndex, endHeapIndex - startHeapIndex);
|
|
15854
|
+
const pages = PageRange.fromMemoryRange(range);
|
|
15855
|
+
for (const pageNumber of pages) {
|
|
15856
|
+
if (this.initialMemory.has(pageNumber)) {
|
|
15896
15857
|
throw new IncorrectSbrkIndex();
|
|
15897
15858
|
}
|
|
15898
15859
|
}
|
|
@@ -18409,7 +18370,7 @@ class PvmExecutor {
|
|
|
18409
18370
|
|
|
18410
18371
|
|
|
18411
18372
|
|
|
18412
|
-
;// CONCATENATED MODULE: ./
|
|
18373
|
+
;// CONCATENATED MODULE: ./workers/block-generator/generator.ts
|
|
18413
18374
|
|
|
18414
18375
|
|
|
18415
18376
|
|
|
@@ -18500,11 +18461,11 @@ class Generator {
|
|
|
18500
18461
|
e.i32(newTimeSlot);
|
|
18501
18462
|
e.i16(validatorId);
|
|
18502
18463
|
// create header
|
|
18503
|
-
const header =
|
|
18464
|
+
const header = Header.create({
|
|
18504
18465
|
parentHeaderHash,
|
|
18505
18466
|
priorStateRoot: await stateRoot,
|
|
18506
18467
|
extrinsicHash,
|
|
18507
|
-
timeSlotIndex:
|
|
18468
|
+
timeSlotIndex: tryAsTimeSlot(newTimeSlot),
|
|
18508
18469
|
epochMarker: null,
|
|
18509
18470
|
ticketsMarker: null,
|
|
18510
18471
|
offendersMarker: [],
|
|
@@ -18515,15 +18476,15 @@ class Generator {
|
|
|
18515
18476
|
// TODO [MaSo] IDK if this is ok to update it here.
|
|
18516
18477
|
// This function utility is to create a block
|
|
18517
18478
|
// not to update any logic.
|
|
18518
|
-
const encoded = encoder_Encoder.encodeObject(
|
|
18519
|
-
const headerView = decoder_Decoder.decodeObject(
|
|
18479
|
+
const encoded = encoder_Encoder.encodeObject(Header.Codec, header, this.chainSpec);
|
|
18480
|
+
const headerView = decoder_Decoder.decodeObject(Header.Codec.View, encoded, this.chainSpec);
|
|
18520
18481
|
this.lastHeaderHash = hasher.header(headerView).hash;
|
|
18521
18482
|
this.lastHeader = header;
|
|
18522
18483
|
return Block.create({ header, extrinsic });
|
|
18523
18484
|
}
|
|
18524
18485
|
}
|
|
18525
18486
|
|
|
18526
|
-
;// CONCATENATED MODULE: ./
|
|
18487
|
+
;// CONCATENATED MODULE: ./workers/block-generator/state-machine.ts
|
|
18527
18488
|
|
|
18528
18489
|
|
|
18529
18490
|
|
|
@@ -18588,7 +18549,7 @@ class GeneratorReady extends State {
|
|
|
18588
18549
|
}
|
|
18589
18550
|
}
|
|
18590
18551
|
|
|
18591
|
-
;// CONCATENATED MODULE: ./
|
|
18552
|
+
;// CONCATENATED MODULE: ./workers/block-generator/index.ts
|
|
18592
18553
|
|
|
18593
18554
|
|
|
18594
18555
|
|