diff options
author | Martin Holst Swende <martin@swende.se> | 2018-10-04 23:15:37 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-10-04 23:15:37 +0800 |
commit | 89a32451aeb418db3fd5d9c427a0c29fddb1e85b (patch) | |
tree | 24df0d470d52030635712364a947bc7a8293d366 /eth/api_tracer.go | |
parent | 8c63d0d2e44128c6a0f12fb9db8f0a32528b4a7d (diff) | |
download | dexon-89a32451aeb418db3fd5d9c427a0c29fddb1e85b.tar.gz dexon-89a32451aeb418db3fd5d9c427a0c29fddb1e85b.tar.zst dexon-89a32451aeb418db3fd5d9c427a0c29fddb1e85b.zip |
core/vm: faster create/create2 (#17806)
* core/vm/runtim: benchmark create/create2
* core/vm: do less hashing in CREATE2
* core/vm: avoid storing jumpdest analysis for initcode
* core/vm: avoid unneccesary lookups, remove unused fields
* core/vm: go formatting tests
* core/vm: save jumpdest analysis locally
* core/vm: use common.Hash instead of nil, fix review comments
* core/vm: removed type destinations
* core/vm: correct check for empty hash
* eth: more elegant api_tracer
* core/vm: address review concerns
Diffstat (limited to 'eth/api_tracer.go')
-rw-r--r-- | eth/api_tracer.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/eth/api_tracer.go b/eth/api_tracer.go index 5b7f168ec..80552ada8 100644 --- a/eth/api_tracer.go +++ b/eth/api_tracer.go @@ -391,6 +391,15 @@ func (api *PrivateDebugAPI) TraceBlockFromFile(ctx context.Context, file string, return api.TraceBlock(ctx, blob, config) } +// TraceBadBlock returns the structured logs created during the execution of a block +// within the blockchain 'badblocks' cache +func (api *PrivateDebugAPI) TraceBadBlock(ctx context.Context, index int, config *TraceConfig) ([]*txTraceResult, error) { + if blocks := api.eth.blockchain.BadBlocks(); index < len(blocks) { + return api.traceBlock(ctx, blocks[index], config) + } + return nil, fmt.Errorf("index out of range") +} + // traceBlock configures a new tracer according to the provided configuration, and // executes all the transactions contained within. The return value will be one item // per transaction, dependent on the requestd tracer. |