Skip to content

Commit

Permalink
chore(genesis): add hrmp to genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
al3mart committed Dec 9, 2024
1 parent 5cef1e3 commit 313b81a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
31 changes: 18 additions & 13 deletions chain-spec-generator/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

use crate::{
relay_chain_specs::{PaseoChainSpec},
relay_chain_specs::PaseoChainSpec,
system_parachains_specs::{
AssetHubPaseoChainSpec,
BridgeHubPaseoChainSpec,CoretimePaseoChainSpec,PeoplePaseoChainSpec,
AssetHubPaseoChainSpec, BridgeHubPaseoChainSpec, CoretimePaseoChainSpec,
PeoplePaseoChainSpec,
},
ChainSpec,
};
Expand All @@ -36,16 +36,21 @@ pub fn from_json_file(filepath: &str, supported: String) -> Result<Box<dyn Chain
let chain_spec: EmptyChainSpecWithId = serde_json::from_reader(reader)
.expect("Failed to read 'json' file with ChainSpec configuration");
match &chain_spec.id {
x if x.eq("paseo") | x.eq("paseo-local") | x.eq("paseo-dev") =>
Ok(Box::new(PaseoChainSpec::from_json_file(path)?)),
x if x.starts_with("asset-hub-paseo") =>
Ok(Box::new(AssetHubPaseoChainSpec::from_json_file(path)?)),
x if x.starts_with("paseo-bridge-hub") =>
Ok(Box::new(BridgeHubPaseoChainSpec::from_json_file(path)?)),
x if x.starts_with("paseo-coretime") =>
Ok(Box::new(CoretimePaseoChainSpec::from_json_file(path)?)),
x if x.starts_with("paseo-people") =>
Ok(Box::new(PeoplePaseoChainSpec::from_json_file(path)?)),
x if x.eq("paseo") | x.eq("paseo-local") | x.eq("paseo-dev") => {
Ok(Box::new(PaseoChainSpec::from_json_file(path)?))
},
x if x.starts_with("asset-hub-paseo") => {
Ok(Box::new(AssetHubPaseoChainSpec::from_json_file(path)?))
},
x if x.starts_with("paseo-bridge-hub") => {
Ok(Box::new(BridgeHubPaseoChainSpec::from_json_file(path)?))
},
x if x.starts_with("paseo-coretime") => {
Ok(Box::new(CoretimePaseoChainSpec::from_json_file(path)?))
},
x if x.starts_with("paseo-people") => {
Ok(Box::new(PeoplePaseoChainSpec::from_json_file(path)?))
},
_ => Err(format!("Unknown chain 'id' in json file. Only supported: {supported}'")),
}
}
3 changes: 2 additions & 1 deletion chain-spec-generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ fn main() -> Result<(), String> {
),
(
"coretime-paseo-local",
Box::new(|| system_parachains_specs::coretime_paseo_local_testnet_config()) as Box<_>,
Box::new(|| system_parachains_specs::coretime_paseo_local_testnet_config())
as Box<_>,
),
(
"coretime-paseo-tot",
Expand Down
11 changes: 7 additions & 4 deletions relay/paseo/src/genesis_config_presets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@ fn default_parachains_host_configuration() -> HostConfiguration<polkadot_primiti
max_head_data_size: 32 * 1024,
max_upward_queue_count: 174172,
max_upward_queue_size: 1024 * 1024,
max_downward_message_size: 1024 * 1024,
max_upward_message_size: 50 * 1024,
max_downward_message_size: 51_200,
max_upward_message_size: 65_531,
max_upward_message_num_per_candidate: 16,
hrmp_sender_deposit: 0,
hrmp_recipient_deposit: 0,
hrmp_channel_max_capacity: 1000,
hrmp_channel_max_total_size: 100 * 1024,
hrmp_max_parachain_inbound_channels: 10,
hrmp_max_parachain_inbound_channels: 30,
hrmp_channel_max_message_size: 1024 * 1024,
hrmp_max_parachain_outbound_channels: 10,
hrmp_max_parachain_outbound_channels: 30,
hrmp_max_message_num_per_candidate: 10,
dispute_period: 6,
no_show_slots: 2,
Expand Down Expand Up @@ -204,6 +204,9 @@ fn paseo_testnet_genesis(
"configuration": {
"config": default_parachains_host_configuration(),
},
"hrmp": {
"preopenHrmpChannels": Vec::<(u32,u32,u32,u32)>::new(),
}
})
}

Expand Down

0 comments on commit 313b81a

Please sign in to comment.