Skip to content

Commit

Permalink
Fix static call gas
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianBland committed Jul 30, 2024
1 parent a0a40c6 commit 1ef1795
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/replayor/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ func (r *Benchmark) traceReceipt(ctx context.Context, receipt *types.Receipt, op
if idx < len(txTrace.StructLogs)-1 {
nextLog = &txTrace.StructLogs[idx+1]
}
if nextLog != nil && log.Depth < nextLog.Depth {
opGas = log.GasCost - nextLog.Gas
if nextLog != nil {
if log.Depth < nextLog.Depth {
opGas = log.GasCost - nextLog.Gas
} else if log.Depth == nextLog.Depth {
opGas = log.Gas - nextLog.Gas
}
}

opCodes[log.Op] = stats.OpCodeStats{
Expand Down

0 comments on commit 1ef1795

Please sign in to comment.