Move to polkadot-sdk

Still a WIP, and using an experimental branch with 2 not-yet-merged PRs merged.
This commit is contained in:
Luke Parker
2023-11-27 06:01:47 -05:00
parent 008da698bc
commit d038aa95fd
21 changed files with 673 additions and 812 deletions

View File

@@ -22,36 +22,36 @@ workspace = true
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2", default-features = false, features = ["derive"] }
sp-core = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-std = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-core = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-std = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-offchain = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-version = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-inherents = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-offchain = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-version = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-inherents = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-session = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-consensus-babe = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-consensus-grandpa = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-session = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-consensus-babe = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-consensus-grandpa = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-authority-discovery = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-authority-discovery = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-transaction-pool = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-block-builder = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-transaction-pool = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-block-builder = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-runtime = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-api = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-runtime = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-api = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
frame-system = { git = "https://github.com/serai-dex/substrate", default-features = false }
frame-support = { git = "https://github.com/serai-dex/substrate", default-features = false }
frame-executive = { git = "https://github.com/serai-dex/substrate", default-features = false }
frame-benchmarking = { git = "https://github.com/serai-dex/substrate", default-features = false, optional = true }
frame-system = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
frame-support = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
frame-executive = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
frame-benchmarking = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false, optional = true }
serai-primitives = { path = "../primitives", default-features = false }
pallet-timestamp = { git = "https://github.com/serai-dex/substrate", default-features = false }
pallet-authorship = { git = "https://github.com/serai-dex/substrate", default-features = false }
pallet-timestamp = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
pallet-authorship = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
pallet-transaction-payment = { git = "https://github.com/serai-dex/substrate", default-features = false }
pallet-transaction-payment = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
coins-pallet = { package = "serai-coins-pallet", path = "../coins/pallet", default-features = false }
dex-pallet = { package = "serai-dex-pallet", path = "../dex/pallet", default-features = false }
@@ -62,14 +62,14 @@ in-instructions-pallet = { package = "serai-in-instructions-pallet", path = "../
signals-pallet = { package = "serai-signals-pallet", path = "../signals/pallet", default-features = false }
pallet-babe = { git = "https://github.com/serai-dex/substrate", default-features = false }
pallet-grandpa = { git = "https://github.com/serai-dex/substrate", default-features = false }
pallet-babe = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
pallet-grandpa = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
frame-system-rpc-runtime-api = { git = "https://github.com/serai-dex/substrate", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/serai-dex/substrate", default-features = false }
frame-system-rpc-runtime-api = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
[build-dependencies]
substrate-wasm-builder = { git = "https://github.com/serai-dex/substrate" }
substrate-wasm-builder = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
[features]
std = [

View File

@@ -36,8 +36,6 @@ use sp_core::OpaqueMetadata;
use sp_std::prelude::*;
use sp_version::RuntimeVersion;
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys, KeyTypeId,
@@ -100,17 +98,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("serai"),
impl_name: create_runtime_str!("core"),
spec_version: 1,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
state_version: 1,
};
#[cfg(feature = "std")]
pub fn native_version() -> NativeVersion {
NativeVersion { runtime_version: VERSION, can_author_with: Default::default() }
}
// 1 MB
pub const BLOCK_SIZE: u32 = 1024 * 1024;
// 6 seconds
@@ -170,13 +161,13 @@ impl Contains<RuntimeCall> for CallFilter {
RuntimeCall::Babe(call) => match call {
babe::Call::report_equivocation { .. } |
babe::Call::report_equivocation_unsigned { .. } => true,
babe::Call::plan_config_change { .. } | babe::Call::__Ignore(_, _) => false,
babe::Call::__Ignore(_, _) => false,
},
RuntimeCall::Grandpa(call) => match call {
grandpa::Call::report_equivocation { .. } |
grandpa::Call::report_equivocation_unsigned { .. } => true,
grandpa::Call::note_stalled { .. } | grandpa::Call::__Ignore(_, _) => false,
grandpa::Call::__Ignore(_, _) => false,
},
}
}
@@ -200,13 +191,8 @@ impl system::Config for Runtime {
type Version = Version;
type PalletInfo = PalletInfo;
type OnNewAccount = ();
type OnKilledAccount = ();
type OnSetCode = ();
type AccountData = ();
type SystemWeightInfo = ();
type SS58Prefix = SS58Prefix; // TODO: Remove for Bech32m
type MaxConsumers = support::traits::ConstU32<16>;
}
@@ -308,6 +294,7 @@ impl babe::Config for Runtime {
type WeightInfo = ();
type MaxAuthorities = MaxAuthorities;
type MaxNominators = ConstU32<1>;
type KeyOwnerProof = MembershipProof<Self>;
type EquivocationReportSystem =
@@ -318,7 +305,9 @@ impl grandpa::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = ();
type MaxAuthorities = MaxAuthorities;
type MaxNominators = ConstU32<1>;
type MaxSetIdSessionEntries = ConstU64<0>;
type KeyOwnerProof = MembershipProof<Self>;