|
|
@ -379,9 +379,8 @@ traceLoop: |
|
|
|
} |
|
|
|
} |
|
|
|
// Generate the next state snapshot fast without tracing
|
|
|
|
// Generate the next state snapshot fast without tracing
|
|
|
|
msg, _ := tx.AsMessage(signer) |
|
|
|
msg, _ := tx.AsMessage(signer) |
|
|
|
|
|
|
|
statedb.Prepare(tx.Hash(), blockHash, i) |
|
|
|
ethTx := tx.ConvertToEth() |
|
|
|
statedb.SetTxHashETH(tx.ConvertToEth().Hash()) |
|
|
|
statedb.Prepare(ethTx.Hash(), blockHash, i) |
|
|
|
|
|
|
|
vmctx := core.NewEVMContext(msg, block.Header(), hmy.BlockChain, nil) |
|
|
|
vmctx := core.NewEVMContext(msg, block.Header(), hmy.BlockChain, nil) |
|
|
|
res, err := hmy.TraceTx(ctx, msg, vmctx, statedb, config) |
|
|
|
res, err := hmy.TraceTx(ctx, msg, vmctx, statedb, config) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
@ -465,8 +464,9 @@ func (hmy *Harmony) TraceBlock(ctx context.Context, block *types.Block, config * |
|
|
|
|
|
|
|
|
|
|
|
msg, _ := txs[task.index].AsMessage(signer) |
|
|
|
msg, _ := txs[task.index].AsMessage(signer) |
|
|
|
vmctx := core.NewEVMContext(msg, block.Header(), hmy.BlockChain, nil) |
|
|
|
vmctx := core.NewEVMContext(msg, block.Header(), hmy.BlockChain, nil) |
|
|
|
ethTx := txs[task.index].ConvertToEth() |
|
|
|
tx := txs[task.index] |
|
|
|
task.statedb.Prepare(ethTx.Hash(), blockHash, task.index) |
|
|
|
task.statedb.Prepare(tx.Hash(), blockHash, task.index) |
|
|
|
|
|
|
|
task.statedb.SetTxHashETH(tx.ConvertToEth().Hash()) |
|
|
|
res, err := hmy.TraceTx(ctx, msg, vmctx, task.statedb, config) |
|
|
|
res, err := hmy.TraceTx(ctx, msg, vmctx, task.statedb, config) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
results[task.index] = &TxTraceResult{Error: err.Error()} |
|
|
|
results[task.index] = &TxTraceResult{Error: err.Error()} |
|
|
@ -489,6 +489,7 @@ func (hmy *Harmony) TraceBlock(ctx context.Context, block *types.Block, config * |
|
|
|
// Generate the next state snapshot fast without tracing
|
|
|
|
// Generate the next state snapshot fast without tracing
|
|
|
|
msg, _ := tx.AsMessage(signer) |
|
|
|
msg, _ := tx.AsMessage(signer) |
|
|
|
statedb.Prepare(tx.Hash(), block.Hash(), i) |
|
|
|
statedb.Prepare(tx.Hash(), block.Hash(), i) |
|
|
|
|
|
|
|
statedb.SetTxHashETH(tx.ConvertToEth().Hash()) |
|
|
|
vmctx := core.NewEVMContext(msg, block.Header(), hmy.BlockChain, nil) |
|
|
|
vmctx := core.NewEVMContext(msg, block.Header(), hmy.BlockChain, nil) |
|
|
|
|
|
|
|
|
|
|
|
vmenv := vm.NewEVM(vmctx, statedb, hmy.BlockChain.Config(), vm.Config{}) |
|
|
|
vmenv := vm.NewEVM(vmctx, statedb, hmy.BlockChain.Config(), vm.Config{}) |
|
|
|