mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-02-13 12:36:39 +00:00
fix constantinople's block reward
This commit is contained in:
parent
7d74d38530
commit
8e921072af
@ -95,6 +95,24 @@ proc makeReceipt(vmState: BaseVMState, fork = FkFrontier): Receipt =
|
|||||||
result.logs = vmState.getAndClearLogEntries()
|
result.logs = vmState.getAndClearLogEntries()
|
||||||
result.bloom = logsBloom(result.logs).value.toByteArrayBE
|
result.bloom = logsBloom(result.logs).value.toByteArrayBE
|
||||||
|
|
||||||
|
func eth(n: int): Uint256 {.compileTime.} =
|
||||||
|
n.u256 * pow(10.u256, 18)
|
||||||
|
|
||||||
|
const
|
||||||
|
eth5 = 5.eth
|
||||||
|
eth3 = 3.eth
|
||||||
|
eth2 = 2.eth
|
||||||
|
blockRewards: array[Fork, Uint256] = [
|
||||||
|
eth5, # FkFrontier
|
||||||
|
eth5, # FkThawing
|
||||||
|
eth5, # FkHomestead
|
||||||
|
eth5, # FkDao
|
||||||
|
eth5, # FkTangerine
|
||||||
|
eth5, # FkSpurious
|
||||||
|
eth3, # FkByzantium
|
||||||
|
eth2 # FkConstantinople
|
||||||
|
]
|
||||||
|
|
||||||
proc processBlock*(chainDB: BaseChainDB, header: BlockHeader, body: BlockBody, vmState: BaseVMState): ValidationResult =
|
proc processBlock*(chainDB: BaseChainDB, header: BlockHeader, body: BlockBody, vmState: BaseVMState): ValidationResult =
|
||||||
if chainDB.config.daoForkSupport and header.blockNumber == chainDB.config.daoForkBlock:
|
if chainDB.config.daoForkSupport and header.blockNumber == chainDB.config.daoForkBlock:
|
||||||
vmState.mutateStateDB:
|
vmState.mutateStateDB:
|
||||||
@ -124,11 +142,7 @@ proc processBlock*(chainDB: BaseChainDB, header: BlockHeader, body: BlockBody, v
|
|||||||
return ValidationResult.Error
|
return ValidationResult.Error
|
||||||
vmState.receipts[txIndex] = makeReceipt(vmState, fork)
|
vmState.receipts[txIndex] = makeReceipt(vmState, fork)
|
||||||
|
|
||||||
let blockReward = if fork >= FkByzantium:
|
let blockReward = blockRewards[fork]
|
||||||
3.u256 * pow(10.u256, 18) # 3 ETH
|
|
||||||
else:
|
|
||||||
5.u256 * pow(10.u256, 18) # 5 ETH
|
|
||||||
|
|
||||||
var mainReward = blockReward
|
var mainReward = blockReward
|
||||||
if header.ommersHash != EMPTY_UNCLE_HASH:
|
if header.ommersHash != EMPTY_UNCLE_HASH:
|
||||||
let h = chainDB.persistUncles(body.uncles)
|
let h = chainDB.persistUncles(body.uncles)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user