only trigger liveness failsafe for mainnet (#4882)

* only trigger liveness failsafe for mainnet

* more user-friendly log
This commit is contained in:
tersec 2023-05-01 09:45:39 +00:00 committed by GitHub
parent bb62fee7d5
commit dc32add555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -37,7 +37,7 @@ type
# Transition # Transition
TERMINAL_TOTAL_DIFFICULTY*: UInt256 TERMINAL_TOTAL_DIFFICULTY*: UInt256
TERMINAL_BLOCK_HASH*: BlockHash # TODO use in eht1monitor TERMINAL_BLOCK_HASH*: BlockHash
# Genesis # Genesis
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT*: uint64 MIN_GENESIS_ACTIVE_VALIDATOR_COUNT*: uint64

View File

@ -619,7 +619,7 @@ proc getBlindedBlockParts[EPH: ForkyExecutionPayloadHeader](
"getBlindedExecutionPayload error: " & exc.msg) "getBlindedExecutionPayload error: " & exc.msg)
if executionPayloadHeader.isErr: if executionPayloadHeader.isErr:
debug "getBlindedBlockParts: getBlindedExecutionPayload failed", warn "Could not obtain blinded execution payload header",
error = executionPayloadHeader.error, slot, validator_index, error = executionPayloadHeader.error, slot, validator_index,
head = shortLog(head) head = shortLog(head)
# Haven't committed to the MEV block, so allow EL fallback. # Haven't committed to the MEV block, so allow EL fallback.
@ -759,6 +759,9 @@ proc proposeBlockMEV(node: BeaconNode, blindedBlock: auto):
"Unblinded block not returned to proposer" "Unblinded block not returned to proposer"
err errMsg err errMsg
func isEFMainnet(cfg: RuntimeConfig): bool =
cfg.DEPOSIT_CHAIN_ID == 1 and cfg.DEPOSIT_NETWORK_ID == 1
proc makeBlindedBeaconBlockForHeadAndSlot*[ proc makeBlindedBeaconBlockForHeadAndSlot*[
BBB: bellatrix_mev.BlindedBeaconBlock | capella_mev.BlindedBeaconBlock]( BBB: bellatrix_mev.BlindedBeaconBlock | capella_mev.BlindedBeaconBlock](
node: BeaconNode, randao_reveal: ValidatorSig, node: BeaconNode, randao_reveal: ValidatorSig,
@ -781,7 +784,7 @@ proc makeBlindedBeaconBlockForHeadAndSlot*[
pubkey = pubkey =
# Relevant state for knowledge of validators # Relevant state for knowledge of validators
withState(node.dag.headState): withState(node.dag.headState):
if livenessFailsafeInEffect( if node.dag.cfg.isEFMainnet and livenessFailsafeInEffect(
forkyState.data.block_roots.data, forkyState.data.slot): forkyState.data.block_roots.data, forkyState.data.slot):
# It's head block's slot which matters here, not proposal slot # It's head block's slot which matters here, not proposal slot
return err("Builder API liveness failsafe in effect") return err("Builder API liveness failsafe in effect")
@ -832,8 +835,8 @@ proc proposeBlockAux(
# EL fails -- i.e. it would change priorities, so any block from the # EL fails -- i.e. it would change priorities, so any block from the
# execution layer client would override builder API. But it seems an # execution layer client would override builder API. But it seems an
# odd requirement to produce no block at all in those conditions. # odd requirement to produce no block at all in those conditions.
not livenessFailsafeInEffect( (not node.dag.cfg.isEFMainnet) or (not livenessFailsafeInEffect(
forkyState.data.block_roots.data, forkyState.data.slot) forkyState.data.block_roots.data, forkyState.data.slot))
else: else:
false false