async fn process_proposed_block(&mut self, proposal: Block<T>) {
        debug!("RoundManager: process_proposed_block {}", proposal);

        if let Some(time_to_receival) =
            duration_since_epoch().checked_sub(Duration::from_micros(proposal.timestamp_usecs()))
        {
            counters::CREATION_TO_RECEIVAL_S.observe_duration(time_to_receival);
        }

        let proposal_round = proposal.round();

        let vote = match self.execute_and_vote(proposal).await {
            Err(e) => {
                warn!("{:?}", e);
                return;
            }
            Ok(vote) => vote,
        };

        let recipients = self
            .proposer_election
            .get_valid_proposers(proposal_round + 1);
        debug!("{}Voted: {} {}", Fg(Green), Fg(Reset), vote);

        self.round_state.record_vote(vote.clone());
        let vote_msg = VoteMsg::new(vote, self.block_store.sync_info());
        self.network.send_vote(vote_msg, recipients).await;
    }
/// This function processes a proposal that was chosen as a representative of its round:
/// 1. Add it to a block store.
/// 2. Try to vote for it following the safety rules.
/// 3. In case a validator chooses to vote, send the vote to the representatives at the next
/// position.
This function processes a proposal that was chosen as a representative of its round:
1. Add it to a block store.
2. Try to vote for it following the safety rules.
3. In case a validator chooses to vote, send the vote to the representatives at the next
position.
This function processes a proposal that was chosen as a representative of its round : 1 . Add it to a block store . 2 . Try to vote for it following the safety rules . 3 . In case a validator chooses to vote send the vote to the representatives at the next position .
async fn process_proposed_block(&mut self, proposal: Block<T>) {
        debug!("RoundManager: process_proposed_block {}", proposal);
        if let Some(time_to_receival) =
            duration_since_epoch().checked_sub(Duration::from_micros(proposal.timestamp_usecs()))
        {
            counters::CREATION_TO_RECEIVAL_S.observe_duration(time_to_receival);
        }
        let proposal_round = proposal.round();
        let vote = match self.execute_and_vote(proposal).await {
            Err(e) => {
                warn!("{:?}", e);
                return;
            }
            Ok(vote) => vote,
        };
        let recipients = self
            .proposer_election
            .get_valid_proposers(proposal_round + 1);
        debug!("{}Voted: {} {}", Fg(Green), Fg(Reset), vote);
        self.round_state.record_vote(vote.clone());
        let vote_msg = VoteMsg::new(vote, self.block_store.sync_info());
        self.network.send_vote(vote_msg, recipients).await;
    }
async fn process_proposed_block ( & mut self , proposal : Block < T > ) { debug ! ( " " proposal ) ; if let Some ( time_to_receival ) = duration_since_epoch ( ) . checked_sub ( Duration :: from_micros ( proposal . timestamp_usecs ( ) ) ) { counters :: CREATION_TO_RECEIVAL_S . observe_duration ( time_to_receival ) ; } let proposal_round = proposal . round ( ) ; let vote = match self . execute_and_vote ( proposal ) . await { Err ( e ) => { warn ! ( " " e ) ; return ; } Ok ( vote ) => vote , } ; let recipients = self . proposer_election . get_valid_proposers ( proposal_round + 1 ) ; debug ! ( " " Fg ( Green ) Fg ( Reset ) vote ) ; self . round_state . record_vote ( vote . clone ( ) ) ; let vote_msg = VoteMsg :: new ( vote , self . block_store . sync_info ( ) ) ; self . network . send_vote ( vote_msg , recipients ) . await ; }
This function processes a proposal that was chosen as a representative of its round:
1.
This function processes a proposal that was chosen as a representative of its round : 1 .
&mut self
proposal
Block<T>
&mut self
proposal
Block<T>