Skip to content

Commit

Permalink
Revisit the solution from PR-260, try keep the API consistent by not …
Browse files Browse the repository at this point in the history
…incrementing the nonce for trading&lending tx (ethereum#371)
  • Loading branch information
wjrjerome authored Nov 24, 2023
1 parent ac40468 commit 9268994
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions eth/api_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,14 +468,16 @@ func (api *PrivateDebugAPI) traceBlock(ctx context.Context, block *types.Block,
jobs <- &txTraceTask{statedb: statedb.Copy(), index: i}
var balacne *big.Int
if tx.To() != nil {
// Bypass the validation for trading and lending transactions as their nonce are not incremented
if tx.IsSkipNonceTransaction() {
continue
}
if value, ok := feeCapacity[*tx.To()]; ok {
balacne = value
}
}
// Generate the next state snapshot fast without tracing
msg, _ := tx.AsMessage(signer, balacne, block.Number())
// Set nonce to fix issue #256
msg.SetNonce(statedb.GetNonce(*tx.From()))
vmctx := core.NewEVMContext(msg, block.Header(), api.eth.blockchain, nil)

vmenv := vm.NewEVM(vmctx, statedb, XDCxState, api.config, vm.Config{})
Expand Down

0 comments on commit 9268994

Please sign in to comment.