Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
5d3dce1
First definition for pair public keys
drskalman Aug 3, 2023
be890d4
Two example of implementation of pair for demonestration
drskalman Aug 3, 2023
fb6a018
- implement paired crypto `Public` as tuple of two `Public`s - unsuce…
drskalman Aug 14, 2023
62ef8b1
keep both public key object and their continous serialization in pair…
drskalman Aug 21, 2023
8d4e523
implement PassBy and From<Pair> for paired_crypto
drskalman Aug 21, 2023
eea74e2
implement rest of aux traits for `paired_crypto::Public` implement so…
drskalman Aug 22, 2023
f407d87
Attempt to implement trait `Pair` for `pair_cyrpto::Pair`
drskalman Aug 29, 2023
2606cc4
- Implement trait `Pair` for `paired_crypto::Pair` - Implement a pair…
drskalman Aug 31, 2023
00933da
implement sgin and verify for
drskalman Sep 5, 2023
e7719ab
Actually implementing `paired_crypto::{Pair, Public, Signatrue}` for …
drskalman Sep 10, 2023
7a9b677
Implement and pass all test for `paired_crypto`
drskalman Sep 11, 2023
a01a814
- move to signle seed for both schemes in `primitives/core/src/paired…
drskalman Sep 25, 2023
7c02658
replace `hex!` → `array_bytes::hex2xx`
drskalman Sep 25, 2023
7f8d958
Apply suggestions from `paired_crypto` code review on type nam, hash …
drskalman Oct 5, 2023
eef2cec
Do not panic in `paired::Signature::try_from`
drskalman Oct 5, 2023
efb215f
Remove `DoublePair` trait.
drskalman Oct 5, 2023
65584bd
Do not empty implement `paired::Pair`
drskalman Oct 5, 2023
e047f75
Use `paired_crypto::Seed` instead of `[u8; SECURE_SEED_LEN]`
drskalman Oct 5, 2023
c12b82e
use `ecdsa::PUBLIC_KEY_SERIALIZED_SIZE` and `ecdsa::SIGNATURE_SERIALI…
drskalman Oct 5, 2023
dba854a
Remove `paired::DoublePair` impl as well
drskalman Oct 5, 2023
5182c86
- Implement `BytesArray` for both ecdsa and bls Signatures
drskalman Oct 5, 2023
17d0077
Implement encode_and_decode_(public_key/signature)_works test for pai…
drskalman Oct 5, 2023
a740589
cargo fmt
drskalman Oct 5, 2023
79f25e9
- Implement RuntimeAppCrypto and necessery hostApi for ecdsa_bls377 c…
drskalman Oct 6, 2023
489522f
cargo fmt
drskalman Oct 6, 2023
05e08b3
make BEEFY Keystore and Worker generic over AuthorityId
drskalman Oct 8, 2023
0541cb0
Fix `BeefyAuthorityId::verify` for `ecdsa_bls_crypto` not to use `ecd…
drskalman Oct 27, 2023
099b86d
Fix comment in `primitives/consensus/beefy/src/lib.rs`
drskalman Oct 27, 2023
033ff57
- implement `sign/verify_with_hasher` for `ecdsa_bls377` `Pair` with …
drskalman Oct 31, 2023
76831b7
Fix typos and improve comment quality
drskalman Nov 1, 2023
a0c6d83
Add ecdsa_bls377_sign_with_keccak256 to the keystore
drskalman Nov 2, 2023
102ad62
add and implement `ecdsa_bls377_sign_with_keccak256`
drskalman Nov 3, 2023
25d1afc
- Make BEEFY Keyring to be generic over `AuthorityId`.
drskalman Nov 9, 2023
05a3ebd
Merge remote-tracking branch 'origin/master' into skalman--beefy-clie…
drskalman Nov 9, 2023
c860dd0
Improve documention and comments
drskalman Nov 9, 2023
8958fde
Remove unused SimpleKeyPair Trait
drskalman Nov 9, 2023
5ef71c8
Merge branch 'skalman--fix-ecdsa-bls-verify-in-beefy-primitives' of h…
drskalman Nov 13, 2023
3b8eded
add reasoning on why in BEEFY we want the ECDSA signature on Keccak …
drskalman Nov 13, 2023
efb350d
Merge branch 'master' into skalman--fix-ecdsa-bls-verify-in-beefy-pri…
drskalman Nov 13, 2023
8cfccd8
fmt
drskalman Nov 13, 2023
a15a60d
Improve documentation
drskalman Nov 13, 2023
85f8999
Merge branch 'master' into skalman--beefy-client-keystore-supporting-…
drskalman Nov 13, 2023
9667c1b
Merge branch 'skalman--beefy-client-keystore-supporting-both-ecdsa-an…
drskalman Nov 13, 2023
b18e2f4
Merge branch 'skalman--fix-ecdsa-bls-verify-in-beefy-primitives' into…
drskalman Nov 13, 2023
00b62ef
fmt
drskalman Nov 13, 2023
3ef0f65
Improve comment quality
drskalman Nov 27, 2023
a80264c
Merge branch 'master' into skalman--beefy-client-keystore-supporting-…
drskalman Dec 5, 2023
3f8d533
drop 'perhaps' from generate_with_phrase_should_be_recoverable_with_f…
drskalman Dec 5, 2023
1b48d48
Merge remote-tracking branch 'origin/master' into skalman--beefy-clie…
Lederstrumpf Dec 5, 2023
5f09d22
fmt
Lederstrumpf Dec 5, 2023
b04880d
Merge branch 'skalman--beefy-client-keystore-supporting-both-ecdsa-an…
drskalman Dec 5, 2023
6304d1e
Apply suggestions from code review
drskalman Jan 19, 2024
7fc1326
Apply suggestions from code review
drskalman Jan 19, 2024
6401a97
use std instead of sp_std as we are not in the Runtime
drskalman Jan 19, 2024
425c3d3
remove sp-std fro Cargo.lock
drskalman Jan 19, 2024
e98945f
Merge branch 'skalman--beefy-client-keystore-supporting-both-ecdsa-an…
drskalman Jan 20, 2024
59a4b5f
Do not re-export internal of primitives/consensus/beefy/src/test_utils
drskalman Jan 20, 2024
f2956c0
fix wrong doc for `BeefySignerAuthority::sign_with_hasher`
drskalman Jan 20, 2024
3422057
Make BEEFY Keyring itself generic over AuthId using PhantomData.
drskalman Jan 24, 2024
7454b6d
Compatiblize all client/beefy tests to Keyring<AuthorityId> enum model
drskalman Jan 25, 2024
e0c57b6
Merge branch 'skalman--beefy-client-keystore-supporting-both-ecdsa-an…
drskalman Jan 26, 2024
7718444
Merge branch 'master' into skalman--beefy-client-generic-on-auth-id
drskalman Feb 13, 2024
ce9ec49
Fix compile errors after merge with master
drskalman Feb 13, 2024
db4ee57
Resolve all errors in BEEFY client test and pass them.
drskalman Feb 19, 2024
d230d74
Resolve warning in BEEFY client
drskalman Feb 27, 2024
4464c38
Remove redundant imports
drskalman Feb 27, 2024
df03389
Merge remote-tracking branch 'origin/master' into skalman--beefy-clie…
drskalman Feb 27, 2024
b82aaa1
fix error in beefy generic client after merge
drskalman Mar 11, 2024
906b436
Remove unused uses
drskalman Mar 11, 2024
b8be941
Merge branch 'master' into skalman--beefy-client-generic-on-auth-id
drskalman Mar 11, 2024
3067351
fmt
drskalman Mar 11, 2024
b2f7c95
Make BEEFY RPC generic over AuthorityId
drskalman Mar 14, 2024
90cb62e
Don't put `authority_id_works_for_ecdsa` behind bls feature.
drskalman Mar 14, 2024
b91af5b
Remove extrac copy of `ecdsa_bls377_sign_with_keccak_works`
drskalman Mar 14, 2024
c0fb32a
Adrian really doesn't like semi-colon at the end of a return statement.
drskalman Mar 14, 2024
a1d50ec
Remove redundant dead stuff
drskalman Mar 14, 2024
45f9c39
delete the a accidental file
drskalman Mar 18, 2024
f7c8b61
Remove SmartDefault
drskalman Mar 18, 2024
adfb1bd
Typos and Redudnacies
drskalman Mar 18, 2024
56e75eb
Remove redundant bound from AuthorityIdBound.
drskalman Mar 18, 2024
3969528
fmt
drskalman Mar 18, 2024
f75e3a2
warn if backend contains a BEEFY state of an obsolete version
drskalman Mar 19, 2024
5d2f33a
Removing constrain on `<AuthorityId as RuntimeAppPublic>::Signature`
drskalman May 27, 2024
6031199
Merge branch 'master' into skalman--beefy-client-generic-on-auth-id-m…
drskalman May 28, 2024
f55e92f
fix beefy tests after merging
drskalman May 28, 2024
99ab160
unwrap beefy justification to pass test
drskalman May 28, 2024
8bf7a40
Remove all remaining `<AuthorityId as RuntimeAppPublic>::Signature:
drskalman May 29, 2024
7c42d8b
Do `cargo +nightly fmt`
drskalman May 29, 2024
a326523
Remove redundant imports resolve all warnings
drskalman May 29, 2024
725fc2c
make @davxy happy
drskalman May 29, 2024
d834a1d
Remove empty line from substrate/primitives/consensus/beefy/src/lib.rs
drskalman May 29, 2024
f65096e
add beefy_primitisto cli/service
drskalman May 29, 2024
cfc59ed
fmt
drskalman May 29, 2024
a6a1f82
Merge remote-tracking branch 'origin/master' into skalman--beefy-clie…
drskalman May 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove all remaining `<AuthorityId as RuntimeAppPublic>::Signature:
Send + Sync,` constraints
  • Loading branch information
