-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix: fix VN merkle root mismatch #220
fix: fix VN merkle root mismatch #220
Conversation
applications/tari_validator_node/src/p2p/proto/conversions/consensus.rs
Outdated
Show resolved
Hide resolved
applications/tari_validator_node/src/p2p/services/epoch_manager/base_layer_epoch_manager.rs
Outdated
Show resolved
Hide resolved
// .map_err(|_| HotStuffError::InvalidQuorumCertificate("invalid merkle proof".to_string()))?; | ||
// } | ||
let validator_node_root = self.epoch_manager.get_validator_node_merkle_root(qc.epoch()).await?; | ||
for md in qc.validators_metadata() { |
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.
Another future optimization: These merkleproofs can be combined into a single merkle proof before the QC is constructed. Then only one validation is needed
// ) | ||
// .map_err(|_| HotStuffError::InvalidQuorumCertificate("invalid merkle proof".to_string()))?; | ||
// } | ||
let validator_node_root = self.epoch_manager.get_validator_node_merkle_root(qc.epoch()).await?; |
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.
This value can also be cached by the epoch manager during scanning
fn sign(&self, challenge: &[u8]) -> Option<Signature> { | ||
let (nonce, public_nonce) = create_key_pair(); | ||
let challenge = Self::create_challenge(&public_nonce, self.node_identity.public_key(), challenge); | ||
let sig = Signature::sign(self.node_identity.secret_key().clone(), nonce, &*challenge).ok()?; |
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.
todo: change to sign_raw when tari_crypto is updated
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.
Yeah I want to update all the tari deps soon
* development: feat: determine leader from payload (tari-project#221)
2fdb0e2
to
fbf6be9
Compare
* development: fix: db error when starting state sync fixes tari-project#225 (tari-project#227) feat: add template name to list templates + minor cleanups (tari-project#226) fix: remove handle new valid transaction check (tari-project#224) fix: vns should not store transactions for shards outside committee range (see issue tari-project#193) (tari-project#206) feat!: add is_mut field to function def (see issue tari-project#213) (tari-project#214) fix: fix VN merkle root mismatch (tari-project#220) feat: determine leader from payload (tari-project#221)
Description
Motivation and Context
Relies on tari-project/tari#4952
Fixes #218
How Has This Been Tested?
Manually
Existing tests updated