Skip to content

Commit

Permalink
format eth value for the bid
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Sep 16, 2024
1 parent 2e2389f commit ab98187
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ private String formatBlockRoots(final Set<Bytes32> blockRoots) {
return blockRoots.stream().map(LogFormatter::formatHashRoot).collect(Collectors.joining(", "));
}

public void logPublishedBid(final UInt64 slot, final UInt64 builderIndex, final UInt64 value) {
public void logPublishedBid(final UInt64 slot, final UInt64 builderIndex, final String ethValue) {
log.info(
ColorConsolePrinter.print(
String.format(
"%sPublished bid Slot: %s, Builder: %s, Value: %s",
PREFIX, slot, builderIndex, value),
"%sPublished bid Slot: %s, Builder: %s, Value: %s ETH",
PREFIX, slot, builderIndex, ethValue),
Color.CYAN));
}

Expand All @@ -184,12 +184,12 @@ public void logPublishedExecutionPayload(
final UInt64 builderIndex,
final Bytes32 blockRoot,
final int numberOfBlobs,
final String context) {
final String executionSummary) {
log.info(
ColorConsolePrinter.print(
String.format(
"%sPublished execution payload Slot: %s, Builder: %s, Block Root: %s, Blobs: %d, %s",
PREFIX, slot, builderIndex, blockRoot, numberOfBlobs, context),
PREFIX, slot, builderIndex, blockRoot, numberOfBlobs, executionSummary),
Color.CYAN));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.Optional;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.tuweni.units.bigints.UInt256;
import tech.pegasys.teku.bls.BLSSignature;
import tech.pegasys.teku.infrastructure.async.SafeFuture;
import tech.pegasys.teku.infrastructure.metrics.Validator.DutyType;
Expand Down Expand Up @@ -158,7 +159,9 @@ private SafeFuture<Void> processExecutionPayloadHeader(
final ExecutionPayloadHeaderEip7732 bid =
ExecutionPayloadHeaderEip7732.required(publishedHeader.getMessage());
VALIDATOR_LOGGER.logPublishedBid(
bid.getSlot(), bid.getBuilderIndex(), bid.getValue());
bid.getSlot(),
bid.getBuilderIndex(),
gweiToEth(UInt256.valueOf(bid.getValue().longValue())));
});
}

Expand Down

0 comments on commit ab98187

Please sign in to comment.