|
| 1 | +# Safrole Test Vectors |
| 2 | + |
| 3 | +For details refer to ASN.1 [schema](./safrole.asn). |
| 4 | + |
| 5 | +## NOTES |
| 6 | + |
| 7 | +- Error codes returned as output are not part of the specification. Feel free to ignore actual values. |
| 8 | +- On error, post-state must match pre-state. |
| 9 | +- Ring verifier is constructed using [ark-ec-vrfs](https://github.com/davxy/ark-ec-vrfs) procedures. |
| 10 | + |
| 11 | +## TODO |
| 12 | + |
| 13 | +- Better specify the procedure used to construct test ring verifier. |
| 14 | + |
| 15 | +## Vectors |
| 16 | + |
| 17 | +- [enact-epoch-change-no-tickets-1.json](enact-epoch-change-with-no-tickets-1.json) |
| 18 | + - Progress from slot 0 to 1. |
| 19 | + - No tickets extrinsic. |
| 20 | +- [enact-epoch-change-no-tickets-2.json](enact-epoch-change-with-no-tickets-2.json) |
| 21 | + - Progress from slot 1 to slot 1. |
| 22 | + - Fail: Timeslot must be strictly monotonic. |
| 23 | +- [enact-epoch-change-no-tickets-3.json](enact-epoch-change-with-no-tickets-3.json) |
| 24 | + - Progress from slot 1 to a slot in epoch's tail. |
| 25 | + - Tickets mark is not generated (no enough ticket). |
| 26 | +- [enact-epoch-change-no-tickets-4.json](enact-epoch-change-with-no-tickets-4.json) |
| 27 | + - Progress from epoch's tail to next epoch. |
| 28 | + - Authorities / entropies rotated. |
| 29 | + - Epoch mark generated. |
| 30 | + |
| 31 | +- [skip-epochs-1](skip-epochs-1.json) |
| 32 | + - Progress by skipping epochs. |
| 33 | + - Accumulated tickets are discarded> |
| 34 | + - Tickets mark is not generated (skipped epochs). |
| 35 | + - Fallback method is enacted. |
| 36 | + |
| 37 | +- [skip-epoch-tail-1](skip-epoch-tail-1.json) |
| 38 | + - Progress to next epoch by skipping epochs tail. |
| 39 | + - Tickets mark has no chance to be generated. |
| 40 | + - Even tough we have enough tickets, these are discarded when next epoch is enacted. |
| 41 | + - Fallback method is enacted. |
| 42 | + |
| 43 | +- [publish-tickets-no-mark-1](publish-tickets-no-mark-1.json) |
| 44 | + - Fail: Submit an extrinsic with more tickets than allwed. |
| 45 | +- [publish-tickets-no-mark-2](publish-tickets-no-mark-2.json) |
| 46 | + - Submit tickets extrinsics from authority 0 and 1. |
| 47 | +- [publish-tickets-no-mark-3](publish-tickets-no-mark-3.json) |
| 48 | + - Fail: Re-submit tickets from authority 0. |
| 49 | +- [publish-tickets-no-mark-4](publish-tickets-no-mark-4.json) |
| 50 | + - Fail: Submit tickets in bad order. |
| 51 | +- [publish-tickets-no-mark-5](publish-tickets-no-mark-5.json) |
| 52 | + - Fail: Submit tickets with bad ring proof. |
| 53 | +- [publish-tickets-no-mark-6](publish-tickets-no-mark-6.json) |
| 54 | + - Submit a ticket from authority 2. |
| 55 | +- [publish-tickets-no-mark-7](publish-tickets-no-mark-7.json) |
| 56 | + - Fail: Submit a ticket while in epoch's tail. |
| 57 | +- [publish-tickets-no-mark-8](publish-tickets-no-mark-8.json) |
| 58 | + - Progress into epoch tail. |
| 59 | + - No enough tickets, thus no tickets mark. |
| 60 | + - TODO: technically we can already drop the tickets from accumulator (check graypaper). |
| 61 | +- [publish-tickets-no-mark-9](publish-tickets-no-mark-9.json) |
| 62 | + - Progress into next epoch with no enough tickets. |
| 63 | + - Tickets are dropped. |
| 64 | + - Fallback method is enacted. |
| 65 | + |
| 66 | +- [pubblish-tickets-with-mark-1](publish-tickets-with-mark-1.json) |
| 67 | + - Publish some tickets with a half filled accumulator. |
| 68 | + - Accumulator is not filled yet. |
| 69 | + - No ticket is dropped from accumulator. |
| 70 | +- [pubblish-tickets-with-mark-2](publish-tickets-with-mark-2.json) |
| 71 | + - Publish some more tickets. |
| 72 | + - Accumulator is filled. |
| 73 | + - One old ticket is removed from the accumulator. |
| 74 | +- [pubblish-tickets-with-mark-3](publish-tickets-with-mark-3.json) |
| 75 | + - Publish some more tickets. |
| 76 | + - Accumulator is filled. |
| 77 | + - Some old ticket are removed to make space for new ones. |
| 78 | +- [pubblish-tickets-with-mark-4](publish-tickets-with-mark-4.json) |
| 79 | + - Progress into epoch tail. |
| 80 | + - Tickets mark is produced. |
| 81 | +- [pubblish-tickets-with-mark-5](publish-tickets-with-mark-5.json) |
| 82 | + - Progress into next epoch. |
| 83 | + - Tickets are enacted. |
0 commit comments