Keep unpinned blocks for a while before announcing (#83)

* Initial commit

Forked at: 461b971ccc
Parent branch: origin/master

* Change substrate and polkadot branch to cecton-cumulus-branch

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* update .editorconfig

* should probably be --dev

* formatting

* Change substrate & polkadot branch to cecton-keep-unpinned-para-blocks

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* Update polkadot & substrate branches

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* Some fixes

* Updated polkadot

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* WIP

Forked at: 461b971ccc
Parent branch: origin/master

* Cargo.lock

* WIP

Forked at: cd1eb3786d
Parent branch: origin/master

* WIP

Forked at: cd1eb3786d
Parent branch: origin/master

* Update substrate & polkadot branches

* Clean-up

* WIP

Forked at: cd1eb3786d
Parent branch: origin/master

* WIP

Forked at: cd1eb3786d
Parent branch: origin/master

* WIP

Forked at: cd1eb3786d
Parent branch: origin/master

* WIP

Forked at: cd1eb3786d
Parent branch: origin/master

* WIP

Forked at: cd1eb3786d
Parent branch: origin/master

* Use JustifiedBlockAnnounceValidator

* debug

* Revert "debug"

This reverts commit 2404121b840984d6ffc1012ccec1e6a784fa236c.

* Revert "Use JustifiedBlockAnnounceValidator"

This reverts commit 33e2efef21a1553c294b2bc23fca8b08bf77be2b.

* Revert branch to cumulus-branch

* clean-up

* clean-up

* cleanup

* cleanup

* Update branches

* debug

* Cancel previous task when new one is created

* Remove stream-cancel

* Clean-up

* cleanup

* cleanup

* Fix merge issue

* Update polkadot_chainspec.json

* 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>

* Use closure instead of NetworkService to announce_block

* doc

* WIP

Forked at: cd1eb3786d
Parent branch: origin/master

* Move disable announcement to its own function with doc

* Change substrate and polkadot branch to cumulus-master

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Cecile Tonglet
2020-05-06 12:50:56 +02:00
committed by GitHub
parent 45a7fe2a94
commit 032595ddd0
6 changed files with 186 additions and 17 deletions
+8 -6
View File
@@ -15,17 +15,12 @@
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
use std::sync::Arc;
use sc_executor::native_executor_instance;
use sc_service::{AbstractService, Configuration};
use sc_finality_grandpa::{FinalityProofProvider as GrandpaFinalityProofProvider, StorageAndProofProvider};
use polkadot_primitives::parachain::CollatorPair;
use cumulus_collator::CollatorBuilder;
use cumulus_collator::{CollatorBuilder, prepare_collator_config};
use futures::FutureExt;
pub use sc_executor::NativeExecutor;
// Our native executor instance.
@@ -76,6 +71,8 @@ pub fn run_collator(
key: Arc<CollatorPair>,
polkadot_config: polkadot_collator::Configuration,
) -> sc_service::error::Result<impl AbstractService> {
let parachain_config = prepare_collator_config(parachain_config);
let (builder, inherent_data_providers) = new_full_start!(parachain_config);
inherent_data_providers
.register_provider(sp_timestamp::InherentDataProvider)
@@ -96,12 +93,17 @@ pub fn run_collator(
let block_import = service.client();
let client = service.client();
let network = service.network();
let announce_block = Arc::new(move |hash, data| {
network.announce_block(hash, data)
});
let builder = CollatorBuilder::new(
proposer_factory,
inherent_data_providers,
block_import,
crate::PARA_ID,
client,
announce_block,
);
let polkadot_future = polkadot_collator::start_collator(