diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetLogs.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetLogs.java index 7561191adfc..506aa7549e7 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetLogs.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetLogs.java @@ -53,6 +53,7 @@ public String getName() { @Override public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { final FilterParameter filter = requestContext.getRequiredParameter(0, FilterParameter.class); + LOG.atTrace().setMessage("eth_getLogs FilterParameter: {}").addArgument(filter).log(); if (!filter.isValid()) { return new JsonRpcErrorResponse( diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/GetBodiesFromPeerTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/GetBodiesFromPeerTask.java index c5a2d1b727a..bd6045e0ea4 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/GetBodiesFromPeerTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/GetBodiesFromPeerTask.java @@ -84,6 +84,11 @@ public static GetBodiesFromPeerTask forHeaders( protected PendingPeerRequest sendRequest() { final List blockHashes = headers.stream().map(BlockHeader::getHash).collect(Collectors.toList()); + LOG.atTrace() + .setMessage("Requesting {} bodies with hashes {}.") + .addArgument(blockHashes.size()) + .addArgument(blockHashes) + .log(); final long minimumRequiredBlockNumber = headers.get(headers.size() - 1).getNumber(); return sendRequestToPeer( @@ -106,6 +111,11 @@ protected Optional> processResponse( final BlockBodiesMessage bodiesMessage = BlockBodiesMessage.readFrom(message); final List bodies = bodiesMessage.bodies(protocolSchedule); + LOG.atTrace() + .setMessage("Received {} bodies: {}") + .addArgument(bodies.size()) + .addArgument(bodies) + .log(); if (bodies.size() == 0) { // Message contains no data - nothing to do LOG.debug("Message contains no data. Peer: {}", peer); @@ -128,6 +138,13 @@ protected Optional> processResponse( // Clear processed headers headers.clear(); } + LOG.atDebug() + .setMessage("Associated {} bodies with {} headers to get {} blocks with these hashes: {}") + .addArgument(bodies.size()) + .addArgument(headers.size()) + .addArgument(blocks.size()) + .addArgument(blocks.stream().map(Block::getHash).collect(Collectors.toList())) + .log(); return Optional.of(blocks); } diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetHeadersEndingAtFromPeerByHashTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetHeadersEndingAtFromPeerByHashTask.java index e467bfba119..5b5b0cef359 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetHeadersEndingAtFromPeerByHashTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/RetryingGetHeadersEndingAtFromPeerByHashTask.java @@ -92,8 +92,8 @@ protected CompletableFuture> executeTaskOnCurrentPeer( return executeSubTask(task::run) .thenApply( peerResult -> { - LOG.debug( - "Get {} block headers by hash {} from peer {} has result {}", + LOG.trace( + "Got {} block headers by hash {} from peer {} has result {}", count, referenceHash, currentPeer, diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContext.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContext.java index bc618e7c133..3fedf5ee1d2 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContext.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContext.java @@ -102,6 +102,7 @@ public synchronized boolean isSyncing() { } public synchronized void updateHead(final Hash headHash) { + LOG.atTrace().setMessage("Maybe update maybeHead to {}").addArgument(headHash).log(); if (Hash.ZERO.equals(headHash)) { maybeHead = Optional.empty(); } else { @@ -331,6 +332,11 @@ protected Void saveBlock(final Block block) { @VisibleForTesting protected void possiblyMoveHead(final Block lastSavedBlock) { final MutableBlockchain blockchain = getProtocolContext().getBlockchain(); + LOG.atTrace() + .setMessage("possibleMoveHead(lastSavedBlock={}); maybeHead={}") + .addArgument(Optional.ofNullable(lastSavedBlock).map(Block::toLogString).orElse("null")) + .addArgument(maybeHead) + .log(); if (maybeHead.isEmpty()) { LOG.debug("Nothing to do with the head"); return;