-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added docs for elections, network, and timegraph pallets (#986)
Co-authored-by: TaniaSaleem <[email protected]> Co-authored-by: Metadata Update Bot <[email protected]>
- Loading branch information
1 parent
cc0e6d5
commit 7f0035f
Showing
15 changed files
with
308 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
flowchart TB | ||
|
||
|
||
|
||
New3[set_shard_config] --> setShardConfig1[Ensure root] | ||
validateShard[Validate shard_size >= shard_threshold] | ||
updateStorage[Update ShardSize and ShardThreshold] | ||
emitEvent[Emit ShardConfigSet event] | ||
iterateUnassigned[Iterate through Unassigned members] | ||
tryElectShard1[try_elect_shard] | ||
|
||
setShardConfig1 --> validateShard | ||
validateShard -->|Valid| updateStorage | ||
updateStorage --> emitEvent | ||
emitEvent --> iterateUnassigned | ||
iterateUnassigned --> tryElectShard1 | ||
|
||
|
||
New2[member_online] --> memberOnline1[Check if member is shard member] | ||
checkElectable[Check if member is electable] | ||
insertUnassigned[Insert member to Unassigned] | ||
tryElectShard2[try_elect_shard] | ||
notifyShards1[Notify Shards interface] | ||
|
||
memberOnline1 -->|No| checkElectable | ||
checkElectable --> insertUnassigned | ||
insertUnassigned --> tryElectShard2 | ||
tryElectShard2 --> notifyShards1 | ||
|
||
memberOnline1 -->|Yes| notifyShards2[Notify Shards interface] | ||
|
||
|
||
shardOffline1[shard_offline] | ||
insertUnassignedShard[Insert shard members to Unassigned] | ||
tryElectShard3[try_elect_shard] | ||
|
||
shardOffline1 --> insertUnassignedShard | ||
insertUnassignedShard --> tryElectShard3 | ||
|
||
memberOffline[member_offline] | ||
memberOffline --> removeUnassigned[Remove member from Unassigned] | ||
removeUnassigned --> notifyShards3[Notify Shards interface] | ||
|
||
|
||
|
||
|
||
|
||
%%tryElectShard1 -->|Calls| tryElectShard4 | ||
%%tryElectShard3 -->|Calls| tryElectShard4 | ||
%%tryElectShard2 -->|Calls| tryElectShard4 | ||
%%createShard -->|Calls| New1 | ||
|
||
%% styles | ||
style New2 fill:#9f9,stroke:#333,stroke-width:2px; | ||
style New3 fill:#9f9,stroke:#333,stroke-width:2px | ||
style memberOffline fill:#9f9,stroke:#333,stroke-width:2px; | ||
style shardOffline1 fill:#9f9,stroke:#333,stroke-width:2px; | ||
style tryElectShard1 fill:#9f9,stroke:#333,stroke-width:2px; | ||
style tryElectShard2 fill:#9f9,stroke:#333,stroke-width:2px; | ||
style tryElectShard3 fill:#9f9,stroke:#333,stroke-width:2px; | ||
|
||
|
||
style emitEvent fill:#bbf,stroke:#333,stroke-width:2px; |
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,41 @@ | ||
flowchart TD | ||
|
||
tryElectShard4[try_elect_shard] | ||
checkNewShard[Check if new shard can be formed] | ||
removeSelectedMembers[Remove selected members from Unassigned] | ||
createShard[Create shard using Shards interface] | ||
|
||
tryElectShard4 --> checkNewShard | ||
checkNewShard -->|Yes| removeSelectedMembers | ||
removeSelectedMembers --> createShard | ||
|
||
|
||
|
||
New1[new_shard_members] --> newShardMembers2[Retrieve required shard size] | ||
collectUnassigned[Collect unassigned members and filter online members] | ||
checkEnoughMembers[Enough members to form shard?] | ||
returnNone[Return None] | ||
sortMembers[Sort members by stake] | ||
selectTopMembers[Select top members to form shard] | ||
returnSelected[Return selected members] | ||
|
||
newShardMembers2 --> collectUnassigned | ||
collectUnassigned --> checkEnoughMembers | ||
checkEnoughMembers -->|No| returnNone | ||
checkEnoughMembers -->|Yes| sortMembers | ||
sortMembers --> selectTopMembers | ||
selectTopMembers --> returnSelected | ||
|
||
|
||
setElectable[set_electable] | ||
setElectable -->|Ensure root| clearElectable[Clear current electable list] | ||
clearElectable --> insertElectable[Insert new electable members] | ||
|
||
|
||
|
||
|
||
%% styles | ||
|
||
style New1 fill:#9f9,stroke:#333,stroke-width:2px; | ||
style tryElectShard4 fill:#9f9,stroke:#333,stroke-width:2px; | ||
style setElectable fill:#9f9,stroke:#333,stroke-width:2px; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
graph TD | ||
B[add_network] | ||
B --> C{Ensure Root} | ||
C -->|Root| D[Call insert_network] | ||
C -->|Not Root| E[Return Error::NotRoot] | ||
|
||
D --> F{Check Network Exists} | ||
F -->|Exists| G[Return Error::NetworkExists] | ||
F -->|Doesn't Exist| H[Get NetworkIdCounter] | ||
|
||
H --> I{Check Overflow} | ||
I -->|Overflow| J[Return Error::NetworkIdOverflow] | ||
I -->|No Overflow| K[Increment NetworkIdCounter] | ||
|
||
K --> L[Store Network in Networks] | ||
L --> M[Update NetworkIdCounter] | ||
|
||
M --> N[Emit NetworkAdded Event] | ||
N --> O[Return Ok] | ||
|
||
|
||
|
||
%% style extrinsics | ||
style B fill:#f9f,stroke:#333,stroke-width:2px; | ||
|
||
%% style errors | ||
style E fill:#f96,stroke:#333,stroke-width:2px; | ||
style G fill:#f96,stroke:#333,stroke-width:2px; | ||
style J fill:#f96,stroke:#333,stroke-width:2px; | ||
|
||
%% style events | ||
style N fill:#bbf,stroke:#333,stroke-width:2px; |
Oops, something went wrong.