Write a DEBUG log entry to make it clear of a BFT node is a validator or not (#6470)

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
This commit is contained in:
Matt Whitehead
2024-01-29 04:51:42 +00:00
committed by GitHub
parent e55569cb90
commit 0f91a674ca

View File

@@ -28,8 +28,14 @@ import org.hyperledger.besu.datatypes.Address;
import java.time.Clock;
import java.util.Collection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** This is the full data set, or context, required for many of the aspects of BFT workflows. */
public class BftFinalState {
private static final Logger LOG = LoggerFactory.getLogger(BftFinalState.class);
private final ValidatorProvider validatorProvider;
private final NodeKey nodeKey;
private final Address localAddress;
@@ -126,7 +132,9 @@ public class BftFinalState {
* @return the boolean
*/
public boolean isLocalNodeValidator() {
return getValidators().contains(localAddress);
final boolean isValidator = getValidators().contains(localAddress);
LOG.debug(isValidator ? "Local node is a validator" : "Local node is a non-validator");
return isValidator;
}
/**