@typeberry/jam 0.3.1 → 0.4.0-13b653d
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 +5 -0
- package/bootstrap-generator.mjs +5 -7
- package/bootstrap-generator.mjs.map +1 -1
- package/bootstrap-importer.mjs +39 -38
- package/bootstrap-importer.mjs.map +1 -1
- package/bootstrap-network.mjs +5 -8
- package/bootstrap-network.mjs.map +1 -1
- package/index.js +44 -43
- package/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,6 +8,11 @@ Typeberry is a TypeScript implementation of [JAM protocol](https://graypaper.com
|
|
|
8
8
|
PRs unless the contributor waives any claims to the prize and copy rights for
|
|
9
9
|
the submitted code. By creating the PR you accept this requirement.**
|
|
10
10
|
|
|
11
|
+
## Links
|
|
12
|
+
|
|
13
|
+
- [Documentation](https://fluffylabs.dev/typeberry)
|
|
14
|
+
- [Performance Charts](https://typeberry.fluffylabs.dev)
|
|
15
|
+
|
|
11
16
|
## Implementation status
|
|
12
17
|
|
|
13
18
|
Gray Paper compliance can be controlled via `GP_VERSION` environment variable.
|
package/bootstrap-generator.mjs
CHANGED
|
@@ -2937,8 +2937,8 @@ class Compatibility {
|
|
|
2937
2937
|
/**
|
|
2938
2938
|
* Allows selecting different values for different Gray Paper versions from one record.
|
|
2939
2939
|
*
|
|
2940
|
-
*
|
|
2941
|
-
*
|
|
2940
|
+
* fallback The default value to return if no value is found for the current.
|
|
2941
|
+
* versions A record mapping versions to values, checking if the version is greater or equal to the current version.
|
|
2942
2942
|
* @returns The value for the current version, or the default value.
|
|
2943
2943
|
*/
|
|
2944
2944
|
static selectIfGreaterOrEqual({ fallback, versions, }) {
|
|
@@ -3101,7 +3101,7 @@ const workspacePathFix = dev_env.NODE_ENV === "development"
|
|
|
3101
3101
|
|
|
3102
3102
|
;// CONCATENATED MODULE: ./packages/core/utils/opaque.ts
|
|
3103
3103
|
/**
|
|
3104
|
-
*
|
|
3104
|
+
* `Opaque<Type, Token>` constructs a unique type which is a subset of Type with a
|
|
3105
3105
|
* specified unique token Token. It means that base type cannot be assigned to unique type by accident.
|
|
3106
3106
|
* Good examples of opaque types include:
|
|
3107
3107
|
* - JWTs or other tokens - these are special kinds of string used for authorization purposes.
|
|
@@ -9024,11 +9024,9 @@ function reencodeAsView(codec, object, chainSpec) {
|
|
|
9024
9024
|
|
|
9025
9025
|
/** Helper function to create most used hashes in the block */
|
|
9026
9026
|
class TransitionHasher {
|
|
9027
|
-
context;
|
|
9028
9027
|
keccakHasher;
|
|
9029
9028
|
blake2b;
|
|
9030
|
-
constructor(
|
|
9031
|
-
this.context = context;
|
|
9029
|
+
constructor(keccakHasher, blake2b) {
|
|
9032
9030
|
this.keccakHasher = keccakHasher;
|
|
9033
9031
|
this.blake2b = blake2b;
|
|
9034
9032
|
}
|
|
@@ -10965,7 +10963,7 @@ class Generator {
|
|
|
10965
10963
|
// select validator for block
|
|
10966
10964
|
const validatorId = tryAsValidatorIndex(newTimeSlot % 6);
|
|
10967
10965
|
// retriev data from previous block
|
|
10968
|
-
const hasher = new TransitionHasher(this.
|
|
10966
|
+
const hasher = new TransitionHasher(this.keccakHasher, this.blake2b);
|
|
10969
10967
|
const parentHeaderHash = this.lastHeaderHash;
|
|
10970
10968
|
const stateRoot = this.states.getStateRoot(this.lastState);
|
|
10971
10969
|
// create extrinsic
|