Skip to content

Commit 5af0d27

Browse files
authored
Merge pull request #55 from davxy/master
2 parents 3a2d4a2 + f412ef1 commit 5af0d27

File tree

1,579 files changed

+162542
-197729
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,579 files changed

+162542
-197729
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [0.7.0] - 26-08-2025
2+
3+
### Changed
4+
5+
* Serialization: Move all variable-length items to end of encoding
6+
(GP [#418](https://github.com/gavofyork/graypaper/pull/418))
7+
* Rearrange the items in `CoreActivityRecord` and `ServiceActivityRecord`,
8+
refer to the ASN.1 schema and GP (no explicit GP PR).
9+
110
## [0.6.7] - 07-08-2025
211

312
### Changed

README.md

Lines changed: 56 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,73 @@
1-
# Test Vectors for the JAM Protocol (0.6.7)
1+
# Test Vectors for the JAM Protocol (0.7.0)
22

3-
## Codec
4-
5-
- [Codec](./codec/README.md)
6-
7-
## Erasure Coding
3+
## Classes
84

5+
- [Codec](./codec/README.md)
96
- [Erasure Coding](./erasure/README.md)
7+
- [State Transition Function](./stf/README.md)
8+
- [Block Import Traces](./traces/README.md)
109

11-
## State Transition Functions
12-
13-
We offer two types of test vectors:
14-
15-
- **Tiny**: designed for quick adjustments and prototyping, with reduced
16-
- validators count: 6
17-
- cores count: 2
18-
- epoch period: 12
19-
- core assignment rotation period: 4
20-
- ticket attempts: 3
21-
22-
- **Full**: vectors with production specs
23-
- validators count: 1023
24-
- cores count: 341
25-
- epoch period: 600
26-
- core assignment rotation period: 10
27-
- ticket attempts: 2
28-
29-
For more information refer to the community [docs](https://docs.jamcha.in/basics/chain-spec).
30-
31-
### STF Output
32-
33-
Technically, the STF execution process does not inherently produce auxiliary
34-
outputs beyond the success or failure result. In this context, we propose
35-
an extension to include additional information that may be beneficial for
36-
implementors or useful for executing other subsystems reliant on values
37-
generated post-STF execution.
38-
39-
When the error or success values are not pertinent to your test vector
40-
processing procedures, you may disregard them as necessary.
41-
42-
A mapping of error code semantics is provided within the ASN.1 schema for each
43-
specific subsystem.
44-
45-
### Vectors
10+
## Binary To JSON
4611

47-
- [Safrole](./stf/safrole/README.md)
48-
- [Disputes](./stf/disputes/README.md)
49-
- [History](./stf/history/README.md)
50-
- [Assurances](./stf/assurances/README.md)
51-
- [Reports](./stf/reports/README.md)
52-
- [Statistics](./stf/statistics/README.md)
53-
- [Authorizations](./stf/authorizations/README.md)
54-
- [Preimages](./stf/preimages/README.md)
55-
- [Accumulate](./stf/accumulate/README.md)
12+
The repository binary test vector files can be converted to their JSON
13+
equivalents for easier inspection and debugging. Use the provided conversion
14+
script to transform binary files into human-readable JSON format:
5615

57-
## Block Import Traces
16+
```bash
17+
./scripts/convert-all.sh
18+
```
5819

59-
- [Fallback](./traces/fallback): fallback block authoring, no-safrole, no-work-reports
60-
- [Safrole](./traces/safrole): safrole block authoring, no-work-reports
61-
- [Work Reports L0](./traces/reports-l0): basic work reports, no-safrole
20+
This script requires the [jam-types](https://github.com/davxy/jam-types-py)
21+
Python library to be installed.
6222

63-
## Vectors Validation
23+
## Validation
6424

6525
Validation scripts are included to verify the JSON files against the expected
6626
ASN.1 syntax provided with the test vectors. These scripts currently rely on my
6727
[asn1tools](https://github.com/davxy/asn1tools) fork.
6828

69-
## Binary To JSON
29+
```bash
30+
./scripts/validate-all.sh.sh
31+
```
7032

71-
The repository binary test vector files can be converted to their JSON
72-
equivalents for easier inspection and debugging. Use the provided conversion
73-
script to transform binary files into human-readable JSON format:
33+
## Chainspec Parameters
7434

75-
```bash
76-
./scripts/convert-all.sh
35+
For more information refer to the community [docs](https://docs.jamcha.in/basics/chain-spec).
36+
37+
### Tiny
38+
39+
```yaml
40+
chain: tiny
41+
num_validators: 6
42+
num_cores: 2
43+
preimage_expunge_period: 32
44+
slot_duration: 6
45+
epoch_duration: 12
46+
contest_duration: 10
47+
tickets_per_validator: 3
48+
max_tickets_per_extrinsic: 3
49+
rotation_period: 4
50+
num_ec_pieces_per_segment: 1026
51+
max_block_gas: 20000000
52+
max_refine_gas: 1000000000
7753
```
7854
79-
This conversion script requires the [jam-types](https://github.com/davxy/jam-types)
80-
Python library to be installed.
55+
### Full
56+
57+
All parameters here must match the Gray Paper.
58+
59+
```yaml
60+
chain: full
61+
num_validators: 1023
62+
num_cores: 341
63+
preimage_expunge_period: 19200
64+
slot_duration: 6
65+
epoch_duration: 600
66+
contest_duration: 500
67+
tickets_per_validator: 2
68+
max_tickets_per_extrinsic: 16
69+
rotation_period: 10
70+
num_ec_pieces_per_segment: 6
71+
max_block_gas: 3500000000
72+
max_refine_gas: 5000000000
73+
```

codec/convert.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,16 @@
5252
"block": Block,
5353
}
5454

55-
5655
def convert(spec_name):
5756
print(f"\n[Converting codec ({spec_name})]")
5857
spec.set_spec(spec_name)
5958
for filename in glob.glob(f"{spec_name}/*.bin"):
60-
print("* Converting ", filename)
6159
basename = os.path.splitext(os.path.basename(filename))[0]
6260
basename = re.sub(r'_\d+$', '', basename)
63-
class_type = dump_classes[basename]
61+
class_type = dump_classes.get(basename)
62+
if class_type is None:
63+
print("* Skipping: ", filename)
64+
continue
6465
convert_to_json(filename, class_type)
6566

6667
for spec_name in ["tiny", "full"]:

codec/full/block.bin

0 Bytes
Binary file not shown.

codec/full/block.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4103,11 +4103,11 @@
41034103
]
41044104
},
41054105
"tickets_mark": null,
4106+
"author_index": 3,
4107+
"entropy_source": "0xae85d6635e9ae539d0846b911ec86a27fe000f619b78bcac8a74b77e36f6dbcf49a52360f74a0233cea0775356ab0512fafff0683df08fae3cb848122e296cbc50fed22418ea55f19e55b3c75eb8b0ec71dcae0d79823d39920bf8d6a2256c5f",
41064108
"offenders_mark": [
41074109
"0x4418fb8c85bb3985394a8c2756d3643457ce614546202a2f50b093d762499ace"
41084110
],
4109-
"author_index": 3,
4110-
"entropy_source": "0xae85d6635e9ae539d0846b911ec86a27fe000f619b78bcac8a74b77e36f6dbcf49a52360f74a0233cea0775356ab0512fafff0683df08fae3cb848122e296cbc50fed22418ea55f19e55b3c75eb8b0ec71dcae0d79823d39920bf8d6a2256c5f",
41114111
"seal": "0x31dc5b1e9423eccff9bccd6549eae8034162158000d5be9339919cc03d14046e6431c14cbb172b3aed702b9e9869904b1f39a6fe1f3e904b0fd536f13e8cac496682e1c81898e88e604904fa7c3e496f9a8771ef1102cc29d567c4aad283f7b0"
41124112
},
41134113
"extrinsic": {
@@ -4159,6 +4159,7 @@
41594159
},
41604160
"core_index": 3,
41614161
"authorizer_hash": "0x022e5e165cc8bd586404257f5cd6f5a31177b5c951eb076c7c10174f90006eef",
4162+
"auth_gas_used": 0,
41624163
"auth_output": "0x0102030405",
41634164
"segment_root_lookup": [],
41644165
"results": [
@@ -4194,8 +4195,7 @@
41944195
"exports": 0
41954196
}
41964197
}
4197-
],
4198-
"auth_gas_used": 0
4198+
]
41994199
},
42004200
"slot": 42,
42014201
"signatures": [

codec/full/extrinsic.bin

0 Bytes
Binary file not shown.

codec/full/extrinsic.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
},
4848
"core_index": 3,
4949
"authorizer_hash": "0x022e5e165cc8bd586404257f5cd6f5a31177b5c951eb076c7c10174f90006eef",
50+
"auth_gas_used": 0,
5051
"auth_output": "0x0102030405",
5152
"segment_root_lookup": [],
5253
"results": [
@@ -82,8 +83,7 @@
8283
"exports": 0
8384
}
8485
}
85-
],
86-
"auth_gas_used": 0
86+
]
8787
},
8888
"slot": 42,
8989
"signatures": [
0 Bytes
Binary file not shown.

codec/full/guarantees_extrinsic.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
},
1919
"core_index": 3,
2020
"authorizer_hash": "0x022e5e165cc8bd586404257f5cd6f5a31177b5c951eb076c7c10174f90006eef",
21+
"auth_gas_used": 0,
2122
"auth_output": "0x0102030405",
2223
"segment_root_lookup": [],
2324
"results": [
@@ -53,8 +54,7 @@
5354
"exports": 0
5455
}
5556
}
56-
],
57-
"auth_gas_used": 0
57+
]
5858
},
5959
"slot": 42,
6060
"signatures": [

codec/full/header_0.bin

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)