async fn pre_process_proposal(&mut self, proposal_msg: ProposalMsg<T>) -> Option<Block<T>> {
        trace_event!("round_manager::pre_process_proposal", {"block", proposal_msg.proposal().id()});
        // RoundState is going to be updated with all the proposal certificates later,
        // but it's known that the round_state's round is not going to decrease so we can already
        // filter out the proposals from old rounds.
        let current_round = self.round_state.current_round();
        if proposal_msg.round() < current_round {
            return None;
        }
        if self
            .proposer_election
            .is_valid_proposer(proposal_msg.proposer(), proposal_msg.round())
            .is_none()
        {
            warn!(
                "Proposer {} for block {} is not a valid proposer for this round",
                proposal_msg.proposer(),
                proposal_msg.proposal()
            );
            return None;
        }
        if let Err(e) = self
            .sync_up(proposal_msg.sync_info(), proposal_msg.proposer(), true)
            .await
        {
            warn!(
                "Dependencies of proposal {} could not be added to the block store: {}",
                proposal_msg, e
            );
            return None;
        }

        // round_state may catch up with the SyncInfo, check again
        let current_round = self.round_state.current_round();
        if proposal_msg.round() != current_round {
            return None;
        }

        self.proposer_election
            .process_proposal(proposal_msg.take_proposal())
    }
/// The function is responsible for processing the incoming proposals and the Quorum
/// Certificate.
/// 1. sync up to the SyncInfo including committing to the committed state the HCC carries
/// and fetch all the blocks from the committed state to the HQC
/// 2. forwarding the proposals to the ProposerElection queue,
/// which is going to eventually trigger one winning proposal per round
The function is responsible for processing the incoming proposals and the Quorum
Certificate.
1. sync up to the SyncInfo including committing to the committed state the HCC carries
and fetch all the blocks from the committed state to the HQC
2. forwarding the proposals to the ProposerElection queue,
which is going to eventually trigger one winning proposal per round
The function is responsible for processing the incoming proposals and the Quorum Certificate . 1 . sync up to the SyncInfo including committing to the committed state the HCC carries and fetch all the blocks from the committed state to the HQC 2 . forwarding the proposals to the ProposerElection queue which is going to eventually trigger one winning proposal per round
async fn pre_process_proposal(&mut self, proposal_msg: ProposalMsg<T>) -> Option<Block<T>> {
        trace_event!("round_manager::pre_process_proposal", {"block", proposal_msg.proposal().id()});
        // RoundState is going to be updated with all the proposal certificates later,
        // but it's known that the round_state's round is not going to decrease so we can already
        // filter out the proposals from old rounds.
        let current_round = self.round_state.current_round();
        if proposal_msg.round() < current_round {
            return None;
        }
        if self
            .proposer_election
            .is_valid_proposer(proposal_msg.proposer(), proposal_msg.round())
            .is_none()
        {
            warn!(
                "Proposer {} for block {} is not a valid proposer for this round",
                proposal_msg.proposer(),
                proposal_msg.proposal()
            );
            return None;
        }
        if let Err(e) = self
            .sync_up(proposal_msg.sync_info(), proposal_msg.proposer(), true)
            .await
        {
            warn!(
                "Dependencies of proposal {} could not be added to the block store: {}",
                proposal_msg, e
            );
            return None;
        }
        // round_state may catch up with the SyncInfo, check again
        let current_round = self.round_state.current_round();
        if proposal_msg.round() != current_round {
            return None;
        }
        self.proposer_election
            .process_proposal(proposal_msg.take_proposal())
    }
async fn pre_process_proposal ( & mut self , proposal_msg : ProposalMsg < T > ) -> Option < Block < T > > { trace_event ! ( " " { " " proposal_msg proposal ( ) id ( ) } ) ; // RoundState is going to be updated with all the proposal certificates later, // but it's known that the round_state's round is not going to decrease so we can already // filter out the proposals from old rounds. let current_round = self . round_state . current_round ( ) ; if proposal_msg . round ( ) < current_round { return None ; } if self . proposer_election . is_valid_proposer ( proposal_msg . proposer ( ) , proposal_msg . round ( ) ) . is_none ( ) { warn ! ( " " proposal_msg proposer ( ) proposal_msg proposal ( ) ) ; return None ; } if let Err ( e ) = self . sync_up ( proposal_msg . sync_info ( ) , proposal_msg . proposer ( ) , true ) . await { warn ! ( " " proposal_msg e ) ; return None ; } // round_state may catch up with the SyncInfo, check again let current_round = self . round_state . current_round ( ) ; if proposal_msg . round ( ) != current_round { return None ; } self . proposer_election . process_proposal ( proposal_msg . take_proposal ( ) ) }
The function is responsible for processing the incoming proposals and the Quorum
Certificate.
The function is responsible for processing the incoming proposals and the Quorum Certificate .
&mut self
proposal_msg
ProposalMsg<T>
&mut self
proposal_msg
ProposalMsg<T>