|
|
@ -20,7 +20,6 @@ import ( |
|
|
|
"bufio" |
|
|
|
"bufio" |
|
|
|
"context" |
|
|
|
"context" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"github.com/ethereum/go-ethereum/common/math" |
|
|
|
|
|
|
|
"io/ioutil" |
|
|
|
"io/ioutil" |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"runtime" |
|
|
|
"runtime" |
|
|
@ -29,6 +28,7 @@ import ( |
|
|
|
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
"github.com/ethereum/go-ethereum/common/hexutil" |
|
|
|
"github.com/ethereum/go-ethereum/common/hexutil" |
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common/math" |
|
|
|
"github.com/ethereum/go-ethereum/rpc" |
|
|
|
"github.com/ethereum/go-ethereum/rpc" |
|
|
|
"github.com/ethereum/go-ethereum/trie" |
|
|
|
"github.com/ethereum/go-ethereum/trie" |
|
|
|
"github.com/harmony-one/harmony/core" |
|
|
|
"github.com/harmony-one/harmony/core" |
|
|
@ -142,7 +142,7 @@ func (hmy *Harmony) TraceChain(ctx context.Context, start, end *types.Block, con |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Execute all the transactions contained within the chain concurrently for each block
|
|
|
|
// Execute all the transactions contained within the chain concurrently for each block
|
|
|
|
blocks := int(end.NumberU64()-origin) |
|
|
|
blocks := int(end.NumberU64() - origin) |
|
|
|
|
|
|
|
|
|
|
|
threads := runtime.NumCPU() |
|
|
|
threads := runtime.NumCPU() |
|
|
|
if threads > blocks { |
|
|
|
if threads > blocks { |
|
|
@ -632,10 +632,10 @@ func (hmy *Harmony) TraceTx(ctx context.Context, message core.Message, vmctx vm. |
|
|
|
switch tracer := tracer.(type) { |
|
|
|
switch tracer := tracer.(type) { |
|
|
|
case *vm.StructLogger: |
|
|
|
case *vm.StructLogger: |
|
|
|
return &ExecutionResult{ |
|
|
|
return &ExecutionResult{ |
|
|
|
Gas: result.UsedGas, |
|
|
|
Gas: result.UsedGas, |
|
|
|
Failed: result.VMErr != nil, |
|
|
|
Failed: result.VMErr != nil, |
|
|
|
ReturnValue: fmt.Sprintf("%x", result.ReturnData), |
|
|
|
ReturnValue: fmt.Sprintf("%x", result.ReturnData), |
|
|
|
StructLogs: FormatLogs(tracer.StructLogs()), |
|
|
|
StructLogs: FormatLogs(tracer.StructLogs()), |
|
|
|
}, nil |
|
|
|
}, nil |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|