Documentation
¶
Overview ¶
Package storageremoval owns deletion batches and their durable send evidence.
Index ¶
- Constants
- func AutoResendSupported(version string) bool
- func ConfirmationTimeoutStart(firstAttempted, workStarted time.Time) time.Time
- func NewRequestID() (string, error)
- func NextSendSet(previous, candidate []int64) ([]int64, error)
- func RemovalStalledAfter(period, window time.Duration) time.Duration
- func ValidateInput(input Input) error
- type AttentionCode
- type FailedReceiptClass
- type Input
- type ReceiptPiece
- type Request
- type RequestStatus
- type Send
- type SendPiece
- type TaskBatch
Constants ¶
View Source
const MaxEnqueuedRemovals = 2000
Variables ¶
This section is empty.
Functions ¶
func AutoResendSupported ¶
func NewRequestID ¶
func NextSendSet ¶
NextSendSet rejects members outside an exposed authorization's exact set. An empty previous set represents a batch without an exposed authorization.
func ValidateInput ¶
Types ¶
type AttentionCode ¶
type AttentionCode string
const ( AttentionIdentityMismatch AttentionCode = "identity_mismatch" AttentionPayerUnderfunded AttentionCode = "payer_underfunded" AttentionProviderUnreachable AttentionCode = "provider_unreachable" AttentionConfirmationTimeout AttentionCode = "confirmation_timeout" AttentionTransactionReverted AttentionCode = "transaction_reverted" AttentionRemovalStalled AttentionCode = "removal_stalled" AttentionCleanupStalled AttentionCode = "cleanup_stalled" )
func ParseAttentionCode ¶
func ParseAttentionCode(value string) (AttentionCode, error)
func (AttentionCode) IsStop ¶
func (c AttentionCode) IsStop() bool
func (AttentionCode) Valid ¶
func (c AttentionCode) Valid() bool
type FailedReceiptClass ¶
type FailedReceiptClass int
const ( FailedReceiptInsufficient FailedReceiptClass = iota FailedReceiptCollision FailedReceiptReverted )
func ClassifyFailedReceipt ¶
func ClassifyFailedReceipt(pieces []ReceiptPiece, receiptBlock uint64, receiptStable bool) FailedReceiptClass
type Input ¶
type Input struct {
storagepipeline.ExecutionIdentity
RequestID string `json:"request_id"`
}
type ReceiptPiece ¶
type Request ¶
type Request struct {
bun.BaseModel `bun:"table:storage_removal_requests,alias:removal_request"`
RequestID string `bun:"request_id,type:text,pk"`
StorageDataSetID int64 `bun:"storage_data_set_id,notnull"`
Status RequestStatus `bun:"status,type:text,notnull"`
TaskID *int64 `bun:"task_id,nullzero"`
SealedAt *time.Time `bun:"sealed_at,nullzero"`
QueuedAt *time.Time `bun:"queued_at,nullzero"`
QueuedBlock *int64 `bun:"queued_block,nullzero"`
AttentionCode *string `bun:"attention_code,type:text,nullzero"`
AttentionAt *time.Time `bun:"attention_at,nullzero"`
LastError *string `bun:"last_error,type:text,nullzero"`
CreatedAt time.Time `bun:"created_at,nullzero,notnull"`
UpdatedAt time.Time `bun:"updated_at,nullzero,notnull"`
}
type RequestStatus ¶
type RequestStatus string
const ( RequestStatusCollecting RequestStatus = "collecting" RequestStatusReady RequestStatus = "ready" RequestStatusSubmitted RequestStatus = "submitted" RequestStatusQueued RequestStatus = "queued" RequestStatusSettled RequestStatus = "settled" RequestStatusAbandoned RequestStatus = "abandoned" )
func (RequestStatus) Terminal ¶
func (s RequestStatus) Terminal() bool
func (RequestStatus) Valid ¶
func (s RequestStatus) Valid() bool
type Send ¶
type Send struct {
bun.BaseModel `bun:"table:storage_removal_sends,alias:removal_send"`
RequestID string `bun:"request_id,type:text,pk"`
SendNo int `bun:"send_no,type:integer,pk"`
TaskID *int64 `bun:"task_id,nullzero"`
AttemptedAt *time.Time `bun:"attempted_at,nullzero"`
TxHash *string `bun:"tx_hash,type:text,nullzero"`
ConfirmedTxHash *string `bun:"confirmed_tx_hash,type:text,nullzero"`
ReceiptStatus *int64 `bun:"receipt_status,type:smallint,nullzero"`
RefusedAt *time.Time `bun:"refused_at,nullzero"`
UnsentAt *time.Time `bun:"unsent_at,nullzero"`
LastError *string `bun:"last_error,type:text,nullzero"`
CreatedAt time.Time `bun:"created_at,nullzero,notnull"`
UpdatedAt time.Time `bun:"updated_at,nullzero,notnull"`
Pieces []SendPiece `bun:"-"`
}
Send preserves one admission, including authorizations refused by a provider.
func (*Send) BeforeAppendModel ¶
func (Send) PossiblyAccepted ¶
type SendPiece ¶
type SendPiece struct {
bun.BaseModel `bun:"table:storage_removal_send_pieces"`
RequestID string `bun:"request_id,type:text,pk"`
SendNo int `bun:"send_no,type:integer,pk"`
CleanupCopyID int64 `bun:"cleanup_copy_id,pk"`
PieceID idtypes.OnChainID `bun:"piece_id,type:text,notnull"`
CreatedAt time.Time `bun:"created_at,nullzero,notnull"`
}
type TaskBatch ¶
type TaskBatch struct {
TaskID int64 `bun:"task_id"`
OwnsRequest bool `bun:"owns_request"`
RequestID string `bun:"request_id"`
Status RequestStatus `bun:"status"`
AttentionCode *string `bun:"attention_code"`
AttentionAt *time.Time `bun:"attention_at"`
ProviderID idtypes.OnChainID `bun:"provider_id,type:text"`
DataSetID *idtypes.OnChainID `bun:"data_set_id,type:text"`
PieceCount int `bun:"piece_count"`
TxHash *string `bun:"tx_hash"`
LastError *string `bun:"last_error"`
}
TaskBatch projects a task's removal batch and current ownership.
Click to show internal directories.
Click to hide internal directories.