-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,363 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,37 @@ | ||
{{/* Get the filepath */}} | ||
{{/* If the first character is "/", the path is from the site's `baseURL`. */}} | ||
{{ if eq (.Get "src" | printf "%.1s") "/" }} | ||
|
||
{{/* Use Hugo `readfile` behavior of path from site's `baseURL`. */}} | ||
{{ $.Scratch.Set "filepath" ( .Get "src" ) }} | ||
|
||
{{ else }} | ||
|
||
{{/* Make relative: Fetch the current directory and then append it to the specified `file=""` value */}} | ||
{{ $.Scratch.Set "filepath" $.Page.Dir }} | ||
{{ $.Scratch.Add "filepath" ( .Get "src" ) }} | ||
|
||
{{ end }} | ||
|
||
|
||
|
||
<div class="diagram"> | ||
|
||
<span class="diagram-title">{{ .Get "title" }}</span> | ||
(<a href="{{ .Get "src" }}" target="_blank">open in new tab</a>) | ||
|
||
{{/* Check if the specified file exists */}} | ||
{{ if fileExists ($.Scratch.Get "filepath") }} | ||
|
||
(<a href="{{ $.Scratch.Get "filepath" }}" target="_blank">open in new tab</a>) | ||
<br /> | ||
<img src="{{ $.Scratch.Get "filepath" }}" /> | ||
|
||
{{/* Say something if the file is not found and display the path that was specified in the shortcode (`file=" "`). */}} | ||
{{ else }} | ||
|
||
<br /> | ||
<p style="color: #D74848"><b><i>Something's not right. The <code>{{ .Get "src" }}</code> file was not found.</i></b></p> | ||
|
||
{{ end }} | ||
|
||
<img src="{{ .Get "src" }}" /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
src/systems/filecoin_mining/storage_mining/diagrams/mining_cycle.dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
digraph mining_cycle { | ||
compound=true; | ||
ranksep=0.2; | ||
edge [style=solid] | ||
|
||
|
||
subgraph cluster_local { | ||
label="Storage Miner\n(off chain)" | ||
|
||
ActiveL -> ChallengedL [style=invis] | ||
|
||
subgraph cluster_local_mining { | ||
label="Mining" | ||
style=filled | ||
color=lightblue | ||
|
||
ActiveL | ||
ChallengedL | ||
|
||
{ // chain challenge | ||
edge [color=red, fontcolor=red] | ||
node [color=red, fontcolor=red, shape=none] | ||
ActiveL -> ChallengedL [label="Chain issues challenge\n(implicit)"] | ||
} | ||
|
||
{ // messages | ||
edge [color=blue, fontcolor=blue] | ||
node [color=blue, fontcolor=blue, shape=none] | ||
} | ||
} | ||
} | ||
|
||
subgraph cluster_chain { | ||
label="Storage Miner Actor\n(on chain)" | ||
color=blue | ||
|
||
OwnerAccountC | ||
ActiveC | ||
// ChallengedC | ||
|
||
|
||
OwnerAccountC -> ActiveC [style=invis] | ||
// ActiveC -> ChallengedC [style=invis] | ||
|
||
{ // cron | ||
edge [color=magenta, fontcolor=magenta] | ||
node [color=magenta, fontcolor=magenta, shape=none] | ||
// ActiveC -> ChallengedC [label="Chain issues challenge\n(implicit)"] | ||
} | ||
|
||
{ // messages | ||
edge [color=blue, fontcolor=blue] | ||
node [color=blue, fontcolor=blue, shape=none] | ||
OwnerAccountC -> ActiveC [label="Create Miner\n(spa.CreateMiner)"] | ||
} | ||
} | ||
|
||
|
||
{ // messages | ||
edge [color=blue, fontcolor=blue] | ||
node [color=blue, fontcolor=blue, shape=none] | ||
OwnerAccL -> ActiveC [label="Create Miner\n(spa.CreateMiner)", constraint=false] | ||
ActiveL -> ActiveC [label="Add Sectors\n(sm.CommitSector)", constraint=false] | ||
|
||
|
||
ProducePost [label="Produce & submit PoSt\n(sm.SubmitPost)"] | ||
ChallengedL -> ProducePost [arrowhead=none] | ||
// ChallengedC -> ProducePost [arrowhead=none] | ||
ProducePost -> ActiveL | ||
ProducePost -> ActiveC | ||
|
||
} | ||
|
||
ActiveC -> ActiveL [label="Miner Created"] | ||
|
||
} |
123 changes: 123 additions & 0 deletions
123
src/systems/filecoin_mining/storage_mining/diagrams/mining_cycle.dot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions
82
src/systems/filecoin_mining/storage_mining/diagrams/sector_chain_fsm.dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
digraph sector { | ||
compound=true; | ||
ranksep=0.2; | ||
splines=ortho; | ||
edge [style=solid] | ||
|
||
subgraph cluster_chain { | ||
label="Sector States in StorageMinerActor\n(on chain)" | ||
style=bold | ||
color=gray | ||
|
||
subgraph cluster_postproving { | ||
label="must be proved in post" | ||
style=filled | ||
color=azure2 | ||
|
||
subgraph cluster_nopowerC1 { | ||
label="Does not count for power" | ||
style=filled | ||
color=lightgray | ||
CommittedC [label="Unproven"] | ||
} | ||
|
||
subgraph cluster_powerC { | ||
label="Counts for power" | ||
style=filled | ||
color=seagreen3 | ||
ActiveC [label="Active"] | ||
} | ||
|
||
} | ||
|
||
subgraph cluster_nopowerC2 { | ||
label="Does not count for power" | ||
style=filled | ||
color=lightgray | ||
|
||
FaultedC [label="Faulted"] | ||
ExpiredC [label="Deleted"] | ||
// DeletedC [label="Deleted"] | ||
|
||
{ // cron | ||
edge [color=magenta, fontcolor=magenta] | ||
// ExpiredC -> DeletedC [label="Sector Cleanup\n(sma.CronTick \n-> sm.SectorCleanup)"] | ||
FaultedC -> ExpiredC [label="Expiry epoch reached\n(sma.CronTick \n-> sm.ExpireSectors)"] | ||
FaultedC -> ExpiredC [label="Faulted 3+ times\n(sma.CronTick \n-> sm.SectorCleanup)", constraint=false] | ||
} | ||
} | ||
|
||
{ // messages | ||
edge [color=blue, fontcolor=blue] | ||
node [color=blue, fontcolor=blue, shape=box] | ||
|
||
FaultsDeclared [label="Fault Declared\n(sm.DeclareFaults)"] | ||
|
||
CommittedC -> ActiveC [label="1st PoSt\n(sm.SubmitPost \n->sm.ActivateSector)"] | ||
|
||
CommittedC -> FaultsDeclared [arrowhead=none] | ||
ActiveC -> FaultsDeclared [arrowhead=none] | ||
FaultsDeclared -> FaultedC | ||
|
||
FaultedC -> CommittedC [label="Recover\n(sm.SubmitPost)", constraint=false] | ||
ActiveC -> ExpiredC [label="Expiry epoch reached\n(sm.SubmitPost \n-> sm.ExpireSectors)"] | ||
} | ||
|
||
{ // cron | ||
edge [color=magenta, fontcolor=magenta] | ||
node [color=magenta, fontcolor=magenta, shape=box] | ||
FaultSpotted [label="Fault Spotted\n(sma.CronTick \n-> sm.PostFailed)"] | ||
|
||
// CommittedC -> ExpiredC [label="Expiry epoch reached\n(sma.CronTick \n-> sm.ExpireSectors)"] | ||
CommittedC -> FaultSpotted [arrowhead=none] | ||
ActiveC -> FaultSpotted [arrowhead=none] | ||
FaultSpotted -> FaultedC | ||
|
||
// ActiveC -> ExpiredC [label="Expiry epoch reached\n(sma.CronTick \n-> sm.ExpireSectors)"] | ||
} | ||
|
||
CommittedC -> ActiveC -> FaultsDeclared -> FaultedC -> ExpiredC [style=invis] // structure | ||
CommittedC -> ActiveC -> FaultSpotted -> FaultedC -> ExpiredC [style=invis] // structure | ||
} | ||
} |
Oops, something went wrong.