Update to v2.0.0-rc1 (#45)

main
Ricardo Rius 2020-05-25 23:48:38 +02:00 committed by GitHub
parent 38058f3ef0
commit 131195352b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 721 additions and 536 deletions

1000
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,9 @@
[profile.release]
panic = 'unwind'
[workspace]
members = [
'node',
'pallets/template',
'runtime',
]
[profile.release]
panic = 'unwind'

View File

@ -7,7 +7,7 @@ homepage = 'https://substrate.io'
license = 'Unlicense'
name = 'node-template'
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
version = '2.0.0-alpha.8'
version = '2.0.0-rc1'
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
@ -20,97 +20,97 @@ structopt = '0.3.8'
[dependencies.node-template-runtime]
path = '../runtime'
version = '2.0.0-alpha.8'
version = '2.0.0-rc1'
[dependencies.sc-basic-authorship]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '0.8.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '0.8.0-rc1'
[dependencies.sc-cli]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '0.8.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '0.8.0-rc1'
[dependencies.sc-client-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sc-consensus]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '0.8.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '0.8.0-rc1'
[dependencies.sc-consensus-aura]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '0.8.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '0.8.0-rc1'
[dependencies.sc-executor]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '0.8.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '0.8.0-rc1'
[dependencies.sc-finality-grandpa]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '0.8.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '0.8.0-rc1'
[dependencies.sc-network]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '0.8.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '0.8.0-rc1'
[dependencies.sc-service]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '0.8.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '0.8.0-rc1'
[dependencies.sc-transaction-pool]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sp-consensus]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '0.8.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '0.8.0-rc1'
[dependencies.sp-consensus-aura]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '0.8.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '0.8.0-rc1'
[dependencies.sp-core]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sp-finality-grandpa]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sp-inherents]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sp-runtime]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sp-transaction-pool]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[build-dependencies.substrate-build-script-utils]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[[bin]]
name = 'node-template'

View File

@ -106,8 +106,11 @@ pub fn new_full(config: Configuration) -> Result<impl AbstractService, ServiceEr
.build()?;
if role.is_authority() {
let proposer =
sc_basic_authorship::ProposerFactory::new(service.client(), service.transaction_pool());
let proposer = sc_basic_authorship::ProposerFactory::new(
service.client(),
service.transaction_pool(),
service.prometheus_registry().as_ref(),
);
let client = service.client();
let select_chain = service.select_chain()

View File

@ -1,15 +1,12 @@
[package]
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
description = 'Substrate FRAME pallet template'
description = 'FRAME pallet template'
edition = '2018'
homepage = 'https://substrate.io'
license = 'Unlicense'
name = 'pallet-template'
repository = 'https://github.com/paritytech/substrate/'
version = '2.0.0-alpha.8'
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
version = '2.0.0-rc1'
[dependencies.codec]
default-features = false
@ -20,32 +17,32 @@ version = '1.3.0'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.frame-system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dev-dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dev-dependencies.sp-io]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dev-dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[features]
default = ['std']

View File

@ -39,6 +39,7 @@ impl system::Trait for Test {
type DbWeight = ();
type BlockExecutionWeight = ();
type ExtrinsicBaseWeight = ();
type MaximumExtrinsicWeight = MaximumBlockWeight;
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;
type Version = ();

View File

@ -1,16 +1,28 @@
[package]
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
edition = '2018'
homepage = 'https://substrate.io'
license = 'Unlicense'
name = 'node-template-runtime'
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
version = '2.0.0-rc1'
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
[dependencies.aura]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'pallet-aura'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.balances]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'pallet-balances'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.codec]
default-features = false
@ -21,28 +33,28 @@ version = '1.3.0'
[dependencies.frame-executive]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.grandpa]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'pallet-grandpa'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.randomness-collective-flip]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'pallet-randomness-collective-flip'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.serde]
features = ['derive']
@ -52,126 +64,108 @@ version = '1.0.101'
[dependencies.sp-api]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sp-block-builder]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sp-consensus-aura]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '0.8.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '0.8.0-rc1'
[dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sp-inherents]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sp-io]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sp-offchain]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sp-session]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sp-std]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sp-transaction-pool]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sp-version]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.sudo]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'pallet-sudo'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'frame-system'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.template]
default-features = false
package = 'pallet-template'
path = '../pallets/template'
version = '2.0.0-alpha.8'
version = '2.0.0-rc1'
[dependencies.timestamp]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'pallet-timestamp'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[dependencies.transaction-payment]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'pallet-transaction-payment'
tag = 'v2.0.0-alpha.8'
version = '2.0.0-alpha.8'
[build-dependencies.wasm-builder-runner]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-wasm-builder-runner'
tag = 'v2.0.0-alpha.8'
version = '1.0.5'
[package]
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
edition = '2018'
homepage = 'https://substrate.io'
license = 'Unlicense'
name = 'node-template-runtime'
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
version = '2.0.0-alpha.8'
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
tag = 'v2.0.0-rc1'
version = '2.0.0-rc1'
[features]
default = ['std']
@ -202,3 +196,9 @@ std = [
'transaction-payment/std',
'template/std',
]
[build-dependencies.wasm-builder-runner]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-wasm-builder-runner'
tag = 'v2.0.0-rc1'
version = '1.0.5'

View File

@ -15,7 +15,7 @@ use sp_runtime::{
transaction_validity::{TransactionValidity, TransactionSource},
};
use sp_runtime::traits::{
BlakeTwo256, Block as BlockT, IdentityLookup, Verify, ConvertInto, IdentifyAccount, NumberFor,
BlakeTwo256, Block as BlockT, IdentityLookup, Verify, IdentifyAccount, NumberFor, Saturating,
};
use sp_api::impl_runtime_apis;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
@ -35,7 +35,7 @@ pub use frame_support::{
construct_runtime, parameter_types, StorageValue,
traits::{KeyOwnerProofSystem, Randomness},
weights::{
Weight,
Weight, IdentityFee,
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
},
};
@ -127,6 +127,9 @@ parameter_types! {
/// We allow for 2 seconds of compute with a 6 second average block time.
pub const MaximumBlockWeight: Weight = 2 * WEIGHT_PER_SECOND;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
/// Assume 10% of weight for average on_initialize calls.
pub const MaximumExtrinsicWeight: Weight = AvailableBlockRatio::get()
.saturating_sub(Perbill::from_percent(10)) * MaximumBlockWeight::get();
pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
pub const Version: RuntimeVersion = VERSION;
}
@ -164,6 +167,10 @@ impl system::Trait for Runtime {
/// The base weight of any extrinsic processed by the runtime, independent of the
/// logic of that extrinsic. (Signature verification, nonce increment, fee, etc...)
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
/// The maximum weight that a single extrinsic of `Normal` dispatch class can have,
/// idependent of the logic of that extrinsics. (Roughly max block weight - average on
/// initialize cost).
type MaximumExtrinsicWeight = MaximumExtrinsicWeight;
/// Maximum size of all encoded transactions (in bytes) that are allowed in one block.
type MaximumBlockLength = MaximumBlockLength;
/// Portion of the block weight that is available to all normal transactions.
@ -236,7 +243,7 @@ impl transaction_payment::Trait for Runtime {
type Currency = balances::Module<Runtime>;
type OnTransactionPayment = ();
type TransactionByteFee = TransactionByteFee;
type WeightToFee = ConvertInto;
type WeightToFee = IdentityFee<Balance>;
type FeeMultiplierUpdate = ();
}