dumpDebuggingMetaData stub

This commit is contained in:
andri lim 2018-12-12 11:31:53 +07:00 committed by zah
parent 3a355e0569
commit 890e8e11a4
2 changed files with 15 additions and 9 deletions

View File

@ -81,13 +81,9 @@ method persistBlocks*(c: Chain, headers: openarray[BlockHeader], bodies: openarr
else: nil
let success = processBlock(c.db, head, headers[i], bodies[i], vmState)
if not success:
# TODO: move this back into tracer.nim and produce a nice bundle of
# debugging tool metadata
let ttrace = traceTransaction(c.db, headers[i], bodies[i], bodies[i].transactions.len - 1, {})
trace "NIMBUS TRACE", transactionTrace=ttrace.pretty()
let dump = dumpBlockState(c.db, headers[i], bodies[i])
trace "NIMBUS STATE DUMP", dump=dump.pretty()
when not defined(release):
if not success:
dumpDebuggingMetaData(c.db, headers[i], bodies[i])
assert(success)

View File

@ -2,7 +2,7 @@ import
db/[db_chain, state_db, capturedb], eth_common, utils, json,
constants, vm_state, vm_types, transaction, p2p/executor,
eth_trie/db, nimcrypto, strutils, ranges, ./utils/addresses,
sets
sets, chronicles
proc getParentHeader(self: BaseChainDB, header: BlockHeader): BlockHeader =
self.getBlockHeader(header.parentHash)
@ -191,4 +191,14 @@ proc traceBlock*(db: BaseChainDB, header: BlockHeader, body: BlockBody, tracerFl
gasUsed = gasUsed + (txFee div tx.gasPrice.u256).truncate(GasInt)
result = vmState.getTracingResult()
result["gas"] = %gasUsed
result["gas"] = %gasUsed
proc dumpDebuggingMetaData*(db: BaseChainDB, header: BlockHeader, body: BlockBody) =
# TODO: tidying this up and make it available to debugging tool
let ttrace = traceTransaction(db, header, body, body.transactions.len - 1, {})
trace "NIMBUS TRACE", transactionTrace=ttrace.pretty()
let dump = dumpBlockState(db, header, body)
trace "NIMBUS STATE DUMP", dump=dump.pretty()
let blockTrace = traceBlock(db, header, body, {})
trace "NIMBUS BLOCK TRACE", blockTrace=blockTrace
# dump receipt #195