Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
84a3962e
Unverified
Commit
84a3962e
authored
Sep 07, 2021
by
Xiliang Chen
Committed by
GitHub
Sep 06, 2021
Browse files
allow config NextFreeParaId in genesis (#3781)
* allow config NextFreeParaId in genesis * update westend chain spec
parent
d0b0c0f9
Pipeline
#155772
passed with stages
in 43 minutes and 56 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
node/service/src/chain_spec.rs
View file @
84a3962e
...
...
@@ -534,6 +534,9 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi
config
:
default_parachains_host_configuration
(),
},
paras
:
Default
::
default
(),
registrar
:
westend_runtime
::
RegistrarConfig
{
next_free_para_id
:
polkadot_primitives
::
v1
::
LOWEST_PUBLIC_ID
,
},
}
}
...
...
@@ -1027,6 +1030,9 @@ fn rococo_staging_testnet_config_genesis(wasm_binary: &[u8]) -> rococo_runtime::
configuration
:
rococo_runtime
::
ConfigurationConfig
{
config
:
default_parachains_host_configuration
(),
},
registrar
:
rococo_runtime
::
RegistrarConfig
{
next_free_para_id
:
polkadot_primitives
::
v1
::
LOWEST_PUBLIC_ID
,
},
// bridge_rococo_grandpa: rococo_runtime::BridgeRococoGrandpaConfig {
// owner: Some(endowed_accounts[0].clone()),
// ..Default::default()
...
...
@@ -1456,6 +1462,9 @@ pub fn westend_testnet_genesis(
config
:
default_parachains_host_configuration
(),
},
paras
:
Default
::
default
(),
registrar
:
westend_runtime
::
RegistrarConfig
{
next_free_para_id
:
polkadot_primitives
::
v1
::
LOWEST_PUBLIC_ID
,
},
}
}
...
...
@@ -1526,6 +1535,9 @@ pub fn rococo_testnet_genesis(
},
hrmp
:
Default
::
default
(),
paras
:
rococo_runtime
::
ParasConfig
{
paras
:
vec!
[]
},
registrar
:
rococo_runtime
::
RegistrarConfig
{
next_free_para_id
:
polkadot_primitives
::
v1
::
LOWEST_PUBLIC_ID
,
},
// bridge_rococo_grandpa: rococo_runtime::BridgeRococoGrandpaConfig {
// owner: Some(root_key.clone()),
// ..Default::default()
...
...
runtime/common/src/paras_registrar.rs
View file @
84a3962e
...
...
@@ -175,6 +175,25 @@ pub mod pallet {
#[pallet::storage]
pub
type
NextFreeParaId
<
T
>
=
StorageValue
<
_
,
ParaId
,
ValueQuery
>
;
#[pallet::genesis_config]
pub
struct
GenesisConfig
{
pub
next_free_para_id
:
ParaId
,
}
#[cfg(feature
=
"std"
)]
impl
Default
for
GenesisConfig
{
fn
default
()
->
Self
{
GenesisConfig
{
next_free_para_id
:
LOWEST_PUBLIC_ID
}
}
}
#[pallet::genesis_build]
impl
<
T
:
Config
>
GenesisBuild
<
T
>
for
GenesisConfig
{
fn
build
(
&
self
)
{
NextFreeParaId
::
<
T
>
::
put
(
self
.next_free_para_id
);
}
}
#[pallet::hooks]
impl
<
T
:
Config
>
Hooks
<
BlockNumberFor
<
T
>>
for
Pallet
<
T
>
{}
...
...
runtime/rococo/src/lib.rs
View file @
84a3962e
...
...
@@ -226,7 +226,7 @@ construct_runtime! {
ParasDisputes
:
parachains_disputes
::{
Pallet
,
Storage
,
Event
<
T
>
},
// Parachain Onboarding Pallets
Registrar
:
paras_registrar
::{
Pallet
,
Call
,
Storage
,
Event
<
T
>
},
Registrar
:
paras_registrar
::{
Pallet
,
Call
,
Storage
,
Event
<
T
>
,
Config
},
Auctions
:
auctions
::{
Pallet
,
Call
,
Storage
,
Event
<
T
>
},
Crowdloan
:
crowdloan
::{
Pallet
,
Call
,
Storage
,
Event
<
T
>
},
Slots
:
slots
::{
Pallet
,
Call
,
Storage
,
Event
<
T
>
},
...
...
runtime/westend/src/lib.rs
View file @
84a3962e
...
...
@@ -1047,7 +1047,7 @@ construct_runtime! {
ParaSessionInfo
:
parachains_session_info
::{
Pallet
,
Storage
}
=
52
,
// Parachain Onboarding Pallets. Start indices at 60 to leave room.
Registrar
:
paras_registrar
::{
Pallet
,
Call
,
Storage
,
Event
<
T
>
}
=
60
,
Registrar
:
paras_registrar
::{
Pallet
,
Call
,
Storage
,
Event
<
T
>
,
Config
}
=
60
,
Slots
:
slots
::{
Pallet
,
Call
,
Storage
,
Event
<
T
>
}
=
61
,
ParasSudoWrapper
:
paras_sudo_wrapper
::{
Pallet
,
Call
}
=
62
,
Auctions
:
auctions
::{
Pallet
,
Call
,
Storage
,
Event
<
T
>
}
=
63
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment