Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

feat: upgrade trappist to polkadot-v1.3.0 #315

Merged
merged 10 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,663 changes: 2,450 additions & 2,213 deletions Cargo.lock

Large diffs are not rendered by default.

239 changes: 115 additions & 124 deletions Cargo.toml

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ clap = { workspace = true }
parity-scale-codec = { workspace = true }
futures = { workspace = true }
hex-literal = { workspace = true }
log = { workspace = true }
log = { workspace = true, features = ["std"] }
serde = { workspace = true }
serde_json = { workspace = true }

Expand All @@ -31,9 +31,6 @@ trappist-runtime = { workspace = true, optional = true }
stout-runtime = { workspace = true, optional = true }
jsonrpsee = { workspace = true, features = ["server"] }

# External Dependencies
pallet-dex-rpc = { workspace = true }

# Substrate
frame-benchmarking = { workspace = true, features = ["std"] }
frame-benchmarking-cli = { workspace = true }
Expand Down Expand Up @@ -67,7 +64,6 @@ sp-api = { workspace = true, features = ["std"] }
sp-consensus-aura = { workspace = true, features = ["std"] }
sc-sysinfo = { workspace = true }
substrate-prometheus-endpoint = { workspace = true }
try-runtime-cli = { workspace = true, optional = true }
sc-transaction-pool-api = { workspace = true }
frame-system = { workspace = true }
frame-rpc-system = { workspace = true }
Expand Down Expand Up @@ -111,11 +107,12 @@ polkadot-cli = { workspace = true }
[features]
default = ["trappist-runtime", "stout-runtime"]
runtime-benchmarks = [
"trappist-runtime?/runtime-benchmarks",
"stout-runtime?/runtime-benchmarks",
"trappist-runtime/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
"stout-runtime/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks"
]
try-runtime = [
"trappist-runtime?/try-runtime",
"try-runtime-cli/try-runtime"
"trappist-runtime/try-runtime",
]
parameterized-consensus-hook = []
1 change: 0 additions & 1 deletion node/src/chain_spec/stout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,5 @@ pub fn testnet_genesis(
members: invulnerables.into_iter().map(|x| x.0).collect::<Vec<_>>(),
phantom: Default::default(),
},
dex: Default::default(),
}
}
2 changes: 0 additions & 2 deletions node/src/chain_spec/trappist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ pub fn testnet_genesis(
treasury: Default::default(),
safe_mode: Default::default(),
tx_pause: Default::default(),
dex: Default::default(),
transaction_payment: Default::default(),
}
}
Expand Down Expand Up @@ -332,7 +331,6 @@ fn trappist_live_genesis(
treasury: Default::default(),
safe_mode: Default::default(),
tx_pause: Default::default(),
dex: Default::default(),
transaction_payment: Default::default(),
}
}
10 changes: 3 additions & 7 deletions node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

use std::sync::Arc;

use parachains_common::{AccountId, AssetIdForTrustBackedAssets as AssetId, Balance, Block, Nonce};
use parachains_common::{AccountId, Balance, Block, Nonce};
use sc_client_api::AuxStore;
pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor};
pub use sc_rpc::DenyUnsafe;
use sc_transaction_pool_api::TransactionPool;
use sp_api::{CallApiAt, ProvideRuntimeApi};
use sp_api::ProvideRuntimeApi;
use sp_block_builder::BlockBuilder;
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};

Expand Down Expand Up @@ -53,17 +53,14 @@ where
+ Send
+ Sync
+ 'static,
C: CallApiAt<Block>,
C::Api: frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
C::Api: BlockBuilder<Block>,
C::Api: pallet_dex_rpc::DexRuntimeApi<Block, AssetId, Balance, Balance>,
P: TransactionPool + Sync + Send + 'static,
B: sc_client_api::Backend<Block> + Send + Sync + 'static,
B::State: sc_client_api::backend::StateBackend<sp_runtime::traits::HashingFor<Block>>,
{
use frame_rpc_system::{System, SystemApiServer};
use pallet_dex_rpc::{Dex, DexApiServer};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
use substrate_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer};

Expand All @@ -73,7 +70,6 @@ where
module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
module.merge(TransactionPayment::new(client.clone()).into_rpc())?;
module.merge(StateMigration::new(client.clone(), backend, deny_unsafe).into_rpc())?;
module.merge(Dex::new(client).into_rpc())?;

Ok(module)
}
9 changes: 2 additions & 7 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ use cumulus_primitives_core::{
use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface};
use futures::lock::Mutex;
use jsonrpsee::RpcModule;
pub use parachains_common::{
AccountId, AssetIdForTrustBackedAssets as AssetId, Balance, Block, Hash, Header, Nonce,
};
pub use parachains_common::{AccountId, Balance, Block, Hash, Header, Nonce};
use parity_scale_codec::Codec;
use sc_consensus::{
import_queue::{BasicQueue, Verifier as VerifierT},
Expand Down Expand Up @@ -127,7 +125,6 @@ where
+ sp_session::SessionKeys<Block>
+ sp_api::ApiExt<Block>
+ sp_offchain::OffchainWorkerApi<Block>
+ pallet_dex_rpc::DexRuntimeApi<Block, AssetId, Balance, Balance>
+ sp_block_builder::BlockBuilder<Block>,
BIQ: FnOnce(
Arc<ParachainClient<RuntimeApi>>,
Expand Down Expand Up @@ -232,7 +229,6 @@ where
+ sp_block_builder::BlockBuilder<Block>
+ cumulus_primitives_core::CollectCollationInfo<Block>
+ frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>
+ pallet_dex_rpc::DexRuntimeApi<Block, AssetId, Balance, Balance>
+ pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
RB: Fn(Arc<ParachainClient<RuntimeApi>>) -> Result<jsonrpsee::RpcModule<()>, sc_service::Error>,
BIQ: FnOnce(
Expand Down Expand Up @@ -519,7 +515,6 @@ where
+ cumulus_primitives_core::CollectCollationInfo<Block>
+ sp_consensus_aura::AuraApi<Block, <<AuraId as AppCrypto>::Pair as Pair>::Public>
+ pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>
+ pallet_dex_rpc::DexRuntimeApi<Block, AssetId, Balance, Balance>
+ frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
<<AuraId as AppCrypto>::Pair as Pair>::Signature:
TryFrom<Vec<u8>> + std::hash::Hash + sp_runtime::traits::Member + Codec,
Expand Down Expand Up @@ -580,6 +575,7 @@ where
collator_service,
// Very limited proposal time.
authoring_duration: Duration::from_millis(500),
collation_request_receiver: None,
};

let fut =
Expand Down Expand Up @@ -609,7 +605,6 @@ where
+ sp_api::ApiExt<Block>
+ sp_offchain::OffchainWorkerApi<Block>
+ sp_block_builder::BlockBuilder<Block>
+ pallet_dex_rpc::DexRuntimeApi<Block, AssetId, Balance, Balance>
+ sp_consensus_aura::AuraApi<Block, <<AuraId as AppCrypto>::Pair as Pair>::Public>,
<<AuraId as AppCrypto>::Pair as Pair>::Signature:
TryFrom<Vec<u8>> + std::hash::Hash + sp_runtime::traits::Member + Codec,
Expand Down
11 changes: 4 additions & 7 deletions pallets/asset-registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ parity-scale-codec = { workspace = true, features = ["derive"] }
scale-info = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
frame-benchmarking = { workspace = true }
frame-benchmarking = { workspace = true, optional = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
pallet-assets = { workspace = true }
pallet-balances = { workspace = true }

xcm = { workspace = true }

Expand All @@ -30,7 +28,8 @@ xcm-primitives = { workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }

pallet-assets = { workspace = true }
pallet-balances = { workspace = true }

xcm = { workspace = true }
xcm-simulator = { workspace = true }
Expand All @@ -53,9 +52,7 @@ std = [
"parity-scale-codec/std",
"sp-runtime/std",
"sp-std/std",
"pallet-assets/std",
"pallet-balances/std",
"frame-benchmarking/std",
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"scale-info/std",
Expand Down
3 changes: 2 additions & 1 deletion pallets/asset-registry/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ impl pallet_balances::Config for Test {
type FreezeIdentifier = ();
type MaxLocks = ();
type MaxReserves = ();
type MaxHolds = ConstU32<0>;
type MaxHolds = ConstU32<3>;
type MaxFreezes = ConstU32<0>;
type RuntimeFreezeReason = ();
}

impl pallet_assets::Config for Test {
Expand Down
8 changes: 4 additions & 4 deletions pallets/benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ parity-scale-codec = { workspace = true, features = ["derive"] }
scale-info = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
frame-benchmarking = { workspace = true }
frame-benchmarking = { workspace = true, optional = true }
frame-support = { workspace = true }
frame-system = { workspace = true }

Expand All @@ -25,11 +25,11 @@ sp-core = { workspace = true }
default = ["std"]
std = [
"parity-scale-codec/std",
"frame-benchmarking/std",
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"sp-runtime/std",
"sp-std/std",
"xcm-executor/std"
"xcm-executor/std",
]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
10 changes: 7 additions & 3 deletions pallets/withdraw-teleport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ parity-scale-codec = { workspace = true, features = [ "derive" ] }
scale-info = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
frame-benchmarking = { workspace = true }
frame-benchmarking = { workspace = true, optional = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
pallet-xcm = { workspace = true }
Expand All @@ -39,11 +39,15 @@ polkadot-runtime-parachains = { workspace = true }
default = ["std"]
std = [
"parity-scale-codec/std",
"frame-benchmarking/std",
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"scale-info/std",
"log/std",
"xcm-executor/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
try-runtime = ["frame-support/try-runtime"]
2 changes: 1 addition & 1 deletion pallets/withdraw-teleport/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl<T: Config> Pallet<T> {

//Build the message to execute on origin.
let assets: MultiAssets = assets.into();
let mut message: Xcm<<T as frame_system::Config>::RuntimeCall> = Xcm(vec![
let mut message = Xcm(vec![
WithdrawAsset(assets.clone()),
SetFeesMode { jit_withdraw: true },
// Burn the native asset.
Expand Down
3 changes: 2 additions & 1 deletion pallets/withdraw-teleport/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ impl pallet_balances::Config for Test {
type FreezeIdentifier = ();
type MaxLocks = ();
type MaxReserves = ();
type MaxHolds = ConstU32<0>;
type MaxHolds = ConstU32<3>;
type MaxFreezes = ConstU32<0>;
type RuntimeFreezeReason = ();
}

parameter_types! {
Expand Down
16 changes: 7 additions & 9 deletions runtime/stout/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,13 @@ cumulus-pallet-xcm = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true }
cumulus-ping = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-timestamp = { workspace = true }
cumulus-primitives-utility = { workspace = true }
pallet-collator-selection = { workspace = true }
parachains-common = { workspace = true }
parachain-info = { workspace = true }
cumulus-pallet-session-benchmarking = { workspace = true }

# Polkadot Dependencies
kusama-runtime-constants = { workspace = true }
pallet-xcm = { workspace = true }
polkadot-core-primitives = { workspace = true }
polkadot-parachain-primitives = { workspace = true }
Expand All @@ -95,8 +93,6 @@ xcm-primitives = { workspace = true }
pallet-xcm-benchmarks = { workspace = true, optional = true }

# External Pallets
pallet-dex = { workspace = true }
pallet-dex-rpc-runtime-api = { workspace = true }
pallet-asset-registry = { workspace = true }

[features]
Expand All @@ -118,10 +114,12 @@ std = [
"sp-std/std",
"sp-transaction-pool/std",
"sp-version/std",
"frame-benchmarking?/std",
"frame-executive/std",
"frame-support/std",
"frame-system/std",
"frame-system-rpc-runtime-api/std",
"frame-system-benchmarking?/std",
"pallet-assets/std",
"pallet-asset-tx-payment/std",
"pallet-aura/std",
Expand All @@ -131,8 +129,6 @@ std = [
"pallet-collective/std",
"pallet-contracts/std",
"pallet-contracts-primitives/std",
"pallet-dex/std",
"pallet-dex-rpc-runtime-api/std",
"pallet-identity/std",
"pallet-multisig/std",
"pallet-insecure-randomness-collective-flip/std",
Expand All @@ -151,16 +147,16 @@ std = [
"cumulus-pallet-xcmp-queue/std",
"cumulus-ping/std",
"cumulus-primitives-core/std",
"cumulus-primitives-timestamp/std",
"cumulus-primitives-utility/std",
"cumulus-pallet-dmp-queue/std",
"cumulus-pallet-session-benchmarking/std",
"parachain-info/std",
"parachains-common/std",
"polkadot-parachain-primitives/std",
"polkadot-runtime-common/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std"
"xcm/std",
]
runtime-benchmarks = [
"hex-literal",
Expand All @@ -176,7 +172,6 @@ runtime-benchmarks = [
"pallet-collator-selection/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
"pallet-contracts/runtime-benchmarks",
"pallet-dex/runtime-benchmarks",
"pallet-identity/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
"pallet-scheduler/runtime-benchmarks",
Expand All @@ -188,3 +183,6 @@ runtime-benchmarks = [
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
"cumulus-pallet-parachain-system/runtime-benchmarks",
]
parameterized-consensus-hook = [
"cumulus-pallet-parachain-system/parameterized-consensus-hook",
]
2 changes: 1 addition & 1 deletion runtime/stout/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.

pub mod currency {
use kusama_runtime_constants as constants;
use parachains_common::kusama as constants;
use polkadot_core_primitives::Balance;

/// The existential deposit. Set to 1/10 of its parent Relay Chain.
Expand Down
1 change: 0 additions & 1 deletion runtime/stout/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use frame_support::{
use pallet_contracts::{
weights::SubstrateWeight, Config, DebugInfo, DefaultAddressGenerator, Frame, Schedule,
};
pub use parachains_common::AVERAGE_ON_INITIALIZE_RATIO;
use sp_core::ConstBool;
use sp_runtime::Perbill;

Expand Down
Loading