Skip to content

Commit

Permalink
log engine/builder API decisionmaking
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec committed Dec 1, 2023
1 parent 2fc43c9 commit dff00c4
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions beacon_chain/validators/beacon_validators.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,38 @@ proc proposeBlockAux(
return head # errors logged in router
false

# There should always be an engine bid, and if payloadBuilderClient exists,
# not getting a builder bid is also an error. Do not report lack of builder
# when that's intentional. Replicate some of the nested if statements here,
# because that avoids entangling logging with other functionality. The logs
# here are inteded to clarify that, for example, when the builder API relay
# URL is provided for this validator, it's reasonable for Nimbus not to use
# it for every block.
if collectedBids.engineBidAvailable:
# Three cases: builder bid expected and absent, builder bid expected and
# present, and builder bid not expected.
if collectedBids.builderBidAvailable:
info "Compared engine and builder block bids",
localBlockValueBoost,
useBuilderBlock,
builderBlockValue =
collectedBids.payloadBuilderBidFut.read.get().blockValue,
engineBlockValue = collectedBids.engineBlockFut.read.get().blockValue
elif payloadBuilderClient.isNil:
discard # builder API not configured for this block
else:
info "Did not receive expected builder bid; using engine block",
engineBlockValue = collectedBids.engineBlockFut.read.get().blockValue
else:
# Similar three cases: builder bid expected and absent, builder bid
# expected and present, and builder bid not expected. However, only
# the second is worth logging, because the other two result in this
# block being missed altogether, and with details logged elsewhere.
if collectedBids.builderBidAvailable:
info "Did not receive expected engine bid; using builder block",
builderBlockValue =
collectedBids.payloadBuilderBidFut.read.get().blockValue

if useBuilderBlock:
let
blindedBlock = (await blindedBlockCheckSlashingAndSign(
Expand Down

0 comments on commit dff00c4

Please sign in to comment.