|
| 1 | +# Accumulate STF Test Vectors |
| 2 | + |
| 3 | +Both JSON and SCALE formats conform to the JAM ASN.1 [schema](../jam-types-asn/jam-types.asn) |
| 4 | +and this subsystem STF specific [schema](./accumulate.asn). |
| 5 | + |
| 6 | +## Test Service Code |
| 7 | + |
| 8 | +Test vectors invoke the `accumulate` method of the provided [test-service](./test-service). |
| 9 | + |
| 10 | +The PVM binary, which refers to the compiled version of the `test-service`, is |
| 11 | +generated using the [`jam-pvm-build`](https://crates.io/crates/jam-pvm-build) |
| 12 | +tool. |
| 13 | + |
| 14 | +Due to differences in dependencies and compiler versions, the resulting binary |
| 15 | +artifact frequently varies, even when generated from identical source code. As |
| 16 | +a result, you can just rely on the code blob embedded in the test vectors, which |
| 17 | +is available within the `accounts` map. |
| 18 | + |
| 19 | +## Statistics |
| 20 | + |
| 21 | +A subset of service activity statistics ($π_S$) updated by the STF subsystem used |
| 22 | +to process these test vectors. |
| 23 | + |
| 24 | +In particular the `accumulate-count` (a.0), `accumulate-gas-used` (a.1), |
| 25 | +`on-transfers-count` (t.0) and `on-transfers-gas-used` (t.1). |
| 26 | + |
| 27 | +## Tiny Vectors |
| 28 | + |
| 29 | +- [no_available_reports-1](./tiny/no_available_reports-1.json) |
| 30 | + - No reports. |
| 31 | +- [process_one_immediate_report-1](./tiny/process_one_immediate_report-1.json) |
| 32 | + - Report with no dependencies. |
| 33 | +- [enqueue_and_unlock_simple-1](./tiny/enqueue_and_unlock_simple-1.json) |
| 34 | + - Report with unsatisfied dependency added to the ready-queue. |
| 35 | +- [enqueue_and_unlock_simple-2](./tiny/enqueue_and_unlock_simple-2.json) |
| 36 | + - Report with no dependencies that resolves previous dependency. |
| 37 | +- [enqueue_and_unlock_with_sr_lookup-1](./tiny/enqueue_and_unlock_with_sr_lookup-1.json) |
| 38 | + - Report with unsatisfied segment tree root dependency added to the ready-queue. |
| 39 | +- [enqueue_and_unlock_with_sr_lookup-2](./tiny/enqueue_and_unlock_with_sr_lookup-2.json) |
| 40 | + - Report with no dependencies that resolves previous dependency. |
| 41 | +- [enqueue_and_unlock_chain-1](./tiny/enqueue_and_unlock_chain-1.json) |
| 42 | + - Two reports with unsatisfied dependencies added to the ready-queue. |
| 43 | +- [enqueue_and_unlock_chain-2](./tiny/enqueue_and_unlock_chain-2.json) |
| 44 | + - Two additional reports with unsatisfied dependencies added to the ready-queue. |
| 45 | +- [enqueue_and_unlock_chain-3](./tiny/enqueue_and_unlock_chain-3.json) |
| 46 | + - Two additional reports. One with unsatisfied dependencies, thus added to the ready-queue. |
| 47 | + - One report is accumulated and resolves two previously enqueued reports. |
| 48 | +- [enqueue_and_unlock_chain-4](./tiny/enqueue_and_unlock_chain-4.json) |
| 49 | + - Report that resolves all remaining queued dependencies. |
| 50 | +- [enqueue_and_unlock_chain_wraps-1](./tiny/enqueue_and_unlock_chain_wraps-1.json) |
| 51 | + - Two reports with unsatisfied dependencies added to the ready-queue. |
| 52 | +- [enqueue_and_unlock_chain_wraps-2](./tiny/enqueue_and_unlock_chain_wraps-2.json) |
| 53 | + - Two additional reports, one with no dependencies and thus immediately accumulated. |
| 54 | + - The other is pushed to the ready-queue which fills up and wraps around |
| 55 | + (ready-queue is a ring buffer). |
| 56 | +- [enqueue_and_unlock_chain_wraps-3](./tiny/enqueue_and_unlock_chain_wraps-3.json) |
| 57 | + - Two additional reports with unsatisfied dependencies pushed to the ready-queue. |
| 58 | +- [enqueue_and_unlock_chain_wraps-4](./tiny/enqueue_and_unlock_chain_wraps-4.json) |
| 59 | + - Two additional reports, one with no dependencies and thus immediately accumulated. |
| 60 | + - Three old entries in the ready-queue are removed. |
| 61 | +- [enqueue_and_unlock_chain_wraps-5](./tiny/enqueue_and_unlock_chain_wraps-5.json) |
| 62 | + - Report with no dependencies resolves all previous enqueued reports. |
| 63 | +- [enqueue_self_referential-1](./tiny/enqueue_self_referential-1.json) |
| 64 | + - Report with direct dependency on itself. |
| 65 | + - This makes the report stale, but pushed to the ready-queue anyway. |
| 66 | +- [enqueue_self_referential-2](./tiny/enqueue_self_referential-2.json) |
| 67 | + - Two reports with indirect circular dependency. |
| 68 | + - This makes the reports stale, but pushed to the ready-queue anyway. |
| 69 | +- [enqueue_self_referential-3](./tiny/enqueue_self_referential-3.json) |
| 70 | + - Two reports. First depends on second, which depends on unseen report. |
| 71 | +- [enqueue_self_referential-4](./tiny/enqueue_self_referential-4.json) |
| 72 | + - New report creates a cycle with the previously queued reports. |
| 73 | + - This makes the reports stale, but pushed to the ready-queue anyway. |
| 74 | +- [accumulate_ready_queued_reports-1](./tiny/accumulate_ready_queued_reports-1.json) |
| 75 | + - There are some reports in the ready-queue ready to be accumulated. |
| 76 | + - Even though we don't supply any new available work report these are processed. |
| 77 | + - This condition may result because of gas exhausition during previous block execution. |
| 78 | +- [queues_are_shifted-1](./tiny/queues_are_shifted-1.json) |
| 79 | + - Check that ready-queue and accumulated-reports queues are shifted. |
| 80 | + - A new available report is supplied. |
| 81 | +- [queues_are_shifted-2](./tiny/queues_are_shifted-2.json) |
| 82 | + - Check that ready-queue and accumulated-reports queues are shifted. |
| 83 | + - No new report is supplied. |
| 84 | +- [ready_queue_editing-1](./tiny/ready_queue_editing-1.json) |
| 85 | + - Two reports with unsatisfied dependencies added to the ready-queue. |
| 86 | +- [ready_queue_editing-2](./tiny/ready_queue_editing-2.json) |
| 87 | + - Two reports, one with unsatisfied dependency added to the ready-queue. |
| 88 | + - One accumulated. Ready queue items dependencies are edited. |
| 89 | +- [ready_queue_editing-3](./tiny/ready_queue_editing-3.json) |
| 90 | + - One report unlocks reports in the ready-queue. |
| 91 | + |
| 92 | +## Full Vectors |
| 93 | + |
| 94 | +Currently, the same test cases as tiny vectors but at a larger scale. |
0 commit comments