Skip to content

Commit

Permalink
To polkadot-v1.1.0 (#1308)
Browse files Browse the repository at this point in the history
* Anchor polkadot-v1.1.0

* Part.1

* Fix the precompile component errors

* Format

* Companion of paritytech/cumulus#2951

* Companion of paritytech/substrate#14612

* Companion of paritytech/cumulus#2270

* Companion of paritytech/cumulus#3046

* Companion of paritytech/cumulus#2300

* Ethereum upgrade part (#1311)

* Fix `message-transact` compile issue

* Fix compile 1

* Fix compile 2

* Fix compile 3

* Fix compile

* Try fix compile

* Fix compile

* Code clean

* Fix `try-runtime` compile

* Fix `runtime-benchmarks` compile

* Update ethereum runtime rpc impl

* Remove useless dep

* Replace to the official dep path

---------

Co-authored-by: Xavier Lau <xavier@inv.cafe>

---------

Co-authored-by: bear <boundless.forest@outlook.com>
  • Loading branch information
aurexav and boundless-forest authored Nov 8, 2023
1 parent b12a6fc commit c89f211
Show file tree
Hide file tree
Showing 53 changed files with 2,416 additions and 2,026 deletions.
2,843 changes: 1,805 additions & 1,038 deletions Cargo.lock

Large diffs are not rendered by default.

283 changes: 142 additions & 141 deletions Cargo.toml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions core/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ pub type Block = sp_runtime::generic::Block<Header, sp_runtime::OpaqueExtrinsic>
///
/// Change this to adjust the block time.
pub const MILLISECS_PER_BLOCK: u64 = 12_000;
/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included
/// into the relay chain.
pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1;
/// How many parachain blocks are processed by the relay chain per parent. Limits the
/// number of blocks authored per slot.
pub const BLOCK_PROCESSING_VELOCITY: u32 = 1;
/// Relay chain slot duration, in milliseconds.
pub const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000;

// NOTE: Currently it is not possible to change the slot duration after the chain has started.
// Attempting to do so will brick block production.
Expand Down
9 changes: 4 additions & 5 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ trauma = { version = "2.2" }

# cumulus
cumulus-client-cli = { workspace = true }
cumulus-client-collator = { workspace = true }
cumulus-client-consensus-aura = { workspace = true }
cumulus-client-consensus-common = { workspace = true }
cumulus-client-consensus-proposer = { workspace = true }
cumulus-client-service = { workspace = true }
cumulus-primitives-core = { workspace = true, features = ["std"] }
cumulus-primitives-parachain-inherent = { workspace = true, features = ["std"] }
Expand All @@ -38,6 +40,7 @@ pangolin-runtime = { workspace = true, optional = true }
pangoro-runtime = { workspace = true, optional = true }

# frontier
fc-api = { workspace = true }
fc-db = { workspace = true }
fc-mapping-sync = { workspace = true }
fc-rpc = { workspace = true }
Expand Down Expand Up @@ -81,10 +84,9 @@ sc-transaction-pool-api = { workspace = true }
sp-api = { workspace = true, features = ["std"] }
sp-block-builder = { workspace = true, features = ["std"] }
sp-blockchain = { workspace = true }
sp-inherents = { workspace = true, features = ["std"] }
sp-consensus-aura = { workspace = true, features = ["std"] }
sp-core = { workspace = true, features = ["std"] }
sp-io = { workspace = true, optional = true, features = ["std"] }
sp-inherents = { workspace = true, features = ["std"] }
sp-keystore = { workspace = true }
sp-offchain = { workspace = true, features = ["std"] }
sp-runtime = { workspace = true, features = ["std"] }
Expand All @@ -93,7 +95,6 @@ sp-timestamp = { workspace = true, features = ["std"] }
sp-transaction-pool = { workspace = true, features = ["std"] }
substrate-frame-rpc-system = { workspace = true }
substrate-prometheus-endpoint = { workspace = true }
try-runtime-cli = { workspace = true, optional = true }

[features]
default = [
Expand Down Expand Up @@ -148,9 +149,7 @@ try-runtime = [
"polkadot-cli/try-runtime",

# substrate
"sp-io",
"sp-runtime/try-runtime",
"try-runtime-cli/try-runtime",
]

all-natives = [
Expand Down
40 changes: 20 additions & 20 deletions node/src/chain_spec/crab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ pub fn development_config() -> ChainSpec {
vec![
// Bind the `Alice` to `Alith` to make `--alice` available for testnet.
(
array_bytes::hex_n_into_unchecked(ALITH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(ALITH),
get_collator_keys_from_seed("Alice"),
),
],
vec![
array_bytes::hex_n_into_unchecked(ALITH),
array_bytes::hex_n_into_unchecked(BALTATHAR),
array_bytes::hex_n_into_unchecked(CHARLETH),
array_bytes::hex_n_into_unchecked(DOROTHY),
array_bytes::hex_n_into_unchecked(ETHAN),
array_bytes::hex_n_into_unchecked(FAITH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(ALITH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(BALTATHAR),
array_bytes::hex_n_into_unchecked::<_, _, 20>(CHARLETH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(DOROTHY),
array_bytes::hex_n_into_unchecked::<_, _, 20>(ETHAN),
array_bytes::hex_n_into_unchecked::<_, _, 20>(FAITH),
],
2105.into(),
)
Expand Down Expand Up @@ -100,27 +100,27 @@ pub fn local_config() -> ChainSpec {
vec![
// Bind the `Alice` to `Alith` to make `--alice` available for testnet.
(
array_bytes::hex_n_into_unchecked(ALITH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(ALITH),
get_collator_keys_from_seed("Alice"),
),
// Bind the `Bob` to `Balthar` to make `--bob` available for testnet.
(
array_bytes::hex_n_into_unchecked(BALTATHAR),
array_bytes::hex_n_into_unchecked::<_, _, 20>(BALTATHAR),
get_collator_keys_from_seed("Bob"),
),
// Bind the `Charlie` to `CHARLETH` to make `--charlie` available for testnet.
(
array_bytes::hex_n_into_unchecked(CHARLETH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(CHARLETH),
get_collator_keys_from_seed("Charlie"),
),
],
vec![
array_bytes::hex_n_into_unchecked(ALITH),
array_bytes::hex_n_into_unchecked(BALTATHAR),
array_bytes::hex_n_into_unchecked(CHARLETH),
array_bytes::hex_n_into_unchecked(DOROTHY),
array_bytes::hex_n_into_unchecked(ETHAN),
array_bytes::hex_n_into_unchecked(FAITH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(ALITH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(BALTATHAR),
array_bytes::hex_n_into_unchecked::<_, _, 20>(CHARLETH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(DOROTHY),
array_bytes::hex_n_into_unchecked::<_, _, 20>(ETHAN),
array_bytes::hex_n_into_unchecked::<_, _, 20>(FAITH),
],
2105.into(),
)
Expand Down Expand Up @@ -180,7 +180,7 @@ pub fn genesis_config() -> ChainSpec {
balances: BalancesConfig {
balances: collators
.iter()
.map(|(k, _)| (array_bytes::hex_n_into_unchecked(k), 10_000 * UNIT))
.map(|(k, _)| (array_bytes::hex_n_into_unchecked::<_, _, 20>(k), 10_000 * UNIT))
.collect(),
},
transaction_payment: Default::default(),
Expand All @@ -203,16 +203,16 @@ pub fn genesis_config() -> ChainSpec {
collator_count: 6,
collators: collators
.iter()
.map(|(k, _)| (array_bytes::hex_n_into_unchecked(k), 1_000 * UNIT))
.map(|(k, _)| (array_bytes::hex_n_into_unchecked::<_, _, 20>(k), 1_000 * UNIT))
.collect(),
},
session: SessionConfig {
keys: collators
.iter()
.map(|(k, a)| {
(
array_bytes::hex_n_into_unchecked(k),
array_bytes::hex_n_into_unchecked(k),
array_bytes::hex_n_into_unchecked::<_, _, 20>(k),
array_bytes::hex_n_into_unchecked::<_, _, 20>(k),
session_keys(array_bytes::hex2array_unchecked(a).unchecked_into()),
)
})
Expand Down
40 changes: 20 additions & 20 deletions node/src/chain_spec/darwinia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ pub fn development_config() -> ChainSpec {
vec![
// Bind the `Alice` to `Alith` to make `--alice` available for testnet.
(
array_bytes::hex_n_into_unchecked(ALITH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(ALITH),
get_collator_keys_from_seed("Alice"),
),
],
vec![
array_bytes::hex_n_into_unchecked(ALITH),
array_bytes::hex_n_into_unchecked(BALTATHAR),
array_bytes::hex_n_into_unchecked(CHARLETH),
array_bytes::hex_n_into_unchecked(DOROTHY),
array_bytes::hex_n_into_unchecked(ETHAN),
array_bytes::hex_n_into_unchecked(FAITH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(ALITH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(BALTATHAR),
array_bytes::hex_n_into_unchecked::<_, _, 20>(CHARLETH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(DOROTHY),
array_bytes::hex_n_into_unchecked::<_, _, 20>(ETHAN),
array_bytes::hex_n_into_unchecked::<_, _, 20>(FAITH),
],
2046.into(),
)
Expand Down Expand Up @@ -100,27 +100,27 @@ pub fn local_config() -> ChainSpec {
vec![
// Bind the `Alice` to `Alith` to make `--alice` available for testnet.
(
array_bytes::hex_n_into_unchecked(ALITH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(ALITH),
get_collator_keys_from_seed("Alice"),
),
// Bind the `Bob` to `Balthar` to make `--bob` available for testnet.
(
array_bytes::hex_n_into_unchecked(BALTATHAR),
array_bytes::hex_n_into_unchecked::<_, _, 20>(BALTATHAR),
get_collator_keys_from_seed("Bob"),
),
// Bind the `Charlie` to `CHARLETH` to make `--charlie` available for testnet.
(
array_bytes::hex_n_into_unchecked(CHARLETH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(CHARLETH),
get_collator_keys_from_seed("Charlie"),
),
],
vec![
array_bytes::hex_n_into_unchecked(ALITH),
array_bytes::hex_n_into_unchecked(BALTATHAR),
array_bytes::hex_n_into_unchecked(CHARLETH),
array_bytes::hex_n_into_unchecked(DOROTHY),
array_bytes::hex_n_into_unchecked(ETHAN),
array_bytes::hex_n_into_unchecked(FAITH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(ALITH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(BALTATHAR),
array_bytes::hex_n_into_unchecked::<_, _, 20>(CHARLETH),
array_bytes::hex_n_into_unchecked::<_, _, 20>(DOROTHY),
array_bytes::hex_n_into_unchecked::<_, _, 20>(ETHAN),
array_bytes::hex_n_into_unchecked::<_, _, 20>(FAITH),
],
2046.into(),
)
Expand Down Expand Up @@ -176,7 +176,7 @@ pub fn genesis_config() -> ChainSpec {
balances: BalancesConfig {
balances: collators
.iter()
.map(|(k, _)| (array_bytes::hex_n_into_unchecked(k), 10_000 * UNIT))
.map(|(k, _)| (array_bytes::hex_n_into_unchecked::<_, _, 20>(k), 10_000 * UNIT))
.collect(),
},
transaction_payment: Default::default(),
Expand All @@ -199,16 +199,16 @@ pub fn genesis_config() -> ChainSpec {
collator_count: 5,
collators: collators
.iter()
.map(|(k, _)| (array_bytes::hex_n_into_unchecked(k), 1_000 * UNIT))
.map(|(k, _)| (array_bytes::hex_n_into_unchecked::<_, _, 20>(k), 1_000 * UNIT))
.collect(),
},
session: SessionConfig {
keys: collators
.iter()
.map(|(k, a)| {
(
array_bytes::hex_n_into_unchecked(k),
array_bytes::hex_n_into_unchecked(k),
array_bytes::hex_n_into_unchecked::<_, _, 20>(k),
array_bytes::hex_n_into_unchecked::<_, _, 20>(k),
session_keys(array_bytes::hex2array_unchecked(a).unchecked_into()),
)
})
Expand Down
Loading

0 comments on commit c89f211

Please sign in to comment.