mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-22 12:30:08 +00:00
avoid nimZeroMem and stack usage in is_merge_transition_complete and is_merge_transition_block (#3399)
This commit is contained in:
parent
47a72c474e
commit
254e0fe2e2
@ -482,15 +482,17 @@ func get_subtree_index*(idx: GeneralizedIndex): uint64 =
|
|||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.9/specs/bellatrix/beacon-chain.md#is_merge_transition_complete
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.9/specs/bellatrix/beacon-chain.md#is_merge_transition_complete
|
||||||
func is_merge_transition_complete*(state: bellatrix.BeaconState): bool =
|
func is_merge_transition_complete*(state: bellatrix.BeaconState): bool =
|
||||||
state.latest_execution_payload_header != default(ExecutionPayloadHeader)
|
const defaultExecutionPayloadHeader = default(ExecutionPayloadHeader)
|
||||||
|
state.latest_execution_payload_header != defaultExecutionPayloadHeader
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.9/specs/bellatrix/beacon-chain.md#is_merge_transition_block
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.9/specs/bellatrix/beacon-chain.md#is_merge_transition_block
|
||||||
func is_merge_transition_block(
|
func is_merge_transition_block(
|
||||||
state: bellatrix.BeaconState,
|
state: bellatrix.BeaconState,
|
||||||
body: bellatrix.BeaconBlockBody | bellatrix.TrustedBeaconBlockBody |
|
body: bellatrix.BeaconBlockBody | bellatrix.TrustedBeaconBlockBody |
|
||||||
bellatrix.SigVerifiedBeaconBlockBody): bool =
|
bellatrix.SigVerifiedBeaconBlockBody): bool =
|
||||||
|
const defaultBellatrixExecutionPayload = default(bellatrix.ExecutionPayload)
|
||||||
not is_merge_transition_complete(state) and
|
not is_merge_transition_complete(state) and
|
||||||
body.execution_payload != default(bellatrix.ExecutionPayload)
|
body.execution_payload != defaultBellatrixExecutionPayload
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.1.9/specs/bellatrix/beacon-chain.md#is_execution_enabled
|
# https://github.com/ethereum/consensus-specs/blob/v1.1.9/specs/bellatrix/beacon-chain.md#is_execution_enabled
|
||||||
func is_execution_enabled*(
|
func is_execution_enabled*(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user