From 000e7a800243862865bfb7a684172331c6b65bfa Mon Sep 17 00:00:00 2001
From: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>
Date: Thu, 21 Mar 2019 17:26:00 -0400
Subject: [PATCH] Make AuRa generic over cryptography (#2062)
As is so often the case in Rust, most of the work was fixing compiler
errors and removing spurious type annotations.
---
substrate/.gitignore | 2 +
substrate/core/consensus/aura/src/lib.rs | 116 +++++++++++-------
substrate/core/primitives/src/sr25519.rs | 2 +-
.../substrate_test_runtime.compact.wasm | Bin 56614 -> 56572 bytes
substrate/node-template/src/service.rs | 4 +-
substrate/node/cli/src/service.rs | 26 ++--
.../release/node_runtime.compact.wasm | Bin 901302 -> 898586 bytes
7 files changed, 88 insertions(+), 62 deletions(-)
diff --git a/substrate/.gitignore b/substrate/.gitignore
index 4caeb6cc53..21dee82d81 100644
--- a/substrate/.gitignore
+++ b/substrate/.gitignore
@@ -16,3 +16,5 @@ node/runtime/wasm/target/
polkadot.*
.DS_Store
.idea/
+nohup.out
+rls*.log
diff --git a/substrate/core/consensus/aura/src/lib.rs b/substrate/core/consensus/aura/src/lib.rs
index 064738216f..e2c1091f14 100644
--- a/substrate/core/consensus/aura/src/lib.rs
+++ b/substrate/core/consensus/aura/src/lib.rs
@@ -26,9 +26,9 @@
//! Blocks from future steps will be either deferred or rejected depending on how
//! far in the future they are.
-use std::{sync::Arc, time::Duration, thread};
+use std::{sync::Arc, time::Duration, thread, marker::PhantomData, hash::Hash, fmt::Debug};
-use parity_codec::Encode;
+use parity_codec::{Encode, Decode};
use consensus_common::{
Authorities, BlockImport, Environment, Proposer, ForkChoiceStrategy
};
@@ -41,7 +41,7 @@ use runtime_primitives::{generic, generic::BlockId, Justification};
use runtime_primitives::traits::{
Block, Header, Digest, DigestItemFor, DigestItem, ProvideRuntimeApi
};
-use primitives::{ed25519, Pair};
+use primitives::Pair;
use inherents::{InherentDataProviders, InherentData, RuntimeString};
use futures::{Stream, Future, IntoFuture, future};
@@ -60,8 +60,8 @@ pub use aura_slots::SlotDuration;
pub use aura_primitives::*;
pub use consensus_common::SyncOracle;
-type AuthorityId = ed25519::Public;
-type Signature = ed25519::Signature;
+type AuthorityId
=
::Public;
+type Signature
=
::Signature;
/// A handle to the network. This is generally implemented by providing some
/// handle to a gossip service or similar.
@@ -76,7 +76,9 @@ pub trait Network: Clone {
}
/// Get slot author for given block along with authorities.
-fn slot_author(slot_num: u64, authorities: &[AuthorityId]) -> Option {
+fn slot_author(slot_num: u64, authorities: &[AuthorityId]) -> Option>
+ where P::Public: Clone,
+{
if authorities.is_empty() { return None }
let idx = slot_num % (authorities.len() as u64);
@@ -88,7 +90,7 @@ fn slot_author(slot_num: u64, authorities: &[AuthorityId]) -> Option Option {
@@ -110,25 +112,27 @@ fn inherent_to_common_error(err: RuntimeString) -> consensus_common::Error {
}
/// A digest item which is usable with aura consensus.
-pub trait CompatibleDigestItem: Sized {
+pub trait CompatibleDigestItem: Sized {
/// Construct a digest item which is a slot number and a signature on the
/// hash.
- fn aura_seal(slot_number: u64, signature: Signature) -> Self;
+ fn aura_seal(slot_number: u64, signature: Signature) -> Self;
/// If this item is an Aura seal, return the slot number and signature.
- fn as_aura_seal(&self) -> Option<(u64, Signature)>;
+ fn as_aura_seal(&self) -> Option<(u64, Signature)>;
}
-impl CompatibleDigestItem for generic::DigestItem {
+impl CompatibleDigestItem for generic::DigestItem>
+ where T::Signature: Clone
+{
/// Construct a digest item which is a slot number and a signature on the
/// hash.
- fn aura_seal(slot_number: u64, signature: Signature) -> Self {
+ fn aura_seal(slot_number: u64, signature: Signature) -> Self {
generic::DigestItem::Seal(slot_number, signature)
}
/// If this item is an Aura seal, return the slot number and signature.
- fn as_aura_seal(&self) -> Option<(u64, Signature)> {
+ fn as_aura_seal(&self) -> Option<(u64, Signature)> {
match self {
- generic::DigestItem::Seal(slot, ref sig) => Some((*slot, sig.clone().into())),
+ generic::DigestItem::Seal(slot, ref sig) => Some((*slot, (*sig).clone())),
_ => None
}
}
@@ -147,9 +151,9 @@ impl SlotCompatible for AuraSlotCompatible {
}
/// Start the aura worker in a separate thread.
-pub fn start_aura_thread(
+pub fn start_aura_thread(
slot_duration: SlotDuration,
- local_key: Arc,
+ local_key: Arc,
client: Arc,
block_import: Arc,
env: Arc,
@@ -164,9 +168,11 @@ pub fn start_aura_thread(
<>::Create as IntoFuture>::Future: Send + 'static,
I: BlockImport + Send + Sync + 'static,
Error: From + From + 'static,
+ P: Pair + Send + Sync + 'static,
+ P::Public: Encode + Decode + Eq + Clone + Debug + Hash + Send + Sync + 'static,
SO: SyncOracle + Send + Sync + Clone + 'static,
OnExit: Future- + Send + 'static,
- DigestItemFor: CompatibleDigestItem + DigestItem + 'static,
+ DigestItemFor: CompatibleDigestItem
+ DigestItem> + 'static,
Error: ::std::error::Error + Send + From<::consensus_common::Error> + 'static,
{
let worker = AuraWorker {
@@ -184,9 +190,9 @@ pub fn start_aura_thread(
}
/// Start the aura worker. The returned future should be run in a tokio runtime.
-pub fn start_aura(
+pub fn start_aura(
slot_duration: SlotDuration,
- local_key: Arc,
+ local_key: Arc,
client: Arc,
block_import: Arc,
env: Arc,
@@ -201,8 +207,10 @@ pub fn start_aura(
<>::Create as IntoFuture>::Future: Send + 'static,
I: BlockImport + Send + Sync + 'static,
Error: From + From,
+ P: Pair + Send + Sync + 'static,
+ P::Public: Hash + Eq + Send + Sync + Clone + Debug + Encode + Decode + 'static,
SO: SyncOracle + Send + Sync + Clone,
- DigestItemFor: CompatibleDigestItem + DigestItem,
+ DigestItemFor: CompatibleDigestItem + DigestItem>,
Error: ::std::error::Error + Send + 'static + From<::consensus_common::Error>,
OnExit: Future- ,
{
@@ -219,24 +227,26 @@ pub fn start_aura(
)
}
-struct AuraWorker {
+struct AuraWorker {
client: Arc,
block_import: Arc,
env: Arc,
- local_key: Arc,
+ local_key: Arc
,
sync_oracle: SO,
inherent_data_providers: InherentDataProviders,
}
-impl SlotWorker for AuraWorker where
+impl SlotWorker for AuraWorker where
C: Authorities,
E: Environment,
E::Proposer: Proposer,
<>::Create as IntoFuture>::Future: Send + 'static,
I: BlockImport + Send + Sync + 'static,
+ P: Pair + Send + Sync + 'static,
+ P::Public: Hash + Eq + Send + Sync + Clone + Debug + Encode + Decode + 'static,
Error: From + From,
SO: SyncOracle + Send + Clone,
- DigestItemFor: CompatibleDigestItem + DigestItem,
+ DigestItemFor: CompatibleDigestItem + DigestItem>,
Error: ::std::error::Error + Send + 'static + From<::consensus_common::Error>,
{
type OnSlot = Box + Send>;
@@ -284,10 +294,10 @@ impl SlotWorker for AuraWorker whe
);
return Box::new(future::ok(()));
}
-
- let proposal_work = match slot_author(slot_num, &authorities) {
+ let maybe_author = slot_author::(slot_num, &authorities);
+ let proposal_work = match maybe_author {
None => return Box::new(future::ok(())),
- Some(author) => if author.0 == public_key.0 {
+ Some(author) => if author == public_key {
debug!(
target: "aura", "Starting authorship at slot {}; timestamp = {}",
slot_num,
@@ -347,7 +357,7 @@ impl SlotWorker for AuraWorker whe
// add it to a digest item.
let to_sign = (slot_num, pre_hash).encode();
let signature = pair.sign(&to_sign[..]);
- let item = as CompatibleDigestItem>::aura_seal(
+ let item = as CompatibleDigestItem>::aura_seal(
slot_num,
signature,
);
@@ -391,9 +401,10 @@ impl SlotWorker for AuraWorker whe
/// if it's successful, returns the pre-header, the slot number, and the signat.
//
// FIXME #1018 needs misbehavior types
-fn check_header(slot_now: u64, mut header: B::Header, hash: B::Hash, authorities: &[AuthorityId])
- -> Result, String>
- where DigestItemFor: CompatibleDigestItem
+fn check_header(slot_now: u64, mut header: B::Header, hash: B::Hash, authorities: &[AuthorityId])
+ -> Result, String>
+ where DigestItemFor: CompatibleDigestItem,
+ P::Public: Clone + AsRef,
{
let digest_item = match header.digest_mut().pop() {
Some(x) => x,
@@ -411,16 +422,16 @@ fn check_header(slot_now: u64, mut header: B::Header, hash: B::Hash, a
// check the signature is valid under the expected authority and
// chain state.
- let expected_author = match slot_author(slot_num, &authorities) {
+ let expected_author = match slot_author::(slot_num, &authorities) {
None => return Err("Slot Author not found".to_string()),
Some(author) => author
};
let pre_hash = header.hash();
let to_sign = (slot_num, pre_hash).encode();
- let public = ed25519::Public(expected_author.0);
+ let public = expected_author;
- if ed25519::Pair::verify(&sig, &to_sign[..], public) {
+ if P::verify(&sig, &to_sign[..], public) {
Ok(CheckedHeader::Checked(header, slot_num, sig))
} else {
Err(format!("Bad signature on {:?}", hash))
@@ -442,13 +453,15 @@ pub trait ExtraVerification: Send + Sync {
}
/// A verifier for Aura blocks.
-pub struct AuraVerifier {
+pub struct AuraVerifier {
client: Arc,
extra: E,
+ phantom: PhantomData,
inherent_data_providers: inherents::InherentDataProviders,
}
-impl AuraVerifier
+impl AuraVerifier
+ where P: Send + Sync + 'static
{
fn check_inherents(
&self,
@@ -511,11 +524,13 @@ impl ExtraVerification for NothingExtra {
}
}
-impl Verifier for AuraVerifier where
+impl Verifier for AuraVerifier where
C: Authorities + ProvideRuntimeApi + Send + Sync,
C::Api: BlockBuilderApi,
- DigestItemFor: CompatibleDigestItem + DigestItem,
+ DigestItemFor: CompatibleDigestItem + DigestItem>,
E: ExtraVerification,
+ P: Pair + Send + Sync + 'static,
+ P::Public: Send + Sync + Hash + Eq + Clone + Decode + Encode + Debug + AsRef + 'static,
{
fn verify(
&self,
@@ -523,7 +538,7 @@ impl Verifier for AuraVerifier where
header: B::Header,
justification: Option,
mut body: Option>,
- ) -> Result<(ImportBlock, Option>), String> {
+ ) -> Result<(ImportBlock, Option>>), String> {
let mut inherent_data = self.inherent_data_providers.create_inherent_data().map_err(String::from)?;
let (timestamp_now, slot_now) = AuraSlotCompatible::extract_timestamp_and_slot(&inherent_data)
.map_err(|e| format!("Could not extract timestamp and slot: {:?}", e))?;
@@ -539,7 +554,7 @@ impl Verifier for AuraVerifier where
// we add one to allow for some small drift.
// FIXME #1019 in the future, alter this queue to allow deferring of headers
- let checked_header = check_header::(slot_now + 1, header, hash, &authorities[..])?;
+ let checked_header = check_header::(slot_now + 1, header, hash, &authorities[..])?;
match checked_header {
CheckedHeader::Checked(pre_header, slot_num, sig) => {
let item = >::aura_seal(slot_num, sig);
@@ -617,7 +632,7 @@ fn register_aura_inherent_data_provider(
}
/// Start an import queue for the Aura consensus algorithm.
-pub fn import_queue(
+pub fn import_queue(
slot_duration: SlotDuration,
block_import: SharedBlockImport,
justification_import: Option>,
@@ -628,13 +643,20 @@ pub fn import_queue(
B: Block,
C: 'static + Authorities + ProvideRuntimeApi + Send + Sync,
C::Api: BlockBuilderApi,
- DigestItemFor: CompatibleDigestItem + DigestItem,
+ DigestItemFor: CompatibleDigestItem + DigestItem>,
E: 'static + ExtraVerification,
+ P: Pair + Send + Sync + 'static,
+ P::Public: Clone + Eq + Send + Sync + Hash + Debug + Encode + Decode + AsRef,
{
register_aura_inherent_data_provider(&inherent_data_providers, slot_duration.get())?;
let verifier = Arc::new(
- AuraVerifier { client: client.clone(), extra, inherent_data_providers }
+ AuraVerifier {
+ client: client.clone(),
+ extra,
+ inherent_data_providers,
+ phantom: PhantomData,
+ }
);
Ok(BasicQueue::new(verifier, block_import, justification_import))
}
@@ -650,6 +672,7 @@ mod tests {
use parking_lot::Mutex;
use tokio::runtime::current_thread;
use keyring::ed25519::Keyring;
+ use primitives::ed25519;
use client::BlockchainEvents;
use test_client;
@@ -664,7 +687,7 @@ mod tests {
type Proposer = DummyProposer;
type Error = Error;
- fn init(&self, parent_header: &::Header, _authorities: &[AuthorityId])
+ fn init(&self, parent_header: &::Header, _authorities: &[AuthorityId])
-> Result
{
Ok(DummyProposer(parent_header.number + 1, self.0.clone()))
@@ -690,7 +713,7 @@ mod tests {
impl TestNetFactory for AuraTestNet {
type Specialization = DummySpecialization;
- type Verifier = AuraVerifier;
+ type Verifier = AuraVerifier;
type PeerData = ();
/// Create new test network with peers and given config.
@@ -717,6 +740,7 @@ mod tests {
client,
extra: NothingExtra,
inherent_data_providers,
+ phantom: Default::default(),
})
}
@@ -775,7 +799,7 @@ mod tests {
&inherent_data_providers, slot_duration.get()
).expect("Registers aura inherent data provider");
- let aura = start_aura(
+ let aura = start_aura::<_, _, _, _, ed25519::Pair, _, _, _>(
slot_duration,
Arc::new(key.clone().into()),
client.clone(),
diff --git a/substrate/core/primitives/src/sr25519.rs b/substrate/core/primitives/src/sr25519.rs
index ee1727b79a..a60ee94b7f 100644
--- a/substrate/core/primitives/src/sr25519.rs
+++ b/substrate/core/primitives/src/sr25519.rs
@@ -501,7 +501,7 @@ impl Pair {
#[cfg(test)]
mod test {
use super::*;
- use crate::{Pair as PairT, crypto::{Ss58Codec, DEV_PHRASE, DEV_ADDRESS}};
+ use crate::crypto::{Ss58Codec, DEV_PHRASE, DEV_ADDRESS};
use hex_literal::{hex, hex_impl};
#[test]
diff --git a/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm b/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm
index c4df3f06b5bb1e46508ff2c11a5c39a9738d6838..4f75adc74d29efaf20706fd240ba8a67443f1d70 100644
GIT binary patch
delta 9107
zcmai43wRXOy`M9)dG2m@Ht!HfW;cN(kdS@O?1liDKzN9}9|A3eeau24NiYd70TYy3
z6j0!xwN@-w+lmSTT~YM&5nnA(P^<`6?JZV&uf4am^wzI({rb4SGcy|ka=#MxoHOV7
zKmW(?|37EuCoc+rdqFsQkhldQ8-HAyV6_SYvGIfx>=_vuf*|DN2suKAV5O%>sZ~hJ
zPUEsONSc^QFO%}@%ex0SYagdx-c3vRg$t|1NnPDqYh-Qjs;=&~-Zrg=tIpM{v<+Hp
zZLiiEUELMCl^b24SGIMcPh@plPpaPQoT>Fj;*s7+Ylm6jeDuP5wLBM~f9A`GLPcQ&
z3DL2Fn>5h5LK$hKYlLBi<8v2iJ-zCj>8;Vo>PTlyYwb#K6X^k=l)ik?O*s0SixST@
z@3mBrNwm^ZSv)yEH6RgbTix2#*}6W`)4{dS6_#=`mG)bThD|TLzDsAMw{4xqO{d2!
zu7asqcEYK|nlX1oc-X>u^Rv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|PuWb_9^sc5jAw!YD7kHmb~JCO7#!I(ehi&oG>Z-iV*SP3TmUY{=-!@1!^W%KxJ
z7A~jPVXxQU$fM5{XD4p#|gSOEPnB!6A2
zrlkBgM>@ixaLSKPzZ~>=WnZGcQyW_G=2TJf2BV5M9*(3EQS9A7|9YmnBa{jxIGGB?+5Eu{eey=ud{WM^;B_)%>W=x1jt?a@Fq7!F6h
zAwP^O9*9NoV*oeb7^CBVTMx2U|8|633C6vCKfJ&zNBxSTjKePl%4wG{Ot|XR42R`3
z|NJh@|F5{rr#HTnU+snQ%ZZfN2VQ&;IX>Y#esnD$>kupC?*ck0u2i*eA00BXNGL`T{!}1jNLk2PxYHYAW
zLZNUV3ExxvF(n$FhF>?h3a8sOOp7H~wRg5{=-k-enV?(VRc3_}fj}q%Wde4R(P(g{
z88Eg=$H7?)6<4(x05)5HGT^P%ercY8i*sn{d!y{h5d0>H3B;n&a3mlvm}H>W
zFnc)UiwDBVK-iZA3V7v(RC=Ra^oL|ck>h?pKrfyOC+Up$M~aDvoQx=5z;w#z5Begs
Y|NYfPp=iLb_(LHHYak
diff --git a/substrate/node-template/src/service.rs b/substrate/node-template/src/service.rs
index aa1d25963b..ae98d01de4 100644
--- a/substrate/node-template/src/service.rs
+++ b/substrate/node-template/src/service.rs
@@ -85,7 +85,7 @@ construct_service_factory! {
Self::Block,
>
{ |config: &mut FactoryFullConfiguration , client: Arc>|
- import_queue(
+ import_queue::<_, _, _, Pair>(
SlotDuration::get_or_compute(&*client)?,
client.clone(),
None,
@@ -98,7 +98,7 @@ construct_service_factory! {
Self::Block,
>
{ |config: &mut FactoryFullConfiguration, client: Arc>|
- import_queue(
+ import_queue::<_, _, _, Pair>(
SlotDuration::get_or_compute(&*client)?,
client.clone(),
None,
diff --git a/substrate/node/cli/src/service.rs b/substrate/node/cli/src/service.rs
index e2c1c67236..64f191dc4b 100644
--- a/substrate/node/cli/src/service.rs
+++ b/substrate/node/cli/src/service.rs
@@ -25,7 +25,7 @@ use client;
use consensus::{import_queue, start_aura, AuraImportQueue, SlotDuration, NothingExtra};
use grandpa;
use node_executor;
-use primitives::{Pair as PairT, ed25519::Pair};
+use primitives::{Pair as PairT, ed25519};
use node_primitives::Block;
use node_runtime::{GenesisConfig, RuntimeApi};
use substrate_service::{
@@ -76,7 +76,7 @@ construct_service_factory! {
{ |config: FactoryFullConfiguration, executor: TaskExecutor|
FullComponents::::new(config, executor) },
AuthoritySetup = {
- |mut service: Self::FullService, executor: TaskExecutor, local_key: Option>| {
+ |mut service: Self::FullService, executor: TaskExecutor, local_key: Option>| {
let (block_import, link_half) = service.config.custom.grandpa_import_setup.take()
.expect("Link Half and Block Import are present for Full Services or setup failed before. qed");
@@ -133,7 +133,7 @@ construct_service_factory! {
config.custom.grandpa_import_setup = Some((block_import.clone(), link_half));
- import_queue(
+ import_queue::<_, _, _, ed25519::Pair>(
slot_duration,
block_import,
Some(justification_import),
@@ -144,16 +144,16 @@ construct_service_factory! {
}},
LightImportQueue = AuraImportQueue
{ |config: &FactoryFullConfiguration, client: Arc>| {
- import_queue(
- SlotDuration::get_or_compute(&*client)?,
- client.clone(),
- None,
- client,
- NothingExtra,
- config.custom.inherent_data_providers.clone(),
- ).map_err(Into::into)
- }
- },
+ import_queue::<_, _, _, ed25519::Pair>(
+ SlotDuration::get_or_compute(&*client)?,
+ client.clone(),
+ None,
+ client,
+ NothingExtra,
+ config.custom.inherent_data_providers.clone(),
+ ).map_err(Into::into)
+ }
+ },
}
}
diff --git a/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm b/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm
index 446e9eaad9b7c42c8435e38f28f298bd48fa373d..5076de93a3bb3a32a54355621ba0312dd0b0880e 100644
GIT binary patch
delta 161087
zcmdqK349bq`aj%N)zdS{%p?;+NJ6geNq~eiT;UYyaH}Y&2(BWaAQF%p#ft$!7M1%d
z573|psGuOnprCT7i^nP|UMniDc&wtLtFE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