-
Notifications
You must be signed in to change notification settings - Fork 2
/
sequence_closed_arbitration.plantuml
108 lines (97 loc) · 2.75 KB
/
sequence_closed_arbitration.plantuml
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
@startuml
box "Client"
actor "Client" as client
participant "Client dApp" as dapp
end box
box "Distributed Data"
entity "Pandora Contracts" as pandora
database "IPFS" as ipfs
end box
box "Workers"
collections "Worker Nodes" as workers
control "Keras/TensorFlow" as nn
collections "Validating Nodes" as validators
collections "Arbiters" as arbiters
end box
entity "Cognition Contract" as cognition
== Closed Cognitive Arbitration Round ==
loop until arbitors found, but < N times
|||
ref over pandora: lottery
pandora -> pandora: selectArbitors
activate pandora
pandora -->> cognition: initWithArbitors
... mining transaction ...
pandora -[#blue]->> arbiters: newArbitrationJob
deactivate pandora
alt Arbiter timeout
pandora -[#red]->x arbiters: penalty
group repeat
end
else Arbiter active
activate arbiters
arbiters -> cognition: readData
cognition --> arbiters: < cognitive job info >
arbiters ->> ipfs: download
... downloading ...
ipfs -->> arbiters: < files >
arbiters -> nn: loadNetwork
activate nn
arbiters -> nn: getDetails
activate pandora
alt Arbiter accepts job
arbiters ->> pandora: jobAccepted(timeEstimation)
else Arbiter declined job
arbiters ->> pandora: jobDeclined
pandora -[#red]->x arbiters: penalty
group repeat
end
end
pandora -> pandora: updateArbiters
deactivate arbiters
... mining transaction ...
pandora -[#blue]->> arbiters: startArbitration
activate arbiters
deactivate pandora
par
arbiters ->> nn: compute
... computing ...
nn -->> arbiters: < results >
deactivate nn
else
ipfs <<- arbiters: download
activate ipfs
note right: downloading\ncomputation\nresults
... downloading ...
ipfs -->> arbiters: < files >
deactivate ipfs
end
arbiters -> arbiters: compareResults
arbiters ->> cognition: arbitrationVerdict
deactivate arbiters
cognition -> pandora: arbitrationResults
alt Arbitration verdict is reached
ref over pandora, workers, validators: Public Appeal
else Arbiter answer timeout
pandora -[#blue]->> arbiters: updateTimeEstimation
activate pandora
alt Arbiter responses
arbiters ->> pandora: updateTimeEstimation
pandora -[#red]->x arbiters: smallPenalty
else Arbiter does not response
pandora -[#red]->x arbiters: penalty
group repeat
end
end
deactivate pandora
end
end
end
group if [Not all arbiters found / worked]
pandora -[#blue]->> dapp: jobCompleted\nArguableValidation
pandora -[#green]->>o client: partialPayout
pandora -[#green]->>o pandora: makePayments\n(accepingValidatorVerdict)
end
|||
deactivate pandora
@enduml