Skip to content

Commit f41a1bb

Browse files
authored
Merge pull request w3f#54 from davxy/improve-stats-vectors
Improve statistics vectors
2 parents c671a0d + 7e2cf04 commit f41a1bb

21 files changed

+115282
-135871
lines changed

accumulate/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ artifact frequently varies, even when generated from identical source code. As
1616
a result, you can just rely on the code blob embedded in the test vectors, which
1717
is available within the `accounts` map.
1818

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+
1927
## Tiny Vectors
2028

2129
- [no_available_reports-1](./tiny/no_available_reports-1.json)

accumulate/accumulate.asn

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,29 @@ AccountsMapEntry ::= SEQUENCE {
3939
}
4040

4141
State ::= SEQUENCE {
42+
-- [τ] Most recent block's timeslot.
4243
slot TimeSlot,
44+
-- [n_0'] Posterior entropy accumulator.
4345
entropy Entropy,
46+
-- [ϑ] Work packages ready to be accumulated.
4447
ready-queue ReadyQueue,
48+
-- [ξ] Work packages recently accumulated.
4549
accumulated AccumulatedQueue,
50+
-- [χ] Privileged service indices.
4651
privileges Privileges,
52+
-- [π_S] Services statistics.
53+
-- Note: Only stats related to accumulate STF are updated, in particular:
54+
-- accumulate_count (a.0), accumulate_gas_used (a.1),
55+
-- on_transfers_count (t.0), on_transfers_gas_used (t.1)
4756
statistics ServicesStatistics,
4857
-- [δ] Relevant services account data. Refer to T(σ) in GP Appendix D.
4958
accounts SEQUENCE OF AccountsMapEntry
5059
}
5160

5261
Input ::= SEQUENCE {
53-
-- [H_t] Block's timeslot.
62+
-- [H_t] Current time slot as found within the block header.
5463
slot TimeSlot,
64+
-- Newly available work reports (W).
5565
reports SEQUENCE OF WorkReport
5666
}
5767

jam-types-asn/jam-types.asn

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ BlocksHistory ::= SEQUENCE (SIZE(0..max-blocks-history)) OF BlockInfo
254254
-- Statistics
255255
--------------------------------------------
256256

257-
ActivityRecord ::= SEQUENCE {
257+
ValidatorActivityRecord ::= SEQUENCE {
258258
blocks U32,
259259
tickets U32,
260260
pre-images U32,
@@ -263,7 +263,7 @@ ActivityRecord ::= SEQUENCE {
263263
assurances U32
264264
}
265265

266-
ActivityRecords ::= SEQUENCE (SIZE(validators-count)) OF ActivityRecord
266+
ValidatorsStatistics ::= SEQUENCE (SIZE(validators-count)) OF ValidatorActivityRecord
267267

268268
CoreActivityRecord ::= SEQUENCE {
269269
-- Amount of bytes which are placed into either Audits or Segments DA.
@@ -323,8 +323,8 @@ ServicesStatisticsMapEntry ::= SEQUENCE {
323323
ServicesStatistics ::= SEQUENCE OF ServicesStatisticsMapEntry
324324

325325
Statistics ::= SEQUENCE {
326-
vals-current ActivityRecords,
327-
vals-last ActivityRecords,
326+
vals-curr ValidatorsStatistics,
327+
vals-last ValidatorsStatistics,
328328
cores CoresStatistics,
329329
services ServicesStatistics
330330
}

preimages/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ and this subsystem STF specific [schema](./preimages.asn).
55

66
## Statistics
77

8-
A subset of `ServiceActivityRecord` structure is updated by the STF involved processing these test vectors.
9-
In particular the `provided-count` and `provided-size` items are updated when new preimages are provided
10-
to be included in the chain storage via the extrinsic.
8+
A subset of service activity statistics ($π_S$) updated by the STF subsystem used
9+
to process these test vectors.
10+
11+
In particular the `provided-count` (p.0) and `provided-size` (p.1) items are
12+
updated when new preimages are provided to be included in the chain storage via
13+
the extrinsic.
1114

1215
## Vectors
1316

preimages/preimages.asn

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,17 @@ AccountsMapEntry ::= SEQUENCE {
3636
}
3737

3838
State ::= SEQUENCE {
39-
-- Relevant services account data [δ]. Refer to T(σ) in GP Appendix D.
39+
-- [δ] Relevant services account data. Refer to T(σ) in GP Appendix D.
4040
accounts SEQUENCE OF AccountsMapEntry,
41-
-- Statistics updated by the preimages STF subsystem.
41+
-- [π_S] Services statistics.
42+
-- Note: Only stats related to preimages STF are updated, in particular:
43+
-- provided_count (p.0), provided_size (p.1).
4244
statistics ServicesStatistics
4345
}
4446

4547
Input ::= SEQUENCE {
4648
-- [E_P] Preimages extrinsic.
4749
preimages PreimagesExtrinsic,
48-
4950
-- [H_t] Block's timeslot.
5051
slot TimeSlot
5152
}

reports/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ Any update to the pools is delegated to the dedicated ["authorizations"](../auth
1212
subsystem, which is tasked with removing consumed items from the authorization
1313
pools and introduce new authorizers from the authorization queue.
1414

15+
## Statistics
16+
17+
A subset of service ($π_S$) and core ($π_S$) activity statistics updated by the
18+
STF subsystem used to process these test vectors.
19+
20+
In particular, for cores statistics we may update imports (i), exports (e),
21+
extrinsic_size (z), extrinsic_count (x), bundle_size (b), gas_used (u).
22+
For services statistics we may update refinement_count (r.0), refinement_gas_used (r.1),
23+
imports (i), exports (x), extrinsic_size (z), extrinsic_count (x).
24+
1525
## Tiny Vectors
1626

1727
- [report_curr_rotation](./tiny/report_curr_rotation-1.json) 🟢

reports/reports.asn

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,16 @@ State ::= SEQUENCE {
5151
-- [δ] Relevant services account data. Refer to T(σ) in GP Appendix D.
5252
accounts SEQUENCE OF AccountsMapEntry,
5353

54-
-- Cores statistics.
54+
-- [π_C] Cores statistics.
55+
-- Note: Only stats related to reports STF are updated, in particular:
56+
-- imports (i), exports (e), extrinsic_size (z), extrinsic_count (x),
57+
-- bundle_size (b), gas_used (u).
5558
cores-statistics CoresStatistics,
5659

57-
-- Services statistics.
60+
-- [π_S] Services statistics.
61+
-- Note: Only stats related to reports STF are updated, in particular:
62+
-- refinement_count (r.0), refinement_gas_used (r.1), imports (i),
63+
-- exports (x), extrinsic_size (z), extrinsic_count (x).
5864
services-statistics ServicesStatistics
5965
}
6066

statistics/README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
# Statistics STF Test Vectors
1+
# Validators Statistics STF Test Vectors
22

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

6+
## Validators Statistics
7+
8+
These vectors exclusively contribute to updating validator-related statistics
9+
($π_V$ and $π_L$).
10+
11+
In contrast, service and core statistics ($π_S$ and $π_C$) are updated by
12+
vectors that more directly influence the state changes relevant to those
13+
metrics (i.e. see [preimages](../preimages/README.md#statistics),
14+
[reports](../reports/README.md#statistics) and
15+
[accumulate](../accumulate/README.md#statistics)).
16+
617
## ⚠️Extrinsic Semantic Validity
718

819
These vectors are intended just to advance the statistics of validators.
-5.33 KB
Binary file not shown.

0 commit comments

Comments
 (0)