Search in sources :

Example 1 with BftExtraDataCodec

use of org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec in project besu by hyperledger.

the class MessageValidatorFactory method createMessageValidator.

public MessageValidator createMessageValidator(final ConsensusRoundIdentifier roundIdentifier, final BlockHeader parentHeader) {
    final BlockValidator blockValidator = protocolSchedule.getByBlockNumber(roundIdentifier.getSequenceNumber()).getBlockValidator();
    final Collection<Address> validators = getValidatorsAfterBlock(parentHeader);
    final BftBlockInterface bftBlockInterface = protocolContext.getConsensusContext(BftContext.class).getBlockInterface();
    return new MessageValidator(createSignedDataValidator(roundIdentifier, parentHeader), new ProposalBlockConsistencyValidator(), blockValidator, protocolContext, new RoundChangeCertificateValidator(validators, (ri) -> createSignedDataValidator(ri, parentHeader), roundIdentifier.getSequenceNumber(), bftExtraDataCodec, bftBlockInterface));
}
Also used : BftBlockInterface(org.hyperledger.besu.consensus.common.bft.BftBlockInterface) ProtocolSchedule(org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule) BftContext(org.hyperledger.besu.consensus.common.bft.BftContext) ConsensusRoundIdentifier(org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier) ProposerSelector(org.hyperledger.besu.consensus.common.bft.blockcreation.ProposerSelector) BlockHeader(org.hyperledger.besu.ethereum.core.BlockHeader) Collection(java.util.Collection) BftBlockInterface(org.hyperledger.besu.consensus.common.bft.BftBlockInterface) ProtocolContext(org.hyperledger.besu.ethereum.ProtocolContext) BftHelpers(org.hyperledger.besu.consensus.common.bft.BftHelpers) BftExtraDataCodec(org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec) Address(org.hyperledger.besu.datatypes.Address) BlockValidator(org.hyperledger.besu.ethereum.BlockValidator) Address(org.hyperledger.besu.datatypes.Address) BftContext(org.hyperledger.besu.consensus.common.bft.BftContext) BlockValidator(org.hyperledger.besu.ethereum.BlockValidator)

Aggregations

Collection (java.util.Collection)1 BftBlockInterface (org.hyperledger.besu.consensus.common.bft.BftBlockInterface)1 BftContext (org.hyperledger.besu.consensus.common.bft.BftContext)1 BftExtraDataCodec (org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec)1 BftHelpers (org.hyperledger.besu.consensus.common.bft.BftHelpers)1 ConsensusRoundIdentifier (org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier)1 ProposerSelector (org.hyperledger.besu.consensus.common.bft.blockcreation.ProposerSelector)1 Address (org.hyperledger.besu.datatypes.Address)1 BlockValidator (org.hyperledger.besu.ethereum.BlockValidator)1 ProtocolContext (org.hyperledger.besu.ethereum.ProtocolContext)1 BlockHeader (org.hyperledger.besu.ethereum.core.BlockHeader)1 ProtocolSchedule (org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule)1