diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c0b6e351..2ff6421c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,7 +26,7 @@ jobs: uses: ./.github/actions/build-dependencies - name: Install nightly rust - run: rustup toolchain install ${{ steps.nightly.outputs.version }} --profile minimal -t wasm32-unknown-unknown -c rust-src -c clippy + run: rustup toolchain install ${{ steps.nightly.outputs.version }} --profile minimal -t wasmv1-none -c clippy - name: Run Clippy run: cargo +${{ steps.nightly.outputs.version }} clippy --all-features --all-targets -- -D warnings -A clippy::items_after_test_module diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index f196c450..4ecc58dc 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -69,7 +69,7 @@ jobs: uses: ./.github/actions/build-dependencies - name: Buld Rust docs run: | - rustup toolchain install ${{ steps.nightly.outputs.version }} --profile minimal -t wasm32-unknown-unknown -c rust-docs + rustup toolchain install ${{ steps.nightly.outputs.version }} --profile minimal -t wasmv1-none -c rust-docs RUSTDOCFLAGS="--cfg docsrs" cargo +${{ steps.nightly.outputs.version }} doc --workspace --all-features mv target/doc docs/_site/rust diff --git a/Cargo.lock b/Cargo.lock index 8eda29f2..497e60c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2685,7 +2685,7 @@ checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" [[package]] name = "fork-tree" version = "13.0.1" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "parity-scale-codec", ] @@ -2718,7 +2718,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "39.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "frame-support", "frame-support-procedural", @@ -2742,7 +2742,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "39.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "frame-support", "frame-system", @@ -2771,7 +2771,7 @@ dependencies = [ [[package]] name = "frame-support" version = "39.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "array-bytes", "bitflags 1.3.2", @@ -2806,7 +2806,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "31.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "Inflector", "cfg-expr", @@ -2825,7 +2825,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "13.0.1" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 3.2.0", @@ -2837,7 +2837,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "12.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "proc-macro2", "quote", @@ -2847,7 +2847,7 @@ dependencies = [ [[package]] name = "frame-system" version = "39.1.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "cfg-if", "frame-support", @@ -2866,7 +2866,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "35.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "parity-scale-codec", "sp-api", @@ -2875,7 +2875,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.45.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "frame-support", "parity-scale-codec", @@ -5618,7 +5618,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "39.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "frame-support", "frame-system", @@ -5631,7 +5631,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "39.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "frame-benchmarking", "frame-support", @@ -5654,7 +5654,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "39.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "frame-benchmarking", "frame-support", @@ -5676,7 +5676,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "39.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "frame-support", "frame-system", @@ -5697,7 +5697,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "38.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "frame-benchmarking", "frame-support", @@ -5715,7 +5715,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "39.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "frame-benchmarking", "frame-support", @@ -5731,7 +5731,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "42.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5747,7 +5747,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "39.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -7076,7 +7076,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "30.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "log", "sp-core", @@ -7087,7 +7087,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.48.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "async-trait", "futures", @@ -7117,7 +7117,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.48.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "futures", "futures-timer", @@ -7139,7 +7139,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.43.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "parity-scale-codec", "sp-api", @@ -7154,7 +7154,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "41.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "array-bytes", "log", @@ -7180,7 +7180,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "12.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", @@ -7191,7 +7191,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.50.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "array-bytes", "chrono", @@ -7232,7 +7232,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "38.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "fnv", "futures", @@ -7258,7 +7258,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.45.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "hash-db", "kvdb", @@ -7284,7 +7284,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.47.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "async-trait", "futures", @@ -7308,7 +7308,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.48.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "async-trait", "fork-tree", @@ -7344,7 +7344,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.47.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "fork-tree", "parity-scale-codec", @@ -7357,7 +7357,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.33.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "ahash", "array-bytes", @@ -7401,7 +7401,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.47.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "async-trait", "futures", @@ -7424,7 +7424,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.41.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -7446,7 +7446,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.36.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -7458,7 +7458,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.36.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "anyhow", "log", @@ -7474,7 +7474,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.47.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "console", "futures", @@ -7491,7 +7491,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "34.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "array-bytes", "parking_lot 0.12.3", @@ -7505,7 +7505,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.48.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "array-bytes", "async-channel", @@ -7551,7 +7551,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.47.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", @@ -7562,7 +7562,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.48.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "ahash", "futures", @@ -7581,7 +7581,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.47.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "array-bytes", "async-channel", @@ -7602,7 +7602,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.47.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "array-bytes", "async-channel", @@ -7637,7 +7637,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.47.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "array-bytes", "futures", @@ -7656,7 +7656,7 @@ dependencies = [ [[package]] name = "sc-network-types" version = "0.15.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "bs58", "ed25519-dalek", @@ -7674,7 +7674,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "43.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "futures", "num_cpus", @@ -7698,7 +7698,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.18.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -7707,7 +7707,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "43.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "futures", "jsonrpsee", @@ -7737,7 +7737,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.47.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -7756,7 +7756,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "20.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "dyn-clone", "forwarded-header-value", @@ -7780,7 +7780,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.48.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "array-bytes", "futures", @@ -7812,7 +7812,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.49.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "async-trait", "directories", @@ -7875,7 +7875,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.37.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "log", "parity-scale-codec", @@ -7886,7 +7886,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "41.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "derive_more", "futures", @@ -7907,7 +7907,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "28.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "chrono", "futures", @@ -7927,7 +7927,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "38.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "chrono", "console", @@ -7954,7 +7954,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "11.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", @@ -7965,7 +7965,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "38.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "async-trait", "futures", @@ -7996,7 +7996,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "38.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "async-trait", "futures", @@ -8012,7 +8012,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "18.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "async-channel", "futures", @@ -9191,7 +9191,6 @@ dependencies = [ name = "serai-runtime" version = "0.1.0" dependencies = [ - "frame-benchmarking", "frame-executive", "frame-support", "frame-system", @@ -9560,7 +9559,7 @@ dependencies = [ [[package]] name = "sp-api" version = "35.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "hash-db", "log", @@ -9581,7 +9580,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "21.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "Inflector", "blake2", @@ -9595,7 +9594,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "39.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "parity-scale-codec", "scale-info", @@ -9607,7 +9606,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "26.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "integer-sqrt", "num-traits", @@ -9620,7 +9619,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "35.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "parity-scale-codec", "scale-info", @@ -9632,7 +9631,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "35.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "sp-api", "sp-inherents", @@ -9642,7 +9641,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "38.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "futures", "parity-scale-codec", @@ -9661,7 +9660,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.41.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "async-trait", "futures", @@ -9676,7 +9675,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.41.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "async-trait", "parity-scale-codec", @@ -9694,7 +9693,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "22.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "finality-grandpa", "log", @@ -9711,7 +9710,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.41.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "parity-scale-codec", "scale-info", @@ -9722,7 +9721,7 @@ dependencies = [ [[package]] name = "sp-core" version = "35.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "array-bytes", "bitflags 1.3.2", @@ -9763,7 +9762,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "blake2b_simd", "byteorder", @@ -9774,7 +9773,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "quote", "sp-crypto-hashing", @@ -9784,7 +9783,7 @@ dependencies = [ [[package]] name = "sp-database" version = "10.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "kvdb", "parking_lot 0.12.3", @@ -9793,7 +9792,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "proc-macro2", "quote", @@ -9803,7 +9802,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.30.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "environmental", "parity-scale-codec", @@ -9813,7 +9812,7 @@ dependencies = [ [[package]] name = "sp-genesis-builder" version = "0.16.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "parity-scale-codec", "scale-info", @@ -9825,7 +9824,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "35.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9838,7 +9837,7 @@ dependencies = [ [[package]] name = "sp-io" version = "39.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "bytes", "log", @@ -9859,7 +9858,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "40.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "sp-core", "sp-runtime", @@ -9869,7 +9868,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.41.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -9880,7 +9879,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "11.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "thiserror 2.0.11", "zstd 0.13.2", @@ -9889,7 +9888,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.8.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -9899,7 +9898,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "35.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "sp-api", "sp-core", @@ -9909,7 +9908,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "13.0.1" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "backtrace", "regex", @@ -9918,7 +9917,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "33.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "rustc-hash 1.1.0", "serde", @@ -9928,7 +9927,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "40.1.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "either", "hash256-std-hasher", @@ -9954,7 +9953,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "29.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -9972,7 +9971,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "18.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "Inflector", "expander", @@ -9985,7 +9984,7 @@ dependencies = [ [[package]] name = "sp-session" version = "37.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "parity-scale-codec", "scale-info", @@ -9999,7 +9998,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "37.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10012,7 +10011,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.44.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "hash-db", "log", @@ -10032,12 +10031,12 @@ dependencies = [ [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" [[package]] name = "sp-storage" version = "22.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10049,7 +10048,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "35.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "async-trait", "parity-scale-codec", @@ -10061,7 +10060,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "17.0.1" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "parity-scale-codec", "tracing", @@ -10072,7 +10071,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "35.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "sp-api", "sp-runtime", @@ -10081,7 +10080,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "38.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "ahash", "hash-db", @@ -10103,7 +10102,7 @@ dependencies = [ [[package]] name = "sp-version" version = "38.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10120,7 +10119,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "15.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "parity-scale-codec", "proc-macro-warning", @@ -10132,7 +10131,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "21.0.1" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -10144,7 +10143,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "31.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -10305,7 +10304,7 @@ dependencies = [ [[package]] name = "substrate-bip39" version = "0.6.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "hmac", "pbkdf2", @@ -10330,12 +10329,12 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "11.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" [[package]] name = "substrate-frame-rpc-system" version = "42.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -10354,7 +10353,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.17.1" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "http-body-util", "hyper 1.4.1", @@ -10368,7 +10367,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "25.0.0" -source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#401f7b8da28413278acd51284ab21bbf98ec1d45" +source = "git+https://github.com/serai-dex/polkadot-sdk?branch=serai-next#ebfc5f338a9752403fa07e88dd072b1d6de7acfc" dependencies = [ "build-helper", "cargo_metadata", diff --git a/orchestration/runtime/Dockerfile b/orchestration/runtime/Dockerfile index fb183e84..0b4b305d 100644 --- a/orchestration/runtime/Dockerfile +++ b/orchestration/runtime/Dockerfile @@ -11,8 +11,7 @@ RUN rm -rf /etc/apt/sources.list.d/debian.sources && \ RUN apt update && apt upgrade && apt install clang -y # Add the wasm toolchain -RUN rustup component add rust-src -RUN rustup target add wasm32-unknown-unknown +RUN rustup target add wasmv1-none FROM deterministic diff --git a/orchestration/src/main.rs b/orchestration/src/main.rs index fd448846..ecc7f18d 100644 --- a/orchestration/src/main.rs +++ b/orchestration/src/main.rs @@ -162,8 +162,7 @@ RUN apt install -y pkg-config clang RUN apt install -y make protobuf-compiler # Add the wasm toolchain -RUN rustup component add rust-src -RUN rustup target add wasm32-unknown-unknown +RUN rustup target add wasmv1-none {prelude} diff --git a/rust-toolchain.toml b/rust-toolchain.toml index d99e6588..76d9b173 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.81" -targets = ["wasm32-unknown-unknown"] +channel = "1.85" +targets = ["wasmv1-none"] profile = "minimal" -components = ["rust-src", "rustfmt", "clippy"] +components = ["rustfmt", "clippy"] diff --git a/spec/Getting Started.md b/spec/Getting Started.md index c2530b2a..2f4cc533 100644 --- a/spec/Getting Started.md +++ b/spec/Getting Started.md @@ -27,9 +27,9 @@ brew install rustup ``` rustup update rustup toolchain install stable -rustup target add wasm32-unknown-unknown +rustup target add wasmv1-none rustup toolchain install nightly -rustup target add wasm32-unknown-unknown --toolchain nightly +rustup target add wasmv1-none --toolchain nightly ``` ### Install Solidity diff --git a/substrate/abi/src/transaction.rs b/substrate/abi/src/transaction.rs index 9e9743fc..cab35409 100644 --- a/substrate/abi/src/transaction.rs +++ b/substrate/abi/src/transaction.rs @@ -268,7 +268,7 @@ mod substrate { >; /// The implicit context to verify transactions with. - fn implicit_context() -> &'static ImplicitContext; + fn implicit_context() -> ImplicitContext; /// If a block is present in the blockchain. fn block_is_present_in_blockchain(&self, hash: &BlockHash) -> bool; @@ -276,8 +276,8 @@ mod substrate { /// /// Returns `None` if the time has yet to be set. fn current_time(&self) -> Option<u64>; - /// The next nonce for an account. - fn next_nonce(&self, signer: &SeraiAddress) -> u32; + /// Get, and consume, the next nonce for an account. + fn get_and_consume_next_nonce(&self, signer: &SeraiAddress) -> u32; /// If the signer can pay the SRI fee. fn can_pay_fee( &self, @@ -339,7 +339,7 @@ mod substrate { contextualized_signature: ContextualizedSignature { explicit_context, signature }, } => { if !sp_core::sr25519::Signature::from(*signature).verify( - Transaction::signature_message(calls, Context::implicit_context(), explicit_context) + Transaction::signature_message(calls, &Context::implicit_context(), explicit_context) .as_slice(), &sp_core::sr25519::Public::from(explicit_context.signer), ) { @@ -402,7 +402,7 @@ mod substrate { Err(TransactionValidityError::Invalid(InvalidTransaction::Stale))?; } } - match self.1.next_nonce(signer).cmp(nonce) { + match self.1.get_and_consume_next_nonce(signer).cmp(nonce) { core::cmp::Ordering::Less => { Err(TransactionValidityError::Invalid(InvalidTransaction::Stale))? } @@ -454,6 +454,7 @@ mod substrate { self.1.can_pay_fee(signer, *fee)?; // Prioritize transactions by their fees + // TODO: Re-evaluate this { let fee = fee.0; Weight::from_all(fee).checked_div_per_component(&info.call_weight).unwrap_or(0) diff --git a/substrate/primitives/src/address.rs b/substrate/primitives/src/address.rs index 81bf44e1..ee771777 100644 --- a/substrate/primitives/src/address.rs +++ b/substrate/primitives/src/address.rs @@ -27,6 +27,10 @@ const HUMAN_READABLE_PART: bech32::Hrp = bech32::Hrp::parse_unchecked("sri"); #[derive(scale::Encode, scale::Decode)] // This is safe as scale and borsh share an encoding here pub struct SeraiAddress(pub [u8; 32]); +// These share encodings as 32-byte arrays +impl scale::EncodeLike<Public> for SeraiAddress {} +impl scale::EncodeLike<Public> for &SeraiAddress {} + impl SeraiAddress { /// Generate an address for use by the system. /// diff --git a/substrate/primitives/src/lib.rs b/substrate/primitives/src/lib.rs index 27a5f906..dcf0260f 100644 --- a/substrate/primitives/src/lib.rs +++ b/substrate/primitives/src/lib.rs @@ -48,9 +48,7 @@ pub mod instructions; /// A block's number is its zero-indexed position on the list of blocks which form a blockchain. /// For non-linear structures, this would presumably be the zero-indexed position within some /// topological order. -#[derive( - Clone, Copy, Default, PartialEq, Eq, Hash, Debug, Zeroize, BorshSerialize, BorshDeserialize, -)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, Zeroize, BorshSerialize, BorshDeserialize)] pub struct BlockNumber(pub u64); impl From<u64> for BlockNumber { fn from(number: u64) -> BlockNumber { @@ -66,6 +64,8 @@ impl From<u64> for BlockNumber { hash it into a 32-byte hash or truncate it. */ #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, Zeroize, BorshSerialize, BorshDeserialize)] +#[rustfmt::skip] +#[derive(scale::Encode, scale::Decode)] // This is safe as scale and borsh share an encoding here pub struct BlockHash(pub [u8; 32]); impl From<[u8; 32]> for BlockHash { fn from(hash: [u8; 32]) -> BlockHash { @@ -77,3 +77,7 @@ impl From<sp_core::H256> for BlockHash { BlockHash(hash.into()) } } + +// These share encodings as 32-byte arrays +impl scale::EncodeLike<sp_core::H256> for BlockHash {} +impl scale::EncodeLike<sp_core::H256> for &BlockHash {} diff --git a/substrate/runtime/Cargo.toml b/substrate/runtime/Cargo.toml index f8d9d6dd..ca86f781 100644 --- a/substrate/runtime/Cargo.toml +++ b/substrate/runtime/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "serai-runtime" version = "0.1.0" -description = "Serai network node runtime, built over Substrate" +description = "Serai's on-chain logic" license = "AGPL-3.0-only" repository = "https://github.com/serai-dex/serai/tree/develop/substrate/runtime" authors = ["Luke Parker <lukeparker5132@gmail.com>"] @@ -19,61 +19,19 @@ ignored = ["scale", "scale-info"] workspace = true [dependencies] -hashbrown = { version = "0.15", default-features = false, features = ["default-hasher", "inline-more"] } - 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/polkadot-sdk", branch = "serai-next", default-features = false } -sp-std = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } - -sp-offchain = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } sp-version = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } -sp-inherents = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } - -sp-session = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } -sp-consensus-babe = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } -sp-consensus-grandpa = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } - -sp-authority-discovery = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } - -sp-transaction-pool = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } -sp-block-builder = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } - sp-runtime = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } sp-api = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } frame-system = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } frame-support = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } frame-executive = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } -frame-benchmarking = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false, optional = true } -serai-primitives = { path = "../primitives", default-features = false } -serai-abi = { path = "../abi", default-features = false } - -pallet-timestamp = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } -pallet-authorship = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } - -pallet-transaction-payment = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", 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 } - -validator-sets-pallet = { package = "serai-validator-sets-pallet", path = "../validator-sets/pallet", default-features = false } -genesis-liquidity-pallet = { package = "serai-genesis-liquidity-pallet", path = "../genesis-liquidity/pallet", default-features = false } -emissions-pallet = { package = "serai-emissions-pallet", path = "../emissions/pallet", default-features = false } - -economic-security-pallet = { package = "serai-economic-security-pallet", path = "../economic-security/pallet", default-features = false } - -in-instructions-pallet = { package = "serai-in-instructions-pallet", path = "../in-instructions/pallet", default-features = false } - -signals-pallet = { package = "serai-signals-pallet", path = "../signals/pallet", default-features = false } - -pallet-babe = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } -pallet-grandpa = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } - -frame-system-rpc-runtime-api = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next", default-features = false } +serai-abi = { path = "../abi", default-features = false, features = ["substrate"] } [build-dependencies] substrate-wasm-builder = { git = "https://github.com/serai-dex/polkadot-sdk", branch = "serai-next" } @@ -84,21 +42,7 @@ std = [ "scale-info/std", "sp-core/std", - "sp-std/std", - - "sp-offchain/std", "sp-version/std", - "sp-inherents/std", - - "sp-session/std", - "sp-consensus-babe/std", - "sp-consensus-grandpa/std", - - "sp-authority-discovery/std", - - "sp-transaction-pool/std", - "sp-block-builder/std", - "sp-runtime/std", "sp-api/std", @@ -106,50 +50,12 @@ std = [ "frame-support/std", "frame-executive/std", - "serai-primitives/std", "serai-abi/std", - - "pallet-timestamp/std", - "pallet-authorship/std", - - "pallet-transaction-payment/std", - - "coins-pallet/std", - "dex-pallet/std", - - "validator-sets-pallet/std", - "genesis-liquidity-pallet/std", - "emissions-pallet/std", - - "economic-security-pallet/std", - - "in-instructions-pallet/std", - - "signals-pallet/std", - - "pallet-babe/std", - "pallet-grandpa/std", - - "frame-system-rpc-runtime-api/std", - "pallet-transaction-payment-rpc-runtime-api/std", ] -fast-epoch = [ - "genesis-liquidity-pallet/fast-epoch", - "emissions-pallet/fast-epoch", -] +fast-epoch = [] # TODO -runtime-benchmarks = [ - "sp-runtime/runtime-benchmarks", - - "frame-system/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - - "pallet-timestamp/runtime-benchmarks", - - "pallet-babe/runtime-benchmarks", - "pallet-grandpa/runtime-benchmarks", -] +try-runtime = ["sp-runtime/try-runtime", "frame-system/try-runtime", "frame-support/try-runtime", "frame-executive/try-runtime"] +runtime-benchmarks = ["sp-runtime/runtime-benchmarks", "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks"] default = ["std"] diff --git a/substrate/runtime/build.rs b/substrate/runtime/build.rs index d19c8315..9aafd17d 100644 --- a/substrate/runtime/build.rs +++ b/substrate/runtime/build.rs @@ -1,12 +1,4 @@ -use substrate_wasm_builder::WasmBuilder; - fn main() { - WasmBuilder::new() - .with_current_project() - // https://substrate.stackexchange.com/questions/12124 - // TODO: Remove once we've moved to polkadot-sdk - .disable_runtime_version_section_check() - .export_heap_base() - .import_memory() - .build() + #[cfg(feature = "std")] + substrate_wasm_builder::WasmBuilder::build_using_defaults(); } diff --git a/substrate/runtime/src/abi.rs b/substrate/runtime/src/abi.rs deleted file mode 100644 index 99b79265..00000000 --- a/substrate/runtime/src/abi.rs +++ /dev/null @@ -1,372 +0,0 @@ -use core::marker::PhantomData; - -use scale::{Encode, Decode}; - -use serai_abi::Call; - -use crate::{ - timestamp, coins, dex, genesis_liquidity, - validator_sets::{self, MembershipProof}, - in_instructions, signals, babe, grandpa, RuntimeCall, -}; - -impl From<Call> for RuntimeCall { - fn from(call: Call) -> RuntimeCall { - match call { - Call::Timestamp(serai_abi::timestamp::Call::set { now }) => { - RuntimeCall::Timestamp(timestamp::Call::set { now }) - } - Call::Coins(coins) => match coins { - serai_abi::coins::Call::transfer { to, balance } => { - RuntimeCall::Coins(coins::Call::transfer { to: to.into(), balance }) - } - serai_abi::coins::Call::burn { balance } => { - RuntimeCall::Coins(coins::Call::burn { balance }) - } - serai_abi::coins::Call::burn_with_instruction { instruction } => { - RuntimeCall::Coins(coins::Call::burn_with_instruction { instruction }) - } - }, - Call::LiquidityTokens(lt) => match lt { - serai_abi::liquidity_tokens::Call::transfer { to, balance } => { - RuntimeCall::LiquidityTokens(coins::Call::transfer { to: to.into(), balance }) - } - serai_abi::liquidity_tokens::Call::burn { balance } => { - RuntimeCall::LiquidityTokens(coins::Call::burn { balance }) - } - }, - Call::Dex(dex) => match dex { - serai_abi::dex::Call::add_liquidity { - coin, - coin_desired, - sri_desired, - coin_min, - sri_min, - mint_to, - } => RuntimeCall::Dex(dex::Call::add_liquidity { - coin, - coin_desired, - sri_desired, - coin_min, - sri_min, - mint_to: mint_to.into(), - }), - serai_abi::dex::Call::remove_liquidity { - coin, - lp_token_burn, - coin_min_receive, - sri_min_receive, - withdraw_to, - } => RuntimeCall::Dex(dex::Call::remove_liquidity { - coin, - lp_token_burn, - coin_min_receive, - sri_min_receive, - withdraw_to: withdraw_to.into(), - }), - serai_abi::dex::Call::swap_exact_tokens_for_tokens { - path, - amount_in, - amount_out_min, - send_to, - } => RuntimeCall::Dex(dex::Call::swap_exact_tokens_for_tokens { - path, - amount_in, - amount_out_min, - send_to: send_to.into(), - }), - serai_abi::dex::Call::swap_tokens_for_exact_tokens { - path, - amount_out, - amount_in_max, - send_to, - } => RuntimeCall::Dex(dex::Call::swap_tokens_for_exact_tokens { - path, - amount_out, - amount_in_max, - send_to: send_to.into(), - }), - }, - Call::ValidatorSets(vs) => match vs { - serai_abi::validator_sets::Call::set_keys { - network, - key_pair, - signature_participants, - signature, - } => RuntimeCall::ValidatorSets(validator_sets::Call::set_keys { - network, - key_pair, - signature_participants, - signature, - }), - serai_abi::validator_sets::Call::set_embedded_elliptic_curve_key { - embedded_elliptic_curve, - key, - } => RuntimeCall::ValidatorSets(validator_sets::Call::set_embedded_elliptic_curve_key { - embedded_elliptic_curve, - key, - }), - serai_abi::validator_sets::Call::report_slashes { network, slashes, signature } => { - RuntimeCall::ValidatorSets(validator_sets::Call::report_slashes { - network, - slashes, - signature, - }) - } - serai_abi::validator_sets::Call::allocate { network, amount } => { - RuntimeCall::ValidatorSets(validator_sets::Call::allocate { network, amount }) - } - serai_abi::validator_sets::Call::deallocate { network, amount } => { - RuntimeCall::ValidatorSets(validator_sets::Call::deallocate { network, amount }) - } - serai_abi::validator_sets::Call::claim_deallocation { network, session } => { - RuntimeCall::ValidatorSets(validator_sets::Call::claim_deallocation { network, session }) - } - }, - Call::GenesisLiquidity(gl) => match gl { - serai_abi::genesis_liquidity::Call::remove_coin_liquidity { balance } => { - RuntimeCall::GenesisLiquidity(genesis_liquidity::Call::remove_coin_liquidity { balance }) - } - serai_abi::genesis_liquidity::Call::oraclize_values { values, signature } => { - RuntimeCall::GenesisLiquidity(genesis_liquidity::Call::oraclize_values { - values, - signature, - }) - } - }, - Call::InInstructions(ii) => match ii { - serai_abi::in_instructions::Call::execute_batch { batch } => { - RuntimeCall::InInstructions(in_instructions::Call::execute_batch { batch }) - } - }, - Call::Signals(signals) => match signals { - serai_abi::signals::Call::register_retirement_signal { in_favor_of } => { - RuntimeCall::Signals(signals::Call::register_retirement_signal { in_favor_of }) - } - serai_abi::signals::Call::revoke_retirement_signal { retirement_signal_id } => { - RuntimeCall::Signals(signals::Call::revoke_retirement_signal { retirement_signal_id }) - } - serai_abi::signals::Call::favor { signal_id, for_network } => { - RuntimeCall::Signals(signals::Call::favor { signal_id, for_network }) - } - serai_abi::signals::Call::revoke_favor { signal_id, for_network } => { - RuntimeCall::Signals(signals::Call::revoke_favor { signal_id, for_network }) - } - serai_abi::signals::Call::stand_against { signal_id, for_network } => { - RuntimeCall::Signals(signals::Call::stand_against { signal_id, for_network }) - } - }, - Call::Babe(babe) => match babe { - serai_abi::babe::Call::report_equivocation(report) => { - RuntimeCall::Babe(babe::Call::report_equivocation { - // TODO: Find a better way to go from Proof<[u8; 32]> to Proof<H256> - equivocation_proof: <_>::decode(&mut report.equivocation_proof.encode().as_slice()) - .unwrap(), - key_owner_proof: MembershipProof(report.key_owner_proof.into(), PhantomData), - }) - } - serai_abi::babe::Call::report_equivocation_unsigned(report) => { - RuntimeCall::Babe(babe::Call::report_equivocation_unsigned { - // TODO: Find a better way to go from Proof<[u8; 32]> to Proof<H256> - equivocation_proof: <_>::decode(&mut report.equivocation_proof.encode().as_slice()) - .unwrap(), - key_owner_proof: MembershipProof(report.key_owner_proof.into(), PhantomData), - }) - } - }, - Call::Grandpa(grandpa) => match grandpa { - serai_abi::grandpa::Call::report_equivocation(report) => { - RuntimeCall::Grandpa(grandpa::Call::report_equivocation { - // TODO: Find a better way to go from Proof<[u8; 32]> to Proof<H256> - equivocation_proof: <_>::decode(&mut report.equivocation_proof.encode().as_slice()) - .unwrap(), - key_owner_proof: MembershipProof(report.key_owner_proof.into(), PhantomData), - }) - } - serai_abi::grandpa::Call::report_equivocation_unsigned(report) => { - RuntimeCall::Grandpa(grandpa::Call::report_equivocation_unsigned { - // TODO: Find a better way to go from Proof<[u8; 32]> to Proof<H256> - equivocation_proof: <_>::decode(&mut report.equivocation_proof.encode().as_slice()) - .unwrap(), - key_owner_proof: MembershipProof(report.key_owner_proof.into(), PhantomData), - }) - } - }, - } - } -} - -impl TryInto<Call> for RuntimeCall { - type Error = (); - - fn try_into(self) -> Result<Call, ()> { - Ok(match self { - RuntimeCall::Timestamp(timestamp::Call::set { now }) => { - Call::Timestamp(serai_abi::timestamp::Call::set { now }) - } - RuntimeCall::Coins(call) => Call::Coins(match call { - coins::Call::transfer { to, balance } => { - serai_abi::coins::Call::transfer { to: to.into(), balance } - } - coins::Call::burn { balance } => serai_abi::coins::Call::burn { balance }, - coins::Call::burn_with_instruction { instruction } => { - serai_abi::coins::Call::burn_with_instruction { instruction } - } - _ => Err(())?, - }), - RuntimeCall::LiquidityTokens(call) => Call::LiquidityTokens(match call { - coins::Call::transfer { to, balance } => { - serai_abi::liquidity_tokens::Call::transfer { to: to.into(), balance } - } - coins::Call::burn { balance } => serai_abi::liquidity_tokens::Call::burn { balance }, - _ => Err(())?, - }), - RuntimeCall::Dex(call) => Call::Dex(match call { - dex::Call::add_liquidity { - coin, - coin_desired, - sri_desired, - coin_min, - sri_min, - mint_to, - } => serai_abi::dex::Call::add_liquidity { - coin, - coin_desired, - sri_desired, - coin_min, - sri_min, - mint_to: mint_to.into(), - }, - dex::Call::remove_liquidity { - coin, - lp_token_burn, - coin_min_receive, - sri_min_receive, - withdraw_to, - } => serai_abi::dex::Call::remove_liquidity { - coin, - lp_token_burn, - coin_min_receive, - sri_min_receive, - withdraw_to: withdraw_to.into(), - }, - dex::Call::swap_exact_tokens_for_tokens { path, amount_in, amount_out_min, send_to } => { - serai_abi::dex::Call::swap_exact_tokens_for_tokens { - path, - amount_in, - amount_out_min, - send_to: send_to.into(), - } - } - dex::Call::swap_tokens_for_exact_tokens { path, amount_out, amount_in_max, send_to } => { - serai_abi::dex::Call::swap_tokens_for_exact_tokens { - path, - amount_out, - amount_in_max, - send_to: send_to.into(), - } - } - _ => Err(())?, - }), - RuntimeCall::GenesisLiquidity(call) => Call::GenesisLiquidity(match call { - genesis_liquidity::Call::remove_coin_liquidity { balance } => { - serai_abi::genesis_liquidity::Call::remove_coin_liquidity { balance } - } - genesis_liquidity::Call::oraclize_values { values, signature } => { - serai_abi::genesis_liquidity::Call::oraclize_values { values, signature } - } - _ => Err(())?, - }), - RuntimeCall::ValidatorSets(call) => Call::ValidatorSets(match call { - validator_sets::Call::set_keys { network, key_pair, signature_participants, signature } => { - serai_abi::validator_sets::Call::set_keys { - network, - key_pair, - signature_participants, - signature, - } - } - validator_sets::Call::set_embedded_elliptic_curve_key { embedded_elliptic_curve, key } => { - serai_abi::validator_sets::Call::set_embedded_elliptic_curve_key { - embedded_elliptic_curve, - key, - } - } - validator_sets::Call::report_slashes { network, slashes, signature } => { - serai_abi::validator_sets::Call::report_slashes { network, slashes, signature } - } - validator_sets::Call::allocate { network, amount } => { - serai_abi::validator_sets::Call::allocate { network, amount } - } - validator_sets::Call::deallocate { network, amount } => { - serai_abi::validator_sets::Call::deallocate { network, amount } - } - validator_sets::Call::claim_deallocation { network, session } => { - serai_abi::validator_sets::Call::claim_deallocation { network, session } - } - _ => Err(())?, - }), - RuntimeCall::InInstructions(call) => Call::InInstructions(match call { - in_instructions::Call::execute_batch { batch } => { - serai_abi::in_instructions::Call::execute_batch { batch } - } - _ => Err(())?, - }), - RuntimeCall::Signals(call) => Call::Signals(match call { - signals::Call::register_retirement_signal { in_favor_of } => { - serai_abi::signals::Call::register_retirement_signal { in_favor_of } - } - signals::Call::revoke_retirement_signal { retirement_signal_id } => { - serai_abi::signals::Call::revoke_retirement_signal { retirement_signal_id } - } - signals::Call::favor { signal_id, for_network } => { - serai_abi::signals::Call::favor { signal_id, for_network } - } - signals::Call::revoke_favor { signal_id, for_network } => { - serai_abi::signals::Call::revoke_favor { signal_id, for_network } - } - signals::Call::stand_against { signal_id, for_network } => { - serai_abi::signals::Call::stand_against { signal_id, for_network } - } - _ => Err(())?, - }), - RuntimeCall::Babe(call) => Call::Babe(match call { - babe::Call::report_equivocation { equivocation_proof, key_owner_proof } => { - serai_abi::babe::Call::report_equivocation(serai_abi::babe::ReportEquivocation { - // TODO: Find a better way to go from Proof<H256> to Proof<[u8; 32]> - equivocation_proof: <_>::decode(&mut equivocation_proof.encode().as_slice()).unwrap(), - key_owner_proof: key_owner_proof.0.into(), - }) - } - babe::Call::report_equivocation_unsigned { equivocation_proof, key_owner_proof } => { - serai_abi::babe::Call::report_equivocation_unsigned(serai_abi::babe::ReportEquivocation { - // TODO: Find a better way to go from Proof<H256> to Proof<[u8; 32]> - equivocation_proof: <_>::decode(&mut equivocation_proof.encode().as_slice()).unwrap(), - key_owner_proof: key_owner_proof.0.into(), - }) - } - _ => Err(())?, - }), - RuntimeCall::Grandpa(call) => Call::Grandpa(match call { - grandpa::Call::report_equivocation { equivocation_proof, key_owner_proof } => { - serai_abi::grandpa::Call::report_equivocation(serai_abi::grandpa::ReportEquivocation { - // TODO: Find a better way to go from Proof<H256> to Proof<[u8; 32]> - equivocation_proof: <_>::decode(&mut equivocation_proof.encode().as_slice()).unwrap(), - key_owner_proof: key_owner_proof.0.into(), - }) - } - grandpa::Call::report_equivocation_unsigned { equivocation_proof, key_owner_proof } => { - serai_abi::grandpa::Call::report_equivocation_unsigned( - serai_abi::grandpa::ReportEquivocation { - // TODO: Find a better way to go from Proof<H256> to Proof<[u8; 32]> - equivocation_proof: <_>::decode(&mut equivocation_proof.encode().as_slice()).unwrap(), - key_owner_proof: key_owner_proof.0.into(), - }, - ) - } - _ => Err(())?, - }), - _ => Err(())?, - }) - } -} diff --git a/substrate/runtime/src/core_pallet.rs b/substrate/runtime/src/core_pallet.rs new file mode 100644 index 00000000..e1febb30 --- /dev/null +++ b/substrate/runtime/src/core_pallet.rs @@ -0,0 +1,19 @@ +#[frame_support::pallet] +mod core_pallet { + use ::alloc::*; + use frame_system::pallet_prelude::*; + use frame_support::pallet_prelude::*; + + #[pallet::storage] + pub type NextNonce<T: Config> = + StorageMap<_, Blake2_128Concat, T::AccountId, T::Nonce, ValueQuery>; + #[pallet::storage] + pub type Blocks<T: Config> = StorageMap<_, Identity, T::Hash, (), OptionQuery>; + + #[pallet::config] + pub trait Config: frame_system::Config {} + + #[pallet::pallet] + pub struct Pallet<T>(_); +} +pub(super) use core_pallet::*; diff --git a/substrate/runtime/src/lib.rs b/substrate/runtime/src/lib.rs index f2f3f91f..542f7eac 100644 --- a/substrate/runtime/src/lib.rs +++ b/substrate/runtime/src/lib.rs @@ -1,11 +1,261 @@ -#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))] #![cfg_attr(not(feature = "std"), no_std)] -#![recursion_limit = "256"] #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); +extern crate alloc; + +use ::alloc::{borrow::Cow, vec::Vec}; + +use sp_core::sr25519::Public; +use sp_runtime::{Perbill, Weight, traits::Header as _}; +use sp_version::RuntimeVersion; + +#[rustfmt::skip] +use serai_abi::{ + primitives::address::SeraiAddress, SubstrateHeader as Header, SubstrateBlock, +}; + +mod core_pallet; + +type Block = SubstrateBlock; + +/// The lookup for a SeraiAddress -> Public. +pub struct Lookup; +impl sp_runtime::traits::StaticLookup for Lookup { + type Source = SeraiAddress; + type Target = Public; + fn lookup(source: SeraiAddress) -> Result<Public, sp_runtime::traits::LookupError> { + Ok(source.into()) + } + fn unlookup(source: Public) -> SeraiAddress { + source.into() + } +} + +// TODO: Remove +#[sp_version::runtime_version] +pub const VERSION: RuntimeVersion = RuntimeVersion { + spec_name: Cow::Borrowed("serai"), + impl_name: Cow::Borrowed("core"), + authoring_version: 0, + spec_version: 0, + impl_version: 0, + apis: RUNTIME_API_VERSIONS, + transaction_version: 0, + system_version: 0, +}; + +frame_support::parameter_types! { + pub const Version: RuntimeVersion = VERSION; + + // TODO + pub BlockLength: frame_system::limits::BlockLength = + frame_system::limits::BlockLength::max_with_normal_ratio(0, Perbill::from_percent(0)); + // TODO + pub BlockWeights: frame_system::limits::BlockWeights = + frame_system::limits::BlockWeights::with_sensible_defaults( + Weight::from_parts(0, 0), + Perbill::from_percent(0), + ); +} + +#[frame_support::runtime] +mod runtime { + use super::*; + + #[runtime::runtime] + #[runtime::derive(RuntimeCall, RuntimeEvent, RuntimeError, RuntimeOrigin)] + pub struct Runtime; + + #[runtime::pallet_index(0)] + pub type System = frame_system::Pallet<Runtime>; + + #[runtime::pallet_index(1)] + pub type Core = core_pallet::Pallet<Runtime>; +} + +impl frame_system::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type BaseCallFilter = frame_support::traits::Everything; + type BlockWeights = BlockWeights; + type BlockLength = BlockLength; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type RuntimeTask = (); + type Nonce = u32; + type Hash = <Self::Block as sp_runtime::traits::Block>::Hash; + type Hashing = sp_runtime::traits::BlakeTwo256; + type AccountId = sp_core::sr25519::Public; + type Lookup = Lookup; + type Block = Block; + // Don't track old block hashes within the System pallet + // We use not a number -> hash index, but a hash -> () index, in our own pallet + type BlockHashCount = sp_core::ConstU64<1>; + type DbWeight = frame_support::weights::constants::RocksDbWeight; + type Version = Version; + type PalletInfo = PalletInfo; + type AccountData = (); + type OnNewAccount = (); + type OnKilledAccount = (); + // We use the default weights as we never expose/call any of these methods + type SystemWeightInfo = (); + // We also don't use the provided extensions framework + type ExtensionsWeightInfo = (); + // We don't invoke any hooks on-set-code as we don't perform upgrades via the blockchain yet via + // nodes, ensuring everyone who upgrades consents to the rules they upgrade to + type OnSetCode = (); + type MaxConsumers = sp_core::ConstU32<{ u32::MAX }>; + // No migrations set + type SingleBlockMigrations = (); + type MultiBlockMigrator = (); + // We don't define any block-level hooks at this time + type PreInherents = (); + type PostInherents = (); + type PostTransactions = (); +} + +impl core_pallet::Config for Runtime {} + +impl From<Option<SeraiAddress>> for RuntimeOrigin { + fn from(signer: Option<SeraiAddress>) -> Self { + match signer { + None => RuntimeOrigin::none(), + Some(signer) => RuntimeOrigin::signed(signer.into()), + } + } +} + +impl From<serai_abi::Call> for RuntimeCall { + fn from(call: serai_abi::Call) -> Self { + match call { + serai_abi::Call::Coins(call) => { + use serai_abi::coins::Call; + match call { + Call::transfer { .. } | Call::burn { .. } | Call::burn_with_instruction { .. } => { + todo!("TODO") + } + } + } + serai_abi::Call::ValidatorSets(call) => { + use serai_abi::validator_sets::Call; + match call { + Call::set_keys { .. } | + Call::report_slashes { .. } | + Call::set_embedded_elliptic_curve_keys { .. } | + Call::allocate { .. } | + Call::deallocate { .. } | + Call::claim_deallocation { .. } => todo!("TODO"), + } + } + serai_abi::Call::Signals(call) => { + use serai_abi::signals::Call; + match call { + Call::register_retirement_signal { .. } | + Call::revoke_retirement_signal { .. } | + Call::favor { .. } | + Call::revoke_favor { .. } | + Call::stand_against { .. } => todo!("TODO"), + } + } + serai_abi::Call::Dex(call) => { + use serai_abi::dex::Call; + match call { + Call::add_liquidity { .. } | + Call::transfer_liquidity { .. } | + Call::remove_liquidity { .. } | + Call::swap_exact { .. } | + Call::swap_for_exact { .. } => todo!("TODO"), + } + } + serai_abi::Call::GenesisLiquidity(call) => { + use serai_abi::genesis_liquidity::Call; + match call { + Call::oraclize_values { .. } | Call::remove_liquidity { .. } => todo!("TODO"), + } + } + serai_abi::Call::InInstructions(call) => { + use serai_abi::in_instructions::Call; + match call { + Call::execute_batch { .. } => todo!("TODO"), + } + } + } + } +} + +type Executive = frame_executive::Executive<Runtime, Block, Context, Runtime, AllPalletsWithSystem>; + +sp_api::impl_runtime_apis! { + impl sp_api::Core<Block> for Runtime { + fn version() -> RuntimeVersion { + VERSION + } + fn initialize_block(header: &Header) -> sp_runtime::ExtrinsicInclusionMode { + core_pallet::Blocks::<Runtime>::set(header.parent_hash(), Some(())); + Executive::initialize_block(header) + } + fn execute_block(block: Block) { + Executive::execute_block(block); + } + } +} + +#[derive(Clone, Default, PartialEq, Eq, Debug)] +struct Context; +impl serai_abi::TransactionContext for Context { + // TODO + const SIGNED_WEIGHT: Weight = Weight::zero(); + + type RuntimeCall = RuntimeCall; + + /// The implicit context to verify transactions with. + fn implicit_context() -> serai_abi::ImplicitContext { + serai_abi::ImplicitContext { + genesis: System::block_hash(0).into(), + protocol_id: [0; 32], // TODO via build script + } + } + + /// If a block is present in the blockchain. + fn block_is_present_in_blockchain(&self, hash: &serai_abi::primitives::BlockHash) -> bool { + core_pallet::Blocks::<Runtime>::get(hash).is_some() + } + /// The time embedded into the current block. + fn current_time(&self) -> Option<u64> { + todo!("TODO") + } + /// Get, and consume, the next nonce for an account. + fn get_and_consume_next_nonce(&self, signer: &SeraiAddress) -> u32 { + core_pallet::NextNonce::<Runtime>::mutate(signer, |value| { + // Copy the current value for the next nonce + let next_nonce = *value; + // Increment the next nonce in the DB, consuming the current value + *value += 1; + // Return the existing value + next_nonce + }) + } + /// If the signer can pay the SRI fee. + fn can_pay_fee( + &self, + signer: &SeraiAddress, + fee: serai_abi::primitives::balance::Amount, + ) -> Result<(), sp_runtime::transaction_validity::TransactionValidityError> { + todo!("TODO") + } + /// Have the transaction pay its SRI fee. + fn pay_fee( + &self, + signer: &SeraiAddress, + fee: serai_abi::primitives::balance::Amount, + ) -> Result<(), sp_runtime::transaction_validity::TransactionValidityError> { + todo!("TODO") + } +} + +/* use core::marker::PhantomData; // Re-export all components @@ -73,29 +323,14 @@ use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use babe::AuthorityId as BabeId; use grandpa::AuthorityId as GrandpaId; -mod abi; - -/// 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; pub type SignedExtra = ( system::CheckNonZeroSender<Runtime>, - system::CheckSpecVersion<Runtime>, - system::CheckTxVersion<Runtime>, - system::CheckGenesis<Runtime>, - system::CheckEra<Runtime>, - system::CheckNonce<Runtime>, - system::CheckWeight<Runtime>, - transaction_payment::ChargeTransactionPayment<Runtime>, + system::CheckWeight<Runtime>, TODO ); -pub type Transaction = serai_abi::tx::Transaction<RuntimeCall, SignedExtra>; -pub type Block = generic::Block<Header, Transaction>; -pub type BlockId = generic::BlockId<Block>; - pub mod opaque { use super::*; @@ -107,22 +342,6 @@ pub mod opaque { } } -#[sp_version::runtime_version] -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() } -} - pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4); pub const BABE_GENESIS_EPOCH_CONFIG: sp_consensus_babe::BabeEpochConfiguration = sp_consensus_babe::BabeEpochConfiguration { @@ -133,7 +352,6 @@ pub const BABE_GENESIS_EPOCH_CONFIG: sp_consensus_babe::BabeEpochConfiguration = const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); parameter_types! { - pub const BlockHashCount: BlockNumber = 2400; pub const Version: RuntimeVersion = VERSION; pub const SS58Prefix: u8 = 42; // TODO: Remove for Bech32m @@ -148,44 +366,6 @@ parameter_types! { ); } -pub struct CallFilter; -impl Contains<RuntimeCall> for CallFilter { - fn contains(call: &RuntimeCall) -> bool { - // If the call is defined in our ABI, it's allowed - let call: Result<serai_abi::Call, ()> = call.clone().try_into(); - call.is_ok() - } -} - -impl system::Config for Runtime { - type BaseCallFilter = CallFilter; - type BlockWeights = BlockWeights; - type BlockLength = BlockLength; - type AccountId = PublicKey; - type RuntimeCall = RuntimeCall; - type Lookup = AccountLookup; - type Hash = Hash; - type Hashing = BlakeTwo256; - type Nonce = Nonce; - type Block = Block; - type RuntimeOrigin = RuntimeOrigin; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type DbWeight = RocksDbWeight; - 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>; -} - impl timestamp::Config for Runtime { type Moment = u64; type OnTimestampSet = Babe; @@ -319,14 +499,6 @@ impl grandpa::Config for Runtime { grandpa::EquivocationReportSystem<Self, ValidatorSets, ValidatorSets, ReportLongevity>; } -pub type Executive = frame_executive::Executive< - Runtime, - Block, - system::ChainContext<Runtime>, - Runtime, - AllPalletsWithSystem, ->; - construct_runtime!( pub enum Runtime { System: system exclude_parts { Call }, @@ -627,3 +799,4 @@ sp_api::impl_runtime_apis! { } } } +*/