Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimistic signature verification for commit votes #14643

Merged
merged 63 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
c906718
Deprecate delayed QC aggregate msg
vusirikala Sep 15, 2024
c4c2cdd
Ledger info with mixed signatures
vusirikala Sep 15, 2024
08f45c9
Minor change
vusirikala Sep 15, 2024
1e85a83
Optimistic signature verification for votes and order votes
vusirikala Sep 15, 2024
02d34f3
Optimistic signature verification for commit votes
vusirikala Sep 15, 2024
8d197db
Resetting minor changes
vusirikala Sep 15, 2024
9a43029
Resetting minor changes
vusirikala Sep 15, 2024
2237342
Minor change
vusirikala Sep 15, 2024
32d5633
Addressing PR comments
vusirikala Sep 17, 2024
1df442b
Addressing PR comments
vusirikala Sep 17, 2024
6fce605
Merge branch 'satya/ledger_info_with_mixed_signatures' into satya/osv…
vusirikala Sep 17, 2024
1e3b58d
Addressing PR comments
vusirikala Sep 17, 2024
f87fb36
Addressing PR comments
vusirikala Sep 17, 2024
ef96325
Merge branch 'satya/osv_votes_and_order_votes' into satya/osv_commit_…
vusirikala Sep 17, 2024
637311b
Addressing PR comments
vusirikala Sep 17, 2024
e744449
Addressing PR comments
vusirikala Sep 18, 2024
cd56587
Addressing PR comments
vusirikala Sep 18, 2024
16370eb
Addressing PR comments
vusirikala Sep 18, 2024
a7b5e82
Minor changes
vusirikala Sep 18, 2024
2e46bb3
Minor change
vusirikala Sep 18, 2024
a2ebb6c
Merge branch 'main' into satya/ledger_info_with_mixed_signatures
vusirikala Sep 18, 2024
065d760
Changing names
vusirikala Sep 18, 2024
5ed8ad5
Addressing PR comments
vusirikala Sep 19, 2024
3be24e2
Merge branch 'satya/ledger_info_with_mixed_signatures' into satya/osv…
vusirikala Sep 19, 2024
541d58d
comments
Sep 21, 2024
20cdb9c
Fixing typos
vusirikala Sep 23, 2024
ffb1e22
Rust lint
vusirikala Sep 23, 2024
fb72780
Changed to VerificationStatus
vusirikala Sep 23, 2024
5f8f183
Merge branch 'satya/ledger_info_with_mixed_signatures' into satya/osv…
vusirikala Sep 23, 2024
25e9031
Fixing errors with rebasing
vusirikala Sep 23, 2024
0435020
Merge branch 'satya/osv_votes_and_order_votes' into satya/osv_commit_…
vusirikala Sep 23, 2024
66dcf61
Fixing errors with rebase
vusirikala Sep 23, 2024
85c7051
Using signature with status
vusirikala Sep 24, 2024
c78c06a
Minor fixes
vusirikala Sep 24, 2024
97af917
Minor comments
vusirikala Sep 24, 2024
c441175
Adding more tests
vusirikala Sep 24, 2024
7275380
Add smoke test
vusirikala Sep 25, 2024
07cb130
Change failpoint names
vusirikala Sep 25, 2024
d5d4381
Use AtomicBool
vusirikala Sep 26, 2024
beb0f7d
Using vector instead of partialsignatures
vusirikala Sep 26, 2024
bf385f9
Use single flag
vusirikala Sep 26, 2024
7a9cce3
Moving optimistic_signature_verification from epoch manager to vote a…
vusirikala Sep 26, 2024
3ecabd7
Merge branch 'main' into satya/osv_votes_and_order_votes
vusirikala Sep 26, 2024
f34cfe9
Fixing errors with rebase
vusirikala Sep 26, 2024
15fe76d
Move optimistic signature verification to validator verifier
vusirikala Sep 30, 2024
ddc6e93
Move more code to validator verifier
vusirikala Sep 30, 2024
ce2cb9b
Minor comment
vusirikala Sep 30, 2024
9b1bd38
Minor changes
vusirikala Sep 30, 2024
edd23b8
Addressing PR comments
vusirikala Oct 1, 2024
c611001
Merge branch 'main' into satya/osv_votes_and_order_votes
vusirikala Oct 2, 2024
b8928f1
Merge branch 'main' into satya/osv_votes_and_order_votes
vusirikala Oct 3, 2024
abd1e32
Rebasing
vusirikala Oct 3, 2024
c79012e
Addressing PR comments
vusirikala Oct 4, 2024
d030c93
Disabling the flag
vusirikala Oct 4, 2024
83ff41a
Merge branch 'satya/osv_votes_and_order_votes' into satya/osv_commit_…
vusirikala Oct 7, 2024
dbcb533
Rebasing and making appropriate changes
vusirikala Oct 7, 2024
3a9a38c
Minor changes
vusirikala Oct 7, 2024
a7465e4
Add smoke test
vusirikala Oct 7, 2024
4c862bd
Enable flag
vusirikala Oct 7, 2024
d0a056d
Merge branch 'main' into satya/osv_commit_votes
vusirikala Oct 8, 2024
592c51d
Minor fix
vusirikala Oct 9, 2024
5a8269d
Add a unit test
vusirikala Oct 9, 2024
a3ba6dc
Added another unit test
vusirikala Oct 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions consensus/consensus-types/src/pipeline/commit_vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use anyhow::Context;
use aptos_crypto::{bls12381, CryptoMaterialError};
use aptos_short_hex_str::AsShortHexStr;
use aptos_types::{
block_info::BlockInfo, ledger_info::LedgerInfo, validator_signer::ValidatorSigner,
block_info::BlockInfo,
ledger_info::{LedgerInfo, SignatureWithStatus},
validator_signer::ValidatorSigner,
validator_verifier::ValidatorVerifier,
};
use serde::{Deserialize, Serialize};
Expand All @@ -17,7 +19,8 @@ use std::fmt::{Debug, Display, Formatter};
pub struct CommitVote {
author: Author,
ledger_info: LedgerInfo,
signature: bls12381::Signature,
/// Signature on the LedgerInfo along with a status on whether the signature is verified.
signature: SignatureWithStatus,
}

// this is required by structured log
Expand Down Expand Up @@ -62,7 +65,7 @@ impl CommitVote {
Self {
author,
ledger_info,
signature,
signature: SignatureWithStatus::from(signature),
}
}

Expand All @@ -78,6 +81,13 @@ impl CommitVote {

/// Return the signature of the vote
pub fn signature(&self) -> &bls12381::Signature {
self.signature.signature()
}

/// Returns the signature along with the verification status of the signature.
// Note: SignatureWithStatus has interior mutability for verification status.
// Need to make sure the verification status is set to true only the verification is successful.
pub fn signature_with_status(&self) -> &SignatureWithStatus {
&self.signature
}

Expand All @@ -93,7 +103,7 @@ impl CommitVote {
/// and then verifies the signature.
pub fn verify(&self, validator: &ValidatorVerifier) -> anyhow::Result<()> {
validator
.verify(self.author(), &self.ledger_info, &self.signature)
.optimistic_verify(self.author(), &self.ledger_info, &self.signature)
.context("Failed to verify Commit Vote")
}

Expand Down
Loading
Loading