Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StorageProvider records Slashed Or Expired Deals #306

Merged
merged 4 commits into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 47 additions & 47 deletions docs/storageclient.mmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,61 @@ stateDiagram-v2
state "StorageDealUnknown" as 0
state "StorageDealProposalAccepted" as 3
state "StorageDealSealing" as 5
state "StorageDealActive" as 6
state "StorageDealExpired" as 7
state "StorageDealSlashed" as 8
state "StorageDealFailing" as 10
state "StorageDealFundsEnsured" as 11
state "StorageDealCheckForAcceptance" as 12
state "StorageDealStartDataTransfer" as 15
state "StorageDealTransferring" as 16
state "StorageDealEnsureClientFunds" as 20
state "StorageDealClientFunding" as 22
state "StorageDealError" as 25
state "StorageDealActive" as 7
state "StorageDealExpired" as 8
state "StorageDealSlashed" as 9
state "StorageDealFailing" as 11
state "StorageDealFundsEnsured" as 12
state "StorageDealCheckForAcceptance" as 13
state "StorageDealStartDataTransfer" as 16
state "StorageDealTransferring" as 17
state "StorageDealEnsureClientFunds" as 21
state "StorageDealClientFunding" as 23
state "StorageDealError" as 26
3 : On entry runs ValidateDealPublished
5 : On entry runs VerifyDealActivated
6 : On entry runs WaitForDealCompletion
10 : On entry runs FailDeal
11 : On entry runs ProposeDeal
12 : On entry runs CheckForDealAcceptance
15 : On entry runs InitiateDataTransfer
20 : On entry runs EnsureClientFunds
22 : On entry runs WaitForFunding
7 : On entry runs WaitForDealCompletion
11 : On entry runs FailDeal
12 : On entry runs ProposeDeal
13 : On entry runs CheckForDealAcceptance
16 : On entry runs InitiateDataTransfer
21 : On entry runs EnsureClientFunds
23 : On entry runs WaitForFunding
[*] --> 0
note right of 0
The following events are not shown cause they can trigger from any state.

