Skip to content

Commit 0305af1

Browse files
authored
Local/v0.9.10 (paritytech#596)
* Set version as V0.9.10 * Change telemetery chain name * fix rpc trading_pairs overflow * fix rpc quotations overflow * Use account instead of authority_id in xsession initializetion Closes paritytech#558 * Update substrate * Update genesis * Add tty password * Modified team & council public key * Update concil as 5 * Update genesis btc-header * Update team and council account * update substrate update substrate to 96986d4
1 parent da3129e commit 0305af1

File tree

14 files changed

+197
-152
lines changed

14 files changed

+197
-152
lines changed

Cargo.lock

Lines changed: 91 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "chainx"
3-
version = "0.9.9"
3+
version = "0.9.10"
44
build = "build.rs"
55
authors = ["Chainpool <https://www.chainx.org>"]
66
edition = "2018"

cli/src/chain_spec.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub fn development_config() -> ChainSpec {
5959
CHAINX_TELEMETRY_URL.to_string(),
6060
0,
6161
)])),
62-
Some("DEV ChainX V0.9.9"),
62+
Some("DEV ChainX V0.9.10"),
6363
None,
6464
Some(
6565
json!({
@@ -80,20 +80,20 @@ fn testnet_genesis() -> GenesisConfig {
8080

8181
pub fn testnet_config() -> ChainSpec {
8282
let boot_nodes = vec![
83-
"/ip4/47.96.134.203/tcp/31126/p2p/QmUzwniXCadDYiHBQhw4CnMNRRttnVAXE2TBdDYXcT65va".into(),
84-
"/ip4/47.96.97.52/tcp/31127/p2p/QmUXuCPovJpMf3Y1AAA5pZJkPhMQkmX1tEgHhCz82cDtiA".into(),
85-
"/ip4/47.110.232.108/tcp/31129/p2p/QmRnWu3c7Mq7bVHTwJTrSC76XKMQJx4cmGofhSA5XTkk9q".into(),
83+
//"/ip4/47.96.134.203/tcp/31126/p2p/QmUzwniXCadDYiHBQhw4CnMNRRttnVAXE2TBdDYXcT65va".into(),
84+
//"/ip4/47.96.97.52/tcp/31127/p2p/QmUXuCPovJpMf3Y1AAA5pZJkPhMQkmX1tEgHhCz82cDtiA".into(),
85+
//"/ip4/47.110.232.108/tcp/31129/p2p/QmRnWu3c7Mq7bVHTwJTrSC76XKMQJx4cmGofhSA5XTkk9q".into(),
8686
];
8787
ChainSpec::from_genesis(
88-
"ChainX V0.9.9",
88+
"ChainX Local V0.9.10",
8989
"chainx_testnet",
9090
testnet_genesis,
9191
boot_nodes,
9292
Some(TelemetryEndpoints::new(vec![
9393
(STAGING_TELEMETRY_URL.to_string(), 0),
9494
(CHAINX_TELEMETRY_URL.to_string(), 0),
9595
])),
96-
Some("ChainX Testnet V0.9.9"),
96+
Some("ChainX Testnet V0.9.10"),
9797
None,
9898
Some(
9999
json!({
82 Bytes
Binary file not shown.

cli/src/genesis_config.rs

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,17 @@ pub fn genesis(genesis_spec: GenesisSpec) -> GenesisConfig {
6565
genesis_node_info.truncate(initial_authorities_len);
6666

6767
let team_account = vec![
68-
hex("a2308187439ac204df9e299e1e54afefafea4bf348e03dad679737c91871dc53"),
69-
hex("6488ceea630000b48fed318d13248ea7c566c0f4d2b8b90d12a136ad6eb02323"),
70-
hex("56758d236714a2fa7981af8c8177dddc6907875b2c23fd5c842922c8a2c5a1be"),
68+
hex("a5b74e024ed2823e5dc4d4e77313c0601393f107c7fa62b9e8ca54930b12d545"),
69+
hex("bf40736f7157faf64411ef36de9b6dae8133be3edf460a50d9e84cc05829dc21"),
70+
hex("120bdbc81e1172e17becc965a51dc1bf3e782162eadee54b5d94fec8a0288c83"),
7171
];
7272

7373
let council_account = vec![
74-
hex("a2308187439ac204df9e299e1e54afefafea4bf348e03dad679737c91871dc53"),
75-
hex("6488ceea630000b48fed318d13248ea7c566c0f4d2b8b90d12a136ad6eb02323"),
76-
hex("56758d236714a2fa7981af8c8177dddc6907875b2c23fd5c842922c8a2c5a1be"),
77-
hex("3f53e37c21e24df9cacc2ec69d010d144fe4dace6b2f087f466ade8b6b72278f"),
78-
hex("d3581c060b04fe74f625f053d6392edb86e94b3d02de7bba4728f761c0700773"),
79-
hex("eb9c5cc73a88e455c86ee59f9d7437666dd4b1b3f54334dff83b0d3d1e4a41a9"),
74+
hex("1595e186c3a915cfbd4f601b23a88bbaab873bfefbb09d231483e424633093e7"),
75+
hex("a4e99224b97dee6798f3fb90b835d63e3f4059f334f09a44e23420ca993e45f0"),
76+
hex("7ad04497564c5da319794aa8c99375d61878f471124dbc83dcc5a3cd6418af11"),
77+
hex("b16a5254fff78ab974abd25c64430ae5944e201916d003807226b6e2a0fcd1f1"),
78+
hex("041b0452b3defb8bdcaab8f4786fa634ae6f841cbe1ee9e1959bd94eaa021f7f"),
8079
];
8180

8281
let blocks_per_session = 150; // 150 blocks per session
@@ -86,7 +85,7 @@ pub fn genesis(genesis_spec: GenesisSpec) -> GenesisConfig {
8685
let intention_bonding_duration = bonding_duration * 10; // freeze 150*12*10 blocks for intention
8786

8887
let params_info = Params::new(
89-
520159231, // max_bits
88+
486604799, // max_bits
9089
2 * 60 * 60, // block_max_future
9190
2 * 7 * 24 * 60 * 60, // target_timespan_seconds
9291
10 * 60, // target_spacing_seconds
@@ -108,9 +107,7 @@ pub fn genesis(genesis_spec: GenesisSpec) -> GenesisConfig {
108107
xsession: Some(SessionConfig {
109108
validators: genesis_node_info
110109
.iter()
111-
.map(|(_, authority_id, balance, _, _, _, _, _)| {
112-
(authority_id.clone().into(), *balance)
113-
})
110+
.map(|(account, _, balance, _, _, _, _, _)| (account.clone().into(), *balance))
114111
.collect(),
115112
session_length: blocks_per_session,
116113
keys: genesis_node_info
@@ -122,7 +119,7 @@ pub fn genesis(genesis_spec: GenesisSpec) -> GenesisConfig {
122119
}),
123120
// chainx runtime module
124121
xsystem: Some(XSystemConfig {
125-
network_props: (xsystem::NetworkType::Testnet, 44),
122+
network_props: (xsystem::NetworkType::Mainnet, 44),
126123
_genesis_phantom_data: Default::default(),
127124
}),
128125
xfee_manager: Some(XFeeManagerConfig {
@@ -166,25 +163,25 @@ pub fn genesis(genesis_spec: GenesisSpec) -> GenesisConfig {
166163
// start genesis block: (genesis, blocknumber)
167164
genesis: (
168165
BlockHeader {
169-
version: 536870912,
166+
version: 545259520,
170167
previous_header_hash: h256_from_rev_str(
171-
"0000000000000f3b669061e1437c502eda529057c33a115b63abdb328b5b4645",
168+
"00000000000000000001b2505c11119fcf29be733ec379f686518bf1090a522a",
172169
),
173170
merkle_root_hash: h256_from_rev_str(
174-
"b954ca2828475be7f5f772a26369b51e6808d853a0e62219af0dcb9f8f9aa0ad",
171+
"cc09d95fd8ccc985826b9eb46bf73f8449116f18535423129f0574500985cf90",
175172
),
176-
time: 1556000895,
177-
bits: Compact::new(437247136),
178-
nonce: 472822001,
173+
time: 1556958733,
174+
bits: Compact::new(388628280),
175+
nonce: 2897942742,
179176
},
180-
1511056,
177+
574560,
181178
),
182179
genesis_hash: h256_from_rev_str(
183-
"0000000000000e6b5c9b88cf3b2b89374841769d075c2698cc80c2eac98cdd54",
180+
"00000000000000000008c8427670a65dec4360e88bf6c8381541ef26b30bd8fc",
184181
),
185182
params_info, // retargeting_factor
186-
network_id: 1,
187-
confirmation_number: 6,
183+
network_id: 0,
184+
confirmation_number: 4,
188185
reserved_block: 2100,
189186
btc_withdrawal_fee: 40000,
190187
max_withdrawal_count: 100,
@@ -197,7 +194,7 @@ pub fn genesis(genesis_spec: GenesisSpec) -> GenesisConfig {
197194
trustee_info_config: vec![(
198195
Chain::Bitcoin,
199196
TrusteeInfoConfig {
200-
min_trustee_count: 4,
197+
min_trustee_count: 3,
201198
max_trustee_count: 15,
202199
},
203200
)],

cli/src/genesis_node.csv

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
account_id,authority_key,money,node_name,node_url,memo,hot_entity,cold_entity
2-
a2308187439ac204df9e299e1e54afefafea4bf348e03dad679737c91871dc53,a2308187439ac204df9e299e1e54afefafea4bf348e03dad679737c91871dc53,10,genesis1,polkadot.network,,03f72c448a0e59f48d4adef86cba7b278214cece8e56ef32ba1d179e0a8129bdba,02a79800dfed17ad4c78c52797aa3449925692bc8c83de469421080f42d27790ee
3-
6488ceea630000b48fed318d13248ea7c566c0f4d2b8b90d12a136ad6eb02323,6488ceea630000b48fed318d13248ea7c566c0f4d2b8b90d12a136ad6eb02323,10,genesis2,polkadot.network,,0306117a360e5dbe10e1938a047949c25a86c0b0e08a0a7c1e611b97de6b2917dd,03ece1a20b5468b12fd7beda3e62ef6b2f6ad9774489e9aff1c8bc684d87d70780
4-
56758d236714a2fa7981af8c8177dddc6907875b2c23fd5c842922c8a2c5a1be,56758d236714a2fa7981af8c8177dddc6907875b2c23fd5c842922c8a2c5a1be,10,genesis3,polkadot.network,,0311252930af8ba766b9c7a6580d8dc4bbf9b0befd17a8ef7fabac275bba77ae40,02e34d10113f2dd162e8d8614a4afbb8e2eb14eddf4036042b35d12cf5529056a2
5-
3f53e37c21e24df9cacc2ec69d010d144fe4dace6b2f087f466ade8b6b72278f,3f53e37c21e24df9cacc2ec69d010d144fe4dace6b2f087f466ade8b6b72278f,10,genesis4,polkadot.network,,0227e54b65612152485a812b8856e92f41f64788858466cc4d8df674939a5538c3,020699bf931859cafdacd8ac4d3e055eae7551427487e281e3efba618bdd395f2f
6-
2+
a2308187439ac204df9e299e1e54afefafea4bf348e03dad679737c91871dc53,a2308187439ac204df9e299e1e54afefafea4bf348e03dad679737c91871dc53,10,genesis1,polkadot.network,,02a3ee44550a9c13575e99f96fc56db20e2f7f686276c82a5737bacca07163571f,02c048a87feb43fe1292c6fa36cfffce33fb77e7306aa3ee3467215d717143a577
3+
6488ceea630000b48fed318d13248ea7c566c0f4d2b8b90d12a136ad6eb02323,6488ceea630000b48fed318d13248ea7c566c0f4d2b8b90d12a136ad6eb02323,10,genesis2,polkadot.network,,02fabd0895598ee8c11a6d4f4610a8b872fe5cefa2d62e82fef12825ec7901e32c,03622d302fdcf12dfbc558e7cca7ebaecca117249191fe54952b63824d794e87bc
4+
56758d236714a2fa7981af8c8177dddc6907875b2c23fd5c842922c8a2c5a1be,56758d236714a2fa7981af8c8177dddc6907875b2c23fd5c842922c8a2c5a1be,10,genesis3,polkadot.network,,03c591c812d681b7b1791b2a5753f4e346eba60f3448bb1f71be93d608644bf67b,03c591c812d681b7b1791b2a5753f4e346eba60f3448bb1f71be93d608644bf67b
5+
3f53e37c21e24df9cacc2ec69d010d144fe4dace6b2f087f466ade8b6b72278f,3f53e37c21e24df9cacc2ec69d010d144fe4dace6b2f087f466ade8b6b72278f,10,genesis4,polkadot.network,,,

cli/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ impl ChainSpec {
5656

5757
pub(crate) fn from(s: &str) -> Option<Self> {
5858
match s {
59-
// TODO wait for substrate fix for command sequence
60-
"dev" | "" => Some(ChainSpec::Development),
59+
"mainnet" | "" => Some(ChainSpec::Mainnet),
6160
"testnet" => Some(ChainSpec::Testnet),
62-
"mainnet" => Some(ChainSpec::Testnet),
61+
"dev" => Some(ChainSpec::Development),
6362
_ => None,
6463
}
6564
}

cli/src/params.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ pub struct ChainXParams {
55
#[structopt(long = "validator-name", value_name = "NAME")]
66
/// registered validator name, when give the node `--key`, must provide matching validator's unique name
77
pub validator_name: Option<String>,
8-
9-
#[structopt(long = "only-grandpa")]
10-
pub only_grandpa: bool,
118
}
129

1310
impl cli::AugmentClap for ChainXParams {

cli/src/service.rs

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ use std::time::Duration;
2424

2525
use log::{info, warn};
2626

27+
use client::LongestChain;
2728
use consensus::{import_queue, start_aura, AuraImportQueue, NothingExtra, SlotDuration};
29+
use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider};
2830
use inherents::InherentDataProviders;
2931
use network::construct_simple_protocol;
3032
use sr_primitives::generic::BlockId;
3133
use sr_primitives::traits::ProvideRuntimeApi;
3234
use substrate_primitives::{ed25519, Pair as PairT};
33-
use client::LongestChain;
3435
use substrate_service::{
3536
construct_service_factory, FactoryFullConfiguration, FullBackend, FullClient, FullComponents,
3637
FullExecutor, LightBackend, LightClient, LightComponents, LightExecutor, TaskExecutor,
@@ -210,8 +211,7 @@ construct_service_factory! {
210211
LightService = LightComponents<Self>
211212
{ |config, executor| <LightComponents<Factory>>::new(config, executor) },
212213
FullImportQueue = AuraImportQueue<Self::Block>
213-
{ |config: &mut FactoryFullConfiguration<Self> , client: Arc<FullClient<Self>>,
214-
select_chain: Self::SelectChain| {
214+
{ |config: &mut FactoryFullConfiguration<Self> , client: Arc<FullClient<Self>>, select_chain: Self::SelectChain| {
215215
let slot_duration = SlotDuration::get_or_compute(&*client)?;
216216
let (block_import, link_half) =
217217
grandpa::block_import::<_, _, _, RuntimeApi, FullClient<Self>, _>(
@@ -226,23 +226,37 @@ construct_service_factory! {
226226
slot_duration,
227227
block_import,
228228
Some(justification_import),
229+
None,
230+
None,
229231
client,
230232
NothingExtra,
231233
config.custom.inherent_data_providers.clone(),
232234
).map_err(Into::into)
233235
}},
234236
LightImportQueue = AuraImportQueue<Self::Block>
235-
{ |config: &FactoryFullConfiguration<Self>, client: Arc<LightClient<Self>>| {
236-
import_queue::<_, _, _, ed25519::Pair>(
237-
SlotDuration::get_or_compute(&*client)?,
238-
client.clone(),
239-
None,
240-
client,
241-
NothingExtra,
242-
config.custom.inherent_data_providers.clone(),
243-
).map_err(Into::into)
244-
}
245-
},
237+
{ |config: &FactoryFullConfiguration<Self>, client: Arc<LightClient<Self>>| {
238+
let fetch_checker = client.backend().blockchain().fetcher()
239+
.upgrade()
240+
.map(|fetcher| fetcher.checker().clone())
241+
.ok_or_else(|| "Trying to start light import queue without active fetch checker")?;
242+
let block_import = grandpa::light_block_import::<_, _, _, RuntimeApi, LightClient<Self>>(
243+
client.clone(), Arc::new(fetch_checker), client.clone()
244+
)?;
245+
let block_import = Arc::new(block_import);
246+
let finality_proof_import = block_import.clone();
247+
let finality_proof_request_builder = finality_proof_import.create_finality_proof_request_builder();
248+
249+
import_queue::<_, _, _, ed25519::Pair>(
250+
SlotDuration::get_or_compute(&*client)?,
251+
block_import,
252+
None,
253+
Some(finality_proof_import),
254+
Some(finality_proof_request_builder),
255+
client,
256+
NothingExtra,
257+
config.custom.inherent_data_providers.clone(),
258+
).map_err(Into::into)
259+
}},
246260
SelectChain = LongestChain<FullBackend<Self>, Self::Block>
247261
{ |config: &FactoryFullConfiguration<Self>, client: Arc<FullClient<Self>>| {
248262
Ok(LongestChain::new(
@@ -251,6 +265,9 @@ construct_service_factory! {
251265
))
252266
}
253267
},
268+
FinalityProofProvider = { |client: Arc<FullClient<Self>>| {
269+
Ok(Some(Arc::new(GrandpaFinalityProofProvider::new(client.clone(), client)) as _))
270+
}},
254271
}
255272
}
256273

runtime/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ xspot = { package = "xrml-xdex-spot", path = "../xrml/xdex/spot", default-featur
6161
xmultisig = { package = "xrml-xmultisig", path = "../xrml/xmultisig", default-features = false }
6262

6363
[dev-dependencies]
64-
hex-literal = "0.1.0"
64+
hex-literal = "0.2.0"
6565

6666
[features]
6767
default = ["std"]

0 commit comments

Comments
 (0)