@@ -621,7 +621,7 @@ impl<Env: Environment> Client<Env> {
621621 let certificate = self
622622 . communicate_chain_action ( committee, finalize_action, hashed_value)
623623 . await ?;
624- self . receive_certificate ( certificate. clone ( ) , ReceiveCertificateMode :: AlreadyChecked )
624+ self . receive_certificate_with_checked_signatures ( certificate. clone ( ) )
625625 . await ?;
626626 Ok ( certificate)
627627 }
@@ -735,51 +735,16 @@ impl<Env: Environment> Client<Env> {
735735 Ok ( certificate)
736736 }
737737
738- /// Processes the confirmed block certificate and its ancestors in the local node, then
739- /// updates the validators up to that certificate .
738+ /// Processes the confirmed block certificate in the local node without checking signatures.
739+ /// Also downloads and processes all ancestors that are still missing .
740740 #[ instrument( level = "trace" , skip_all) ]
741- async fn receive_certificate_and_update_validators (
741+ async fn receive_certificate_with_checked_signatures (
742742 & self ,
743743 certificate : ConfirmedBlockCertificate ,
744- mode : ReceiveCertificateMode ,
745- ) -> Result < ( ) , ChainClientError > {
746- let block_chain_id = certificate. block ( ) . header . chain_id ;
747- let block_height = certificate. block ( ) . header . height ;
748-
749- self . receive_certificate ( certificate, mode) . await ?;
750-
751- // Make sure a quorum of validators (according to the chain's new committee) are up-to-date
752- // for data availability.
753- let local_committee = self
754- . chain_info_with_committees ( block_chain_id)
755- . await ?
756- . into_current_committee ( ) ?;
757- self . communicate_chain_updates (
758- & local_committee,
759- block_chain_id,
760- block_height. try_add_one ( ) ?,
761- CrossChainMessageDelivery :: Blocking ,
762- )
763- . await ?;
764- Ok ( ( ) )
765- }
766-
767- /// Processes the confirmed block certificate in the local node. Also downloads and processes
768- /// all ancestors that are still missing.
769- #[ instrument( level = "trace" , skip_all) ]
770- async fn receive_certificate (
771- & self ,
772- certificate : ConfirmedBlockCertificate ,
773- mode : ReceiveCertificateMode ,
774744 ) -> Result < ( ) , ChainClientError > {
775745 let certificate = Box :: new ( certificate) ;
776746 let block = certificate. block ( ) ;
777747
778- // Verify the certificate before doing any expensive networking.
779- let ( max_epoch, committees) = self . admin_committees ( ) . await ?;
780- if let ReceiveCertificateMode :: NeedsCheck = mode {
781- Self :: check_certificate ( max_epoch, & committees, & certificate) ?. into_result ( ) ?;
782- }
783748 // Recover history from the network.
784749 self . download_certificates ( block. header . chain_id , block. header . height )
785750 . await ?;
@@ -3405,24 +3370,6 @@ impl<Env: Environment> ChainClient<Env> {
34053370 self . update_state ( |state| state. clear_pending_proposal ( ) ) ;
34063371 }
34073372
3408- /// Processes a confirmed block for which this chain is a recipient and updates validators.
3409- #[ instrument(
3410- level = "trace" ,
3411- skip( certificate) ,
3412- fields( certificate_hash = ?certificate. hash( ) ) ,
3413- ) ]
3414- pub async fn receive_certificate_and_update_validators (
3415- & self ,
3416- certificate : ConfirmedBlockCertificate ,
3417- ) -> Result < ( ) , ChainClientError > {
3418- self . client
3419- . receive_certificate_and_update_validators (
3420- certificate,
3421- ReceiveCertificateMode :: NeedsCheck ,
3422- )
3423- . await
3424- }
3425-
34263373 /// Rotates the key of the chain.
34273374 ///
34283375 /// Replaces current owners of the chain with the new key pair.
0 commit comments