From 92689943a022e3dbbefb4ecfa2d444c744a82494 Mon Sep 17 00:00:00 2001 From: Banana-J Date: Sat, 25 Nov 2023 00:04:59 +1100 Subject: [PATCH] Revisit the solution from PR-260, try keep the API consistent by not incrementing the nonce for trading&lending tx (#371) --- eth/api_tracer.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eth/api_tracer.go b/eth/api_tracer.go index 218781b57b..706bd56bc9 100644 --- a/eth/api_tracer.go +++ b/eth/api_tracer.go @@ -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{})