This repository was archived by the owner on Feb 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
Lr/split validation #3495
Merged
Merged
Lr/split validation #3495
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8bf609a
Split validation
lukaszrzasik 1383d7a
Remove byzantine code for now
lukaszrzasik bdd911e
Adjust tests
lukaszrzasik 0df5de2
Fix one more test
lukaszrzasik 20e9397
Change the broadcast event indiciating correclty the High QC has been…
lukaszrzasik 63b5aff
Cleanup
lukaszrzasik 63c5e28
Add more verbose description of the `QuorumProposalValidated` event
lukaszrzasik 9957263
Fix a call to `validate_signature`
lukaszrzasik 3161e3a
Remove an obsolete comment.
lukaszrzasik 419bcfc
Merge branch 'main' into lr/split-validation
lukaszrzasik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -353,7 +353,6 @@ pub async fn validate_proposal_safety_and_liveness<TYPES: NodeType>( | |
| consensus: OuterConsensus<TYPES>, | ||
| decided_upgrade_certificate: Arc<RwLock<Option<UpgradeCertificate<TYPES>>>>, | ||
| quorum_membership: Arc<TYPES::Membership>, | ||
| view_leader_key: TYPES::SignatureKey, | ||
| event_stream: Sender<Arc<HotShotEvent<TYPES>>>, | ||
| sender: TYPES::SignatureKey, | ||
| event_sender: Sender<Event<TYPES>>, | ||
|
|
@@ -397,18 +396,6 @@ pub async fn validate_proposal_safety_and_liveness<TYPES: NodeType>( | |
| ) | ||
| .await; | ||
|
|
||
| // Validate the proposal's signature. This should also catch if the leaf_commitment does not equal our calculated parent commitment | ||
| // | ||
| // There is a mistake here originating in the genesis leaf/qc commit. This should be replaced by: | ||
| // | ||
| // proposal.validate_signature(&quorum_membership)?; | ||
| // | ||
| // in a future PR. | ||
| ensure!( | ||
| view_leader_key.validate(&proposal.signature, proposed_leaf.commit().as_ref()), | ||
| "Could not verify proposal." | ||
| ); | ||
|
|
||
| UpgradeCertificate::validate(&proposal.data.upgrade_certificate, &quorum_membership)?; | ||
|
|
||
| // Validate that the upgrade certificate is re-attached, if we saw one on the parent | ||
|
|
@@ -487,7 +474,6 @@ pub async fn validate_proposal_safety_and_liveness<TYPES: NodeType>( | |
| /// If any validation or view number check fails. | ||
| pub fn validate_proposal_view_and_certs<TYPES: NodeType>( | ||
| proposal: &Proposal<TYPES, QuorumProposal<TYPES>>, | ||
| sender: &TYPES::SignatureKey, | ||
| cur_view: TYPES::Time, | ||
| quorum_membership: &Arc<TYPES::Membership>, | ||
| timeout_membership: &Arc<TYPES::Membership>, | ||
|
|
@@ -500,9 +486,18 @@ pub fn validate_proposal_view_and_certs<TYPES: NodeType>( | |
| ); | ||
|
|
||
| let view_leader_key = quorum_membership.leader(view); | ||
|
|
||
| // Validate the proposal's signature. This should also catch if the leaf_commitment does not equal our calculated parent commitment | ||
| // | ||
| // There is a mistake here originating in the genesis leaf/qc commit. This should be replaced by: | ||
|
||
| // | ||
| // proposal.validate_signature(&quorum_membership)?; | ||
| // | ||
| // in a future PR. | ||
| let proposed_leaf = Leaf::from_quorum_proposal(&proposal.data); | ||
| ensure!( | ||
| view_leader_key == *sender, | ||
| "Leader key does not match key in proposal" | ||
| view_leader_key.validate(&proposal.signature, proposed_leaf.commit().as_ref()), | ||
|
||
| "Could not verify proposal's signature." | ||
| ); | ||
|
|
||
| // Verify a timeout certificate OR a view sync certificate exists and is valid. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it'd be helpful to elucidate how this event is different from the
QuorumProposalValidatedevent? Unfortunately, it looks like theQuorumProposalValidatedevent's doc comment doesn't give much information right now, so an unfamiliar reader might not be able to trivially differentiate the two events without tracing the validation paths. We could also update the validated event as well with a more descriptive doc comment.