Skip to content

Commit

Permalink
debug_traceBlockByNumber with refund=false (#13216)
Browse files Browse the repository at this point in the history
The check on gasUsed should be done only if refund is true (default
case)
  • Loading branch information
lupin012 authored Dec 26, 2024
1 parent ec2b7b2 commit ba0129d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion turbo/jsonrpc/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,12 @@ func (api *PrivateDebugAPIImpl) traceBlock(ctx context.Context, blockNrOrHash rp
}

if dbg.AssertEnabled {
if block.GasUsed() != usedGas {
var refunds = true
if config.NoRefunds != nil && *config.NoRefunds {
refunds = false
}

if refunds == true && block.GasUsed() != usedGas {
panic(fmt.Errorf("assert: block.GasUsed() %d != usedGas %d. blockNum=%d", block.GasUsed(), usedGas, blockNumber))
}
}
Expand Down

0 comments on commit ba0129d

Please sign in to comment.