Skip to content

Commit

Permalink
Update to 3dedd246c62255ba6f9b777ecba318dfc2078d85
Browse files Browse the repository at this point in the history
  • Loading branch information
shawntabrizi committed Oct 4, 2019
1 parent ef3a59b commit 1434d54
Show file tree
Hide file tree
Showing 9 changed files with 1,395 additions and 1,210 deletions.
2,304 changes: 1,255 additions & 1,049 deletions Cargo.lock

Large diffs are not rendered by default.

62 changes: 31 additions & 31 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,95 +1,96 @@
[build-dependencies]
vergen = '3'
[profile.release]
panic = 'unwind'

[workspace]
members = ['runtime']

[dependencies]
derive_more = '0.14.0'
exit-future = '0.1'
futures = '0.1'
log = '0.4'
derive_more = '0.15.0'
exit-future = '0.1.4'
futures = '0.1.29'
log = '0.4.8'
parking_lot = '0.9.0'
tokio = '0.1'
tokio = '0.1.22'
trie-root = '0.15.2'

[dependencies.babe]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-consensus-babe'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.babe-primitives]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-consensus-babe-primitives'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.basic-authorship]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-basic-authorship'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.codec]
package = 'parity-scale-codec'
version = '1.0.0'

[dependencies.ctrlc]
features = ['termination']
version = '3.0'
version = '3.1.3'

[dependencies.grandpa]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-finality-grandpa'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.grandpa-primitives]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-finality-grandpa-primitives'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.inherents]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-inherents'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.network]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-network'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.node-template-runtime]
path = 'runtime'

[dependencies.primitives]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-primitives'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.sr-io]
git = 'https://github.com/paritytech/substrate.git'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.substrate-cli]
git = 'https://github.com/paritytech/substrate.git'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.substrate-client]
git = 'https://github.com/paritytech/substrate.git'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.substrate-executor]
git = 'https://github.com/paritytech/substrate.git'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.substrate-service]
git = 'https://github.com/paritytech/substrate.git'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.transaction-pool]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-transaction-pool'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'
[profile.release]
panic = 'unwind'

[[bin]]
name = 'node-template'
path = 'src/main.rs'

[workspace]
members = ['runtime']

[package]
authors = ['Anonymous']
Expand All @@ -98,6 +99,5 @@ edition = '2018'
name = 'node-template'
version = '2.0.0'

[[bin]]
name = 'node-template'
path = 'src/main.rs'
[build-dependencies]
vergen = '3.0.4'
52 changes: 26 additions & 26 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
[package]
authors = ['Anonymous']
edition = '2018'
name = 'node-template-runtime'
version = '2.0.0'
[dependencies.babe]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-babe'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.babe-primitives]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-consensus-babe-primitives'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.balances]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-balances'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.client]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-client'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.codec]
default-features = false
Expand All @@ -37,99 +32,104 @@ version = '1.0.0'
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-executive'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.grandpa]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-grandpa'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.indices]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-indices'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.offchain-primitives]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-offchain-primitives'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.primitives]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-primitives'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.rstd]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'sr-std'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.runtime-io]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'sr-io'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.safe-mix]
default-features = false
version = '1.0'
version = '1.0.0'

[dependencies.serde]
features = ['derive']
optional = true
version = '1.0'
version = '1.0.101'

[dependencies.sr-primitives]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.substrate-session]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.sudo]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-sudo'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.support]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-support'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.system]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-system'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.timestamp]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-timestamp'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'

[dependencies.version]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'sr-version'
rev = '3ba0f2a2dbd37c31851a0ff1c1c0c47aa940de90'
rev = '3dedd246c62255ba6f9b777ecba318dfc2078d85'
[build-dependencies.wasm-builder-runner]
package = 'substrate-wasm-builder-runner'
version = '1.0.2'

[package]
authors = ['Anonymous']
edition = '2018'
name = 'node-template-runtime'
version = '2.0.0'

