mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-12 23:34:44 +00:00
This commit is contained in:
parent
1bb2859aca
commit
94c3b005fa
beacon_chain
@ -221,7 +221,8 @@ func get_temporary_block_header*(blck: BeaconBlock): BeaconBlockHeader =
|
||||
previous_block_root: blck.previous_block_root,
|
||||
state_root: ZERO_HASH,
|
||||
block_body_root: hash_tree_root_final(blck.body),
|
||||
signature: blck.signature)
|
||||
signature: EMPTY_SIGNATURE,
|
||||
)
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/0.4.0/specs/core/0_beacon-chain.md#on-genesis
|
||||
func get_empty_block*(): BeaconBlock =
|
||||
|
@ -68,8 +68,10 @@ proc processBlockHeader(
|
||||
state_slot = humaneSlotNum(state.slot)
|
||||
return false
|
||||
|
||||
if not (blck.previous_block_root ==
|
||||
hash_tree_root_final(state.latest_block_header)):
|
||||
## https://github.com/ethereum/eth2.0-specs/pull/816/files remove when
|
||||
## switched to 0.5.1
|
||||
if not (blck.previous_block_root.data ==
|
||||
signed_root(state.latest_block_header)):
|
||||
notice "Block header: previous block root mismatch",
|
||||
previous_block_root = blck.previous_block_root,
|
||||
latest_block_header = state.latest_block_header,
|
||||
@ -466,7 +468,7 @@ func cacheState(state: var BeaconState) =
|
||||
|
||||
# store latest known block for previous slot
|
||||
state.latest_block_roots[state.slot mod SLOTS_PER_HISTORICAL_ROOT] =
|
||||
hash_tree_root_final(state.latest_block_header)
|
||||
Eth2Digest(data: signed_root(state.latest_block_header))
|
||||
|
||||
func processSlot(state: var BeaconState, previous_block_root: Eth2Digest) =
|
||||
advanceSlot(state)
|
||||
|
Loading…
x
Reference in New Issue
Block a user