Skip to content

Commit

Permalink
Reorder if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Oct 29, 2024
1 parent a4cf741 commit 10f656c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/beacon-node/src/api/impl/validator/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ export function selectBlockProductionSource({

case routes.validator.BuilderSelection.Default:
case routes.validator.BuilderSelection.MaxProfit: {
if (builderBoostFactor === MAX_BUILDER_BOOST_FACTOR) {
return {source: ProducedBlockSource.builder, reason: BuilderBlockSelectionReason.BuilderPreferred};
}

if (builderBoostFactor === BigInt(0)) {
return {source: ProducedBlockSource.engine, reason: EngineBlockSelectionReason.EnginePreferred};
}

if (builderBoostFactor === MAX_BUILDER_BOOST_FACTOR) {
return {source: ProducedBlockSource.builder, reason: BuilderBlockSelectionReason.BuilderPreferred};
}

if (engineBlockValue >= (builderBlockValue * builderBoostFactor) / BigInt(100)) {
return {source: ProducedBlockSource.engine, reason: EngineBlockSelectionReason.BlockValue};
}
Expand Down

0 comments on commit 10f656c

Please sign in to comment.