[features]
default = ['std']
no_std = []
std = [
'codec/std',
'client/std',
Expand Down
2 changes: 1 addition & 1 deletion runtime/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use wasm_builder_runner::{build_current_project_with_rustflags, WasmBuilderSourc
fn main() {
build_current_project_with_rustflags(
"wasm_binary.rs",
WasmBuilderSource::Crates("1.0.5"),
WasmBuilderSource::Crates("1.0.7"),
// This instructs LLD to export __heap_base as a global variable, which is used by the
// external memory allocator.
"-Clink-arg=--export=__heap_base",
Expand Down
38 changes: 9 additions & 29 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ use sr_primitives::{
ApplyResult, transaction_validity::TransactionValidity, generic, create_runtime_str,
impl_opaque_keys, AnySignature
};
use sr_primitives::traits::{NumberFor, BlakeTwo256, Block as BlockT, DigestFor, StaticLookup, Verify, ConvertInto};
use sr_primitives::traits::{NumberFor, BlakeTwo256, Block as BlockT, StaticLookup, Verify, ConvertInto};
use sr_primitives::weights::Weight;
use babe::{AuthorityId as BabeId};
use grandpa::{AuthorityId as GrandpaId, AuthorityWeight as GrandpaWeight};
use grandpa::fg_primitives::{self, ScheduledChange};
use grandpa::fg_primitives;
use client::{
block_builder::api::{CheckInherentsResult, InherentData, self as block_builder_api},
runtime_api as client_api, impl_runtime_apis
Expand Down Expand Up @@ -189,6 +189,7 @@ parameter_types! {
impl babe::Trait for Runtime {
type EpochDuration = EpochDuration;
type ExpectedBlockTime = ExpectedBlockTime;
type EpochChangeTrigger = babe::SameAuthoritiesForever;
}

impl grandpa::Trait for Runtime {
Expand All @@ -208,7 +209,7 @@ impl indices::Trait for Runtime {
}

parameter_types! {
pub const MinimumPeriod: u64 = 5000;
pub const MinimumPeriod: u64 = SLOT_DURATION / 2;
}

impl timestamp::Trait for Runtime {
Expand All @@ -235,7 +236,6 @@ impl balances::Trait for Runtime {
type OnNewAccount = Indices;
/// The ubiquitous event type.
type Event = Event;

type TransactionPayment = ();
type DustRemoval = ();
type TransferPayment = ();
Expand Down Expand Up @@ -268,7 +268,7 @@ construct_runtime!(
Babe: babe::{Module, Call, Storage, Config, Inherent(Timestamp)},
Grandpa: grandpa::{Module, Call, Storage, Config, Event},
Indices: indices::{default, Config<T>},
Balances: balances,
Balances: balances::{default, Error},
Sudo: sudo,
// Used for the module template in `./template.rs`
TemplateModule: template::{Module, Call, Storage, Event<T>},
Expand Down Expand Up @@ -357,45 +357,25 @@ impl_runtime_apis! {
}

impl fg_primitives::GrandpaApi<Block> for Runtime {
fn grandpa_pending_change(digest: &DigestFor<Block>)
-> Option<ScheduledChange<NumberFor<Block>>>
{
Grandpa::pending_change(digest)
}

fn grandpa_forced_change(digest: &DigestFor<Block>)
-> Option<(NumberFor<Block>, ScheduledChange<NumberFor<Block>>)>
{
Grandpa::forced_change(digest)
}

fn grandpa_authorities() -> Vec<(GrandpaId, GrandpaWeight)> {
Grandpa::grandpa_authorities()
}
}

impl babe_primitives::BabeApi<Block> for Runtime {
fn startup_data() -> babe_primitives::BabeConfiguration {
fn configuration() -> babe_primitives::BabeConfiguration {
// The choice of `c` parameter (where `1 - c` represents the
// probability of a slot being empty), is done in accordance to the
// slot duration and expected target block time, for safely
// resisting network delays of maximum two seconds.
// <https://research.web3.foundation/en/latest/polkadot/BABE/Babe/#6-practical-results>
babe_primitives::BabeConfiguration {
median_required_blocks: 1000,
slot_duration: Babe::slot_duration(),
epoch_length: EpochDuration::get(),
c: PRIMARY_PROBABILITY,
}
}

fn epoch() -> babe_primitives::Epoch {
babe_primitives::Epoch {
start_slot: Babe::epoch_start_slot(),
authorities: Babe::authorities(),
epoch_index: Babe::epoch_index(),
genesis_authorities: Babe::authorities(),
randomness: Babe::randomness(),
duration: EpochDuration::get(),
secondary_slots: Babe::secondary_slots().0,
secondary_slots: true,
}
}
}
Expand Down
Loading

0 comments on commit 1434d54

Please sign in to comment.