Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBlobNotFound is used to indicate that the blob was not found. ErrBlobNotFound = errors.New("blob: not found") // ErrBlobSizeOverLimit is used to indicate that the blob size is over limit ErrBlobSizeOverLimit = errors.New("blob: over size limit") // ErrTxTimedout is the error message returned by the DA when mempool is congested ErrTxTimedout = errors.New("timed out waiting for tx to be included in a block") // ErrTxAlreadyInMempool is the error message returned by the DA when tx is already in mempool ErrTxAlreadyInMempool = errors.New("tx already in mempool") // ErrTxIncorrectAccountSequence is the error message returned by the DA when tx has incorrect sequence ErrTxIncorrectAccountSequence = errors.New("incorrect account sequence") // ErrTxSizeTooBig is the error message returned by the DA when tx size is too big ErrTxSizeTooBig = errors.New("tx size is too big") // ErrContextDeadline is the error message returned by the DA when context deadline exceeds ErrContextDeadline = errors.New("context deadline") )
Functions ¶
This section is empty.
Types ¶
type BaseResult ¶
type BaseResult struct {
// Code is to determine if the action succeeded.
Code StatusCode
// Message may contain DA layer specific information (like DA block height/hash, detailed error message, etc)
Message string
// DAHeight informs about a height on Data Availability Layer for given result.
DAHeight uint64
// SubmittedCount is the number of successfully submitted blocks.
SubmittedCount uint64
}
BaseResult contains basic information returned by DA layer.
type DAClient ¶ added in v0.11.6
type DAClient struct {
DA goDA.DA
GasPrice float64
GasMultiplier float64
Namespace goDA.Namespace
Logger log.Logger
}
DAClient is a new DA implementation.
func (*DAClient) RetrieveBlocks ¶ added in v0.11.6
func (dac *DAClient) RetrieveBlocks(ctx context.Context, dataLayerHeight uint64) ResultRetrieveBlocks
RetrieveBlocks retrieves blocks from DA.
func (*DAClient) SubmitBlocks ¶ added in v0.11.6
func (dac *DAClient) SubmitBlocks(ctx context.Context, blocks []*types.Block, maxBlobSize uint64, gasPrice float64) ResultSubmitBlocks
SubmitBlocks submits blocks to DA.
type ResultRetrieveBlocks ¶
type ResultRetrieveBlocks struct {
BaseResult
// Block is the full block retrieved from Data Availability Layer.
// If Code is not equal to StatusSuccess, it has to be nil.
Blocks []*types.Block
}
ResultRetrieveBlocks contains batch of blocks returned from DA layer client.
type ResultSubmitBlocks ¶ added in v0.10.0
type ResultSubmitBlocks struct {
BaseResult
}
ResultSubmitBlocks contains information returned from DA layer after blocks submission.
type StatusCode ¶
type StatusCode uint64
StatusCode is a type for DA layer return status. TODO: define an enum of different non-happy-path cases that might need to be handled by Rollkit independent of the underlying DA chain.
const ( StatusUnknown StatusCode = iota StatusSuccess StatusNotFound StatusNotIncludedInBlock StatusAlreadyInMempool StatusTooBig StatusContextDeadline StatusError )
Data Availability return codes.
Click to show internal directories.
Click to hide internal directories.