mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-27 12:35:00 +00:00
zah's request: add missing comments
This commit is contained in:
parent
150fafbc8c
commit
282824cd53
@ -80,6 +80,11 @@ template createTrieKeyFromSlot(slot: UInt256): ByteRange =
|
|||||||
# morally equivalent to toByteRange_Unnecessary but with different types
|
# morally equivalent to toByteRange_Unnecessary but with different types
|
||||||
|
|
||||||
template getAccountTrie(stateDb: AccountStateDB, account: Account): auto =
|
template getAccountTrie(stateDb: AccountStateDB, account: Account): auto =
|
||||||
|
# TODO: implement `prefix-db` to solve issue #228 permanently.
|
||||||
|
# the `prefix-db` will automatically insert account address to the
|
||||||
|
# underlying-db key without disturb how the trie works.
|
||||||
|
# it will create virtual container for each account.
|
||||||
|
# see nim-eth#9
|
||||||
initSecureHexaryTrie(HexaryTrie(stateDb.trie).db, account.storageRoot, false)
|
initSecureHexaryTrie(HexaryTrie(stateDb.trie).db, account.storageRoot, false)
|
||||||
|
|
||||||
# XXX: https://github.com/status-im/nimbus/issues/142#issuecomment-420583181
|
# XXX: https://github.com/status-im/nimbus/issues/142#issuecomment-420583181
|
||||||
|
@ -231,8 +231,11 @@ proc generateChildComputation*(fork: Fork, computation: BaseComputation, childMs
|
|||||||
applyMessage(childComp, opCode)
|
applyMessage(childComp, opCode)
|
||||||
except VMError:
|
except VMError:
|
||||||
# weird Nim bug
|
# weird Nim bug
|
||||||
type T = vm_types.Error
|
# cannot use `Error` directly when constructing error object
|
||||||
childComp.error = T(info: getCurrentExceptionMsg())
|
# it seems the compiler confused in the presence of static[Op]
|
||||||
|
# param
|
||||||
|
type ErrorT = vm_types.Error
|
||||||
|
childComp.error = ErrorT(info: getCurrentExceptionMsg())
|
||||||
debug "applyMesage() failed", error = getCurrentExceptionMsg()
|
debug "applyMesage() failed", error = getCurrentExceptionMsg()
|
||||||
|
|
||||||
return childComp
|
return childComp
|
||||||
|
@ -68,6 +68,8 @@ method getAncestorHash*(vmState: BaseVMState, blockNumber: BlockNumber): Hash256
|
|||||||
|
|
||||||
result = vmState.chainDB.getBlockHash(blockNumber)
|
result = vmState.chainDB.getBlockHash(blockNumber)
|
||||||
#TODO: should we use deque here?
|
#TODO: should we use deque here?
|
||||||
|
# someday we may revive this code when
|
||||||
|
# we already have working miner
|
||||||
when false:
|
when false:
|
||||||
let idx = ancestorDepth.toInt
|
let idx = ancestorDepth.toInt
|
||||||
if idx >= vmState.prevHeaders.len:
|
if idx >= vmState.prevHeaders.len:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user