document strange-looking capella/bellatrix apparent mismatch in block building (#5461)

This commit is contained in:
tersec 2023-09-27 16:06:22 +00:00 committed by GitHub
parent 7c45b8f98d
commit 7ecc1096e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -10,7 +10,7 @@
import
# Status libraries
metrics,
chronicles, stew/[byteutils, results],
chronicles, stew/byteutils,
# Internal
../spec/[
beaconstate, eth2_merkleization, forks, state_transition_epoch, validator],
@ -20,7 +20,7 @@ import
from std/sequtils import keepItIf, maxIndex
export results, blockchain_dag, fork_choice
export blockchain_dag, fork_choice
const
# TODO since deneb, this is looser (whole previous epoch)
@ -621,10 +621,16 @@ proc getAttestationsForBlock*(pool: var AttestationPool,
# Using a greedy algorithm, select as many attestations as possible that will
# fit in the block.
#
# Effectively https://en.wikipedia.org/wiki/Maximum_coverage_problem which
# therefore has inapproximability results of greedy algorithm optimality.
#
# Some research, also, has been done showing that one can tweak this and do
# a kind of k-greedy version where each greedy step tries all possible two,
# three, or higher-order tuples of next elements. These seem promising, but
# also expensive.
#
# For each round, we'll look for the best attestation and add it to the result
# then re-score the other candidates.
#
# A possible improvement here would be to use a maximum cover algorithm.
var
prevEpoch = state.data.get_previous_epoch()
prevEpochSpace =

View File

@ -1195,6 +1195,8 @@ proc proposeBlock(node: BeaconNode,
proposeBlockContinuation(
capella_mev.SignedBlindedBeaconBlock, capella.ExecutionPayloadForSigning)
else:
# Bellatrix MEV is not supported; this signals that, because it triggers
# intentional SignedBlindedBeaconBlock/ExecutionPayload mismatches.
proposeBlockContinuation(
capella_mev.SignedBlindedBeaconBlock, bellatrix.ExecutionPayloadForSigning)