Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STF Vectors #28

Open
wants to merge 169 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 164 commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
d94bdc8
Blinding factor used to compute blinding nonce
davxy Jul 29, 2024
b954edf
Introduce offenders to the STF inputs
davxy Aug 8, 2024
02bf209
Disputes STF test vectors
davxy Aug 14, 2024
d5c1c39
Leave safrole alone here
davxy Aug 14, 2024
926e6c0
ASN.1 schema for disputes
davxy Aug 16, 2024
4dd16f4
Sequence of U8 are just OCTET STRING(s)
davxy Aug 16, 2024
921413c
Check constraints
davxy Aug 16, 2024
2a04e2c
Nit
davxy Aug 16, 2024
2f32cc2
Use OCTET STRING instead of SEQUENCE OF U8
davxy Aug 16, 2024
edc6a08
Use greek letters as per GP
davxy Aug 16, 2024
fb50df3
Add missing bits to state for signatures verification
davxy Aug 17, 2024
7fc4038
Rename vectors
davxy Aug 17, 2024
3008118
README
davxy Aug 17, 2024
8f7e9b5
README completed
davxy Aug 17, 2024
0c6c282
Improve README
davxy Aug 17, 2024
b2e2713
On error pre-state matches post-state
davxy Aug 18, 2024
2c8fb6b
Fix validation after vector name change
davxy Aug 18, 2024
a7ea6b9
For test vectors, set zk-rows to 0, as per spec
davxy Aug 20, 2024
673df81
Remove verdicts mark from output
davxy Aug 25, 2024
80d8be2
Test vectors
davxy Aug 25, 2024
e47b0df
Twak sequence of options for ASN.1 compliance
davxy Aug 25, 2024
04c2c14
Fix ASN.1 validation of case including sequence of options
davxy Aug 25, 2024
cac43c2
Use Keccak-256 for MMR
davxy Aug 26, 2024
bcc43b7
Fix doc
davxy Aug 26, 2024
ac7e31f
Fix MMR hash
davxy Aug 28, 2024
142fbf4
WorkReport requires at least one result
davxy Sep 3, 2024
2d71c3f
Add test for padded ring commitment
davxy Sep 24, 2024
53ab147
Add vectors with JAM compact codec
davxy Sep 24, 2024
695567a
Update ASN schema
davxy Sep 24, 2024
284ef4b
Fix link
davxy Sep 24, 2024
78f74a4
Add vectors with JAM compact integer codec
davxy Sep 24, 2024
6ef5ff8
Add vectors with JAM compact integer codec
davxy Sep 24, 2024
9e6aa03
Rename vector
davxy Sep 24, 2024
ed65fac
Merge branch 'safrole-ring-signatures-update' into polkajam-vectors
davxy Oct 15, 2024
ff5a107
Merge branch 'disputes' into polkajam-vectors
davxy Oct 15, 2024
30638fa
Merge branch 'blocks-history' into polkajam-vectors
davxy Oct 15, 2024
9bab1f7
README
davxy Oct 15, 2024
b9ba221
Merge branch 'blocks-history' into polkajam-vectors
davxy Oct 15, 2024
c2ab5c7
Remove old SCALE vectors
davxy Nov 4, 2024
aebb223
Remove old SCALE vectors
davxy Nov 4, 2024
58869d2
Reported work packages comes with the exported segment root
davxy Nov 4, 2024
f791dff
Remove old SCALE vectors
davxy Nov 4, 2024
205517f
Signatures change after alteration of opaque work dummy-work-report
davxy Nov 4, 2024
1fa652f
Update binary encoded files
davxy Nov 4, 2024
df36605
Update binary encoded files
davxy Nov 4, 2024
fdf9e9c
Merge branch 'blocks-history' into polkajam-vectors
davxy Nov 4, 2024
c1d27e6
Merge branch 'disputes' into polkajam-vectors
davxy Nov 4, 2024
1c80e4a
Merge branch 'safrole-ring-signatures-update' into polkajam-vectors
davxy Nov 4, 2024
2340a11
Tiny vectors
davxy Nov 16, 2024
cf9b936
README and vectors update
davxy Nov 16, 2024
fe16aad
README update
davxy Nov 16, 2024
2faa306
WARN
davxy Nov 16, 2024
c72baad
Update to 0.5
davxy Nov 16, 2024
b7a706f
Update
davxy Nov 16, 2024
7bf321f
Merge branch 'disputes' into polkajam-vectors
davxy Nov 18, 2024
b51a4e7
Merge branch 'blocks-history' into polkajam-vectors
davxy Nov 18, 2024
b9c8b4e
Merge branch 'codec-vectors-update' into polkajam-vectors
davxy Nov 18, 2024
54b3f0c
Merge branch 'safrole-ring-signatures-update' into polkajam-vectors
davxy Nov 18, 2024
df0c355
Merge branch 'work-reports' into polkajam-vectors
davxy Nov 18, 2024
0ee6d82
Full vectors
davxy Nov 18, 2024
ccc431e
Merge branch 'work-reports' into polkajam-vectors
davxy Nov 18, 2024
c86d442
Begin shared ASN.1 schema
davxy Nov 18, 2024
7744558
Codecs and history using common schema and utils
davxy Nov 18, 2024
a74939d
Use common code for history
davxy Nov 18, 2024
078db06
safrole is using shared asn.1 code
davxy Nov 18, 2024
22485a9
Allow for invalid attempt number
davxy Nov 18, 2024
af6e913
Begin reports schema definition
davxy Nov 18, 2024
132d7a2
General overhaul
davxy Nov 19, 2024
7dc0f5c
Reports ASN1 schema
davxy Nov 19, 2024
9f99153
Use common JAM ASN.1 types
davxy Nov 19, 2024
20c4809
Use common JAM ASN.1 types
davxy Nov 19, 2024
fb0c8ef
Use common JAM ASN.1 types
davxy Nov 19, 2024
643cb1d
Use common JAM ASN.1 types
davxy Nov 19, 2024
c30506c
All in one asn1 syntax file
davxy Nov 19, 2024
96666aa
All in one asn1 syntax file
davxy Nov 19, 2024
26e882b
All in one asn1 syntax file
davxy Nov 19, 2024
95b73ca
All in one asn1 syntax file
davxy Nov 19, 2024
e7ecc70
Add tickets entropy to epoch marker
davxy Nov 21, 2024
5191709
Add tickets entropy to epoch marker
davxy Nov 21, 2024
9ffd698
Add tickets entropy to epoch marker
davxy Nov 21, 2024
df18b31
Add tickets entropy to epoch marker
davxy Nov 21, 2024
fde23dd
Fix reported issues
davxy Nov 21, 2024
7e2c61d
Fix ASN.1
davxy Nov 21, 2024
e091053
Merge branch 'master' into safrole-ring-signatures-update
davxy Nov 21, 2024
1df9896
Remove dead code
davxy Nov 21, 2024
99fb959
Merge branch 'master' into blocks-history
davxy Nov 21, 2024
10f5122
Nit
davxy Nov 21, 2024
f44aefb
Merge branch 'master' into disputes
davxy Nov 21, 2024
bfd9cf3
Merge branch 'master' into work-reports
davxy Nov 21, 2024
eddd7f9
Pick jam-types-asn from master
davxy Nov 22, 2024
bcfcce4
Merge branch 'master' into polkajam-vectors
davxy Nov 22, 2024
fe46d60
Merge branch 'blocks-history' into polkajam-vectors
davxy Nov 22, 2024
8303360
Merge branch 'disputes' into polkajam-vectors
davxy Nov 22, 2024
43561e3
Merge branch 'safrole-ring-signatures-update' into polkajam-vectors
davxy Nov 22, 2024
43bc4b4
Merge branch 'work-reports' into polkajam-vectors
davxy Nov 22, 2024
de1d5aa
Update README
davxy Nov 25, 2024
01b3f9d
Explicit GP symbols in ASN1 schema
davxy Nov 25, 2024
4a14a19
Merge branch 'safrole-ring-signatures-update' into polkajam-vectors
davxy Nov 25, 2024
5b9e74e
Explicit GP symbols in ASN1 schema
davxy Nov 25, 2024
b40d625
Merge branch 'disputes' into polkajam-vectors
davxy Nov 25, 2024
db2bb40
Explicit GP symbols in ASN1 schema
davxy Nov 25, 2024
4cd28a9
Merge branch 'blocks-history' into polkajam-vectors
davxy Nov 25, 2024
be4b014
Improve ASN1 schema
davxy Nov 25, 2024
d10987d
README
davxy Nov 25, 2024
bd352a1
Move entropy and offenders to state
davxy Nov 25, 2024
686a850
Merge branch 'work-reports' into polkajam-vectors
davxy Nov 25, 2024
aeb976f
Move posterior offenders list to state
davxy Nov 25, 2024
d4a7c87
Merge branch 'safrole-ring-signatures-update' into polkajam-vectors
davxy Nov 25, 2024
379c503
- Rotation period for full set to 10 (was 4)
davxy Nov 28, 2024
318c737
README update with explicit rotation period
davxy Nov 28, 2024
ae8c5b0
Merge branch 'work-reports' into polkajam-vectors
davxy Nov 29, 2024
2d4e4f4
Update safrole.asn
xDimon Nov 29, 2024
0fa0840
Increase attempts per validator to 3 for tiny
davxy Nov 30, 2024
0867291
Merge branch 'safrole-ring-signatures-update' into polkajam-vectors
davxy Nov 30, 2024
86106e8
Schema
davxy Dec 2, 2024
9cae0a6
Tiny
davxy Dec 2, 2024
39cff81
Full
davxy Dec 2, 2024
d089a64
Fix
davxy Dec 2, 2024
3b76ab7
ASN1 validation works
davxy Dec 2, 2024
835560c
Update README
davxy Dec 2, 2024
d47eeea
Fix docs
davxy Dec 2, 2024
973f041
Merge branch 'assurances' into polkajam-vectors
davxy Dec 2, 2024
730f919
README update
davxy Dec 2, 2024
f399076
Merge branch 'work-reports' into polkajam-vectors
davxy Dec 2, 2024
e5ab869
Merge pull request #2 from xDimon/patch-1
davxy Dec 2, 2024
287862b
Update safrole.asn
xDimon Nov 29, 2024
a4b431b
Merge branch 'safrole-ring-signatures-update' into polkajam-vectors
davxy Dec 2, 2024
4690180
Post offenders sequence must match prior one
davxy Dec 2, 2024
dfd0d0e
Same for full
davxy Dec 2, 2024
f2b9511
Merge branch 'safrole-ring-signatures-update' into polkajam-vectors
davxy Dec 2, 2024
9407a72
Update ark-ec-vrfs rev
davxy Dec 4, 2024
25aaedc
Tiny tickets limit set to 3
davxy Dec 4, 2024
5385316
Full tickets fix
davxy Dec 4, 2024
b06f7cd
Align asn1 syntax
davxy Dec 4, 2024
610b742
Statistics vectors
davxy Dec 5, 2024
8fc8404
Merge branch 'safrole-ring-signatures-update' into polkajam-vectors
davxy Dec 5, 2024
3f7ffac
Merge branch 'statistics' into polkajam-vectors
davxy Dec 5, 2024
a3ccb8d
Statistics STF vectors
davxy Dec 5, 2024
b789300
Update README
davxy Dec 5, 2024
67bd2f9
Missing Statistics definition in ASN1 types
davxy Dec 5, 2024
eb8e2db
Merge branch 'statistics' into polkajam-vectors
davxy Dec 5, 2024
c08d0ff
Not sorted or unique assurances
davxy Dec 6, 2024
64a7117
Merge branch 'assurances' into polkajam-vectors
davxy Dec 6, 2024
1fce96e
Merge branch 'codec-update' into polkajam-vectors
davxy Dec 7, 2024
86b1e00
GP 0.5.2 - Assurances STF vectors update
davxy Dec 7, 2024
2ce0576
Merge branch 'master' into polkajam-vectors
davxy Dec 8, 2024
2737ae4
Include protocol version
davxy Dec 8, 2024
78ef799
reports: fix beefy root
davxy Dec 8, 2024
82b5418
assurances: proactive removal of stale reports (GP 0.5.2)
davxy Dec 8, 2024
88bec12
disputes: align new gas naming
davxy Dec 8, 2024
8a6c01c
reports: add missing test to readme
davxy Dec 8, 2024
1db626e
README update
davxy Dec 9, 2024
2028209
Be more explicit about state items semantics
davxy Dec 9, 2024
e821f29
Big work report output vectors
davxy Dec 11, 2024
729592c
Auth pools are not mutated by reports STF
davxy Dec 11, 2024
1c5211f
Auth pools are not mutated (full)
davxy Dec 11, 2024
b059bc7
reports: add new error code to asn1
davxy Dec 11, 2024
e6238ba
Add tickets_per_validator constant
xDimon Dec 13, 2024
a1a8490
Merge pull request #4 from xDimon/tickets_per_validator
davxy Dec 13, 2024
ba4293c
Authorizations STF vectors
davxy Dec 13, 2024
79389b5
ASN.1 schema and validation
davxy Dec 13, 2024
86cdcdd
README update
davxy Dec 13, 2024
71471d7
README update
davxy Dec 13, 2024
0e78675
Merge pull request #5 from davxy/authorizations-stf-vectors
davxy Dec 13, 2024
12505a1
statistics: remove reporters from input
davxy Dec 16, 2024
2a58a11
safrole: restore tickets order
davxy Dec 17, 2024
4456b9c
First pass
davxy Dec 20, 2024
ae7bedf
Add bad-export variant to WorkError
davxy Dec 22, 2024
2e0c424
Merge pull request #8 from davxy/preimages-vectors
davxy Dec 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Test Vectors for the JAM Protocol

