bugfix: block 78458 crash
This commit is contained in:
parent
282824cd53
commit
a1242d2538
|
@ -224,6 +224,11 @@ proc generateChildComputation*(fork: Fork, computation: BaseComputation, childMs
|
||||||
# Copy the fork op code executor proc (assumes child computation is in the same fork)
|
# Copy the fork op code executor proc (assumes child computation is in the same fork)
|
||||||
childComp.opCodeExec = computation.opCodeExec
|
childComp.opCodeExec = computation.opCodeExec
|
||||||
|
|
||||||
|
# TODO: use AccountStateDB revert/commit after JournalDB implemented
|
||||||
|
let stateDb = computation.vmState.accountDb
|
||||||
|
let intermediateRoot = stateDb.rootHash
|
||||||
|
computation.vmState.blockHeader.stateRoot = stateDb.rootHash
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if childMsg.isCreate:
|
if childMsg.isCreate:
|
||||||
fork.applyCreateMessage(childComp, opCode)
|
fork.applyCreateMessage(childComp, opCode)
|
||||||
|
@ -236,7 +241,16 @@ proc generateChildComputation*(fork: Fork, computation: BaseComputation, childMs
|
||||||
# param
|
# param
|
||||||
type ErrorT = vm_types.Error
|
type ErrorT = vm_types.Error
|
||||||
childComp.error = ErrorT(info: getCurrentExceptionMsg())
|
childComp.error = ErrorT(info: getCurrentExceptionMsg())
|
||||||
debug "applyMesage() failed", error = getCurrentExceptionMsg()
|
if childMsg.isCreate:
|
||||||
|
debug "childComputation: createMessage() failed", error = getCurrentExceptionMsg()
|
||||||
|
else:
|
||||||
|
debug "childComputation: applyMessage() failed", error = getCurrentExceptionMsg()
|
||||||
|
|
||||||
|
if childComp.isError:
|
||||||
|
stateDb.rootHash = intermediateRoot
|
||||||
|
computation.vmState.blockHeader.stateRoot = intermediateRoot
|
||||||
|
else:
|
||||||
|
stateDb.rootHash = computation.vmState.blockHeader.stateRoot
|
||||||
|
|
||||||
return childComp
|
return childComp
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue