mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-10 05:09:22 +00:00
Correct timing issues
1) Commit didn't include the round, leaving the clock in question. 2) Machines started with a local time, instead of a proper start time. 3) Machines immediately started the next block instead of waiting for the block time.
This commit is contained in:
@@ -3,7 +3,7 @@ use std::sync::Arc;
|
||||
|
||||
use parity_scale_codec::{Encode, Decode};
|
||||
|
||||
use crate::SignedMessage;
|
||||
use crate::{SignedMessage, commit_msg};
|
||||
|
||||
/// An alias for a series of traits required for a type to be usable as a validator ID,
|
||||
/// automatically implemented for all types satisfying those traits.
|
||||
@@ -64,6 +64,8 @@ pub trait SignatureScheme: Send + Sync {
|
||||
/// a valid commit.
|
||||
#[derive(Clone, PartialEq, Debug, Encode, Decode)]
|
||||
pub struct Commit<S: SignatureScheme> {
|
||||
/// Round which created this commit.
|
||||
pub round: Round,
|
||||
/// Validators participating in the signature.
|
||||
pub validators: Vec<S::ValidatorId>,
|
||||
/// Aggregate signature.
|
||||
@@ -140,7 +142,7 @@ pub trait Network: Send + Sync {
|
||||
commit: &Commit<Self::SignatureScheme>,
|
||||
) -> bool {
|
||||
if !self.signature_scheme().verify_aggregate(
|
||||
&id.encode(),
|
||||
&commit_msg(commit.round, id.as_ref()),
|
||||
&commit.validators,
|
||||
&commit.signature,
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user