drskalman committed May 29, 2024
commit 8bf7a40c6d1c12cb7712e0e33ce660de516ea9f8
3 changes: 0 additions & 3 deletions substrate/client/consensus/beefy/src/aux_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ pub(crate) fn write_voter_state<B: BlockT, BE: AuxStore, AuthorityId: AuthorityI
backend: &BE,
state: &PersistedState<B, AuthorityId>,
) -> ClientResult<()>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
trace!(target: LOG_TARGET, "🥩 persisting {:?}", state);
AuxStore::insert_aux(backend, &[(WORKER_STATE_KEY, state.encode().as_slice())], &[])
Expand All @@ -66,7 +64,6 @@ pub(crate) fn load_persistent<B, BE, AuthorityId: AuthorityIdBound>(
where
B: BlockT,
BE: Backend<B>,
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
let version: Option<u32> = load_decode(backend, VERSION_KEY)?;

Expand Down
16 changes: 1 addition & 15 deletions substrate/client/consensus/beefy/src/communication/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ enum Consider {
/// BEEFY gossip message type that gets encoded and sent on the network.
#[derive(Debug, Encode, Decode)]
pub(crate) enum GossipMessage<B: Block, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
/// BEEFY message with commitment and single signature.
Vote(VoteMessage<NumberFor<B>, AuthorityId, <AuthorityId as RuntimeAppPublic>::Signature>),
Expand All @@ -81,8 +79,6 @@ where
}

impl<B: Block, AuthorityId: AuthorityIdBound> GossipMessage<B, AuthorityId>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
/// Return inner vote if this message is a Vote.
pub fn unwrap_vote(
Expand Down Expand Up @@ -122,8 +118,6 @@ where

#[derive(Clone, Debug)]
pub(crate) struct GossipFilterCfg<'a, B: Block, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
pub start: NumberFor<B>,
pub end: NumberFor<B>,
Expand All @@ -132,17 +126,13 @@ where

#[derive(Clone, Debug)]
struct FilterInner<B: Block, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
pub start: NumberFor<B>,
pub end: NumberFor<B>,
pub validator_set: ValidatorSet<AuthorityId>,
}

struct Filter<B: Block, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
// specifies live rounds
inner: Option<FilterInner<B, AuthorityId>>,
Expand All @@ -151,8 +141,6 @@ where
}

