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
This commit is contained in:
Martin Holst Swende
2018-10-04 17:15:37 +02:00
committed by Péter Szilágyi
parent 8c63d0d2e4
commit 89a32451ae
9 changed files with 164 additions and 56 deletions

View File

@ -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.