zah's request: add missing comments

This commit is contained in:
andri lim 2019-02-16 14:00:50 +07:00 committed by zah
parent 150fafbc8c
commit 282824cd53
3 changed files with 12 additions and 2 deletions

View File

@ -80,6 +80,11 @@ template createTrieKeyFromSlot(slot: UInt256): ByteRange =
# morally equivalent to toByteRange_Unnecessary but with different types
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)
# XXX: https://github.com/status-im/nimbus/issues/142#issuecomment-420583181

View File

@ -231,8 +231,11 @@ proc generateChildComputation*(fork: Fork, computation: BaseComputation, childMs
applyMessage(childComp, opCode)
except VMError:
# weird Nim bug
type T = vm_types.Error
childComp.error = T(info: getCurrentExceptionMsg())
# cannot use `Error` directly when constructing error object
# 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()
return childComp

View File

@ -68,6 +68,8 @@ method getAncestorHash*(vmState: BaseVMState, blockNumber: BlockNumber): Hash256
result = vmState.chainDB.getBlockHash(blockNumber)
#TODO: should we use deque here?
# someday we may revive this code when
# we already have working miner
when false:
let idx = ancestorDepth.toInt
if idx >= vmState.prevHeaders.len: