|
4 | 4 |
|
5 | 5 | use crate::{ |
6 | 6 | payload::{OptBatches, OptQuorumStorePayload, PayloadExecutionLimit, TxnAndGasLimits}, |
7 | | - proof_of_store::{BatchInfo, ProofCache, ProofOfStore}, |
| 7 | + proof_of_store::{BatchInfo, BatchInfoExt, ProofCache, ProofOfStore, TBatchInfo}, |
8 | 8 | }; |
9 | 9 | use anyhow::ensure; |
10 | 10 | use aptos_crypto::{ |
@@ -518,13 +518,13 @@ impl Payload { |
518 | 518 | fn verify_with_cache( |
519 | 519 | proofs: &[ProofOfStore<BatchInfo>], |
520 | 520 | validator: &ValidatorVerifier, |
521 | | - proof_cache: &ProofCache<BatchInfo>, |
| 521 | + proof_cache: &ProofCache, |
522 | 522 | ) -> anyhow::Result<()> { |
523 | 523 | let unverified: Vec<_> = proofs |
524 | 524 | .iter() |
525 | 525 | .filter(|proof| { |
526 | 526 | proof_cache |
527 | | - .get(proof.info()) |
| 527 | + .get(&BatchInfoExt::from(proof.info().clone())) |
528 | 528 | .is_none_or(|cached_proof| cached_proof != *proof.multi_signature()) |
529 | 529 | }) |
530 | 530 | .collect(); |
@@ -571,7 +571,7 @@ impl Payload { |
571 | 571 | pub fn verify( |
572 | 572 | &self, |
573 | 573 | verifier: &ValidatorVerifier, |
574 | | - proof_cache: &ProofCache<BatchInfo>, |
| 574 | + proof_cache: &ProofCache, |
575 | 575 | quorum_store_enabled: bool, |
576 | 576 | ) -> anyhow::Result<()> { |
577 | 577 | match (quorum_store_enabled, self) { |
@@ -741,7 +741,7 @@ impl BatchPayload { |
741 | 741 | #[derive(Deserialize, Serialize, Clone, Debug, PartialEq, Eq)] |
742 | 742 | pub enum PayloadFilter { |
743 | 743 | DirectMempool(Vec<TransactionSummary>), |
744 | | - InQuorumStore(HashSet<BatchInfo>), |
| 744 | + InQuorumStore(HashSet<BatchInfoExt>), |
745 | 745 | Empty, |
746 | 746 | } |
747 | 747 |
|
@@ -772,35 +772,35 @@ impl From<&Vec<&Payload>> for PayloadFilter { |
772 | 772 | match payload { |
773 | 773 | Payload::InQuorumStore(proof_with_status) => { |
774 | 774 | for proof in &proof_with_status.proofs { |
775 | | - exclude_batches.insert(proof.info().clone()); |
| 775 | + exclude_batches.insert(proof.info().clone().into()); |
776 | 776 | } |
777 | 777 | }, |
778 | 778 | Payload::InQuorumStoreWithLimit(proof_with_status) => { |
779 | 779 | for proof in &proof_with_status.proof_with_data.proofs { |
780 | | - exclude_batches.insert(proof.info().clone()); |
| 780 | + exclude_batches.insert(proof.info().clone().into()); |
781 | 781 | } |
782 | 782 | }, |
783 | 783 | Payload::QuorumStoreInlineHybrid(inline_batches, proof_with_data, _) |
784 | 784 | | Payload::QuorumStoreInlineHybridV2(inline_batches, proof_with_data, _) => { |
785 | 785 | for proof in &proof_with_data.proofs { |
786 | | - exclude_batches.insert(proof.info().clone()); |
| 786 | + exclude_batches.insert(proof.info().clone().into()); |
787 | 787 | } |
788 | 788 | for (batch_info, _) in inline_batches { |
789 | | - exclude_batches.insert(batch_info.clone()); |
| 789 | + exclude_batches.insert(batch_info.clone().into()); |
790 | 790 | } |
791 | 791 | }, |
792 | 792 | Payload::DirectMempool(_) => { |
793 | 793 | error!("DirectMempool payload in InQuorumStore filter"); |
794 | 794 | }, |
795 | 795 | Payload::OptQuorumStore(opt_qs_payload) => { |
796 | 796 | for batch in opt_qs_payload.inline_batches().iter() { |
797 | | - exclude_batches.insert(batch.info().clone()); |
| 797 | + exclude_batches.insert(batch.info().clone().into()); |
798 | 798 | } |
799 | 799 | for batch_info in &opt_qs_payload.opt_batches().batch_summary { |
800 | | - exclude_batches.insert(batch_info.clone()); |
| 800 | + exclude_batches.insert(batch_info.clone().into()); |
801 | 801 | } |
802 | 802 | for proof in &opt_qs_payload.proof_with_data().batch_summary { |
803 | | - exclude_batches.insert(proof.info().clone()); |
| 803 | + exclude_batches.insert(proof.info().clone().into()); |
804 | 804 | } |
805 | 805 | }, |
806 | 806 | } |
|
0 commit comments