impl<B: Block, AuthorityId: AuthorityIdBound> Filter<B, AuthorityId>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
pub fn new() -> Self {
Self { inner: None, rounds_with_valid_proofs: BTreeSet::new() }
Expand Down Expand Up @@ -242,7 +230,6 @@ where
pub(crate) struct GossipValidator<B, N, AuthorityId: AuthorityIdBound>
where
B: Block,
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
votes_topic: B::Hash,
justifs_topic: B::Hash,
Expand All @@ -256,11 +243,10 @@ impl<B, N,AuthorityId> GossipValidator<B, N,AuthorityId>
where
B: Block,
AuthorityId: AuthorityIdBound,
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
pub(crate) fn new(known_peers: Arc<Mutex<KnownPeers<B>>>, network: Arc<N>) -> Self {
Self {
votes_topic: votes_topic::<B>(),
votes_topic: votes_topic::<B>(),
justifs_topic: proofs_topic::<B>(),
gossip_filter: RwLock::new(Filter::new()),
next_rebroadcast: Mutex::new(Instant::now() + REBROADCAST_AFTER),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,19 @@ type ResponseReceiver = oneshot::Receiver<Response>;

#[derive(Clone, Debug)]
struct RequestInfo<B: Block, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
block: NumberFor<B>,
active_set: ValidatorSet<AuthorityId>,
}

enum State<B: Block, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
Idle,
AwaitingResponse(PeerId, RequestInfo<B, AuthorityId>, ResponseReceiver),
}

/// Possible engine responses.
pub(crate) enum ResponseInfo<B: Block, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
/// No peer response available yet.
Pending,
Expand All @@ -80,8 +74,6 @@ where
}

