Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/el-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ func NewExpressLaneProxy(
&params.ChainConfig{ChainID: big.NewInt(config.ChainId)},
config.MaxTxDataSize,
0,
nil,
)
if err != nil {
return nil, fmt.Errorf("error creating express lane tracker: %w", err)
Expand Down
16 changes: 15 additions & 1 deletion execution/gethexec/express_lane_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type ExpressLaneTracker struct {

roundControl containers.SyncMap[uint64, common.Address] // thread safe
useLogs bool
isActiveFunc func() bool // nil means unknown/not applicable
}

func NewExpressLaneTracker(
Expand All @@ -56,7 +57,9 @@ func NewExpressLaneTracker(
auctionContractAddr common.Address,
chainConfig *params.ChainConfig,
maxTxSize uint64,
earlySubmissionGrace time.Duration) (*ExpressLaneTracker, error) {
earlySubmissionGrace time.Duration,
isActiveFunc func() bool,
) (*ExpressLaneTracker, error) {
if err := ValidateMaxTxDataSize(maxTxSize); err != nil {
return nil, err
}
Expand All @@ -70,6 +73,7 @@ func NewExpressLaneTracker(
chainConfig: chainConfig,
maxTxSize: maxTxSize,
useLogs: false, // default to use contract polling
isActiveFunc: isActiveFunc,
}, nil
}

Expand Down Expand Up @@ -146,6 +150,13 @@ func (t *ExpressLaneTracker) AuctionContractAddr() common.Address {
return t.auctionContractAddr
}

func (t *ExpressLaneTracker) isActiveSequencer() bool {
if t.isActiveFunc == nil {
return false
}
return t.isActiveFunc()
}

// --- internals ---

func (t *ExpressLaneTracker) startViaLogIterator(ctxIn context.Context) {
Expand Down Expand Up @@ -207,6 +218,7 @@ func (t *ExpressLaneTracker) startViaLogIterator(ctxIn context.Context) {
"round", it.Event.Round,
"controller", it.Event.FirstPriceExpressLaneController,
"timeSinceAuctionClose", timeSinceAuctionClose,
"isActiveSequencer", t.isActiveSequencer(),
)

t.roundControl.Store(it.Event.Round, it.Event.FirstPriceExpressLaneController)
Expand Down Expand Up @@ -262,6 +274,7 @@ func (t *ExpressLaneTracker) startViaContractPolling(ctxIn context.Context) {
"round", record.round,
"controller", record.controller,
"timeSinceAuctionClose", timeSinceAuctionClose,
"isActiveSequencer", t.isActiveSequencer(),
)
}

Expand Down Expand Up @@ -304,6 +317,7 @@ func (t *ExpressLaneTracker) roundHeartbeatThread() {
"round", round,
"timestamp", ti,
"haveController", ok,
"isActiveSequencer", t.isActiveSequencer(),
)

// Cleanup previous round controller data
Expand Down
9 changes: 9 additions & 0 deletions execution/gethexec/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,14 @@ func (n *ExecutionNode) InitializeTimeboost(ctx context.Context, chainConfig *pa
return err
}

var isActiveFunc func() bool
if n.Sequencer != nil {
isActiveFunc = func() bool {
_, forwarder := n.Sequencer.GetPauseAndForwarder()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to double-check, should the pause be handled here in the same way as in Sequencer.getForwarder?

return forwarder == nil
}
}

expressLaneTracker, err := NewExpressLaneTracker(
*roundTimingInfo,
execNodeConfig.Sequencer.MaxBlockSpeed,
Expand All @@ -604,6 +612,7 @@ func (n *ExecutionNode) InitializeTimeboost(ctx context.Context, chainConfig *pa
chainConfig,
uint64(execNodeConfig.Sequencer.MaxTxDataSize), // #nosec G115
execNodeConfig.Sequencer.Timeboost.EarlySubmissionGrace,
isActiveFunc,
)
if err != nil {
return fmt.Errorf("error creating express lane tracker: %w", err)
Expand Down
1 change: 1 addition & 0 deletions system_tests/timeboost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,7 @@ func setupExpressLaneAuction(
builderSeq.chainConfig,
uint64(builderSeq.execConfig.Sequencer.MaxTxDataSize), // #nosec G115
builderSeq.execConfig.Sequencer.Timeboost.EarlySubmissionGrace,
nil,
)
Require(t, err)

Expand Down
Loading