-
Notifications
You must be signed in to change notification settings - Fork 231
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
1 parent
4e0f3d6
commit a9216ce
Showing
9 changed files
with
277 additions
and
92 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,31 @@ | ||
## **StatusManager** sequence diagram, showing `TxStatus` state transitions | ||
## **StatusManager** state diagram, showing `TxStatus` transitions | ||
|
||
### Current Implementation | ||
|
||
```mermaid | ||
sequenceDiagram | ||
participant I as Initial | ||
participant O as OBSERVED | ||
participant A as ADVANCED | ||
participant S as SETTLED | ||
Note over O,S: Currently Implemented State Transitions | ||
I->>O: statusManager.observe()<br/>When TX observed via EventFeed | ||
O->>A: statusManager.advance()<br/>When IBC transfer initiated | ||
A->>S: statusManager.settle()<br/>When settlement received + dispersed | ||
Note over O,A: Status updated when transfer starts | ||
Note over A,S: Requires matching settlement transfer | ||
stateDiagram-v2 | ||
[*] --> Observed: EventFeed .observe() | ||
Observed --> Advanced: Advancer .advance() | ||
Advanced --> Settled: Settler .settle() after fees | ||
Observed --> Skipped: Advancer .skip() | ||
Skipped --> Settled: Settler .settle() sans fees | ||
Settled --> [*] | ||
``` | ||
|
||
### Additional States to Consider (Not Implemented) | ||
### Additional Scenarios to Consider | ||
|
||
```mermaid | ||
sequenceDiagram | ||
participant I as Initial | ||
participant O as OBSERVED | ||
participant AG as ADVANCING | ||
participant A as ADVANCED | ||
participant S as SETTLED | ||
participant AS as ADVANCE_SKIPPED | ||
participant AF as ADVANCE_FAILED | ||
participant OS as ORPHANED_SETTLE | ||
Note over O,S: Normal Flow | ||
I->>O: statusManager.observe() | ||
O->>AG: initiate IBC transfer<br/>(if validation passes) | ||
AG->>A: IBC transfer settled | ||
A->>S: settlement received | ||
Note over O,AS: Early Failures | ||
O-->>AS: validation fails<br/>(missing chain config,<br/>invalid path,<br/>no pool funds) | ||
Note over AG,AF: IBC Failures | ||
AG-->>AF: timeout,<br/>unexpected error,<br/>insufficient funds | ||
Note over O,OS: Edge Cases | ||
I-->>OS: Settlement received without OBSERVED | ||
O-->>S: OBSERVED->SETTLED without ADVANCING/ADVANCED<br/>is this a valid state transition?<br/>behavior is slowUSDC? | ||
AG-->>S: Settlement received while ADVANCING<br/>wait for ADVANCED to SETTLE/disperse funds? | ||
Note over AS,AF: Future: Queue for retry? | ||
Note over OS: Future: Wait for OBSERVE? | ||
stateDiagram-v2 | ||
[*] --> Observed: EventFeed .observe() | ||
Observed --> Advanced: Advancer .advance() | ||
Advanced --> Settled: Settler .settle() after fees | ||
note right of Advanced | ||
When IBC transfer starts; | ||
needs to account for failure | ||
end note | ||
Observed --> Skipped: Advancer .skip() | ||
Skipped --> Settled: Settler .settle() sans fees | ||
Settled --> [*] | ||
[*] --> [*]: Unobserved settlement | ||
``` |
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
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.