Skip to content
Open
Changes from 4 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
8 changes: 7 additions & 1 deletion arbnode/transaction_streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rlp"

Expand All @@ -39,6 +40,10 @@ import (
"github.com/offchainlabs/nitro/util/stopwaiter"
)

var (
messageTimer = metrics.NewRegisteredHistogram("arb/txstreamer/message/duration", nil, metrics.NewBoundedHistogramSample())
)

// TransactionStreamer produces blocks from a node's L1 messages, storing the results in the blockchain and recording their positions
// The streamer is notified when there's new batches to process
type TransactionStreamer struct {
Expand Down Expand Up @@ -1339,6 +1344,7 @@ func (s *TransactionStreamer) ExecuteNextMsg(ctx context.Context) bool {
return false
}
defer s.reorgMutex.RUnlock()
start := time.Now()

prevHeadMsgIdx := s.prevHeadMsgIdx
consensusHeadMsgIdx, err := s.GetHeadMessageIndex()
Expand Down Expand Up @@ -1406,7 +1412,7 @@ func (s *TransactionStreamer) ExecuteNextMsg(ctx context.Context) bool {
BlockMetadata: msgAndBlockInfo.BlockMetadata,
}
s.broadcastMessages([]arbostypes.MessageWithMetadataAndBlockInfo{msgWithBlockInfo}, msgIdxToExecute)

messageTimer.Update(time.Since(start).Nanoseconds())
return msgIdxToExecute+1 <= consensusHeadMsgIdx
}

Expand Down
Loading