JAM protocol version 0.5.2

## Index

- [Codec](./codec/README.md)
- [Safrole](./safrole/README.md)
- [Disputes](./disputes/README.md)
- [History](./history/README.md)
- [Assurances](./assurances/README.md)
- [Reports](./reports/README.md)
- [Statistics](./statistics/README.md)
- [Authorizations](./authorizations/README.md)
54 changes: 54 additions & 0 deletions assurances/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Availability Assurances STF Test Vectors

We offer two types of test vectors:

- Tiny: These are designed for quick adjustments and prototyping, with reduced validators (6)
and cores count (2).
- Full: These vectors use production validators (1023) and cores count (341)

Both JSON and SCALE formats conform to the JAM ASN.1 [schema](../jam-types-asn/jam-types.asn)
and this subsystem STF specific [schema](./assurances.asn).

## STF Output

Technically, the STF execution process does not inherently produce auxiliary
outputs beyond the success or failure result. In this context, we propose
an extension to include additional information that may be beneficial for
implementors or useful for executing other subsystems reliant on values
generated post-STF execution.

When the error or success values are not pertinent to your test vector
processing procedures, you may disregard them as necessary.

A mapping of error code semantics is provided within the ASN.1 schema for this
subsystem.

## Tiny Vectors

- [no_assurances-1](tiny/no_assurances-1.json)🟢
- Progress with an empty assurances extrinsic.
- [some_assurances-1](tiny/some_assurances-1.json) 🟢
- Several assurances contributing to establishing availability supermajority for some
of the cores.
- [no_assurances_with_stale_report-1](tiny/no_assurances_with_stale_report-1.json) 🟢
- Progress with an empty assurances extrinsic.
- Stale work report assignment is removed (but not returned in the output).
- [assurances_with_bad_signature-1](tiny/assurances_with_bad_signature-1.json)🔴
- One assurance has a bad signature.
- [assurances_with_bad_validator_index-1](tiny/assurances_with_bad_validator_index-1.json)🔴
- One assurance has a bad validator index.
- [assurance_for_not_engaged_core-1](tiny/assurance_for_not_engaged_core-1.json)🔴
- One assurance targets a core without any assigned work report.
- [assurance_with_bad_attestation_parent-1](tiny/assurance_with_bad_attestation_parent-1.json)🔴
- One assurance has a bad attestation parent hash.
- [assurances_for_stale_report-1](tiny/assurances_for_stale_report-1.json)🔴
- One assurance targets a core with a stale report.
- We are lenient on the stale report as far as it is available.
- [assurers_not_sorted_or_unique-1](tiny/assurers_not_sorted_or_unique-1.json)🔴
- Assurers not sorted.
- [assurers_not_sorted_or_unique-2](tiny/assurers_not_sorted_or_unique-2.json)🔴
- Duplicate assurer.

