Skip to content

Commit b6058b6

Browse files
committed
revert: gloas beacon_block validation
1 parent c0da29d commit b6058b6

File tree

1 file changed

+40
-42
lines changed

1 file changed

+40
-42
lines changed

beacon_chain/gossip_processing/gossip_validation.nim

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,6 @@ proc validateDataColumnSidecar*(
780780

781781
# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/p2p-interface.md#beacon_block
782782
# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/bellatrix/p2p-interface.md#beacon_block
783-
# https://github.com/ethereum/consensus-specs/blob/v1.6.0-beta.0/specs/gloas/p2p-interface.md#beacon_block
784783
proc validateBeaconBlock*(
785784
dag: ChainDAGRef, quarantine: ref Quarantine,
786785
signed_beacon_block: ForkySignedBeaconBlock,
@@ -856,47 +855,46 @@ proc validateBeaconBlock*(
856855
# [REJECT] The block's parent (defined by block.parent_root)
857856
# passes validation.
858857
let parent = dag.getBlockRef(signed_beacon_block.message.parent_root).valueOr:
859-
when type(signed_beacon_block).kind <= ConsensusFork.Fulu:
860-
if signed_beacon_block.message.parent_root in quarantine[].unviable:
861-
quarantine[].addUnviable(signed_beacon_block.root)
862-
863-
# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/bellatrix/p2p-interface.md#beacon_block
864-
# `is_execution_enabled(state, block.body)` check, but unlike in
865-
# validateBeaconBlockBellatrix() don't have parent BlockRef.
866-
if signed_beacon_block.message.is_execution_block:
867-
# Blocks with execution enabled will be permitted to propagate
868-
# regardless of the validity of the execution payload. This prevents
869-
# network segregation between optimistic and non-optimistic nodes.
870-
#
871-
# If execution_payload verification of block's parent by an execution
872-
# node is not complete:
873-
#
874-
# - [REJECT] The block's parent (defined by `block.parent_root`) passes
875-
# all validation (excluding execution node verification of the
876-
# `block.body.execution_payload`).
877-
#
878-
# otherwise:
879-
#
880-
# - [IGNORE] The block's parent (defined by `block.parent_root`) passes
881-
# all validation (including execution node verification of the
882-
# `block.body.execution_payload`).
883-
884-
# Implementation restrictions:
885-
#
886-
# - We don't know if the parent state had execution enabled.
887-
# If it had, and the block doesn't have it enabled anymore,
888-
# we end up in the pre-Merge path below (`else`) and REJECT.
889-
# Such a block is clearly invalid, though, without asking the EL.
890-
#
891-
# - We know that the parent was marked unviable, but don't know
892-
# whether it was marked unviable due to consensus (REJECT) or
893-
# execution (IGNORE) verification failure. We err on the IGNORE side.
894-
return errIgnore("BeaconBlock: ignored, parent from unviable fork")
895-
else:
896-
# [REJECT] The block's parent (defined by `block.parent_root`) passes
897-
# validation.
898-
return dag.checkedReject(
899-
"BeaconBlock: rejected, parent from unviable fork")
858+
if signed_beacon_block.message.parent_root in quarantine[].unviable:
859+
quarantine[].addUnviable(signed_beacon_block.root)
860+
861+
# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/bellatrix/p2p-interface.md#beacon_block
862+
# `is_execution_enabled(state, block.body)` check, but unlike in
863+
# validateBeaconBlockBellatrix() don't have parent BlockRef.
864+
if signed_beacon_block.message.is_execution_block:
865+
# Blocks with execution enabled will be permitted to propagate
866+
# regardless of the validity of the execution payload. This prevents
867+
# network segregation between optimistic and non-optimistic nodes.
868+
#
869+
# If execution_payload verification of block's parent by an execution
870+
# node is not complete:
871+
#
872+
# - [REJECT] The block's parent (defined by `block.parent_root`) passes
873+
# all validation (excluding execution node verification of the
874+
# `block.body.execution_payload`).
875+
#
876+
# otherwise:
877+
#
878+
# - [IGNORE] The block's parent (defined by `block.parent_root`) passes
879+
# all validation (including execution node verification of the
880+
# `block.body.execution_payload`).
881+
882+
# Implementation restrictions:
883+
#
884+
# - We don't know if the parent state had execution enabled.
885+
# If it had, and the block doesn't have it enabled anymore,
886+
# we end up in the pre-Merge path below (`else`) and REJECT.
887+
# Such a block is clearly invalid, though, without asking the EL.
888+
#
889+
# - We know that the parent was marked unviable, but don't know
890+
# whether it was marked unviable due to consensus (REJECT) or
891+
# execution (IGNORE) verification failure. We err on the IGNORE side.
892+
return errIgnore("BeaconBlock: ignored, parent from unviable fork")
893+
else:
894+
# [REJECT] The block's parent (defined by `block.parent_root`) passes
895+
# validation.
896+
return dag.checkedReject(
897+
"BeaconBlock: rejected, parent from unviable fork")
900898

901899
# When the parent is missing, we can't validate the block - we'll queue it
902900
# in the quarantine for later processing

0 commit comments

Comments
 (0)