mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 05:14:14 +00:00
fix debug tool
This commit is contained in:
parent
e104153379
commit
78367bf10a
@ -45,7 +45,7 @@ method persistBlocks*(c: Chain, headers: openarray[BlockHeader], bodies: openarr
|
||||
let vmState = newBaseVMState(head, c.db)
|
||||
let validationResult = processBlock(c.db, head, headers[i], bodies[i], vmState)
|
||||
|
||||
when not defined(release) and not defined(debugging_tool):
|
||||
when not defined(release):
|
||||
if validationResult == ValidationResult.Error:
|
||||
dumpDebuggingMetaData(c.db, headers[i], bodies[i], vmState.receipts)
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import
|
||||
json, os, stint, eth_trie/db, byteutils, eth_common,
|
||||
../nimbus/db/[db_chain], ../nimbus/p2p/chain,
|
||||
chronicles
|
||||
../nimbus/db/[db_chain], chronicles, ../nimbus/vm_state,
|
||||
../nimbus/p2p/executor
|
||||
|
||||
proc prepareBlockEnv(node: JsonNode, memoryDB: TrieDatabaseRef) =
|
||||
let state = node["state"]
|
||||
@ -13,18 +13,16 @@ proc prepareBlockEnv(node: JsonNode, memoryDB: TrieDatabaseRef) =
|
||||
|
||||
proc executeBlock(memoryDB: TrieDatabaseRef, blockNumber: Uint256) =
|
||||
let
|
||||
chainDB = newBaseChainDB(memoryDB, false)
|
||||
parentNumber = blockNumber - 1
|
||||
chainDB = newBaseChainDB(memoryDB, false)
|
||||
parent = chainDB.getBlockHeader(parentNumber)
|
||||
header = chainDB.getBlockHeader(blockNumber)
|
||||
headerHash = header.blockHash
|
||||
body = chainDB.getBlockBody(headerHash)
|
||||
chain = newChain(chainDB)
|
||||
headers = @[header]
|
||||
bodies = @[body]
|
||||
body = chainDB.getBlockBody(header.blockHash)
|
||||
|
||||
let
|
||||
vmState = newBaseVMState(parent, chainDB)
|
||||
validationResult = processBlock(chainDB, parent, header, body, vmState)
|
||||
|
||||
chainDB.setHead(parent, true)
|
||||
let validationResult = chain.persistBlocks(headers, bodies)
|
||||
if validationResult != ValidationResult.OK:
|
||||
error "block validation error", validationResult
|
||||
else:
|
||||
|
@ -1 +0,0 @@
|
||||
-d:debugging_tool
|
Loading…
x
Reference in New Issue
Block a user