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 else: nil
let success = processBlock(c.db, head, headers[i], bodies[i], vmState) let success = processBlock(c.db, head, headers[i], bodies[i], vmState)
when not defined(release):
if not success: if not success:
# TODO: move this back into tracer.nim and produce a nice bundle of dumpDebuggingMetaData(c.db, headers[i], bodies[i])
# 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()
assert(success) assert(success)

View File

@ -2,7 +2,7 @@ import
db/[db_chain, state_db, capturedb], eth_common, utils, json, db/[db_chain, state_db, capturedb], eth_common, utils, json,
constants, vm_state, vm_types, transaction, p2p/executor, constants, vm_state, vm_types, transaction, p2p/executor,
eth_trie/db, nimcrypto, strutils, ranges, ./utils/addresses, eth_trie/db, nimcrypto, strutils, ranges, ./utils/addresses,
sets sets, chronicles
proc getParentHeader(self: BaseChainDB, header: BlockHeader): BlockHeader = proc getParentHeader(self: BaseChainDB, header: BlockHeader): BlockHeader =
self.getBlockHeader(header.parentHash) self.getBlockHeader(header.parentHash)
@ -192,3 +192,13 @@ proc traceBlock*(db: BaseChainDB, header: BlockHeader, body: BlockBody, tracerFl
result = vmState.getTracingResult() 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