Reject blocks without justification which don't have the best number (#105)

* Initial commit

Forked at: 6c74beab7b
Parent branch: origin/master

* Reject blocks without justification

* Revert "Reject blocks without justification"

This reverts commit ee60e12097939d4ccfe987a71db9a876319ae5ba.

* WIP

Forked at: 6c74beab7b
Parent branch: origin/master

* WIP

Forked at: 6c74beab7b
Parent branch: origin/master

* WIP

Forked at: 6c74beab7b
Parent branch: origin/master

* CLEANUP

Forked at: 6c74beab7b
Parent branch: origin/master

* WIP

Forked at: 6c74beab7b
Parent branch: origin/master

* WIP

Forked at: 6c74beab7b
Parent branch: origin/master

* CLEANUP

Forked at: 6c74beab7b
Parent branch: origin/master

* WIP

Forked at: 6c74beab7b
Parent branch: origin/master

* WIP

Forked at: 6c74beab7b
Parent branch: origin/master

* Move HeadData to primitives

* Update network/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update network/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* CLEANUP

Forked at: 6c74beab7b
Parent branch: origin/master

* fix

* CLEANUP

Forked at: 6c74beab7b
Parent branch: origin/master

* messages

* for the greater good

* Update primitives/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update network/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update network/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update network/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Cecile Tonglet
2020-06-03 14:15:52 +02:00
committed by GitHub
parent 6c74beab7b
commit ccf05e5022
6 changed files with 89 additions and 24 deletions
+6 -9
View File
@@ -20,7 +20,7 @@ use cumulus_network::{
DelayedBlockAnnounceValidator, JustifiedBlockAnnounceValidator, WaitToAnnounce,
};
use cumulus_primitives::{
inherents::VALIDATION_FUNCTION_PARAMS_IDENTIFIER as VFP_IDENT,
HeadData, inherents::VALIDATION_FUNCTION_PARAMS_IDENTIFIER as VFP_IDENT,
validation_function_params::ValidationFunctionParams,
};
use cumulus_runtime::ParachainBlockData;
@@ -56,12 +56,6 @@ use std::{fmt::Debug, marker::PhantomData, sync::Arc, time::Duration, pin::Pin};
use parking_lot::Mutex;
/// The head data of the parachain, stored in the relay chain.
#[derive(Decode, Encode, Debug)]
struct HeadData<Block: BlockT> {
header: Block::Header,
}
/// The implementation of the Cumulus `Collator`.
pub struct Collator<Block: BlockT, PF, BI> {
proposer_factory: Arc<Mutex<PF>>,
@@ -340,7 +334,10 @@ where
+ Sync
+ 'static,
Backend: sc_client_api::Backend<Block> + 'static,
Client: Finalizer<Block, Backend> + UsageProvider<Block> + Send + Sync + 'static,
Client: Finalizer<Block, Backend> + UsageProvider<Block> + HeaderBackend<Block>
+ Send
+ Sync
+ 'static,
{
type ParachainContext = Collator<Block, PF, BI>;
@@ -359,7 +356,7 @@ where
Extrinsic: codec::Codec + Send + Sync + 'static,
{
self.delayed_block_announce_validator.set(
Box::new(JustifiedBlockAnnounceValidator::new(polkadot_client.clone())),
Box::new(JustifiedBlockAnnounceValidator::new(polkadot_client.clone(), self.para_id)),
);
let follow =