diff --git a/Cargo.lock b/Cargo.lock index ab44b60c..fb600bb4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1644,8 +1644,18 @@ version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core 0.20.3", + "darling_macro 0.20.3", ] [[package]] @@ -1662,17 +1672,42 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.26", +] + [[package]] name = "darling_macro" version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ - "darling_core", + "darling_core 0.14.4", "quote", "syn 1.0.109", ] +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core 0.20.3", + "quote", + "syn 2.0.26", +] + [[package]] name = "data-encoding" version = "2.4.0" @@ -1785,7 +1820,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" dependencies = [ - "darling", + "darling 0.14.4", "proc-macro2", "quote", "syn 1.0.109", @@ -2805,7 +2840,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-runtime-interface", - "sp-std 8.0.0", + "sp-std", "sp-storage", "static_assertions", ] @@ -2871,7 +2906,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 8.0.0", + "sp-std", "sp-tracing", ] @@ -2927,7 +2962,7 @@ dependencies = [ "sp-runtime", "sp-staking", "sp-state-machine", - "sp-std 8.0.0", + "sp-std", "sp-tracing", "sp-weights", "tt-call", @@ -2987,7 +3022,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 8.0.0", + "sp-std", "sp-version", "sp-weights", ] @@ -3010,7 +3045,7 @@ dependencies = [ "parity-scale-codec", "sp-api", "sp-runtime", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -5669,7 +5704,7 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -5685,7 +5720,7 @@ dependencies = [ "sp-application-crypto", "sp-authority-discovery", "sp-runtime", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -5699,7 +5734,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -5723,7 +5758,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -5738,7 +5773,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -5761,7 +5796,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -5781,7 +5816,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 8.0.0", + "sp-std", "sp-trie", ] @@ -5799,7 +5834,7 @@ dependencies = [ "sp-inherents", "sp-io", "sp-runtime", - "sp-std 8.0.0", + "sp-std", "sp-timestamp", ] @@ -5816,7 +5851,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -8067,7 +8102,7 @@ dependencies = [ "serde_json", "sp-core", "sp-io", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -8199,25 +8234,26 @@ dependencies = [ [[package]] name = "scale-decode" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e5527e4b3bf079d4c0b2f253418598c380722ba37ef20fac9088081407f2b6" +checksum = "f0459d00b0dbd2e765009924a78ef36b2ff7ba116292d732f00eb0ed8e465d15" dependencies = [ "parity-scale-codec", "primitive-types", "scale-bits", "scale-decode-derive", "scale-info", + "smallvec", "thiserror", ] [[package]] name = "scale-decode-derive" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b38741b2f78e4391b94eac6b102af0f6ea2b0f7fe65adb55d7f4004f507854db" +checksum = "4391f0dfbb6690f035f6d2a15d6a12f88cc5395c36bcc056db07ffa2a90870ec" dependencies = [ - "darling", + "darling 0.14.4", "proc-macro-crate", "proc-macro2", "quote", @@ -8226,25 +8262,26 @@ dependencies = [ [[package]] name = "scale-encode" -version = "0.1.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15546e5efbb45f0fc2291f7e202dee8623274c5d8bbfdf9c6886cc8b44a7ced3" +checksum = "b0401b7cdae8b8aa33725f3611a051358d5b32887ecaa0fda5953a775b2d4d76" dependencies = [ "parity-scale-codec", "primitive-types", "scale-bits", "scale-encode-derive", "scale-info", + "smallvec", "thiserror", ] [[package]] name = "scale-encode-derive" -version = "0.1.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd983cf0a9effd76138554ead18a6de542d1af175ac12fd5e91836c5c0268082" +checksum = "316e0fb10ec0fee266822bd641bab5e332a4ab80ef8c5b5ff35e5401a394f5a6" dependencies = [ - "darling", + "darling 0.14.4", "proc-macro-crate", "proc-macro2", "quote", @@ -8279,10 +8316,12 @@ dependencies = [ [[package]] name = "scale-value" -version = "0.7.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11f549769261561e6764218f847e500588f9a79a289de49ce92f9e26642a3574" +checksum = "f2096d36e94ce9bf87d8addb752423b6b19730dc88edd7cc452bb2b90573f7a7" dependencies = [ + "base58", + "blake2", "either", "frame-metadata 15.1.0", "parity-scale-codec", @@ -8621,7 +8660,7 @@ dependencies = [ "serde", "sp-application-crypto", "sp-runtime", - "sp-std 8.0.0", + "sp-std", "zeroize", ] @@ -8803,7 +8842,7 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-std 8.0.0", + "sp-std", "sp-transaction-pool", "sp-version", "substrate-wasm-builder", @@ -8848,7 +8887,7 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-runtime", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -8862,7 +8901,7 @@ dependencies = [ "serai-primitives", "serde", "sp-core", - "sp-std 8.0.0", + "sp-std", "zeroize", ] @@ -9167,7 +9206,7 @@ dependencies = [ "sp-metadata-ir", "sp-runtime", "sp-state-machine", - "sp-std 8.0.0", + "sp-std", "sp-trie", "sp-version", "thiserror", @@ -9197,7 +9236,7 @@ dependencies = [ "serde", "sp-core", "sp-io", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -9210,7 +9249,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std 8.0.0", + "sp-std", "static_assertions", ] @@ -9224,7 +9263,7 @@ dependencies = [ "sp-api", "sp-application-crypto", "sp-runtime", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -9235,7 +9274,7 @@ dependencies = [ "sp-api", "sp-inherents", "sp-runtime", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -9286,7 +9325,7 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-std 8.0.0", + "sp-std", "sp-timestamp", ] @@ -9305,7 +9344,7 @@ dependencies = [ "sp-core", "sp-keystore", "sp-runtime", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -9316,7 +9355,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std 8.0.0", + "sp-std", "sp-timestamp", ] @@ -9351,11 +9390,11 @@ dependencies = [ "secp256k1", "secrecy", "serde", - "sp-core-hashing 9.0.0", + "sp-core-hashing", "sp-debug-derive", "sp-externalities", "sp-runtime-interface", - "sp-std 8.0.0", + "sp-std", "sp-storage", "ss58-registry", "substrate-bip39", @@ -9365,21 +9404,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "sp-core-hashing" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27449abdfbe41b473e625bce8113745e81d65777dd1d5a8462cf24137930dad8" -dependencies = [ - "blake2b_simd", - "byteorder", - "digest 0.10.7", - "sha2 0.10.7", - "sha3", - "sp-std 7.0.0", - "twox-hash", -] - [[package]] name = "sp-core-hashing" version = "9.0.0" @@ -9399,7 +9423,7 @@ version = "9.0.0" source = "git+https://github.com/serai-dex/substrate#5fc3862740f695224cd21bc1bcfd858560cfdd78" dependencies = [ "quote", - "sp-core-hashing 9.0.0", + "sp-core-hashing", "syn 2.0.26", ] @@ -9429,7 +9453,7 @@ source = "git+https://github.com/serai-dex/substrate#5fc3862740f695224cd21bc1bcf dependencies = [ "environmental", "parity-scale-codec", - "sp-std 8.0.0", + "sp-std", "sp-storage", ] @@ -9443,7 +9467,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std 8.0.0", + "sp-std", "thiserror", ] @@ -9465,7 +9489,7 @@ dependencies = [ "sp-keystore", "sp-runtime-interface", "sp-state-machine", - "sp-std 8.0.0", + "sp-std", "sp-tracing", "sp-trie", "tracing", @@ -9512,7 +9536,7 @@ dependencies = [ "frame-metadata 16.0.0", "parity-scale-codec", "scale-info", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -9563,7 +9587,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-io", - "sp-std 8.0.0", + "sp-std", "sp-weights", ] @@ -9578,7 +9602,7 @@ dependencies = [ "primitive-types", "sp-externalities", "sp-runtime-interface-proc-macro", - "sp-std 8.0.0", + "sp-std", "sp-storage", "sp-tracing", "sp-wasm-interface", @@ -9609,7 +9633,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-staking", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -9623,7 +9647,7 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -9640,7 +9664,7 @@ dependencies = [ "sp-core", "sp-externalities", "sp-panic-handler", - "sp-std 8.0.0", + "sp-std", "sp-trie", "thiserror", "tracing", @@ -9660,16 +9684,10 @@ dependencies = [ "sp-externalities", "sp-runtime", "sp-runtime-interface", - "sp-std 8.0.0", + "sp-std", "thiserror", ] -[[package]] -name = "sp-std" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de8eef39962b5b97478719c493bed2926cf70cb621005bbf68ebe58252ff986" - [[package]] name = "sp-std" version = "8.0.0" @@ -9685,7 +9703,7 @@ dependencies = [ "ref-cast", "serde", "sp-debug-derive", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -9697,7 +9715,7 @@ dependencies = [ "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std 8.0.0", + "sp-std", "thiserror", ] @@ -9707,7 +9725,7 @@ version = "10.0.0" source = "git+https://github.com/serai-dex/substrate#5fc3862740f695224cd21bc1bcfd858560cfdd78" dependencies = [ "parity-scale-codec", - "sp-std 8.0.0", + "sp-std", "tracing", "tracing-core", "tracing-subscriber", @@ -9733,7 +9751,7 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-std 8.0.0", + "sp-std", "sp-trie", ] @@ -9753,7 +9771,7 @@ dependencies = [ "scale-info", "schnellru", "sp-core", - "sp-std 8.0.0", + "sp-std", "thiserror", "tracing", "trie-db", @@ -9772,7 +9790,7 @@ dependencies = [ "serde", "sp-core-hashing-proc-macro", "sp-runtime", - "sp-std 8.0.0", + "sp-std", "sp-version-proc-macro", "thiserror", ] @@ -9797,7 +9815,7 @@ dependencies = [ "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std 8.0.0", + "sp-std", "wasmtime", ] @@ -9813,7 +9831,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-debug-derive", - "sp-std 8.0.0", + "sp-std", ] [[package]] @@ -10085,9 +10103,9 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "subxt" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b9c4ddefcb2d87eb18a6336f65635c29208f766d0deefaa2a1a19f7426a993" +checksum = "31a734d66fa935fbda56ba6a71d7e969f424c8c5608d416ba8499d71d8cbfc1f" dependencies = [ "base58", "blake2", @@ -10100,7 +10118,6 @@ dependencies = [ "impl-serde", "jsonrpsee", "parity-scale-codec", - "parking_lot 0.12.1", "primitive-types", "scale-bits", "scale-decode", @@ -10109,7 +10126,7 @@ dependencies = [ "scale-value", "serde", "serde_json", - "sp-core-hashing 8.0.0", + "sp-core-hashing", "subxt-macro", "subxt-metadata", "thiserror", @@ -10118,11 +10135,10 @@ dependencies = [ [[package]] name = "subxt-codegen" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e924f41069e9273236398ff89662d6d336468a5d94faac812129d44547db0e7f" +checksum = "4e2f231d97c145c564bd544212c0cc0c29c09ff516af199f4ce00c8e055f8138" dependencies = [ - "darling", "frame-metadata 15.1.0", "heck 0.4.1", "hex", @@ -10132,33 +10148,34 @@ dependencies = [ "quote", "scale-info", "subxt-metadata", - "syn 1.0.109", + "syn 2.0.26", "thiserror", "tokio", ] [[package]] name = "subxt-macro" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced0b043a069ee039f8700d3dfda01be156e4229c82277c305bc8e79a7dd855d" +checksum = "e544e41e1c84b616632cd2f86862342868f62e11e4cd9062a9e3dbf5fc871f64" dependencies = [ - "darling", + "darling 0.20.3", "proc-macro-error", "subxt-codegen", - "syn 1.0.109", + "syn 2.0.26", ] [[package]] name = "subxt-metadata" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18be3b8f4308fe7369ee1df66ae59c2eca79de20eab57b0f41c75736e843300f" +checksum = "a01ce5044c81db3404d38c56f1e69d72eff72c54e5913c9bba4c0b58d376031f" dependencies = [ "frame-metadata 15.1.0", "parity-scale-codec", "scale-info", - "sp-core-hashing 8.0.0", + "sp-core-hashing", + "thiserror", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 1f7e1d5c..9574483a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,3 +72,8 @@ monero-serai = { opt-level = 3 } [profile.release] panic = "unwind" + +[patch.crates-io] +# 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" } diff --git a/substrate/client/Cargo.toml b/substrate/client/Cargo.toml index 4ad62b8e..03f59fbe 100644 --- a/substrate/client/Cargo.toml +++ b/substrate/client/Cargo.toml @@ -22,7 +22,7 @@ scale-info = { version = "2", optional = true } serai-runtime = { path = "../runtime", version = "0.1" } sp-core = { git = "https://github.com/serai-dex/substrate" } -subxt = { version = "0.28", default-features = false, features = ["jsonrpsee-ws"], optional = true } +subxt = { version = "0.29", default-features = false, features = ["jsonrpsee-ws"], optional = true } bitcoin = { version = "0.30", optional = true } diff --git a/substrate/client/src/serai/mod.rs b/substrate/client/src/serai/mod.rs index 7e3ca443..3ba15d92 100644 --- a/substrate/client/src/serai/mod.rs +++ b/substrate/client/src/serai/mod.rs @@ -40,7 +40,7 @@ pub struct Tip { pub tip: u64, } -pub type Header = SubstrateHeader<::BlockNumber, BlakeTwo256>; +pub type Header = SubstrateHeader; #[derive(Clone, Copy, PartialEq, Eq, Debug)] pub struct SeraiConfig; @@ -48,7 +48,7 @@ impl SubxtConfig for SeraiConfig { type Hash = ::Hash; type Hasher = BlakeTwo256; - type Index = ::Index; + type Index = serai_runtime::Nonce; type AccountId = ::AccountId; // TODO: Bech32m type Address = SeraiAddress; diff --git a/substrate/runtime/src/lib.rs b/substrate/runtime/src/lib.rs index 8eb05a1c..a57b2906 100644 --- a/substrate/runtime/src/lib.rs +++ b/substrate/runtime/src/lib.rs @@ -64,8 +64,8 @@ use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; /// An index to a block. pub type BlockNumber = u64; -/// Index of a transaction in the chain, for a given account. -pub type Index = u32; +/// Nonce of a transaction in the chain, for a given account. +pub type Nonce = u32; /// A hash of some data used by the chain. pub type Hash = sp_core::H256; @@ -189,7 +189,7 @@ impl system::Config for Runtime { type Lookup = AccountLookup; type Hash = Hash; type Hashing = BlakeTwo256; - type Nonce = u32; + type Nonce = Nonce; type Block = Block; type RuntimeOrigin = RuntimeOrigin; type RuntimeEvent = RuntimeEvent; @@ -564,8 +564,8 @@ sp_api::impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: PublicKey) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: PublicKey) -> Nonce { System::account_nonce(account) } }