mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 13:24:21 +00:00
fixes nimbus evm tracer, add missing networkParams when constructing chainDB
This commit is contained in:
parent
8552dda7bb
commit
44394d9ffd
@ -46,6 +46,9 @@ proc newBaseChainDB*(
|
||||
proc `$`*(db: BaseChainDB): string =
|
||||
result = "BaseChainDB"
|
||||
|
||||
proc networkParams*(db: BaseChainDB): NetworkParams =
|
||||
NetworkParams(config: db.config, genesis: db.genesis)
|
||||
|
||||
proc exists*(self: BaseChainDB, hash: Hash256): bool =
|
||||
self.db.contains(hash.data)
|
||||
|
||||
|
@ -86,7 +86,8 @@ proc traceTransaction*(chainDB: BaseChainDB, header: BlockHeader,
|
||||
memoryDB = newMemoryDB()
|
||||
captureDB = newCaptureDB(chainDB.db, memoryDB)
|
||||
captureTrieDB = trieDB captureDB
|
||||
captureChainDB = newBaseChainDB(captureTrieDB, false, chainDB.networkId) # prune or not prune?
|
||||
networkParams = chainDB.networkParams
|
||||
captureChainDB = newBaseChainDB(captureTrieDB, false, chainDB.networkId, networkParams) # prune or not prune?
|
||||
vmState = newBaseVMState(parent.stateRoot, header, captureChainDB, tracerFlags + {EnableAccount})
|
||||
|
||||
var stateDb = vmState.accountDb
|
||||
@ -153,7 +154,8 @@ proc dumpBlockState*(db: BaseChainDB, header: BlockHeader, body: BlockBody, dump
|
||||
memoryDB = newMemoryDB()
|
||||
captureDB = newCaptureDB(db.db, memoryDB)
|
||||
captureTrieDB = trieDB captureDB
|
||||
captureChainDB = newBaseChainDB(captureTrieDB, false, db.networkId)
|
||||
networkParams = db.networkParams
|
||||
captureChainDB = newBaseChainDB(captureTrieDB, false, db.networkId, networkParams)
|
||||
# we only need stack dump if we want to scan for internal transaction address
|
||||
vmState = newBaseVMState(parent.stateRoot, header, captureChainDB, {EnableTracing, DisableMemory, DisableStorage, EnableAccount})
|
||||
miner = vmState.coinbase()
|
||||
@ -210,7 +212,8 @@ proc traceBlock*(chainDB: BaseChainDB, header: BlockHeader, body: BlockBody, tra
|
||||
memoryDB = newMemoryDB()
|
||||
captureDB = newCaptureDB(chainDB.db, memoryDB)
|
||||
captureTrieDB = trieDB captureDB
|
||||
captureChainDB = newBaseChainDB(captureTrieDB, false, chainDB.networkId)
|
||||
networkParams = chainDB.networkParams
|
||||
captureChainDB = newBaseChainDB(captureTrieDB, false, chainDB.networkId, networkParams)
|
||||
vmState = newBaseVMState(parent.stateRoot, header, captureChainDB, tracerFlags + {EnableTracing})
|
||||
|
||||
if header.txRoot == BLANK_ROOT_HASH: return newJNull()
|
||||
@ -243,7 +246,8 @@ proc dumpDebuggingMetaData*(chainDB: BaseChainDB, header: BlockHeader,
|
||||
memoryDB = newMemoryDB()
|
||||
captureDB = newCaptureDB(chainDB.db, memoryDB)
|
||||
captureTrieDB = trieDB captureDB
|
||||
captureChainDB = newBaseChainDB(captureTrieDB, false, chainDB.networkId)
|
||||
networkParams = chainDB.networkParams
|
||||
captureChainDB = newBaseChainDB(captureTrieDB, false, chainDB.networkId, networkParams)
|
||||
bloom = createBloom(vmState.receipts)
|
||||
|
||||
let blockSummary = %{
|
||||
|
Loading…
x
Reference in New Issue
Block a user