Skip to content

Commit

Permalink
logging improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Jan 26, 2023
1 parent 0bf2921 commit 6f17f9b
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions packages/beacon-node/src/network/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ export class Network implements INetwork {
let includedIndexes = [];
let totalProcessed = 0;

this.logger.info("Re-gossiping the cached bls changes");
this.logger.debug("Re-gossiping unsubmitted cached bls changes");
try {
const headState = this.chain.getHeadState();
for (const poolData of this.chain.opPool.getAllBlsToExecutionChanges()) {
Expand All @@ -520,32 +520,34 @@ export class Network implements INetwork {

this.chain.opPool.insertBlsToExecutionChange(value, false);
totalProcessed += 1;
}

// Cleanup in small batches
if (totalProcessed % CACHED_BLS_BATCH_CLEANUP_LIMIT === 0) {
this.logger.info("Gossiped cached blsChanges", {
gossipedIndexes: `${gossipedIndexes}`,
includedIndexes: `${includedIndexes}`,
totalProcessed,
});
gossipedIndexes = [];
includedIndexes = [];
// Cleanup in small batches
if (totalProcessed % CACHED_BLS_BATCH_CLEANUP_LIMIT === 0) {
this.logger.debug("Gossiped cached blsChanges", {
gossipedIndexes: `${gossipedIndexes}`,
includedIndexes: `${includedIndexes}`,
totalProcessed,
});
gossipedIndexes = [];
includedIndexes = [];
}
}
}

// Log any remaining changes
if (totalProcessed % CACHED_BLS_BATCH_CLEANUP_LIMIT !== 0) {
this.logger.info("Gossiped cached blsChanges", {
this.logger.debug("Gossiped cached blsChanges", {
gossipedIndexes: `${gossipedIndexes}`,
includedIndexes: `${includedIndexes}`,
totalProcessed,
});
}
} catch (e) {
this.logger.error("Failed to gossip all cached bls changes", {totalProcessed}, e as Error);
this.logger.error("Failed to gossip unsubmitted cached bls changes", {totalProcessed}, e as Error);
}
if (totalProcessed > 0) {
this.logger.info("Processed unsubmitted blsChanges", {totalProcessed});
}
this.logger.info("Processed cached blsChanges", {totalProcessed});
}

private onLightClientFinalityUpdate = async (finalityUpdate: altair.LightClientFinalityUpdate): Promise<void> => {
Expand Down

0 comments on commit 6f17f9b

Please sign in to comment.