mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-10 13:09:24 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user