pub struct OnDemandJustificationsEngine<B: Block, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
network: Arc<dyn NetworkRequest + Send + Sync>,
protocol_name: ProtocolName,
Expand All @@ -94,8 +86,6 @@ where
}

impl<B: Block, AuthorityId: AuthorityIdBound> OnDemandJustificationsEngine<B, AuthorityId>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
pub fn new(
network: Arc<dyn NetworkRequest + Send + Sync>,
Expand Down
8 changes: 0 additions & 8 deletions substrate/client/consensus/beefy/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ use crate::{
///
/// When using BEEFY, the block import worker should be using this block import object.
pub struct BeefyBlockImport<Block: BlockT, Backend, RuntimeApi, I, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
backend: Arc<Backend>,
runtime: Arc<RuntimeApi>,
Expand All @@ -59,8 +57,6 @@ where

impl<Block: BlockT, BE, Runtime, I: Clone, AuthorityId: AuthorityIdBound> Clone
for BeefyBlockImport<Block, BE, Runtime, I, AuthorityId>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
fn clone(&self) -> Self {
BeefyBlockImport {
Expand All @@ -75,8 +71,6 @@ where

impl<Block: BlockT, BE, Runtime, I, AuthorityId: AuthorityIdBound>
BeefyBlockImport<Block, BE, Runtime, I, AuthorityId>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
/// Create a new BeefyBlockImport.
pub fn new(
Expand All @@ -97,7 +91,6 @@ where
Runtime: ProvideRuntimeApi<Block>,
Runtime::Api: BeefyApi<Block, AuthorityId> + Send,
AuthorityId: AuthorityIdBound,
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
fn decode_and_verify(
&self,
Expand Down Expand Up @@ -137,7 +130,6 @@ where
Runtime: ProvideRuntimeApi<Block> + Send + Sync,
Runtime::Api: BeefyApi<Block, AuthorityId>,
AuthorityId: AuthorityIdBound,
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
type Error = ConsensusError;

Expand Down
4 changes: 0 additions & 4 deletions substrate/client/consensus/beefy/src/justification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ pub type BeefyVersionedFinalityProof<Block, AuthorityId> =
pub(crate) fn proof_block_num_and_set_id<Block: BlockT, AuthorityId: AuthorityIdBound>(
proof: &BeefyVersionedFinalityProof<Block, AuthorityId>,
) -> (NumberFor<Block>, ValidatorSetId)
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
match proof {
VersionedFinalityProof::V1(sc) =>
Expand All @@ -45,8 +43,6 @@ pub(crate) fn decode_and_verify_finality_proof<Block: BlockT, AuthorityId: Autho
target_number: NumberFor<Block>,
validator_set: &ValidatorSet<AuthorityId>,
) -> Result<BeefyVersionedFinalityProof<Block, AuthorityId>, (ConsensusError, u32)>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
let proof = <BeefyVersionedFinalityProof<Block, AuthorityId>>::decode_all(&mut &*encoded)
.map_err(|_| (ConsensusError::InvalidJustification, 0))?;
Expand Down
2 changes: 0 additions & 2 deletions substrate/client/consensus/beefy/src/keystore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ impl<AuthorityId: AuthorityIdBound> BeefyKeystore<AuthorityId> {
}

impl<AuthorityId: AuthorityIdBound> From<Option<KeystorePtr>> for BeefyKeystore<AuthorityId>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
fn from(store: Option<KeystorePtr>) -> BeefyKeystore<AuthorityId> {
BeefyKeystore(store, PhantomData)
Expand Down
15 changes: 0 additions & 15 deletions substrate/client/consensus/beefy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ where
/// to be used by the voter.
#[derive(Clone)]
pub struct BeefyVoterLinks<B: Block, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
// BlockImport -> Voter links
/// Stream of BEEFY signed commitments from block import to voter.
Expand All @@ -137,8 +135,6 @@ where
/// Links used by the BEEFY RPC layer, from the BEEFY background voter.
#[derive(Clone)]
pub struct BeefyRPCLinks<B: Block, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
/// Stream of signed commitments coming from the voter.
pub from_voter_justif_stream: BeefyVersionedFinalityProofStream<B, AuthorityId>,
Expand All @@ -164,7 +160,6 @@ where
RuntimeApi: ProvideRuntimeApi<B> + Send + Sync,
RuntimeApi::Api: BeefyApi<B, AuthorityId>,
AuthorityId: AuthorityIdBound,
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
// Voter -> RPC links
let (to_rpc_justif_sender, from_voter_justif_stream) =
Expand Down Expand Up @@ -215,8 +210,6 @@ pub struct BeefyNetworkParams<B: Block, N, S> {

/// BEEFY gadget initialization parameters.
pub struct BeefyParams<B: Block, BE, C, N, P, R, S, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
/// BEEFY client
pub client: Arc<C>,
Expand Down Expand Up @@ -245,8 +238,6 @@ where
///
/// These are created once, but will be reused if worker is restarted/reinitialized.
pub(crate) struct BeefyComms<B: Block, N, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
pub gossip_engine: GossipEngine<B>,
pub gossip_validator: Arc<GossipValidator<B, N, AuthorityId>>,
Expand All @@ -260,8 +251,6 @@ where
/// GossipEngine. Once initialization is done, the GossipEngine (and other pieces) are added to get
/// the complete [worker::BeefyWorker] object.
pub(crate) struct BeefyWorkerBuilder<B: Block, BE, RuntimeApi, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
// utilities
backend: Arc<BE>,
Expand All @@ -279,7 +268,6 @@ where
R: ProvideRuntimeApi<B>,
R::Api: BeefyApi<B, AuthorityId>,
AuthorityId: AuthorityIdBound,
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
/// This will wait for the chain to enable BEEFY (if not yet enabled) and also wait for the
/// backend to sync all headers required by the voter to build a contiguous chain of mandatory
Expand Down Expand Up @@ -518,7 +506,6 @@ pub async fn start_beefy_gadget<B, BE, C, N, P, R, S, AuthorityId>(
N: GossipNetwork<B> + NetworkRequest + Send + Sync + 'static,
S: GossipSyncing<B> + SyncOracle + 'static,
AuthorityId: AuthorityIdBound,
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
let BeefyParams {
client,
Expand Down Expand Up @@ -685,7 +672,6 @@ where
B: Block,
R: ProvideRuntimeApi<B>,
R::Api: BeefyApi<B, AuthorityId>,
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
info!(target: LOG_TARGET, "🥩 BEEFY gadget waiting for BEEFY pallet to become available...");
loop {
Expand Down Expand Up @@ -724,7 +710,6 @@ where
BE: Backend<B>,
R: ProvideRuntimeApi<B>,
R::Api: BeefyApi<B, AuthorityId>,
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
let blockchain = backend.blockchain();
// Walk up the chain looking for the validator set active at 'at_header'. Process both state and
Expand Down
11 changes: 0 additions & 11 deletions substrate/client/consensus/beefy/src/round.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,18 @@ use std::collections::BTreeMap;
/// Does not do any validation on votes or signatures, layers above need to handle that (gossip).
#[derive(Debug, Decode, Encode, PartialEq)]
pub(crate) struct RoundTracker<AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
votes: BTreeMap<AuthorityId, <AuthorityId as RuntimeAppPublic>::Signature>,
}

impl<AuthorityId: AuthorityIdBound> Default for RoundTracker<AuthorityId>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
fn default() -> Self {
Self { votes: Default::default() }
}
}

impl<AuthorityId: AuthorityIdBound> RoundTracker<AuthorityId>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
fn add_vote(
&mut self,
Expand All @@ -78,8 +72,6 @@ pub fn threshold(authorities: usize) -> usize {

#[derive(Debug, PartialEq)]
pub enum VoteImportResult<B: Block, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
Ok,
RoundConcluded(SignedCommitment<NumberFor<B>, <AuthorityId as RuntimeAppPublic>::Signature>),
Expand All @@ -95,8 +87,6 @@ where
/// Does not do any validation on votes or signatures, layers above need to handle that (gossip).
#[derive(Debug, Decode, Encode, PartialEq)]
pub(crate) struct Rounds<B: Block, AuthorityId: AuthorityIdBound>
where
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
rounds: BTreeMap<Commitment<NumberFor<B>>, RoundTracker<AuthorityId>>,
previous_votes: BTreeMap<
Expand All @@ -113,7 +103,6 @@ impl<B, AuthorityId> Rounds<B, AuthorityId>
where
B: Block,
AuthorityId: AuthorityIdBound,
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
pub(crate) fn new(
session_start: NumberFor<B>,
Expand Down