Skip to content

Commit fe949ca

Browse files
Add isActiveSequencer to ExpressLaneTracker log messages
When running multiple sequencers in HA mode, all nodes run an ExpressLaneTracker that polls for auction resolution events. This means the "AuctionResolved" and "New express lane auction round" log messages appear on every sequencer node, making it difficult for operators to distinguish which node is active vs standby. Add isActiveSequencer field to these log messages so operators can identify whether the logging node is the active sequencer (sequencing transactions) or an inactive one (validating and forwarding, ready for failover). The active status is determined by checking if the sequencer's forwarder is nil - active sequencers don't have a forwarder, while inactive ones forward to the active sequencer.
1 parent f8bbec4 commit fe949ca

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

cmd/el-proxy/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ func NewExpressLaneProxy(
130130
&params.ChainConfig{ChainID: big.NewInt(config.ChainId)},
131131
config.MaxTxDataSize,
132132
0,
133+
nil,
133134
)
134135
if err != nil {
135136
return nil, fmt.Errorf("error creating express lane tracker: %w", err)

execution/gethexec/express_lane_tracker.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type ExpressLaneTracker struct {
4646

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

5152
func NewExpressLaneTracker(
@@ -56,7 +57,9 @@ func NewExpressLaneTracker(
5657
auctionContractAddr common.Address,
5758
chainConfig *params.ChainConfig,
5859
maxTxSize uint64,
59-
earlySubmissionGrace time.Duration) (*ExpressLaneTracker, error) {
60+
earlySubmissionGrace time.Duration,
61+
isActiveFunc func() bool,
62+
) (*ExpressLaneTracker, error) {
6063
if err := ValidateMaxTxDataSize(maxTxSize); err != nil {
6164
return nil, err
6265
}
@@ -70,6 +73,7 @@ func NewExpressLaneTracker(
7073
chainConfig: chainConfig,
7174
maxTxSize: maxTxSize,
7275
useLogs: false, // default to use contract polling
76+
isActiveFunc: isActiveFunc,
7377
}, nil
7478
}
7579

@@ -146,6 +150,13 @@ func (t *ExpressLaneTracker) AuctionContractAddr() common.Address {
146150
return t.auctionContractAddr
147151
}
148152

153+
func (t *ExpressLaneTracker) isActiveSequencer() bool {
154+
if t.isActiveFunc == nil {
155+
return false
156+
}
157+
return t.isActiveFunc()
158+
}
159+
149160
// --- internals ---
150161

151162
func (t *ExpressLaneTracker) startViaLogIterator(ctxIn context.Context) {
@@ -207,6 +218,7 @@ func (t *ExpressLaneTracker) startViaLogIterator(ctxIn context.Context) {
207218
"round", it.Event.Round,
208219
"controller", it.Event.FirstPriceExpressLaneController,
209220
"timeSinceAuctionClose", timeSinceAuctionClose,
221+
"isActiveSequencer", t.isActiveSequencer(),
210222
)
211223

212224
t.roundControl.Store(it.Event.Round, it.Event.FirstPriceExpressLaneController)
@@ -262,6 +274,7 @@ func (t *ExpressLaneTracker) startViaContractPolling(ctxIn context.Context) {
262274
"round", record.round,
263275
"controller", record.controller,
264276
"timeSinceAuctionClose", timeSinceAuctionClose,
277+
"isActiveSequencer", t.isActiveSequencer(),
265278
)
266279
}
267280

@@ -304,6 +317,7 @@ func (t *ExpressLaneTracker) roundHeartbeatThread() {
304317
"round", round,
305318
"timestamp", ti,
306319
"haveController", ok,
320+
"isActiveSequencer", t.isActiveSequencer(),
307321
)
308322

309323
// Cleanup previous round controller data

execution/gethexec/node.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,14 @@ func (n *ExecutionNode) InitializeTimeboost(ctx context.Context, chainConfig *pa
595595
return err
596596
}
597597

598+
var isActiveFunc func() bool
599+
if n.Sequencer != nil {
600+
isActiveFunc = func() bool {
601+
_, forwarder := n.Sequencer.GetPauseAndForwarder()
602+
return forwarder == nil
603+
}
604+
}
605+
598606
expressLaneTracker, err := NewExpressLaneTracker(
599607
*roundTimingInfo,
600608
execNodeConfig.Sequencer.MaxBlockSpeed,
@@ -604,6 +612,7 @@ func (n *ExecutionNode) InitializeTimeboost(ctx context.Context, chainConfig *pa
604612
chainConfig,
605613
uint64(execNodeConfig.Sequencer.MaxTxDataSize), // #nosec G115
606614
execNodeConfig.Sequencer.Timeboost.EarlySubmissionGrace,
615+
isActiveFunc,
607616
)
608617
if err != nil {
609618
return fmt.Errorf("error creating express lane tracker: %w", err)

system_tests/timeboost_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,7 @@ func setupExpressLaneAuction(
17151715
builderSeq.chainConfig,
17161716
uint64(builderSeq.execConfig.Sequencer.MaxTxDataSize), // #nosec G115
17171717
builderSeq.execConfig.Sequencer.Timeboost.EarlySubmissionGrace,
1718+
nil,
17181719
)
17191720
Require(t, err)
17201721

0 commit comments

Comments
 (0)