Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrPermanentPublish = errors.New("permanent publish failure")
ErrPermanentPublish marks a publish failure that no retry can fix. Producers wrap it around deterministic rejections only, as a strict allowlist: Topic.Publish also surfaces the caller's context error, so a publish that merely hit publishTimeout must stay retryable, and classifying that as permanent would silently disable retry altogether.
Functions ¶
This section is empty.
Types ¶
type AsyncGossiper ¶
type AsyncGossiper interface {
Gossip(payload *eth.ExecutionPayloadEnvelope)
Clear()
Stop()
Start()
}
type Metrics ¶
type Metrics interface {
RecordPublishingError()
RecordDroppedPublish()
RecordPublishQueueLen(length int)
RecordPublishDelay(duration time.Duration)
}
To avoid import cycles, we define a new Metrics interface here this interface is compatible with driver.Metrics
type Network ¶
type Network interface {
SignAndPublishL2Payload(ctx context.Context, envelope *eth.ExecutionPayloadEnvelope) error
// GossipTimestampThreshold is the age past which peers reject a block
// outright. Zero means unbounded, which is what a node with p2p disabled
// reports; publishing is a no-op there anyway.
GossipTimestampThreshold() time.Duration
}
To avoid import cycles, we define a new Network interface here this interface is compatible with driver.Network
type NoOpGossiper ¶
type NoOpGossiper struct{}
NoOpGossiper is a no-op implementation of AsyncGossiper it serves as a placeholder for when the AsyncGossiper is not needed
func (NoOpGossiper) Clear ¶
func (NoOpGossiper) Clear()
func (NoOpGossiper) Gossip ¶
func (NoOpGossiper) Gossip(payload *eth.ExecutionPayloadEnvelope)
func (NoOpGossiper) Start ¶
func (NoOpGossiper) Start()
func (NoOpGossiper) Stop ¶
func (NoOpGossiper) Stop()
type SimpleAsyncGossiper ¶
type SimpleAsyncGossiper struct {
// contains filtered or unexported fields
}
SimpleAsyncGossiper publishes sealed blocks to peers off the sequencer's hot path, in seal order, on a dedicated goroutine.
The sequencer hands a block over only once it has inserted it, so every queued block is one this node has already adopted as its canonical head. A queued block can therefore be late, but it can never be one the sequencer has to take back — which is what makes it safe to queue and retry at all.
Gossip and Clear only take a mutex. Neither waits for the network.
func NewAsyncGossiper ¶
func (*SimpleAsyncGossiper) Clear ¶
func (p *SimpleAsyncGossiper) Clear()
Clear drops every queued block. The sequencer calls it each time sequencing starts, since anything still queued was sealed under a previous stint and extends a chain it is no longer necessarily building on. It is not called on a reset, so blocks inserted before a reset but not yet published stay queued.
func (*SimpleAsyncGossiper) Gossip ¶
func (p *SimpleAsyncGossiper) Gossip(payload *eth.ExecutionPayloadEnvelope)
Gossip queues a block for publication and returns. It does not wait for the network, nor for the publish goroutine.
func (*SimpleAsyncGossiper) Start ¶
func (p *SimpleAsyncGossiper) Start()
Start starts the publish goroutine.
func (*SimpleAsyncGossiper) Stop ¶
func (p *SimpleAsyncGossiper) Stop()
Stop stops the publish goroutine and waits for it to exit. It is safe to call on a gossiper that was never started, and on one whose loop has already exited because the parent context was cancelled.