-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathreports.asn
122 lines (97 loc) · 3.06 KB
/
reports.asn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
-- Guarantee reports STF test vectors schema
ReportsModule DEFINITIONS ::= BEGIN
IMPORTS
cores-count, OpaqueHash, TimeSlot, EntropyBuffer,
ServiceId, ServiceInfo, ValidatorsData, BlocksHistory, AvailabilityAssignments,
GuaranteesExtrinsic, Ed25519Public, WorkPackageHash, CoresStatistics, ServicesStatistics
FROM JamTypes;
-- Service account information relevant for this STF.
Account ::= SEQUENCE {
-- [a_c, a_b, a_g, a_m, a_o, a_i] Service metadata.
service ServiceInfo
}
AccountsMapEntry ::= SEQUENCE {
id ServiceId,
data Account
}
AuthPool ::= SEQUENCE OF OpaqueHash
AuthPools ::= SEQUENCE (SIZE(cores-count)) OF AuthPool
State ::= SEQUENCE {
-- [ρ‡] Intermediate pending reports after that any work report judged as
-- uncertain or invalid has been removed from it (ϱ†), and the availability
-- assurances are processed. Mutated to ϱ'.
avail-assignments AvailabilityAssignments,
-- [κ'] Posterior active validators.
curr-validators ValidatorsData,
-- [λ'] Posterior previous validators.
prev-validators ValidatorsData,
-- [η'] Posterior entropy buffer.
entropy EntropyBuffer,
-- [ψ'_o] Posterior offenders.
offenders SEQUENCE OF Ed25519Public,
-- [β] Recent blocks.
recent-blocks BlocksHistory,
-- [α] Authorization pools.
auth-pools AuthPools,
-- [δ] Relevant services account data. Refer to T(σ) in GP Appendix D.
accounts SEQUENCE OF AccountsMapEntry,
-- Cores statistics.
cores-statistics CoresStatistics,
-- Services statistics.
services-statistics ServicesStatistics
}
Input ::= SEQUENCE {
-- [E_G] Guarantees extrinsic.
guarantees GuaranteesExtrinsic,
-- [H_t] Block's timeslot.
slot TimeSlot
}
ReportedPackage ::= SEQUENCE {
work-package-hash WorkPackageHash,
segment-tree-root OpaqueHash
}
OutputData ::= SEQUENCE {
-- Reported packages hash and segment tree root
reported SEQUENCE OF ReportedPackage,
-- Reporters for reported packages
reporters SEQUENCE OF Ed25519Public
}
-- State transition function execution error.
-- Error codes **are not specified** in the the Graypaper.
-- Feel free to ignore the actual value.
ErrorCode ::= ENUMERATED {
bad-core-index (0),
future-report-slot (1),
report-epoch-before-last (2),
insufficient-guarantees (3),
out-of-order-guarantee (4),
not-sorted-or-unique-guarantors (5),
wrong-assignment (6),
core-engaged (7),
anchor-not-recent (8),
bad-service-id (9),
bad-code-hash (10),
dependency-missing (11),
duplicate-package (12),
bad-state-root (13),
bad-beefy-mmr-root (14),
core-unauthorized (15),
bad-validator-index (16),
work-report-gas-too-high (17),
service-item-gas-too-low (18),
too-many-dependencies (19),
segment-root-lookup-invalid (20),
bad-signature (21),
work-report-too-big (22)
}
Output ::= CHOICE {
ok OutputData,
err ErrorCode
}
TestCase ::= SEQUENCE {
input Input,
pre-state State,
output Output,
post-state State
}
END