-
Notifications
You must be signed in to change notification settings - Fork 607
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat x/bridge: added InboundTransfer storing (#7775)
* feat x/bridge: added InboundTransfer storing * added finalization checks * added inbound transfer diagram * Generated protofile changes * code review 1 * code review 2 --------- Co-authored-by: github-actions <[email protected]>
- Loading branch information
Showing
16 changed files
with
977 additions
and
139 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,98 @@ | ||
@startuml | ||
|
||
actor "Client" as client | ||
node "BTC vault" as vault | ||
|
||
client --> vault : send BTC | ||
|
||
folder "Valset" as valset1 { | ||
cloud "Validator 1" as val1 #lightgreen | ||
cloud "Validator 2" as val2 | ||
cloud "Validator 3" as val3 #lightgreen | ||
cloud "Validator 4" as val4 | ||
cloud "Validator 5" as val5 #lightgreen | ||
} | ||
|
||
note bottom of valset1 | ||
Green validators are | ||
running x/bridge observers. | ||
|
||
Let's say that we need **three** | ||
votes to process the transfer. | ||
end note | ||
|
||
folder "Valset" as valset2 { | ||
cloud "Validator 1" as val1_2 #lightgreen | ||
cloud "Validator 2" as val2_2 | ||
cloud "Validator 3" as val3_2 #lightgreen | ||
cloud "Validator 4" as val4_2 | ||
cloud "Validator 5" as val5_2 #lightgreen | ||
} | ||
|
||
vault <-- val1 : observe | ||
vault <-- val3 : observe | ||
vault <-- val5 : observe | ||
|
||
node "Chain proposer" as proposer | ||
|
||
val1 --> proposer : MsgInboundTransfer | ||
val3 --> proposer : MsgInboundTransfer | ||
val5 --> proposer : MsgInboundTransfer | ||
|
||
json Block { | ||
"1":"MsgInboundTransfer", | ||
"2":"MsgInboundTransfer", | ||
"3":"MsgInboundTransfer" | ||
} | ||
|
||
proposer --> Block : forms a block to process | ||
|
||
Block <-- val1_2 : process | ||
Block <-- val2_2 : process | ||
Block <-- val3_2 : process | ||
Block <-- val4_2 : process | ||
Block <-- val5_2 : process | ||
|
||
action "Process each\nMsgInboundTransfer" as val1_act_1 | ||
action "Process each\nMsgInboundTransfer" as val2_act_1 | ||
action "Process each\nMsgInboundTransfer" as val3_act_1 | ||
action "Process each\nMsgInboundTransfer" as val4_act_1 | ||
action "Process each\nMsgInboundTransfer" as val5_act_1 | ||
|
||
val1_2 --> val1_act_1 | ||
val2_2 --> val2_act_1 | ||
val3_2 --> val3_act_1 | ||
val4_2 --> val4_act_1 | ||
val5_2 --> val5_act_1 | ||
|
||
action "Accumulate votes x3" as val1_act_2 | ||
action "Is not a part\nof the signers set" as val2_act_2 #red | ||
action "Accumulate votes x3" as val3_act_2 | ||
action "Is not a part\nof the signers set" as val4_act_2 #red | ||
action "Accumulate votes x3" as val5_act_2 | ||
|
||
val1_act_1 --> val1_act_2 | ||
val2_act_1 --> val2_act_2 | ||
val3_act_1 --> val3_act_2 | ||
val4_act_1 --> val4_act_2 | ||
val5_act_1 --> val5_act_2 | ||
|
||
action "Call tokenfactory mint" as val1_act_3 | ||
action "Call tokenfactory mint" as val3_act_3 | ||
action "Call tokenfactory mint" as val5_act_3 | ||
|
||
val1_act_2 --> val1_act_3 | ||
val3_act_2 --> val3_act_3 | ||
val5_act_2 --> val5_act_3 | ||
|
||
node "Submit the block" as consensus | ||
|
||
val1_act_3 --> consensus | ||
val3_act_3 --> consensus | ||
val5_act_3 --> consensus | ||
|
||
note left of consensus | ||
The transfer is done! | ||
end note | ||
|
||
@enduml |
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
Oops, something went wrong.