ClientEventStreamCloseError - transitions state to StorageDealError
ClientEventRestart - does not transition state
end note
0 --> 20 : ClientEventOpen
20 --> 22 : ClientEventFundingInitiated
20 --> 10 : ClientEventEnsureFundsFailed
22 --> 10 : ClientEventEnsureFundsFailed
20 --> 11 : ClientEventFundsEnsured
22 --> 11 : ClientEventFundsEnsured
11 --> 25 : ClientEventWriteProposalFailed
11 --> 10 : ClientEventReadResponseFailed
11 --> 10 : ClientEventResponseVerificationFailed
11 --> 15 : ClientEventInitiateDataTransfer
11 --> 10 : ClientEventUnexpectedDealState
15 --> 10 : ClientEventDataTransferFailed
16 --> 10 : ClientEventDataTransferFailed
15 --> 16 : ClientEventDataTransferInitiated
15 --> 12 : ClientEventDataTransferComplete
16 --> 12 : ClientEventDataTransferComplete
12 --> 12 : ClientEventWaitForDealState
12 --> 10 : ClientEventResponseDealDidNotMatch
12 --> 10 : ClientEventDealRejected
12 --> 3 : ClientEventDealAccepted
3 --> 25 : ClientEventDealPublishFailed
0 --> 21 : ClientEventOpen
21 --> 23 : ClientEventFundingInitiated
21 --> 11 : ClientEventEnsureFundsFailed
23 --> 11 : ClientEventEnsureFundsFailed
21 --> 12 : ClientEventFundsEnsured
23 --> 12 : ClientEventFundsEnsured
12 --> 26 : ClientEventWriteProposalFailed
12 --> 11 : ClientEventReadResponseFailed
12 --> 11 : ClientEventResponseVerificationFailed
12 --> 16 : ClientEventInitiateDataTransfer
12 --> 11 : ClientEventUnexpectedDealState
16 --> 11 : ClientEventDataTransferFailed
17 --> 11 : ClientEventDataTransferFailed
16 --> 17 : ClientEventDataTransferInitiated
16 --> 13 : ClientEventDataTransferComplete
17 --> 13 : ClientEventDataTransferComplete
13 --> 13 : ClientEventWaitForDealState
13 --> 11 : ClientEventResponseDealDidNotMatch
13 --> 11 : ClientEventDealRejected
13 --> 3 : ClientEventDealAccepted
3 --> 26 : ClientEventDealPublishFailed
3 --> 5 : ClientEventDealPublished
5 --> 25 : ClientEventDealActivationFailed
5 --> 6 : ClientEventDealActivated
6 --> 8 : ClientEventDealSlashed
6 --> 7 : ClientEventDealExpired
6 --> 25 : ClientEventDealCompletionFailed
10 --> 25 : ClientEventFailed
5 --> 26 : ClientEventDealActivationFailed
5 --> 7 : ClientEventDealActivated
7 --> 9 : ClientEventDealSlashed
7 --> 8 : ClientEventDealExpired
7 --> 26 : ClientEventDealCompletionFailed
11 --> 26 : ClientEventFailed
9 --> [*]
8 --> [*]
7 --> [*]
25 --> [*]
26 --> [*]
Binary file modified docs/storageclient.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/storageclient.mmd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 65 additions & 58 deletions docs/storageprovider.mmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,81 @@ stateDiagram-v2
state "StorageDealUnknown" as 0
state "StorageDealStaged" as 4
state "StorageDealSealing" as 5
state "StorageDealActive" as 6
state "StorageDealRejecting" as 9
state "StorageDealFailing" as 10
state "StorageDealValidating" as 13
state "StorageDealAcceptWait" as 14
state "StorageDealTransferring" as 16
state "StorageDealWaitingForData" as 17
state "StorageDealVerifyData" as 18
state "StorageDealEnsureProviderFunds" as 19
state "StorageDealProviderFunding" as 21
state "StorageDealPublish" as 23
state "StorageDealPublishing" as 24
state "StorageDealError" as 25
state "StorageDealCompleted" as 26
state "<invalid Value>" as 6
state "StorageDealActive" as 7
state "StorageDealExpired" as 8
state "StorageDealSlashed" as 9
state "StorageDealRejecting" as 10
state "StorageDealFailing" as 11
state "StorageDealValidating" as 14
state "StorageDealAcceptWait" as 15
state "StorageDealTransferring" as 17
state "StorageDealWaitingForData" as 18
state "StorageDealVerifyData" as 19
state "StorageDealEnsureProviderFunds" as 20
state "StorageDealProviderFunding" as 22
state "StorageDealPublish" as 24
state "StorageDealPublishing" as 25
state "StorageDealError" as 26
4 : On entry runs HandoffDeal
5 : On entry runs VerifyDealActivated
6 : On entry runs RecordPieceInfo
9 : On entry runs RejectDeal
10 : On entry runs FailDeal
13 : On entry runs ValidateDealProposal
14 : On entry runs DecideOnProposal
18 : On entry runs VerifyData
19 : On entry runs EnsureProviderFunds
21 : On entry runs WaitForFunding
23 : On entry runs PublishDeal
24 : On entry runs WaitForPublish
7 : On entry runs WaitForDealCompletion
10 : On entry runs RejectDeal
11 : On entry runs FailDeal
14 : On entry runs ValidateDealProposal
15 : On entry runs DecideOnProposal
19 : On entry runs VerifyData
20 : On entry runs EnsureProviderFunds
22 : On entry runs WaitForFunding
24 : On entry runs PublishDeal
25 : On entry runs WaitForPublish
[*] --> 0
note right of 0
The following events are not shown cause they can trigger from any state.

