Replace Tendermint step with sync_block

Step moved a step forward after an externally synced/added block. This created
a race condition to add the block between the sync process and the Tendermint
machine. Now that the block routes through Tendermint, there is no such race
condition.
This commit is contained in:
Luke Parker
2023-04-13 18:18:29 -04:00
parent 9bea368d36
commit 5858b6c03e
3 changed files with 43 additions and 22 deletions

View File

@@ -117,9 +117,10 @@ impl<S: SignatureScheme> SignatureScheme for Arc<S> {
}
}
/// A commit for a specific block. The list of validators have weight exceeding the threshold for
/// a valid commit.
#[derive(Clone, PartialEq, Debug, Encode, Decode)]
/// A commit for a specific block.
///
/// The list of validators have weight exceeding the threshold for a valid commit.
#[derive(PartialEq, Debug, Encode, Decode)]
pub struct Commit<S: SignatureScheme> {
/// End time of the round which created this commit, used as the start time of the next block.
pub end_time: u64,
@@ -129,6 +130,16 @@ pub struct Commit<S: SignatureScheme> {
pub signature: S::AggregateSignature,
}
impl<S: SignatureScheme> Clone for Commit<S> {
fn clone(&self) -> Self {
Self {
end_time: self.end_time,
validators: self.validators.clone(),
signature: self.signature.clone(),
}
}
}
/// Weights for the validators present.
pub trait Weights: Send + Sync {
type ValidatorId: ValidatorId;