mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 17:11:02 +00:00
update substrate (#442)
This commit is contained in:
committed by
Robert Habermeier
parent
21cb1e9f45
commit
444a19ec5f
Generated
+202
-178
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@ edition = "2018"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
futures = "0.1.17"
|
futures = "0.1.17"
|
||||||
futures03 = { package = "futures-preview", version = "0.3.0-alpha.17", features = ["compat"] }
|
futures03 = { package = "futures-preview", version = "0.3.0-alpha.18", features = ["compat"] }
|
||||||
client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
|
client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
|
||||||
primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
|
primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
|
||||||
substrate-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
|
substrate-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ offences = { package = "srml-offences", git = "https://github.com/paritytech/sub
|
|||||||
session = { package = "srml-session", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
|
session = { package = "srml-session", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
|
||||||
srml-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
|
srml-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
|
||||||
staking = { package = "srml-staking", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
|
staking = { package = "srml-staking", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
|
||||||
|
srml-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
|
||||||
sudo = { package = "srml-sudo", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
|
sudo = { package = "srml-sudo", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
|
||||||
system = { package = "srml-system", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
|
system = { package = "srml-system", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
|
||||||
timestamp = { package = "srml-timestamp", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
|
timestamp = { package = "srml-timestamp", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
|
||||||
|
|||||||
@@ -39,11 +39,11 @@ use client::{
|
|||||||
runtime_api as client_api, impl_runtime_apis,
|
runtime_api as client_api, impl_runtime_apis,
|
||||||
};
|
};
|
||||||
use sr_primitives::{
|
use sr_primitives::{
|
||||||
ApplyResult, generic,
|
ApplyResult, generic, Permill, Perbill, impl_opaque_keys, create_runtime_str, key_types,
|
||||||
transaction_validity::{TransactionValidity, InvalidTransaction, TransactionValidityError},
|
transaction_validity::{TransactionValidity, InvalidTransaction, TransactionValidityError},
|
||||||
impl_opaque_keys, weights::{Weight, DispatchInfo}, create_runtime_str, key_types, traits::{
|
weights::{Weight, DispatchInfo},
|
||||||
BlakeTwo256, Block as BlockT, DigestFor, StaticLookup, SignedExtension,
|
traits::{BlakeTwo256, Block as BlockT, DigestFor, StaticLookup, SignedExtension},
|
||||||
},
|
curve::PiecewiseLinear,
|
||||||
};
|
};
|
||||||
use version::RuntimeVersion;
|
use version::RuntimeVersion;
|
||||||
use grandpa::{AuthorityId as GrandpaId, fg_primitives::{self, ScheduledChange}};
|
use grandpa::{AuthorityId as GrandpaId, fg_primitives::{self, ScheduledChange}};
|
||||||
@@ -67,7 +67,6 @@ pub use timestamp::Call as TimestampCall;
|
|||||||
pub use balances::Call as BalancesCall;
|
pub use balances::Call as BalancesCall;
|
||||||
pub use attestations::{Call as AttestationsCall, MORE_ATTESTATIONS_IDENTIFIER};
|
pub use attestations::{Call as AttestationsCall, MORE_ATTESTATIONS_IDENTIFIER};
|
||||||
pub use parachains::{Call as ParachainsCall, NEW_HEADS_IDENTIFIER};
|
pub use parachains::{Call as ParachainsCall, NEW_HEADS_IDENTIFIER};
|
||||||
pub use sr_primitives::{Permill, Perbill};
|
|
||||||
pub use srml_support::StorageValue;
|
pub use srml_support::StorageValue;
|
||||||
|
|
||||||
/// Implementations of some helper traits passed into runtime modules as associated types.
|
/// Implementations of some helper traits passed into runtime modules as associated types.
|
||||||
@@ -264,6 +263,10 @@ impl_opaque_keys! {
|
|||||||
// TODO: Introduce some structure to tie these together to make it a bit less of a footgun. This
|
// TODO: Introduce some structure to tie these together to make it a bit less of a footgun. This
|
||||||
// should be easy, since OneSessionHandler trait provides the `Key` as an associated type. #2858
|
// should be easy, since OneSessionHandler trait provides the `Key` as an associated type. #2858
|
||||||
|
|
||||||
|
parameter_types! {
|
||||||
|
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
||||||
|
}
|
||||||
|
|
||||||
impl session::Trait for Runtime {
|
impl session::Trait for Runtime {
|
||||||
type OnSessionEnding = Staking;
|
type OnSessionEnding = Staking;
|
||||||
type SessionHandler = SessionHandlers;
|
type SessionHandler = SessionHandlers;
|
||||||
@@ -273,6 +276,7 @@ impl session::Trait for Runtime {
|
|||||||
type SelectInitialValidators = Staking;
|
type SelectInitialValidators = Staking;
|
||||||
type ValidatorId = AccountId;
|
type ValidatorId = AccountId;
|
||||||
type ValidatorIdOf = staking::StashOf<Self>;
|
type ValidatorIdOf = staking::StashOf<Self>;
|
||||||
|
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl session::historical::Trait for Runtime {
|
impl session::historical::Trait for Runtime {
|
||||||
@@ -280,11 +284,23 @@ impl session::historical::Trait for Runtime {
|
|||||||
type FullIdentificationOf = staking::ExposureOf<Self>;
|
type FullIdentificationOf = staking::ExposureOf<Self>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
srml_staking_reward_curve::build! {
|
||||||
|
const REWARD_CURVE: PiecewiseLinear<'static> = curve!(
|
||||||
|
min_inflation: 0_025_000,
|
||||||
|
max_inflation: 0_100_000,
|
||||||
|
ideal_stake: 0_500_000,
|
||||||
|
falloff: 0_050_000,
|
||||||
|
max_piece_count: 40,
|
||||||
|
test_precision: 0_005_000,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
// Six sessions in an era (24 hours).
|
// Six sessions in an era (24 hours).
|
||||||
pub const SessionsPerEra: SessionIndex = 6;
|
pub const SessionsPerEra: SessionIndex = 6;
|
||||||
// 28 eras for unbonding (28 days).
|
// 28 eras for unbonding (28 days).
|
||||||
pub const BondingDuration: staking::EraIndex = 28;
|
pub const BondingDuration: staking::EraIndex = 28;
|
||||||
|
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl staking::Trait for Runtime {
|
impl staking::Trait for Runtime {
|
||||||
@@ -298,6 +314,7 @@ impl staking::Trait for Runtime {
|
|||||||
type BondingDuration = BondingDuration;
|
type BondingDuration = BondingDuration;
|
||||||
type SessionInterface = Self;
|
type SessionInterface = Self;
|
||||||
type Time = Timestamp;
|
type Time = Timestamp;
|
||||||
|
type RewardCurve = RewardCurve;
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
@@ -347,6 +364,7 @@ parameter_types! {
|
|||||||
pub const CandidacyBond: Balance = 10 * DOLLARS;
|
pub const CandidacyBond: Balance = 10 * DOLLARS;
|
||||||
pub const VotingBond: Balance = 1 * DOLLARS;
|
pub const VotingBond: Balance = 1 * DOLLARS;
|
||||||
pub const VotingFee: Balance = 2 * DOLLARS;
|
pub const VotingFee: Balance = 2 * DOLLARS;
|
||||||
|
pub const MinimumVotingLock: Balance = 1 * DOLLARS;
|
||||||
pub const PresentSlashPerVoter: Balance = 1 * CENTS;
|
pub const PresentSlashPerVoter: Balance = 1 * CENTS;
|
||||||
pub const CarryCount: u32 = 6;
|
pub const CarryCount: u32 = 6;
|
||||||
// one additional vote should go by before an inactive voter can be reaped.
|
// one additional vote should go by before an inactive voter can be reaped.
|
||||||
@@ -366,6 +384,7 @@ impl elections::Trait for Runtime {
|
|||||||
type CandidacyBond = CandidacyBond;
|
type CandidacyBond = CandidacyBond;
|
||||||
type VotingBond = VotingBond;
|
type VotingBond = VotingBond;
|
||||||
type VotingFee = VotingFee;
|
type VotingFee = VotingFee;
|
||||||
|
type MinimumVotingLock = MinimumVotingLock;
|
||||||
type PresentSlashPerVoter = PresentSlashPerVoter;
|
type PresentSlashPerVoter = PresentSlashPerVoter;
|
||||||
type CarryCount = CarryCount;
|
type CarryCount = CarryCount;
|
||||||
type InactiveGracePeriod = InactiveGracePeriod;
|
type InactiveGracePeriod = InactiveGracePeriod;
|
||||||
@@ -424,7 +443,6 @@ impl im_online::Trait for Runtime {
|
|||||||
type Call = Call;
|
type Call = Call;
|
||||||
type SubmitTransaction = SubmitTransaction;
|
type SubmitTransaction = SubmitTransaction;
|
||||||
type ReportUnresponsiveness = ();
|
type ReportUnresponsiveness = ();
|
||||||
type CurrentElectedSet = staking::CurrentElectedStashAccounts<Runtime>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl grandpa::Trait for Runtime {
|
impl grandpa::Trait for Runtime {
|
||||||
|
|||||||
@@ -890,6 +890,7 @@ mod tests {
|
|||||||
Perbill,
|
Perbill,
|
||||||
traits::{BlakeTwo256, IdentityLookup, ConvertInto},
|
traits::{BlakeTwo256, IdentityLookup, ConvertInto},
|
||||||
testing::{UintAuthorityId, Header},
|
testing::{UintAuthorityId, Header},
|
||||||
|
curve::PiecewiseLinear,
|
||||||
};
|
};
|
||||||
use primitives::{
|
use primitives::{
|
||||||
parachain::{CandidateReceipt, HeadData, ValidityAttestation, ValidatorId},
|
parachain::{CandidateReceipt, HeadData, ValidityAttestation, ValidatorId},
|
||||||
@@ -944,6 +945,7 @@ mod tests {
|
|||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const Period: BlockNumber = 1;
|
pub const Period: BlockNumber = 1;
|
||||||
pub const Offset: BlockNumber = 0;
|
pub const Offset: BlockNumber = 0;
|
||||||
|
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
||||||
}
|
}
|
||||||
|
|
||||||
impl session::Trait for Test {
|
impl session::Trait for Test {
|
||||||
@@ -955,6 +957,7 @@ mod tests {
|
|||||||
type SelectInitialValidators = staking::Module<Self>;
|
type SelectInitialValidators = staking::Module<Self>;
|
||||||
type ValidatorId = u64;
|
type ValidatorId = u64;
|
||||||
type ValidatorIdOf = staking::StashOf<Self>;
|
type ValidatorIdOf = staking::StashOf<Self>;
|
||||||
|
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl session::historical::Trait for Test {
|
impl session::historical::Trait for Test {
|
||||||
@@ -1005,10 +1008,22 @@ mod tests {
|
|||||||
type WeightToFee = ConvertInto;
|
type WeightToFee = ConvertInto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
srml_staking_reward_curve::build! {
|
||||||
|
const REWARD_CURVE: PiecewiseLinear<'static> = curve!(
|
||||||
|
min_inflation: 0_025_000,
|
||||||
|
max_inflation: 0_100_000,
|
||||||
|
ideal_stake: 0_500_000,
|
||||||
|
falloff: 0_050_000,
|
||||||
|
max_piece_count: 40,
|
||||||
|
test_precision: 0_005_000,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const SessionsPerEra: sr_staking_primitives::SessionIndex = 6;
|
pub const SessionsPerEra: sr_staking_primitives::SessionIndex = 6;
|
||||||
pub const BondingDuration: staking::EraIndex = 28;
|
pub const BondingDuration: staking::EraIndex = 28;
|
||||||
pub const AttestationPeriod: BlockNumber = 100;
|
pub const AttestationPeriod: BlockNumber = 100;
|
||||||
|
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl staking::Trait for Test {
|
impl staking::Trait for Test {
|
||||||
@@ -1022,6 +1037,7 @@ mod tests {
|
|||||||
type BondingDuration = BondingDuration;
|
type BondingDuration = BondingDuration;
|
||||||
type SessionInterface = Self;
|
type SessionInterface = Self;
|
||||||
type Time = timestamp::Module<Test>;
|
type Time = timestamp::Module<Test>;
|
||||||
|
type RewardCurve = RewardCurve;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl attestations::Trait for Test {
|
impl attestations::Trait for Test {
|
||||||
|
|||||||
@@ -20,11 +20,12 @@ use primitives::{Pair, Public, crypto::UncheckedInto};
|
|||||||
use polkadot_primitives::{AccountId, parachain::ValidatorId};
|
use polkadot_primitives::{AccountId, parachain::ValidatorId};
|
||||||
use polkadot_runtime::{
|
use polkadot_runtime::{
|
||||||
GenesisConfig, CouncilConfig, ElectionsConfig, DemocracyConfig, SystemConfig,
|
GenesisConfig, CouncilConfig, ElectionsConfig, DemocracyConfig, SystemConfig,
|
||||||
SessionConfig, StakingConfig, BalancesConfig, Perbill, SessionKeys, TechnicalCommitteeConfig,
|
SessionConfig, StakingConfig, BalancesConfig, SessionKeys, TechnicalCommitteeConfig,
|
||||||
SudoConfig, IndicesConfig, StakerStatus, WASM_BINARY,
|
SudoConfig, IndicesConfig, StakerStatus, WASM_BINARY,
|
||||||
ClaimsConfig, ParachainsConfig
|
ClaimsConfig, ParachainsConfig
|
||||||
};
|
};
|
||||||
use polkadot_runtime::constants::{currency::DOTS, time::*};
|
use polkadot_runtime::constants::{currency::DOTS, time::*};
|
||||||
|
use sr_primitives::Perbill;
|
||||||
use telemetry::TelemetryEndpoints;
|
use telemetry::TelemetryEndpoints;
|
||||||
use hex_literal::hex;
|
use hex_literal::hex;
|
||||||
use babe_primitives::AuthorityId as BabeId;
|
use babe_primitives::AuthorityId as BabeId;
|
||||||
|
|||||||
@@ -332,9 +332,8 @@ pub fn new_light(config: Configuration<CustomConfiguration, GenesisConfig>)
|
|||||||
.with_transaction_pool(|config, client|
|
.with_transaction_pool(|config, client|
|
||||||
Ok(TransactionPool::new(config, transaction_pool::ChainApi::new(client)))
|
Ok(TransactionPool::new(config, transaction_pool::ChainApi::new(client)))
|
||||||
)?
|
)?
|
||||||
.with_import_queue_and_fprb(|_config, client, backend, _select_chain, transaction_pool| {
|
.with_import_queue_and_fprb(|_config, client, backend, fetcher, _select_chain, transaction_pool| {
|
||||||
let fetch_checker = backend.blockchain().fetcher()
|
let fetch_checker = fetcher
|
||||||
.upgrade()
|
|
||||||
.map(|fetcher| fetcher.checker().clone())
|
.map(|fetcher| fetcher.checker().clone())
|
||||||
.ok_or_else(|| "Trying to start light import queue without active fetch checker")?;
|
.ok_or_else(|| "Trying to start light import queue without active fetch checker")?;
|
||||||
let block_import = grandpa::light_block_import::<_, _, _, RuntimeApi, _>(
|
let block_import = grandpa::light_block_import::<_, _, _, RuntimeApi, _>(
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
use wasm_builder_runner::{build_current_project_with_rustflags, WasmBuilderSource};
|
use wasm_builder_runner::{build_current_project_with_rustflags, WasmBuilderSource};
|
||||||
|
|
||||||
use std::env;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
build_current_project_with_rustflags(
|
build_current_project_with_rustflags(
|
||||||
"wasm_binary.rs",
|
"wasm_binary.rs",
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ edition = "2018"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
futures = "0.1.17"
|
futures = "0.1.17"
|
||||||
futures03 = { package = "futures-preview", version = "0.3.0-alpha.17", features = ["compat"] }
|
futures03 = { package = "futures-preview", version = "0.3.0-alpha.18", features = ["compat"] }
|
||||||
futures-timer = "0.2.1"
|
futures-timer = "0.4.0"
|
||||||
parking_lot = "0.9.0"
|
parking_lot = "0.9.0"
|
||||||
tokio = "0.1.7"
|
tokio = "0.1.7"
|
||||||
derive_more = "0.14.0"
|
derive_more = "0.14.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user