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") //ErrTxTooLarge is the err message returned by the DA when tx size is too large ErrTxTooLarge = errors.New("tx too large") // 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
SubmitOptions []byte
SubmitTimeout time.Duration
RetrieveTimeout time.Duration
Logger log.Logger
}
DAClient is a new DA implementation.
func NewDAClient ¶ added in v0.13.0
func NewDAClient(da goDA.DA, gasPrice, gasMultiplier float64, ns goDA.Namespace, options []byte, logger log.Logger) *DAClient
NewDAClient returns a new DA client.
func (*DAClient) RetrieveHeaders ¶ added in v0.14.0
func (dac *DAClient) RetrieveHeaders(ctx context.Context, dataLayerHeight uint64) ResultRetrieveHeaders
RetrieveHeaders retrieves block headers from DA.
func (*DAClient) SubmitHeaders ¶ added in v0.14.0
func (dac *DAClient) SubmitHeaders(ctx context.Context, headers []*types.SignedHeader, maxBlobSize uint64, gasPrice float64) ResultSubmit
SubmitHeaders submits block headers to DA.
type ResultRetrieveHeaders ¶ added in v0.14.0
type ResultRetrieveHeaders struct {
BaseResult
// Header is the block header retrieved from Data Availability Layer.
// If Code is not equal to StatusSuccess, it has to be nil.
Headers []*types.SignedHeader
}
ResultRetrieveHeaders contains batch of block headers returned from DA layer client.
type ResultSubmit ¶ added in v0.14.0
type ResultSubmit struct {
BaseResult
}
ResultSubmit contains information returned from DA layer after block headers/data 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.