|
|
@ -21,9 +21,14 @@ import org.hyperledger.besu.consensus.qbft.validation.MessageValidatorFactory; |
|
|
|
import org.hyperledger.besu.consensus.qbft.validator.ValidatorModeTransitionLogger; |
|
|
|
import org.hyperledger.besu.consensus.qbft.validator.ValidatorModeTransitionLogger; |
|
|
|
import org.hyperledger.besu.ethereum.core.BlockHeader; |
|
|
|
import org.hyperledger.besu.ethereum.core.BlockHeader; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
|
|
|
|
|
|
|
/** The Qbft block height manager factory. */ |
|
|
|
/** The Qbft block height manager factory. */ |
|
|
|
public class QbftBlockHeightManagerFactory { |
|
|
|
public class QbftBlockHeightManagerFactory { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final Logger LOG = LoggerFactory.getLogger(QbftBlockHeightManagerFactory.class); |
|
|
|
|
|
|
|
|
|
|
|
private final QbftRoundFactory roundFactory; |
|
|
|
private final QbftRoundFactory roundFactory; |
|
|
|
private final BftFinalState finalState; |
|
|
|
private final BftFinalState finalState; |
|
|
|
private final MessageValidatorFactory messageValidatorFactory; |
|
|
|
private final MessageValidatorFactory messageValidatorFactory; |
|
|
@ -62,8 +67,10 @@ public class QbftBlockHeightManagerFactory { |
|
|
|
validatorModeTransitionLogger.logTransitionChange(parentHeader); |
|
|
|
validatorModeTransitionLogger.logTransitionChange(parentHeader); |
|
|
|
|
|
|
|
|
|
|
|
if (finalState.isLocalNodeValidator()) { |
|
|
|
if (finalState.isLocalNodeValidator()) { |
|
|
|
|
|
|
|
LOG.debug("Local node is a validator"); |
|
|
|
return createFullBlockHeightManager(parentHeader); |
|
|
|
return createFullBlockHeightManager(parentHeader); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
LOG.debug("Local node is a non-validator"); |
|
|
|
return createNoOpBlockHeightManager(parentHeader); |
|
|
|
return createNoOpBlockHeightManager(parentHeader); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|