From 89a32451aeb418db3fd5d9c427a0c29fddb1e85b Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Thu, 4 Oct 2018 17:15:37 +0200 Subject: 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 --- eth/api_tracer.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'eth') 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. -- cgit v1.2.3