mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-09 03:38:00 +00:00
Pruning changes trie without digests (#952)
* pruning changes tries without digests * u64::max_value()
This commit is contained in:
committed by
Gav Wood
parent
5b28147d27
commit
6f9a505fba
@@ -59,7 +59,6 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
consensus: Some(ConsensusConfig {
|
||||
code: include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm").to_vec(), // TODO change
|
||||
authorities: initial_authorities.clone(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
system: None,
|
||||
balances: Some(BalancesConfig {
|
||||
@@ -70,12 +69,10 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
transfer_fee: 1 * CENTS,
|
||||
creation_fee: 1 * CENTS,
|
||||
reclaim_rebate: 1 * CENTS,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
session: Some(SessionConfig {
|
||||
validators: initial_authorities.iter().cloned().map(Into::into).collect(),
|
||||
session_length: 5 * MINUTES,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
staking: Some(StakingConfig {
|
||||
current_era: 0,
|
||||
@@ -89,13 +86,11 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
bonding_duration: 1 * DAYS,
|
||||
offline_slash_grace: 4,
|
||||
minimum_validator_count: 4,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
democracy: Some(DemocracyConfig {
|
||||
launch_period: 5 * MINUTES, // 1 day per public referendum
|
||||
voting_period: 5 * MINUTES, // 3 days to discuss & vote on an active referendum
|
||||
minimum_deposit: 50 * DOLLARS, // 12000 as the minimum deposit for a referendum
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
council_seats: Some(CouncilSeatsConfig {
|
||||
active_council: vec![],
|
||||
@@ -108,23 +103,19 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
term_duration: 28 * DAYS,
|
||||
desired_seats: 0,
|
||||
inactive_grace_period: 1, // one additional vote should go by before an inactive voter can be reaped.
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
council_voting: Some(CouncilVotingConfig {
|
||||
cooloff_period: 4 * DAYS,
|
||||
voting_period: 1 * DAYS,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
timestamp: Some(TimestampConfig {
|
||||
period: SECS_PER_BLOCK,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
treasury: Some(TreasuryConfig {
|
||||
proposal_bond: Permill::from_percent(5),
|
||||
proposal_bond_minimum: 1 * DOLLARS,
|
||||
spend_period: 1 * DAYS,
|
||||
burn: Permill::from_percent(50),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
contract: Some(ContractConfig {
|
||||
contract_fee: 1 * CENTS,
|
||||
@@ -134,11 +125,9 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
max_depth: 1024,
|
||||
block_gas_limit: 10_000_000,
|
||||
current_schedule: Default::default(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
upgrade_key: Some(UpgradeKeyConfig {
|
||||
key: endowed_accounts[0].clone(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
}
|
||||
}
|
||||
@@ -186,7 +175,6 @@ pub fn testnet_genesis(
|
||||
consensus: Some(ConsensusConfig {
|
||||
code: include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm").to_vec(),
|
||||
authorities: initial_authorities.clone(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
system: None,
|
||||
balances: Some(BalancesConfig {
|
||||
@@ -197,12 +185,10 @@ pub fn testnet_genesis(
|
||||
creation_fee: 0,
|
||||
reclaim_rebate: 0,
|
||||
balances: endowed_accounts.iter().map(|&k| (k.into(), (1 << 60))).collect(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
session: Some(SessionConfig {
|
||||
validators: initial_authorities.iter().cloned().map(Into::into).collect(),
|
||||
session_length: 10,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
staking: Some(StakingConfig {
|
||||
current_era: 0,
|
||||
@@ -216,13 +202,11 @@ pub fn testnet_genesis(
|
||||
current_offline_slash: 0,
|
||||
current_session_reward: 0,
|
||||
offline_slash_grace: 0,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
democracy: Some(DemocracyConfig {
|
||||
launch_period: 9,
|
||||
voting_period: 18,
|
||||
minimum_deposit: 10,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
council_seats: Some(CouncilSeatsConfig {
|
||||
active_council: endowed_accounts.iter()
|
||||
@@ -237,23 +221,19 @@ pub fn testnet_genesis(
|
||||
term_duration: 1000000,
|
||||
desired_seats: (endowed_accounts.len() - initial_authorities.len()) as u32,
|
||||
inactive_grace_period: 1,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
council_voting: Some(CouncilVotingConfig {
|
||||
cooloff_period: 75,
|
||||
voting_period: 20,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
timestamp: Some(TimestampConfig {
|
||||
period: 5, // 5 second block time.
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
treasury: Some(TreasuryConfig {
|
||||
proposal_bond: Permill::from_percent(5),
|
||||
proposal_bond_minimum: 1_000_000,
|
||||
spend_period: 12 * 60 * 24,
|
||||
burn: Permill::from_percent(50),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
contract: Some(ContractConfig {
|
||||
contract_fee: 21,
|
||||
@@ -263,11 +243,9 @@ pub fn testnet_genesis(
|
||||
max_depth: 1024,
|
||||
block_gas_limit: 10_000_000,
|
||||
current_schedule: Default::default(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
upgrade_key: Some(UpgradeKeyConfig {
|
||||
key: upgrade_key,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
}
|
||||
}
|
||||
@@ -311,7 +289,7 @@ mod tests {
|
||||
|
||||
fn local_testnet_genesis_instant() -> GenesisConfig {
|
||||
let mut genesis = local_testnet_genesis();
|
||||
genesis.timestamp = Some(TimestampConfig { period: 0, _genesis_phantom_data: Default::default() });
|
||||
genesis.timestamp = Some(TimestampConfig { period: 0 });
|
||||
genesis
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ use substrate_service::{
|
||||
Roles, TaskExecutor,
|
||||
};
|
||||
use node_executor;
|
||||
use consensus::{import_queue, start_aura, Config as AuraConfig, AuraImportQueue, NothingExtra};
|
||||
use consensus::{import_queue, start_aura, Config as AuraConfig, AuraImportQueue};
|
||||
use client;
|
||||
|
||||
const AURA_SLOT_DURATION: u64 = 6;
|
||||
@@ -79,25 +79,17 @@ construct_service_factory! {
|
||||
},
|
||||
LightService = LightComponents<Self>
|
||||
{ |config, executor| <LightComponents<Factory>>::new(config, executor) },
|
||||
FullImportQueue = AuraImportQueue<Self::Block, FullClient<Self>, NothingExtra>
|
||||
{ |config, client| Ok(import_queue(
|
||||
AuraConfig {
|
||||
FullImportQueue = AuraImportQueue<Self::Block, FullClient<Self>>
|
||||
{ |config, client| Ok(import_queue(AuraConfig {
|
||||
local_key: None,
|
||||
slot_duration: 5
|
||||
}, client)) },
|
||||
LightImportQueue = AuraImportQueue<Self::Block, LightClient<Self>>
|
||||
{ |config, client| Ok(
|
||||
import_queue(AuraConfig {
|
||||
local_key: None,
|
||||
slot_duration: 5
|
||||
},
|
||||
client,
|
||||
NothingExtra,
|
||||
))
|
||||
},
|
||||
LightImportQueue = AuraImportQueue<Self::Block, LightClient<Self>, NothingExtra>
|
||||
{ |config, client| Ok(import_queue(
|
||||
AuraConfig {
|
||||
local_key: None,
|
||||
slot_duration: 5
|
||||
},
|
||||
client,
|
||||
NothingExtra,
|
||||
))
|
||||
}, client))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,3 @@ srml-timestamp = { path = "../../srml/timestamp" }
|
||||
srml-treasury = { path = "../../srml/treasury" }
|
||||
srml-contract = { path = "../../srml/contract" }
|
||||
wabt = "0.4"
|
||||
|
||||
[features]
|
||||
benchmarks = []
|
||||
|
||||
@@ -17,14 +17,10 @@
|
||||
//! A `CodeExecutor` specialisation which uses natively compiled runtime when the wasm to be
|
||||
//! executed is equivalent to the natively compiled code.
|
||||
|
||||
#![cfg_attr(feature = "benchmarks", feature(test))]
|
||||
|
||||
extern crate node_runtime;
|
||||
#[macro_use] extern crate substrate_executor;
|
||||
#[cfg_attr(test, macro_use)] extern crate substrate_primitives as primitives;
|
||||
|
||||
#[cfg(feature = "benchmarks")] extern crate test;
|
||||
|
||||
#[cfg(test)] extern crate substrate_keyring as keyring;
|
||||
#[cfg(test)] extern crate sr_primitives as runtime_primitives;
|
||||
#[cfg(test)] extern crate srml_support as runtime_support;
|
||||
@@ -234,12 +230,10 @@ mod tests {
|
||||
transfer_fee: 0,
|
||||
creation_fee: 0,
|
||||
reclaim_rebate: 0,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
session: Some(SessionConfig {
|
||||
session_length: 2,
|
||||
validators: vec![One.to_raw_public().into(), Two.to_raw_public().into(), three],
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
staking: Some(StakingConfig {
|
||||
sessions_per_era: 2,
|
||||
@@ -253,7 +247,6 @@ mod tests {
|
||||
current_offline_slash: 0,
|
||||
current_session_reward: 0,
|
||||
offline_slash_grace: 0,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
democracy: Some(Default::default()),
|
||||
council_seats: Some(Default::default()),
|
||||
@@ -751,19 +744,4 @@ mod tests {
|
||||
|
||||
assert!(t.storage_changes_root(Default::default(), 0).is_some());
|
||||
}
|
||||
|
||||
#[cfg(feature = "benchmarks")]
|
||||
mod benches {
|
||||
use super::*;
|
||||
use test::Bencher;
|
||||
|
||||
#[bench]
|
||||
fn wasm_execute_block(b: &mut Bencher) {
|
||||
b.iter(|| {
|
||||
let mut t = new_test_ext(false);
|
||||
WasmExecutor::new().call(&mut t, 8, COMPACT_CODE, "execute_block", &block1(false).0).unwrap();
|
||||
WasmExecutor::new().call(&mut t, 8, COMPACT_CODE, "execute_block", &block2().0).unwrap();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+12
-5
@@ -472,6 +472,11 @@ dependencies = [
|
||||
"ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nan-preserving-float"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "net2"
|
||||
version = "0.2.33"
|
||||
@@ -934,7 +939,7 @@ dependencies = [
|
||||
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-std 0.1.0",
|
||||
"substrate-primitives 0.1.0",
|
||||
"wasmi 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1265,7 +1270,7 @@ dependencies = [
|
||||
"substrate-serializer 0.1.0",
|
||||
"substrate-state-machine 0.1.0",
|
||||
"substrate-trie 0.4.0",
|
||||
"wasmi 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1311,7 +1316,7 @@ dependencies = [
|
||||
"twox-hash 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"uint 0.5.0-beta.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmi 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1654,11 +1659,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "wasmi"
|
||||
version = "0.4.2"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"nan-preserving-float 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@@ -1781,6 +1787,7 @@ dependencies = [
|
||||
"checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40"
|
||||
"checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125"
|
||||
"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
|
||||
"checksum nan-preserving-float 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34d4f00fcc2f4c9efa8cc971db0da9e28290e28e97af47585e48691ef10ff31f"
|
||||
"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88"
|
||||
"checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2"
|
||||
"checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea"
|
||||
@@ -1861,7 +1868,7 @@ dependencies = [
|
||||
"checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d"
|
||||
"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
|
||||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
||||
"checksum wasmi 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8a60b9508cff2b7c27ed41200dd668806280740fadc8c88440e9c88625e84f1a"
|
||||
"checksum wasmi 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d184c4b7081f30316f74f8d73c197314dcb56ea7af9323522b42a2fa9cb19453"
|
||||
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
|
||||
"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0"
|
||||
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
|
||||
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user