diff --git a/nimbus/p2p/chain.nim b/nimbus/p2p/chain.nim index 3088ee798..d80e7c674 100644 --- a/nimbus/p2p/chain.nim +++ b/nimbus/p2p/chain.nim @@ -43,7 +43,7 @@ method persistBlocks*(c: Chain, headers: openarray[BlockHeader], bodies: openarr for i in 0 ..< headers.len: let head = c.db.getCanonicalHead() let vmState = newBaseVMState(head.stateRoot, headers[i], c.db) - let validationResult = processBlock(c.db, head, headers[i], bodies[i], vmState) + let validationResult = processBlock(c.db, headers[i], bodies[i], vmState) when not defined(release): if validationResult == ValidationResult.Error: diff --git a/nimbus/p2p/executor.nim b/nimbus/p2p/executor.nim index d11b8a272..93f7649d4 100644 --- a/nimbus/p2p/executor.nim +++ b/nimbus/p2p/executor.nim @@ -95,7 +95,7 @@ proc makeReceipt(vmState: BaseVMState, cumulativeGasUsed: GasInt, fork = FkFront result.logs = vmState.getAndClearLogEntries() result.bloom = logsBloom(result.logs).value.toByteArrayBE -proc processBlock*(chainDB: BaseChainDB, head, header: BlockHeader, body: BlockBody, vmState: BaseVMState): ValidationResult = +proc processBlock*(chainDB: BaseChainDB, header: BlockHeader, body: BlockBody, vmState: BaseVMState): ValidationResult = let blockReward = 5.u256 * pow(10.u256, 18) # 5 ETH if body.transactions.calcTxRoot != header.txRoot: diff --git a/nimbus/tracer.nim b/nimbus/tracer.nim index c22ba166d..53961d4d2 100644 --- a/nimbus/tracer.nim +++ b/nimbus/tracer.nim @@ -159,7 +159,7 @@ proc dumpBlockState*(db: BaseChainDB, header: BlockHeader, body: BlockBody, dump for idx, uncle in body.uncles: before.captureAccount(stateBefore, uncle.coinbase, uncleName & $idx) - discard captureChainDB.processBlock(parent, header, body, vmState) + discard captureChainDB.processBlock(header, body, vmState) var stateAfter = vmState.accountDb diff --git a/premix/debug.nim b/premix/debug.nim index 610eb3830..fc96ce083 100644 --- a/premix/debug.nim +++ b/premix/debug.nim @@ -23,7 +23,7 @@ proc executeBlock(blockEnv: JsonNode, memoryDB: TrieDatabaseRef, blockNumber: Ui defer: transaction.dispose() let vmState = newBaseVMState(parent.stateRoot, header, chainDB) - validationResult = processBlock(chainDB, parent, header, body, vmState) + validationResult = processBlock(chainDB, header, body, vmState) if validationResult != ValidationResult.OK: error "block validation error", validationResult diff --git a/premix/dumper.nim b/premix/dumper.nim index 3a3cfad32..23a672ac5 100644 --- a/premix/dumper.nim +++ b/premix/dumper.nim @@ -27,7 +27,7 @@ proc dumpDebug(chainDB: BaseChainDB, blockNumber: Uint256) = vmState = newBaseVMState(parent.stateRoot, header, captureChainDB) captureChainDB.setHead(parent, true) - let validationResult = processBlock(captureChainDB, parent, header, body, vmState) + let validationResult = processBlock(captureChainDB, header, body, vmState) transaction.rollback() dumpDebuggingMetaData(captureChainDB, header, body, vmState, false) diff --git a/premix/hunter.nim b/premix/hunter.nim index 3ae4dd778..a7c9987e4 100644 --- a/premix/hunter.nim +++ b/premix/hunter.nim @@ -97,7 +97,7 @@ proc huntProblematicBlock(blockNumber: Uint256): ValidationResult = defer: transaction.dispose() let vmState = newHunterVMState(parentBlock.header.stateRoot, thisBlock.header, chainDB) - validationResult = processBlock(chainDB, parentBlock.header, thisBlock.header, thisBlock.body, vmState) + validationResult = processBlock(chainDB, thisBlock.header, thisBlock.body, vmState) if validationResult != ValidationResult.OK: transaction.rollback() diff --git a/premix/regress.nim b/premix/regress.nim index 578659675..144645a66 100644 --- a/premix/regress.nim +++ b/premix/regress.nim @@ -31,7 +31,7 @@ proc validateBlock(chainDB: BaseChainDB, blockNumber: BlockNumber): BlockNumber let vmState = newBaseVMState(parent.stateRoot, headers[i], chainDB) - validationResult = processBlock(chainDB, parent, headers[i], bodies[i], vmState) + validationResult = processBlock(chainDB, headers[i], bodies[i], vmState) if validationResult != ValidationResult.OK: error "block validation error", validationResult, blockNumber = blockNumber + i.u256