Skip to content
Open
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
7 changes: 7 additions & 0 deletions 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 @@ -1350,6 +1355,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 @@ -1412,6 +1418,7 @@ func (s *TransactionStreamer) ExecuteNextMsg(ctx context.Context) bool {
}

s.broadcastMessages([]arbostypes.MessageWithMetadataAndBlockInfo{*msgAndBlockInfo}, msgIdxToExecute)
messageTimer.Update(time.Since(start).Nanoseconds())

return msgIdxToExecute+1 <= consensusHeadMsgIdx
}
Expand Down
Loading