Documentation
¶
Index ¶
- Constants
- type AdaptiveStrategy
- type BatchingStrategy
- type DAHintAppender
- type DASubmitter
- type DASubmitterAPI
- type ImmediateStrategy
- type SizeBasedStrategy
- type Submitter
- func (s *Submitter) GetDAIncludedHeight() uint64
- func (s *Submitter) IsHeightDAIncluded(height uint64, header *types.SignedHeader, data *types.Data) (bool, error)
- func (s *Submitter) SetDAIncludedHeight(height uint64)
- func (s *Submitter) Start(ctx context.Context) error
- func (s *Submitter) Stop() error
- type TimeBasedStrategy
Constants ¶
const ( // DefaultEnvelopeCacheSize is the default size for caching signed DA envelopes. // This avoids re-signing headers on retry scenarios. DefaultEnvelopeCacheSize = 10_000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdaptiveStrategy ¶
type AdaptiveStrategy struct {
// contains filtered or unexported fields
}
AdaptiveStrategy balances between size and time constraints It submits when either: - The batch reaches the size threshold, OR - The max delay is reached and we have at least min items
func NewAdaptiveStrategy ¶
func (*AdaptiveStrategy) ShouldSubmit ¶
type BatchingStrategy ¶
type BatchingStrategy interface {
// ShouldSubmit determines if a batch should be submitted based on the strategy
// Returns true if submission should happen now
ShouldSubmit(pendingCount uint64, totalSizeBeforeSig int, maxBlobSize int, timeSinceLastSubmit time.Duration) bool
}
BatchingStrategy defines the interface for different batching strategies Batching strategies always go through the da submitter which does extra size checks and possible further splitting for batches above the DA layer blob size.
func NewBatchingStrategy ¶
func NewBatchingStrategy(cfg config.DAConfig) (BatchingStrategy, error)
NewBatchingStrategy creates a batching strategy based on configuration
type DAHintAppender ¶
type DASubmitter ¶
type DASubmitter struct {
// contains filtered or unexported fields
}
DASubmitter handles DA submission operations
func NewDASubmitter ¶
func NewDASubmitter( client da.Client, config config.Config, genesis genesis.Genesis, options common.BlockOptions, metrics *common.Metrics, logger zerolog.Logger, headerDAHintAppender DAHintAppender, dataDAHintAppender DAHintAppender, ) *DASubmitter
NewDASubmitter creates a new DA submitter
func (*DASubmitter) SubmitData ¶
func (s *DASubmitter) SubmitData(ctx context.Context, unsignedDataList []*types.SignedData, marshalledData [][]byte, cache cache.Manager, signer signer.Signer, genesis genesis.Genesis) error
SubmitData submits pending data to DA layer
func (*DASubmitter) SubmitHeaders ¶
func (s *DASubmitter) SubmitHeaders(ctx context.Context, headers []*types.SignedHeader, marshalledHeaders [][]byte, cache cache.Manager, signer signer.Signer) error
SubmitHeaders submits pending headers to DA layer
type DASubmitterAPI ¶
type DASubmitterAPI interface {
SubmitHeaders(ctx context.Context, headers []*types.SignedHeader, marshalledHeaders [][]byte, cache cache.Manager, signer signer.Signer) error
SubmitData(ctx context.Context, signedDataList []*types.SignedData, marshalledData [][]byte, cache cache.Manager, signer signer.Signer, genesis genesis.Genesis) error
}
DASubmitterAPI defines minimal methods needed by Submitter for DA submissions.
func WithTracingDASubmitter ¶
func WithTracingDASubmitter(inner DASubmitterAPI) DASubmitterAPI
WithTracingDASubmitter wraps a DASubmitterAPI with OpenTelemetry tracing.
type ImmediateStrategy ¶
type ImmediateStrategy struct{}
ImmediateStrategy submits as soon as any items are available
func (*ImmediateStrategy) ShouldSubmit ¶
type SizeBasedStrategy ¶
type SizeBasedStrategy struct {
// contains filtered or unexported fields
}
SizeBasedStrategy waits until the batch reaches a certain size threshold
func NewSizeBasedStrategy ¶
func NewSizeBasedStrategy(sizeThreshold float64, minItems uint64) *SizeBasedStrategy
func (*SizeBasedStrategy) ShouldSubmit ¶
type Submitter ¶
type Submitter struct {
// contains filtered or unexported fields
}
Submitter handles DA submission and inclusion processing for both sync and aggregator nodes
func NewSubmitter ¶
func NewSubmitter( store store.Store, exec coreexecutor.Executor, cache cache.Manager, metrics *common.Metrics, config config.Config, genesis genesis.Genesis, daSubmitter DASubmitterAPI, sequencer coresequencer.Sequencer, signer signer.Signer, logger zerolog.Logger, errorCh chan<- error, ) *Submitter
NewSubmitter creates a new DA submitter component
func (*Submitter) GetDAIncludedHeight ¶
GetDAIncludedHeight returns the DA included height
func (*Submitter) IsHeightDAIncluded ¶
func (s *Submitter) IsHeightDAIncluded(height uint64, header *types.SignedHeader, data *types.Data) (bool, error)
IsHeightDAIncluded checks if a height is included in DA
func (*Submitter) SetDAIncludedHeight ¶
SetDAIncludedHeight updates the DA included height
type TimeBasedStrategy ¶
type TimeBasedStrategy struct {
// contains filtered or unexported fields
}
TimeBasedStrategy submits after a certain time interval