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:
Luke Parker
2022-10-20 00:21:14 -04:00
parent 6b56510da9
commit ff41e9f031
4 changed files with 38 additions and 16 deletions

View File

@@ -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,
) {