From 5d90681d0db4316a40dfc2bbc0f86a42cfde534e Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Thu, 18 Jan 2024 13:06:41 -0700 Subject: [PATCH] Fix delayed sequencer finality not recognizing Arbitrum --- arbnode/delayed_sequencer.go | 2 +- util/headerreader/header_reader.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arbnode/delayed_sequencer.go b/arbnode/delayed_sequencer.go index 5d439e32d8..f1b912e0f7 100644 --- a/arbnode/delayed_sequencer.go +++ b/arbnode/delayed_sequencer.go @@ -100,7 +100,7 @@ func (d *DelayedSequencer) sequenceWithoutLockout(ctx context.Context, lastBlock } var finalized uint64 - if config.UseMergeFinality && lastBlockHeader.Difficulty.Sign() == 0 { + if config.UseMergeFinality && headerreader.HeaderIndicatesFinalitySupport(lastBlockHeader) { var err error if config.RequireFullFinality { finalized, err = d.l1Reader.LatestFinalizedBlockNr(ctx) diff --git a/util/headerreader/header_reader.go b/util/headerreader/header_reader.go index c5b8fa23f1..06dfcfbfa8 100644 --- a/util/headerreader/header_reader.go +++ b/util/headerreader/header_reader.go @@ -436,7 +436,7 @@ func (s *HeaderReader) LastPendingCallBlockNr() uint64 { var ErrBlockNumberNotSupported = errors.New("block number not supported") -func headerIndicatesFinalitySupport(header *types.Header) bool { +func HeaderIndicatesFinalitySupport(header *types.Header) bool { if header.Difficulty.Sign() == 0 { // This is an Ethereum PoS chain return true @@ -466,7 +466,7 @@ func (s *HeaderReader) getCached(ctx context.Context, c *cachedHeader) (*types.H if HeadersEqual(currentHead, c.headWhenCached) { return c.header, nil } - if !s.config().UseFinalityData || !headerIndicatesFinalitySupport(currentHead) { + if !s.config().UseFinalityData || !HeaderIndicatesFinalitySupport(currentHead) { return nil, ErrBlockNumberNotSupported } header, err := s.client.HeaderByNumber(ctx, c.rpcBlockNum)