Skip to content

Commit

Permalink
Check if tracer is actually set before checking if its Firehose tra…
Browse files Browse the repository at this point in the history
…cer via `OnBlockUpdate != nil`
  • Loading branch information
maoueh committed Jan 13, 2025
1 parent 315f179 commit 0997931
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arbos/block_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ func ProduceBlockAdvanced(
tmpBlock := types.NewBlock(header, &types.Body{Transactions: complete}, receipts, trie.NewStackTrie(nil))
blockHash := tmpBlock.Hash()

if tracer != nil {
if tracer != nil && tracer.OnBlockUpdate != nil {
tracer.OnBlockUpdate(tmpBlock, big.NewInt(1))
}
for _, receipt := range receipts {
Expand Down
2 changes: 1 addition & 1 deletion arbos/tx_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (p *TxProcessor) StartTxHook() (endTxNow bool, gasUsed uint64, err error, r

// Only Firehose tracer has OnBlockUpdate defined, we can use
tracer := evm.Config.Tracer
if evm.Config.Tracer.OnBlockUpdate != nil {
if tracer != nil && tracer.OnBlockUpdate != nil {
// FIXME: It seems having the `Firehose` tracer enabled causes a problem since most probably, the series
// of tracer call below don't respect the `Firehose` tracer's expectations.
tracer = nil
Expand Down
2 changes: 1 addition & 1 deletion arbos/util/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (info *TracingInfo) MockCall(input []byte, gas uint64, from, to common.Addr
tracer := info.Tracer

// Only Firehose tracer has OnBlockUpdate defined, we can use
if info.Tracer.OnBlockUpdate != nil {
if tracer != nil && tracer.OnBlockUpdate != nil {
// FIXME: It seems having the `Firehose` tracer enabled causes a problem since most probably, the series
// of tracer call below don't respect the `Firehose` tracer's expectations.
tracer = nil
Expand Down
2 changes: 1 addition & 1 deletion arbos/util/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TransferBalance(

// Only Firehose tracer has OnBlockUpdate defined, we can use
tracer := evm.Config.Tracer
if evm.Config.Tracer.OnBlockUpdate != nil {
if tracer != nil && tracer.OnBlockUpdate != nil {
// FIXME: It seems having the `Firehose` tracer enabled causes a problem since most probably, the series
// of tracer call below don't respect the `Firehose` tracer's expectations.
tracer = nil
Expand Down

0 comments on commit 0997931

Please sign in to comment.