Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchDataProvider ¶
type BatchDataProvider interface {
// GetBatchL2Data retrieve the data of a batch from the DA backend. The returned data must be the pre-image of the hash
GetBatchL2Data(batchNum []uint64, batchHashes []common.Hash, dataAvailabilityMessage []byte) ([][]byte, error)
}
BatchDataProvider is used to retrieve batch data
type DABackendType ¶
type DABackendType string
DABackendType is the data availability protocol for the CDK
const ( // DataAvailabilityCommittee is the DAC protocol backend DataAvailabilityCommittee DABackendType = "DataAvailabilityCommittee" )
type DABackender ¶
type DABackender interface {
SequenceRetriever
SequenceSender
// Init initializes the DABackend
Init() error
}
DABackender is an interface for components that store and retrieve batch data
type DataAvailability ¶
type DataAvailability struct {
// contains filtered or unexported fields
}
DataAvailability implements an abstract data availability integration
func New ¶
func New(backend DABackender) (*DataAvailability, error)
New creates a DataAvailability instance
func (*DataAvailability) PostSequenceBanana ¶
func (d *DataAvailability) PostSequenceBanana( ctx context.Context, sequenceBanana etherman.SequenceBanana, ) ([]byte, error)
PostSequenceBanana sends sequence data to the backend and returns a response.
func (*DataAvailability) PostSequenceElderberry ¶
func (d *DataAvailability) PostSequenceElderberry(ctx context.Context, batchesData [][]byte) ([]byte, error)
PostSequenceElderberry sends batch data to the backend and returns a response.
type DataManager ¶
type DataManager interface {
BatchDataProvider
SequenceSender
}
DataManager is an interface for components that send and retrieve batch data
type SequenceRetriever ¶
type SequenceRetriever interface {
// GetSequence retrieves the sequence data from the data availability backend
GetSequence(ctx context.Context, batchHashes []common.Hash, dataAvailabilityMessage []byte) ([][]byte, error)
}
SequenceRetriever is used to retrieve batch data
type SequenceSender ¶
type SequenceSender interface {
SequenceSenderElderberry
SequenceSenderBanana
}
SequenceSender is used to send provided sequence of batches
type SequenceSenderBanana ¶
type SequenceSenderBanana interface {
// PostSequence sends the sequence data to the data availability backend, and returns the dataAvailabilityMessage
// as expected by the contract
PostSequenceBanana(ctx context.Context, sequence etherman.SequenceBanana) ([]byte, error)
}
SequenceSenderBanana defines methods for sending sequence data to the data availability backend.
type SequenceSenderElderberry ¶
type SequenceSenderElderberry interface {
// PostSequence sends the sequence data to the data availability backend, and returns the dataAvailabilityMessage
// as expected by the contract
PostSequenceElderberry(ctx context.Context, batchesData [][]byte) ([]byte, error)
}
SequenceSenderElderberry defines methods for sending sequence data to the data availability backend.