diff --git a/core/blockchain.go b/core/blockchain.go index aa3d74197fec..f3b150c4cb82 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -53,6 +53,7 @@ var ( headHeaderGauge = metrics.NewRegisteredGauge("chain/head/header", nil) headFastBlockGauge = metrics.NewRegisteredGauge("chain/head/receipt", nil) headTimeGapGauge = metrics.NewRegisteredGauge("chain/head/timegap", nil) + headL1MessageGauge = metrics.NewRegisteredGauge("chain/head/l1msg", nil) l2BaseFeeGauge = metrics.NewRegisteredGauge("chain/fees/l2basefee", nil) @@ -1253,6 +1254,17 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types. l2BaseFeeGauge.Update(0) } + // Note the latest relayed L1 message queue index (if any) + for _, tx := range block.Transactions() { + if msg := tx.AsL1MessageTx(); msg != nil { + // Queue index is guaranteed to fit into int64. + headL1MessageGauge.Update(int64(msg.QueueIndex)) + } else { + // No more L1 messages in this block. + break + } + } + parent := bc.GetHeaderByHash(block.ParentHash()) // block.Time is guaranteed to be larger than parent.Time, // and the time gap should fit into int64. diff --git a/params/version.go b/params/version.go index e90b16275426..133999bae33f 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 5 // Major version component of the current release VersionMinor = 8 // Minor version component of the current release - VersionPatch = 26 // Patch version component of the current release + VersionPatch = 27 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string )