Skip to content

Commit

Permalink
Things to do before sudo (#979)
Browse files Browse the repository at this point in the history
## Describe your changes

1. Setup governance in parachain
2. Prepare mainnet runtime for sudo removal
  • Loading branch information
Gauthamastro committed Aug 12, 2024
2 parents c92a82e + dea69bd commit 9a57c78
Show file tree
Hide file tree
Showing 8 changed files with 278 additions and 5 deletions.
6 changes: 6 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions nodes/parachain/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,12 @@ fn create_genesis_config(
..Default::default()
},
sudo: parachain_polkadex_runtime::SudoConfig { key: Some(root_key) },
elections: Default::default(),
council: Default::default(),
technical_committee: Default::default(),
assets: Default::default(),
transaction_payment: Default::default(),
democracy: Default::default(),
}
}

Expand Down
1 change: 1 addition & 0 deletions pallets/thea/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ pub mod pallet {
stake: Balance,
) -> DispatchResult {
let signer = ensure_signed(origin)?;
// Testing relayer must be removed after final audit
let expected_signer = <AllowListTestingRelayers<T>>::get(payload.network)
.ok_or(Error::<T>::NoRelayersFound)?;
ensure!(signer == expected_signer, Error::<T>::NotAnAllowlistedRelayer);
Expand Down
10 changes: 10 additions & 0 deletions polkadex-xcm-simulator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,13 @@ runtime-benchmarks = [
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-balances/try-runtime",
"pallet-message-queue/try-runtime",
"pallet-uniques/try-runtime",
"pallet-xcm/try-runtime",
"polkadot-runtime-parachains/try-runtime",
"sp-runtime/try-runtime",
]
1 change: 1 addition & 0 deletions primitives/bls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ std = [
"tiny-bip39",
"blst",
]
parachain = []
26 changes: 26 additions & 0 deletions runtimes/parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ hex-literal = { workspace = true, optional = true }
log = { workspace = true, default-features = false }
scale-info = { workspace = true, default-features = false, features = ["derive"] }
smallvec = { workspace = true }
static_assertions = {workspace = true}

# Substrate
frame-benchmarking = { workspace = true, default-features = false, optional = true }
Expand All @@ -36,7 +37,12 @@ pallet-balances = { workspace = true, default-features = false }
pallet-bags-list = { workspace = true, default-features = false, optional = true }
pallet-session = { workspace = true, default-features = false }
pallet-sudo = { workspace = true, default-features = false }
pallet-democracy = { workspace = true, default-features = false }
pallet-collective = { workspace = true, default-features = false }
pallet-timestamp = { workspace = true, default-features = false }
pallet-elections-phragmen = { workspace = true, default-features = false }
pallet-scheduler = { workspace = true, default-features = false }
pallet-preimage = { workspace = true, default-features = false }
pallet-transaction-payment = { workspace = true, default-features = false }
pallet-transaction-payment-rpc-runtime-api = { workspace = true, default-features = false }
sp-api = { workspace = true, default-features = false }
Expand Down Expand Up @@ -113,6 +119,11 @@ std = [
"pallet-collator-selection/std",
"pallet-session/std",
"pallet-sudo/std",
"pallet-democracy/std",
"pallet-collective/std",
"pallet-elections-phragmen/std",
"pallet-scheduler/std",
"pallet-preimage/std",
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
Expand Down Expand Up @@ -163,6 +174,13 @@ runtime-benchmarks = [
"thea-council/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
"cumulus-pallet-parachain-system/runtime-benchmarks",


"pallet-collective/runtime-benchmarks",
"pallet-democracy/runtime-benchmarks",
"pallet-preimage/runtime-benchmarks",
"pallet-scheduler/runtime-benchmarks",
"pallet-elections-phragmen/runtime-benchmarks",
]

try-runtime = [
Expand All @@ -183,6 +201,14 @@ try-runtime = [
"pallet-collator-selection/try-runtime",
"pallet-session/try-runtime",
"pallet-sudo/try-runtime",

"pallet-collective/try-runtime",
"pallet-democracy/try-runtime",
"pallet-preimage/try-runtime",
"pallet-scheduler/try-runtime",
"pallet-elections-phragmen/try-runtime",


"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-xcm/try-runtime",
Expand Down
5 changes: 5 additions & 0 deletions runtimes/parachain/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@ pub mod currency {
pub const PDEX: Balance = 1_000_000_000_000;
pub const DOLLARS: Balance = PDEX; // 1_000_000_000_000
pub const CENTS: Balance = DOLLARS / 100; // 10_000_000_000

pub const fn deposit(items: u32, bytes: u32) -> polkadex_primitives::Balance {
items as polkadex_primitives::Balance * 15 * CENTS
+ (bytes as polkadex_primitives::Balance) * 6 * CENTS
}
}
Loading

0 comments on commit 9a57c78

Please sign in to comment.