Skip to content

Commit

Permalink
nitty refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Oct 23, 2024
1 parent 33b5e53 commit 2d611ec
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -666,15 +666,15 @@ private SafeFuture<InternalValidationResult> processAggregateAndProof(
public SafeFuture<SendSignedBlockResult> sendSignedBlock(
final SignedBlockContainer maybeBlindedBlockContainer,
final BroadcastValidationLevel broadcastValidationLevel) {
final UInt64 slot = maybeBlindedBlockContainer.getSlot();
final BlockPublishingPerformance blockPublishingPerformance =
blockProductionAndPublishingPerformanceFactory.createForPublishing(
maybeBlindedBlockContainer.getSlot());
blockProductionAndPublishingPerformanceFactory.createForPublishing(slot);
return blockPublisher
.sendSignedBlock(
maybeBlindedBlockContainer,
// do only EQUIVOCATION validation when GOSSIP validation has been requested and the
// block has been locally created
broadcastValidationLevel == GOSSIP && isLocallyCreatedBlock(maybeBlindedBlockContainer)
broadcastValidationLevel == GOSSIP && isLocallyCreatedBlock(slot)
? EQUIVOCATION
: broadcastValidationLevel,
blockPublishingPerformance)
Expand Down Expand Up @@ -883,9 +883,9 @@ private List<ProposerDuty> getProposalSlotsForEpoch(final BeaconState state, fin
return proposerSlots;
}

private boolean isLocallyCreatedBlock(final SignedBlockContainer blockContainer) {
private boolean isLocallyCreatedBlock(final UInt64 slot) {
final SafeFuture<Optional<BlockContainerAndMetaData>> localBlockProduction =
localBlockProductionBySlotCache.get(blockContainer.getSlot());
localBlockProductionBySlotCache.get(slot);
if (localBlockProduction == null) {
return false;
}
Expand Down

0 comments on commit 2d611ec

Please sign in to comment.