Skip to content

Commit

Permalink
Reorder log context to print slot first
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Apr 12, 2024
1 parent 323e4ce commit 3225fea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions packages/beacon-node/src/api/impl/beacon/blocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function getBeaconBlockApi({
const bodyRoot = toHex(chain.config.getForkTypes(slot).BeaconBlockBody.hashTreeRoot(signedBlock.message.body));
const blockLocallyProduced =
chain.producedBlockRoot.has(blockRoot) || chain.producedBlindedBlockRoot.has(blockRoot);
const valLogMeta = {broadcastValidation, blockRoot, bodyRoot, blockLocallyProduced, slot};
const valLogMeta = {slot, blockRoot, bodyRoot, broadcastValidation, blockLocallyProduced};

switch (broadcastValidation) {
case routes.beacon.BroadcastValidation.gossip: {
Expand Down Expand Up @@ -227,26 +227,26 @@ export function getBeaconBlockApi({
const executionPayload = chain.producedBlockRoot.get(blockRoot);
if (executionPayload !== undefined) {
const source = ProducedBlockSource.engine;
chain.logger.debug("Reconstructing signedBlockOrContents", {blockRoot, slot, source});
chain.logger.debug("Reconstructing signedBlockOrContents", {slot, blockRoot, source});

const contents = executionPayload
? chain.producedContentsCache.get(toHex(executionPayload.blockHash)) ?? null
: null;
const signedBlockOrContents = reconstructFullBlockOrContents(signedBlindedBlock, {executionPayload, contents});

chain.logger.info("Publishing assembled block", {blockRoot, slot, source});
chain.logger.info("Publishing assembled block", {slot, blockRoot, source});
return publishBlock(signedBlockOrContents, opts);
} else {
const source = ProducedBlockSource.builder;
chain.logger.debug("Reconstructing signedBlockOrContents", {blockRoot, slot, source});
chain.logger.debug("Reconstructing signedBlockOrContents", {slot, blockRoot, source});

const signedBlockOrContents = await reconstructBuilderBlockOrContents(chain, signedBlindedBlock);

// the full block is published by relay and it's possible that the block is already known to us
// by gossip
//
// see: https://github.com/ChainSafe/lodestar/issues/5404
chain.logger.info("Publishing assembled block", {blockRoot, slot, source});
chain.logger.info("Publishing assembled block", {slot, blockRoot, source});
return publishBlock(signedBlockOrContents, {...opts, ignoreIfKnown: true});
}
};
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/api/impl/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,9 @@ export function getValidatorApi({
}

const loggerContext = {
slot,
fork,
builderSelection,
slot,
isBuilderEnabled,
isEngineEnabled,
strictFeeRecipientCheck,
Expand Down

0 comments on commit 3225fea

Please sign in to comment.