use of org.hyperledger.besu.consensus.ibft.payload.ProposalPayload in project besu by hyperledger.
the class RoundChangePayloadValidator method validatePrepareCertificate.
private boolean validatePrepareCertificate(final PreparedCertificate certificate, final ConsensusRoundIdentifier roundChangeTarget) {
final SignedData<ProposalPayload> proposalMessage = certificate.getProposalPayload();
final ConsensusRoundIdentifier proposalRoundIdentifier = proposalMessage.getPayload().getRoundIdentifier();
if (!validatePreparedCertificateRound(proposalRoundIdentifier, roundChangeTarget)) {
return false;
}
final SignedDataValidator signedDataValidator = messageValidatorFactory.createAt(proposalRoundIdentifier);
return validateConsistencyOfPrepareCertificateMessages(certificate, signedDataValidator);
}
use of org.hyperledger.besu.consensus.ibft.payload.ProposalPayload in project besu by hyperledger.
the class SignedDataValidator method handleSubsequentProposal.
private boolean handleSubsequentProposal(final SignedData<ProposalPayload> existingMsg, final SignedData<ProposalPayload> newMsg) {
if (!existingMsg.getAuthor().equals(newMsg.getAuthor())) {
LOG.info("Received subsequent invalid Proposal message; sender differs from original.");
return false;
}
final ProposalPayload existingData = existingMsg.getPayload();
final ProposalPayload newData = newMsg.getPayload();
if (!proposalMessagesAreIdentical(existingData, newData)) {
LOG.info("Received subsequent invalid Proposal message; content differs from original.");
return false;
}
return true;
}
use of org.hyperledger.besu.consensus.ibft.payload.ProposalPayload in project besu by hyperledger.
the class Proposal method decode.
public static Proposal decode(final Bytes data) {
final RLPInput rlpIn = RLP.input(data);
rlpIn.enterList();
final SignedData<ProposalPayload> payload = PayloadDeserializers.readSignedProposalPayloadFrom(rlpIn);
final Block proposedBlock = Block.readFrom(rlpIn, BftBlockHeaderFunctions.forCommittedSeal(BFT_EXTRA_DATA_ENCODER));
final Optional<RoundChangeCertificate> roundChangeCertificate = readRoundChangeCertificate(rlpIn);
rlpIn.leaveList();
return new Proposal(payload, proposedBlock, roundChangeCertificate);
}
Aggregations