ProviderEventNodeErrored - transitions state to StorageDealFailing
ProviderEventRestart - does not transition state
end note
0 --> 13 : ProviderEventOpen
13 --> 9 : ProviderEventDealRejected
14 --> 9 : ProviderEventDealRejected
18 --> 9 : ProviderEventDealRejected
9 --> 10 : ProviderEventRejectionSent
13 --> 14 : ProviderEventDealDeciding
14 --> 17 : ProviderEventDataRequested
16 --> 10 : ProviderEventDataTransferFailed
17 --> 16 : ProviderEventDataTransferInitiated
16 --> 18 : ProviderEventDataTransferCompleted
18 --> 10 : ProviderEventDataVerificationFailed
17 --> 19 : ProviderEventVerifiedData
18 --> 19 : ProviderEventVerifiedData
19 --> 21 : ProviderEventFundingInitiated
19 --> 23 : ProviderEventFunded
21 --> 23 : ProviderEventFunded
23 --> 24 : ProviderEventDealPublishInitiated
24 --> 10 : ProviderEventDealPublishError
9 --> 10 : ProviderEventSendResponseFailed
14 --> 10 : ProviderEventSendResponseFailed
24 --> 4 : ProviderEventDealPublished
4 --> 10 : ProviderEventFileStoreErrored
5 --> 10 : ProviderEventFileStoreErrored
6 --> 10 : ProviderEventFileStoreErrored
4 --> 10 : ProviderEventDealHandoffFailed
0 --> 14 : ProviderEventOpen
14 --> 10 : ProviderEventDealRejected
15 --> 10 : ProviderEventDealRejected
19 --> 10 : ProviderEventDealRejected
10 --> 11 : ProviderEventRejectionSent
14 --> 15 : ProviderEventDealDeciding
15 --> 18 : ProviderEventDataRequested
17 --> 11 : ProviderEventDataTransferFailed
18 --> 17 : ProviderEventDataTransferInitiated
17 --> 19 : ProviderEventDataTransferCompleted
19 --> 11 : ProviderEventDataVerificationFailed
18 --> 20 : ProviderEventVerifiedData
19 --> 20 : ProviderEventVerifiedData
20 --> 22 : ProviderEventFundingInitiated
20 --> 24 : ProviderEventFunded
22 --> 24 : ProviderEventFunded
24 --> 25 : ProviderEventDealPublishInitiated
25 --> 11 : ProviderEventDealPublishError
10 --> 11 : ProviderEventSendResponseFailed
15 --> 11 : ProviderEventSendResponseFailed
25 --> 4 : ProviderEventDealPublished
4 --> 11 : ProviderEventFileStoreErrored
5 --> 11 : ProviderEventFileStoreErrored
7 --> 11 : ProviderEventFileStoreErrored
4 --> 11 : ProviderEventDealHandoffFailed
4 --> 5 : ProviderEventDealHandedOff
5 --> 10 : ProviderEventDealActivationFailed
5 --> 11 : ProviderEventDealActivationFailed
5 --> 6 : ProviderEventDealActivated
6 --> 10 : ProviderEventPieceStoreErrored
6 --> 26 : ProviderEventDealCompleted
6 --> 10 : ProviderEventUnableToLocatePiece
6 --> 10 : ProviderEventReadMetadataErrored
10 --> 25 : ProviderEventFailed
9 --> 25 : ProviderEventRestart
13 --> 25 : ProviderEventRestart
14 --> 25 : ProviderEventRestart
25 --> [*]
6 --> 11 : ProviderEventPieceStoreErrored
6 --> 11 : ProviderEventUnableToLocatePiece
6 --> 11 : ProviderEventReadMetadataErrored
6 --> 7 : ProviderEventPieceRecorded
7 --> 9 : ProviderEventDealSlashed
7 --> 8 : ProviderEventDealExpired
7 --> 26 : ProviderEventDealCompletionFailed
11 --> 26 : ProviderEventFailed
10 --> 26 : ProviderEventRestart
14 --> 26 : ProviderEventRestart
15 --> 26 : ProviderEventRestart
26 --> [*]
9 --> [*]
8 --> [*]
Binary file modified docs/storageprovider.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading