Skip to content

Commit

Permalink
Move to polkadot-sdk
Browse files Browse the repository at this point in the history
Still a WIP, and using an experimental branch with 2 not-yet-merged PRs merged.
  • Loading branch information
kayabaNerve committed Nov 28, 2023
1 parent 695d1f0 commit 0409fd9
Show file tree
Hide file tree
Showing 22 changed files with 661 additions and 764 deletions.
1,161 changes: 533 additions & 628 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,10 @@ panic = "unwind"
lazy_static = { git = "https://github.com/rust-lang-nursery/lazy-static.rs", rev = "5735630d46572f1e5377c8f2ba0f79d18f53b10c" }

# subxt *can* pull these off crates.io yet there's no benefit to this
sp-core-hashing = { git = "https://github.com/serai-dex/substrate" }
sp-std = { git = "https://github.com/serai-dex/substrate" }
sp-core-hashing = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sp-std = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }

# The external arkworks-substrate repo refers back to the paritytech
# polkadot-sdk repo, hence patching it to point to serai-dex's
[patch."https://github.com/paritytech/polkadot-sdk"]
sp-crypto-ec-utils = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
6 changes: 3 additions & 3 deletions coordinator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ processor-messages = { package = "serai-processor-messages", path = "../processo
message-queue = { package = "serai-message-queue", path = "../message-queue" }
tributary = { package = "tributary-chain", path = "./tributary" }

sp-application-crypto = { git = "https://github.com/serai-dex/substrate", default-features = false, features = ["std"] }
sp-application-crypto = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false, features = ["std"] }
serai-client = { path = "../substrate/client", default-features = false, features = ["serai"] }

hex = { version = "0.4", default-features = false, features = ["std"] }
Expand All @@ -53,5 +53,5 @@ libp2p = { version = "0.52", default-features = false, features = ["tokio", "tcp
[dev-dependencies]
futures = { version = "0.3", default-features = false, features = ["std"] }
tributary = { package = "tributary-chain", path = "./tributary", features = ["tests"] }
sp-application-crypto = { git = "https://github.com/serai-dex/substrate", default-features = false, features = ["std"] }
sp-runtime = { git = "https://github.com/serai-dex/substrate", default-features = false, features = ["std"] }
sp-application-crypto = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false, features = ["std"] }
sp-runtime = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false, features = ["std"] }
2 changes: 1 addition & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ allow-registry = ["https://github.com/rust-lang/crates.io-index"]
allow-git = [
"https://github.com/rust-lang-nursery/lazy-static.rs",
"https://github.com/serai-dex/substrate-bip39",
"https://github.com/serai-dex/substrate",
"https://github.com/serai-dex/polkadot-sdk",
"https://github.com/monero-rs/base58-monero",
]
2 changes: 1 addition & 1 deletion processor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ futures = { version = "0.3", default-features = false }

frost = { package = "modular-frost", path = "../crypto/frost", features = ["tests"] }

sp-application-crypto = { git = "https://github.com/serai-dex/substrate", default-features = false, features = ["std"] }
sp-application-crypto = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false, features = ["std"] }

dockertest = "0.4"
serai-docker-tests = { path = "../tests/docker" }
Expand Down
4 changes: 2 additions & 2 deletions substrate/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ scale = { package = "parity-scale-codec", version = "3" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"

sp-core = { git = "https://github.com/serai-dex/substrate" }
sp-runtime = { git = "https://github.com/serai-dex/substrate" }
sp-core = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sp-runtime = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
serai-runtime = { path = "../runtime", version = "0.1" }
simple-request = { path = "../../common/request", version = "0.1" }

Expand Down
12 changes: 6 additions & 6 deletions substrate/coins/pallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ rustdoc-args = ["--cfg", "docsrs"]
parity-scale-codec = { version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2", default-features = false, features = ["derive"] }

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-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 }

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-runtime = { 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-runtime = { 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 }

serai-primitives = { path = "../../primitives", default-features = false, features = ["serde"] }
coins-primitives = { package = "serai-coins-primitives", path = "../primitives", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion substrate/coins/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ scale-info = { version = "2", default-features = false, features = ["derive"] }
serai-primitives = { path = "../../primitives", default-features = false }

[dev-dependencies]
sp-runtime = { 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 }

[features]
std = ["zeroize", "borsh?/std", "serde?/std", "scale/std", "scale-info/std", "sp-runtime/std", "serai-primitives/std"]
Expand Down
16 changes: 8 additions & 8 deletions substrate/dex/pallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ rustdoc-args = ["--cfg", "docsrs"]
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false }
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }

sp-std = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-io = { 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/substrate", default-features = false }
sp-core = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-std = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-io = { 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 }
sp-runtime = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-core = { 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-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-benchmarking = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false, optional = true }

coins-pallet = { package = "serai-coins-pallet", path = "../../coins/pallet", default-features = false }

Expand Down
4 changes: 0 additions & 4 deletions substrate/dex/pallet/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ impl frame_system::Config for Test {
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = ConstU32<16>;
}

Expand Down
16 changes: 8 additions & 8 deletions substrate/in-instructions/pallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ rustdoc-args = ["--cfg", "docsrs"]
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "max-encoded-len"] }
scale-info = { version = "2", default-features = false, features = ["derive"] }

sp-std = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-application-crypto = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-io = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-runtime = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-core = { git = "https://github.com/serai-dex/substrate", 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 }
sp-std = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-application-crypto = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-io = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-runtime = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-core = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }

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 }

serai-primitives = { path = "../../primitives", default-features = false }
in-instructions-primitives = { package = "serai-in-instructions-primitives", path = "../primitives", default-features = false }
Expand Down
6 changes: 3 additions & 3 deletions substrate/in-instructions/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ serde = { version = "1", default-features = false, features = ["derive", "alloc"
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2", default-features = false, features = ["derive"] }

sp-std = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-application-crypto = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-runtime = { git = "https://github.com/serai-dex/substrate", default-features = false }
sp-std = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-application-crypto = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }
sp-runtime = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental", default-features = false }

serai-primitives = { path = "../../primitives", default-features = false }
coins-primitives = { package = "serai-coins-primitives", path = "../../coins/primitives", default-features = false }
Expand Down
56 changes: 28 additions & 28 deletions substrate/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,45 @@ name = "serai-node"
clap = { version = "4", features = ["derive"] }

futures = "0.3"
jsonrpsee = { version = "0.16", features = ["server"] }
jsonrpsee = { version = "0.20", features = ["server"] }

sp-core = { git = "https://github.com/serai-dex/substrate" }
sp-timestamp = { git = "https://github.com/serai-dex/substrate" }
sp-io = { git = "https://github.com/serai-dex/substrate" }
sp-blockchain = { git = "https://github.com/serai-dex/substrate" }
sp-api = { git = "https://github.com/serai-dex/substrate" }
sp-block-builder = { git = "https://github.com/serai-dex/substrate" }
sp-consensus-babe = { git = "https://github.com/serai-dex/substrate" }
sp-core = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sp-timestamp = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sp-io = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sp-blockchain = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sp-api = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sp-block-builder = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sp-consensus-babe = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }

frame-benchmarking = { git = "https://github.com/serai-dex/substrate" }
frame-benchmarking = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }

serai-runtime = { path = "../runtime", features = ["std"] }

sc-offchain = { git = "https://github.com/serai-dex/substrate" }
sc-transaction-pool = { git = "https://github.com/serai-dex/substrate" }
sc-transaction-pool-api = { git = "https://github.com/serai-dex/substrate" }
sc-basic-authorship = { git = "https://github.com/serai-dex/substrate" }
sc-executor = { git = "https://github.com/serai-dex/substrate" }
sc-service = { git = "https://github.com/serai-dex/substrate" }
sc-client-api = { git = "https://github.com/serai-dex/substrate" }
sc-network-common = { git = "https://github.com/serai-dex/substrate" }
sc-network = { git = "https://github.com/serai-dex/substrate" }
sc-offchain = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sc-transaction-pool = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sc-transaction-pool-api = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sc-basic-authorship = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sc-executor = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sc-service = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sc-client-api = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sc-network-sync = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sc-network = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }

sc-consensus = { git = "https://github.com/serai-dex/substrate" }
sc-consensus-babe = { git = "https://github.com/serai-dex/substrate" }
sc-consensus-grandpa = { git = "https://github.com/serai-dex/substrate" }
sc-authority-discovery = { git = "https://github.com/serai-dex/substrate" }
sc-consensus = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sc-consensus-babe = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sc-consensus-grandpa = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sc-authority-discovery = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }

sc-telemetry = { git = "https://github.com/serai-dex/substrate" }
sc-cli = { git = "https://github.com/serai-dex/substrate" }
sc-telemetry = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
sc-cli = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }

sc-rpc-api = { git = "https://github.com/serai-dex/substrate" }
sc-rpc-api = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }

substrate-frame-rpc-system = { git = "https://github.com/serai-dex/substrate" }
pallet-transaction-payment-rpc = { git = "https://github.com/serai-dex/substrate" }
substrate-frame-rpc-system = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }
pallet-transaction-payment-rpc = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }

[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/serai-dex/substrate" }
substrate-build-script-utils = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "experimental" }

[features]
default = []
Expand Down
11 changes: 7 additions & 4 deletions substrate/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ fn account_from_name(name: &'static str) -> PublicKey {
}

fn testnet_genesis(
wasm_binary: &[u8],
validators: &[&'static str],
endowed_accounts: Vec<PublicKey>,
) -> RuntimeGenesisConfig {
let validators = validators.iter().map(|name| account_from_name(name)).collect::<Vec<_>>();
RuntimeGenesisConfig {
system: SystemConfig { code: wasm_binary.to_vec(), _config: PhantomData },
system: SystemConfig { _config: PhantomData },

transaction_payment: Default::default(),

Expand Down Expand Up @@ -67,6 +66,7 @@ fn testnet_genesis(
pub fn development_config() -> Result<ChainSpec, &'static str> {
let wasm_binary = WASM_BINARY.ok_or("Development wasm not available")?;

#[allow(deprecated)]
Ok(ChainSpec::from_genesis(
// Name
"Development Network",
Expand All @@ -75,7 +75,6 @@ pub fn development_config() -> Result<ChainSpec, &'static str> {
ChainType::Development,
|| {
testnet_genesis(
wasm_binary,
&["Alice"],
vec![
account_from_name("Alice"),
Expand All @@ -99,12 +98,15 @@ pub fn development_config() -> Result<ChainSpec, &'static str> {
None,
// Extensions
None,
// Code
wasm_binary,
))
}

pub fn testnet_config() -> Result<ChainSpec, &'static str> {
let wasm_binary = WASM_BINARY.ok_or("Testnet wasm not available")?;

#[allow(deprecated)]
Ok(ChainSpec::from_genesis(
// Name
"Local Test Network",
Expand All @@ -113,7 +115,6 @@ pub fn testnet_config() -> Result<ChainSpec, &'static str> {
ChainType::Local,
|| {
testnet_genesis(
wasm_binary,
&["Alice", "Bob", "Charlie", "Dave"],
vec![
account_from_name("Alice"),
Expand All @@ -137,5 +138,7 @@ pub fn testnet_config() -> Result<ChainSpec, &'static str> {
None,
// Extensions
None,
// Code
wasm_binary,
))
}
Loading

0 comments on commit 0409fd9

Please sign in to comment.