Skip to content

Commit

Permalink
squash: joshy no rocks db (#2)
Browse files Browse the repository at this point in the history
* Remove `testnets-common` (paritytech#2620)

`testnets-common` was introduced recently to start to separate testnet
parachain configurations from those of Polkadot and Kusama.

The `locks-review` and `polkadot-review` requirements are removed from
`parachains-common` in
paritytech#2564 and there are
[plans](paritytech#2564 (comment))
to move the Polkadot and Kusama contents of that package to the
fellowship, `testnets-common` is no longer needed.

This PR removes the crate and replaces uses of it in
`collectives-westend`, the only place it is currently used.

* cumulus-client-cli

* substrate-test-utils

* checkpoint

* remove outdated comment

* fmt

* polkadot-cli

* try-runtime

* bunch of cumulus stuff

* cumulus-test-client

* Mke cumulus test service use paritydb

* josh: disable db feature

---------

Co-authored-by: Dónal Murray <donal.murray@parity.io>
Co-authored-by: Joshy Orndorff <admin@joshyorndorff.com>
  • Loading branch information
3 people authored Dec 8, 2023
1 parent ab80513 commit ff0e924
Show file tree
Hide file tree
Showing 30 changed files with 125 additions and 429 deletions.
15 changes: 0 additions & 15 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ members = [
"cumulus/parachains/runtimes/test-utils",
"cumulus/parachains/runtimes/testing/penpal",
"cumulus/parachains/runtimes/testing/rococo-parachain",
"cumulus/parachains/testnets-common",
"cumulus/polkadot-parachain",
"cumulus/primitives/aura",
"cumulus/primitives/core",
Expand Down
4 changes: 2 additions & 2 deletions cumulus/client/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ codec = { package = "parity-scale-codec", version = "3.0.0" }
url = "2.4.0"

# Substrate
sc-cli = { path = "../../../substrate/client/cli" }
sc-cli = { default-features = false, path = "../../../substrate/client/cli" }
sc-client-api = { path = "../../../substrate/client/api" }
sc-chain-spec = { path = "../../../substrate/client/chain-spec" }
sc-service = { path = "../../../substrate/client/service" }
sc-service = { default-features = false, path = "../../../substrate/client/service" }
sp-core = { path = "../../../substrate/primitives/core" }
sp-runtime = { path = "../../../substrate/primitives/runtime" }
4 changes: 2 additions & 2 deletions cumulus/client/relay-chain-inprocess-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ futures = "0.3.28"
futures-timer = "3.0.2"

# Substrate
sc-cli = { path = "../../../substrate/client/cli" }
sc-cli = { path = "../../../substrate/client/cli", default-features = false }
sc-client-api = { path = "../../../substrate/client/api" }
sc-telemetry = { path = "../../../substrate/client/telemetry" }
sc-tracing = { path = "../../../substrate/client/tracing" }
Expand All @@ -25,7 +25,7 @@ sp-state-machine = { path = "../../../substrate/primitives/state-machine" }

# Polkadot
polkadot-cli = { path = "../../../polkadot/cli", default-features = false, features = ["cli"] }
polkadot-service = { path = "../../../polkadot/node/service" }
polkadot-service = { path = "../../../polkadot/node/service", default-features = false }

# Cumulus
cumulus-primitives-core = { path = "../../primitives/core" }
Expand Down
2 changes: 1 addition & 1 deletion cumulus/client/relay-chain-minimal-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ polkadot-node-core-prospective-parachains = { path = "../../../polkadot/node/cor
sc-authority-discovery = { path = "../../../substrate/client/authority-discovery" }
sc-network = { path = "../../../substrate/client/network" }
sc-network-common = { path = "../../../substrate/client/network/common" }
sc-service = { path = "../../../substrate/client/service" }
sc-client-api = { path = "../../../substrate/client/api" }
sc-service = { path = "../../../substrate/client/service", default-features = false }
substrate-prometheus-endpoint = { path = "../../../substrate/utils/prometheus" }
sc-tracing = { path = "../../../substrate/client/tracing" }
sc-utils = { path = "../../../substrate/client/utils" }
Expand Down
2 changes: 1 addition & 1 deletion cumulus/client/relay-chain-rpc-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ sp-runtime = { path = "../../../substrate/primitives/runtime" }
sp-version = { path = "../../../substrate/primitives/version" }
sc-client-api = { path = "../../../substrate/client/api" }
sc-rpc-api = { path = "../../../substrate/client/rpc-api" }
sc-service = { path = "../../../substrate/client/service" }
sc-service = { path = "../../../substrate/client/service", default-features = false }

tokio = { version = "1.32.0", features = ["sync"] }
tokio-util = { version = "0.7.8", features = ["compat"] }
Expand Down
4 changes: 3 additions & 1 deletion cumulus/client/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sc-client-api = { path = "../../../substrate/client/api" }
sc-consensus = { path = "../../../substrate/client/consensus/common" }
sc-transaction-pool = { path = "../../../substrate/client/transaction-pool" }
sc-rpc = { path = "../../../substrate/client/rpc" }
sc-service = { path = "../../../substrate/client/service" }
sc-service = { path = "../../../substrate/client/service", default-features = false }
sc-sysinfo = { path = "../../../substrate/client/sysinfo" }
sc-telemetry = { path = "../../../substrate/client/telemetry" }
sc-network = { path = "../../../substrate/client/network" }
Expand All @@ -33,6 +33,8 @@ polkadot-primitives = { path = "../../../polkadot/primitives" }

# Cumulus
cumulus-client-cli = { path = "../cli" }

# For some reason I can enable the collator here, even though it appears to leak rocks on its own...
cumulus-client-collator = { path = "../collator" }
cumulus-client-consensus-common = { path = "../consensus/common" }
cumulus-client-pov-recovery = { path = "../pov-recovery" }
Expand Down
29 changes: 24 additions & 5 deletions cumulus/parachains/common/src/westend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@
// See the License for the specific language governing permissions and
// limitations under the License.

/// Universally recognized accounts.
pub mod account {
use frame_support::PalletId;

/// Westend treasury pallet id, used to convert into AccountId - in Westend as a destination for
/// slashed funds.
pub const WESTEND_TREASURY_PALLET_ID: PalletId = PalletId(*b"py/trsry");
/// Alliance pallet ID - used as a temporary place to deposit a slashed imbalance before the
/// teleport to the Treasury.
pub const ALLIANCE_PALLET_ID: PalletId = PalletId(*b"py/allia");
/// Referenda pallet ID - used as a temporary place to deposit a slashed imbalance before the
/// teleport to the Treasury.
pub const REFERENDA_PALLET_ID: PalletId = PalletId(*b"py/refer");
/// Ambassador Referenda pallet ID - used as a temporary place to deposit a slashed imbalance
/// before the teleport to the Treasury.
pub const AMBASSADOR_REFERENDA_PALLET_ID: PalletId = PalletId(*b"py/amref");
}

pub mod currency {
use polkadot_core_primitives::Balance;
use westend_runtime_constants as constants;
Expand All @@ -21,6 +39,7 @@ pub mod currency {
pub const EXISTENTIAL_DEPOSIT: Balance = constants::currency::EXISTENTIAL_DEPOSIT / 10;

pub const UNITS: Balance = constants::currency::UNITS;
pub const DOLLARS: Balance = UNITS; // 1_000_000_000_000
pub const CENTS: Balance = constants::currency::CENTS;
pub const MILLICENTS: Balance = constants::currency::MILLICENTS;
pub const GRAND: Balance = constants::currency::GRAND;
Expand All @@ -44,7 +63,7 @@ pub mod fee {
use smallvec::smallvec;
pub use sp_runtime::Perbill;

/// The block saturation level. Fees will be updates based on this value.
/// The block saturation level. Fees will be updated based on this value.
pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25);

/// Handles converting a weight scalar to a fee value, based on the scale and granularity of the
Expand Down Expand Up @@ -110,11 +129,11 @@ pub mod fee {

/// Consensus-related.
pub mod consensus {
/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included
/// into the relay chain.
/// 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.
/// 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ pallet-collator-selection = { path = "../../../../pallets/collator-selection", d
pallet-collective-content = { path = "../../../pallets/collective-content", default-features = false }
parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false }
testnets-common = { path = "../../../testnets-common", default-features = false }

[build-dependencies]
substrate-wasm-builder = { path = "../../../../../substrate/utils/wasm-builder", optional = true }
Expand Down Expand Up @@ -118,7 +117,6 @@ runtime-benchmarks = [
"polkadot-parachain-primitives/runtime-benchmarks",
"polkadot-runtime-common/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"testnets-common/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
]
Expand Down Expand Up @@ -216,7 +214,6 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"testnets-common/std",
"westend-runtime-constants/std",
"xcm-builder/std",
"xcm-executor/std",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,14 @@ use frame_system::{
};
pub use parachains_common as common;
use parachains_common::{
impls::DealWithFees, message_queue::*, AccountId, AuraId, Balance, BlockNumber, Hash, Header,
Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, MINUTES,
NORMAL_DISPATCH_RATIO, SLOT_DURATION,
impls::DealWithFees,
message_queue::*,
westend::{account::*, consensus::*, currency::*, fee::WeightToFee},
AccountId, AuraId, Balance, BlockNumber, Hash, Header, Nonce, Signature,
AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, MINUTES, NORMAL_DISPATCH_RATIO,
SLOT_DURATION,
};
use sp_runtime::RuntimeDebug;
use testnets_common::westend::{account::*, consensus::*, currency::*, fee::WeightToFee};
use xcm_config::{GovernanceLocation, XcmOriginToTransactDispatchOrigin};

#[cfg(any(feature = "std", test))]
Expand Down
44 changes: 0 additions & 44 deletions cumulus/parachains/testnets-common/Cargo.toml

This file was deleted.

30 changes: 0 additions & 30 deletions cumulus/parachains/testnets-common/src/lib.rs

This file was deleted.

Loading

0 comments on commit ff0e924

Please sign in to comment.