## Full Vectors

Currently, the same test cases as tiny vectors but at a larger scale.
59 changes: 59 additions & 0 deletions assurances/assurances.asn
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
-- Work reports assurances STF test vectors schema

ReportsModule DEFINITIONS ::= BEGIN

IMPORTS
TimeSlot, ValidatorsData, HeaderHash, WorkReport,
AvailabilityAssignments, AssurancesExtrinsic
FROM JamTypes;


State ::= SEQUENCE {
-- [ρ†] Intermediate pending reports after that any work report judged as
-- uncertain or invalid has been removed from it. Mutated to ϱ‡.
avail-assignments AvailabilityAssignments,

-- [κ'] Posterior active validators.
curr-validators ValidatorsData
}

Input ::= SEQUENCE {
-- [E_A] Assurances extrinsic.
assurances AssurancesExtrinsic,

-- [H_t] Block's timeslot.
slot TimeSlot,

-- [H_p] Parent hash.
parent HeaderHash
}

-- State transition function execution error.
-- Error codes **are not specified** in the the Graypaper.
-- Feel free to ignore the actual value.
ErrorCode ::= ENUMERATED {
bad-attestation-parent (0),
bad-validator-index (1),
core-not-engaged (2),
bad-signature (3),
not-sorted-or-unique-assurers (4)
}

OutputData ::= SEQUENCE {
-- Items removed from ρ† to get ρ'
reported SEQUENCE OF WorkReport
}

Output ::= CHOICE {
ok OutputData,
err ErrorCode
}

TestCase ::= SEQUENCE {
input Input,
pre-state State,
output Output,
post-state State
}

END
Binary file not shown.
21,227 changes: 21,227 additions & 0 deletions assurances/full/assurance_for_not_engaged_core-1.json

Large diffs are not rendered by default.

Binary file not shown.
21,295 changes: 21,295 additions & 0 deletions assurances/full/assurance_with_bad_attestation_parent-1.json

Large diffs are not rendered by default.

Binary file not shown.
21,234 changes: 21,234 additions & 0 deletions assurances/full/assurances_for_stale_report-1.json

Large diffs are not rendered by default.

Binary file not shown.
21,295 changes: 21,295 additions & 0 deletions assurances/full/assurances_with_bad_signature-1.json

Large diffs are not rendered by default.

Binary file not shown.
21,295 changes: 21,295 additions & 0 deletions assurances/full/assurances_with_bad_validator_index-1.json

Large diffs are not rendered by default.

Binary file not shown.
21,295 changes: 21,295 additions & 0 deletions assurances/full/assurers_not_sorted_or_unique-1.json

Large diffs are not rendered by default.

Binary file not shown.
21,295 changes: 21,295 additions & 0 deletions assurances/full/assurers_not_sorted_or_unique-2.json

Large diffs are not rendered by default.

Binary file added assurances/full/no_assurances-1.bin
Binary file not shown.
Loading