Update to latest substrate (#57)

* update to latest substrate

* update WASM and runtime

* Rename Id to ParaId in decl_{module,storage} (exported metadata type) (#58)

* Rename Id to ParaId in decla_module (exported type)

* AccountParaId -> AccountId
This commit is contained in:
Robert Habermeier
2018-12-20 13:43:48 +01:00
committed by Gav Wood
parent 014215181b
commit ccbae389c2
12 changed files with 153 additions and 127 deletions
+4 -2
View File
@@ -78,7 +78,8 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
launch_period: 12 * 60 * 24, // 1 day per public referendum
voting_period: 12 * 60 * 24 * 3, // 3 days to discuss & vote on an active referendum
minimum_deposit: 5000, // 12000 as the minimum deposit for a referendum
public_delay: 0,
public_delay: 10 * 60,
max_lock_periods: 6,
}),
grandpa: Some(GrandpaConfig {
authorities: initial_authorities.clone().into_iter().map(|k| (k, 1)).collect(),
@@ -168,7 +169,8 @@ fn testnet_genesis(initial_authorities: Vec<AuthorityId>) -> GenesisConfig {
launch_period: 9,
voting_period: 18,
minimum_deposit: 10,
public_delay: 0,
public_delay: 10 * 60,
max_lock_periods: 6,
}),
grandpa: Some(GrandpaConfig {
authorities: initial_authorities.clone().into_iter().map(|k| (k, 1)).collect(),
+10 -9
View File
@@ -64,9 +64,6 @@ pub use primitives::{Blake2Hasher};
pub use sr_primitives::traits::ProvideRuntimeApi;
pub use chain_spec::ChainSpec;
// wait 1.5 seconds for parachain candidates before releasing a block.
const PARACHAIN_EMPTY_DURATION: Duration = Duration::from_millis(1500);
/// All configuration for the polkadot node.
pub type Configuration = FactoryFullConfiguration<Factory>;
@@ -166,25 +163,24 @@ construct_service_factory! {
{ |config: FactoryFullConfiguration<Self>, executor: TaskExecutor| {
FullComponents::<Factory>::new(config, executor)
} },
AuthoritySetup = { |mut service: Self::FullService, executor: TaskExecutor, key: Arc<ed25519::Pair>| {
AuthoritySetup = { |mut service: Self::FullService, executor: TaskExecutor, key: Option<Arc<ed25519::Pair>>| {
use polkadot_network::consensus::ConsensusNetwork;
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");
// always run GRANDPA in order to sync.
{
info!("Running Grandpa session as Authority {}", key.public());
let (voter, oracle) = grandpa::run_grandpa(
let voter = grandpa::run_grandpa(
grandpa::Config {
gossip_duration: Duration::new(4, 0), // FIXME: make this available through chainspec?
local_key: Some(key.clone()),
local_key: key.clone(),
name: Some(service.config.name.clone())
},
link_half,
grandpa::NetworkBridge::new(service.network()),
)?;
executor.spawn(oracle);
executor.spawn(voter);
}
@@ -200,6 +196,12 @@ construct_service_factory! {
})?
};
// run authorship only if authority.
let key = match key {
Some(key) => key,
None => return Ok(service),
};
let client = service.client();
// collator connections and consensus network both fulfilled by this
@@ -210,7 +212,6 @@ construct_service_factory! {
consensus_network,
service.transaction_pool(),
executor.clone(),
PARACHAIN_EMPTY_DURATION,
key.clone(),
extrinsic_store,
);