From a67f06e5209593ebfd37a3288675d0ecd853229f Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Wed, 22 Jan 2025 19:21:33 +0900 Subject: [PATCH 01/16] feat: add hyperbridge on polkadot2407 --- Cargo.lock | 319 ++++++++-- Cargo.toml | 18 + pallets/token-gateway/Cargo.toml | 58 ++ pallets/token-gateway/primitives/Cargo.toml | 52 ++ pallets/token-gateway/primitives/src/lib.rs | 91 +++ pallets/token-gateway/src/impls.rs | 108 ++++ pallets/token-gateway/src/lib.rs | 658 ++++++++++++++++++++ pallets/token-gateway/src/types.rs | 85 +++ primitives/src/traits/assets.rs | 14 + runtime/testnet/Cargo.toml | 10 +- runtime/testnet/src/hyperbridge.rs | 115 ++++ 11 files changed, 1487 insertions(+), 41 deletions(-) create mode 100644 pallets/token-gateway/Cargo.toml create mode 100644 pallets/token-gateway/primitives/Cargo.toml create mode 100644 pallets/token-gateway/primitives/src/lib.rs create mode 100644 pallets/token-gateway/src/impls.rs create mode 100644 pallets/token-gateway/src/lib.rs create mode 100644 pallets/token-gateway/src/types.rs create mode 100644 runtime/testnet/src/hyperbridge.rs diff --git a/Cargo.lock b/Cargo.lock index 15a1f0547..4fff0de03 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -141,7 +141,7 @@ version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da226340862e036ab26336dc99ca85311c6b662267c1440e1733890fd688802c" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.18", "num_enum", "strum 0.26.3", ] @@ -153,7 +153,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4138dc275554afa6f18c4217262ac9388790b2fc393c2dfe03c51d357abf013" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-rlp", "alloy-serde", "alloy-trie", @@ -172,7 +172,7 @@ checksum = "0fa04e1882c31288ce1028fdf31b6ea94cfa9eafa2e497f903ded631c8c6a42c" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-rlp", "alloy-serde", "serde", @@ -188,11 +188,11 @@ dependencies = [ "alloy-json-abi", "alloy-network", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-provider", "alloy-pubsub", "alloy-rpc-types-eth", - "alloy-sol-types", + "alloy-sol-types 0.8.18", "alloy-transport", "futures 0.3.31", "futures-util", @@ -207,9 +207,9 @@ checksum = "d0713007d14d88a6edb8e248cddab783b698dbb954a28b8eee4bab21cfb7e578" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-rlp", - "alloy-sol-types", + "alloy-sol-types 0.8.18", ] [[package]] @@ -219,9 +219,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44e3b98c37b3218924cd1d2a8570666b89662be54e5b182643855f783ea68b33" dependencies = [ "alloy-json-abi", - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-sol-type-parser", - "alloy-sol-types", + "alloy-sol-types 0.8.18", "const-hex", "itoa", "serde", @@ -235,7 +235,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-rlp", "serde", ] @@ -246,7 +246,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cabf647eb4650c91a9d38cb6f972bb320009e7e9d61765fb688a86f1563b33e8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-rlp", "derive_more 1.0.0", "k256", @@ -261,7 +261,7 @@ checksum = "52dd5869ed09e399003e0e0ec6903d981b2a92e74c5d37e6b40890bad2517526" dependencies = [ "alloy-eip2930", "alloy-eip7702", - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-rlp", "alloy-serde", "c-kzg", @@ -278,7 +278,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7d2a7fe5c1a9bd6793829ea21a636f30fc2b3f5d2e7418ba86d96e41dd1f460" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-serde", "alloy-trie", "serde", @@ -290,7 +290,7 @@ version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "731ea743b3d843bc657e120fb1d1e9cc94f5dab8107e35a82125a63e6420a102" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-sol-type-parser", "serde", "serde_json", @@ -302,8 +302,8 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2008bedb8159a255b46b7c8614516eda06679ea82f620913679afbd8031fea72" dependencies = [ - "alloy-primitives", - "alloy-sol-types", + "alloy-primitives 0.8.18", + "alloy-sol-types 0.8.18", "serde", "serde_json", "thiserror 2.0.8", @@ -321,12 +321,12 @@ dependencies = [ "alloy-eips", "alloy-json-rpc", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-rpc-types-any", "alloy-rpc-types-eth", "alloy-serde", "alloy-signer", - "alloy-sol-types", + "alloy-sol-types 0.8.18", "async-trait", "auto_impl", "futures-utils-wasm", @@ -343,11 +343,33 @@ checksum = "f31c3c6b71340a1d076831823f09cb6e02de01de5c6630a9631bdb36f947ff80" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-serde", "serde", ] +[[package]] +name = "alloy-primitives" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 0.99.18", + "hex-literal 0.4.1", + "itoa", + "k256", + "keccak-asm", + "proptest", + "rand", + "ruint", + "serde", + "tiny-keccak", +] + [[package]] name = "alloy-primitives" version = "0.8.18" @@ -387,7 +409,7 @@ dependencies = [ "alloy-json-rpc", "alloy-network", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-pubsub", "alloy-rpc-client", "alloy-rpc-types-debug", @@ -424,7 +446,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2269fd635f7b505f27c63a3cb293148cd02301efce4c8bdd9ff54fbfc4a20e23" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-transport", "bimap", "futures 0.3.31", @@ -465,7 +487,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d06a292b37e182e514903ede6e623b9de96420e8109ce300da288a96d88b7e4b" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-pubsub", "alloy-transport", "alloy-transport-http", @@ -490,7 +512,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9383845dd924939e7ab0298bbfe231505e20928907d7905aa3bf112287305e06" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-rpc-types-engine", "alloy-rpc-types-eth", "alloy-rpc-types-trace", @@ -515,7 +537,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "358d6a8d7340b9eb1a7589a6c1fb00df2c9b26e90737fa5ed0108724dd8dac2c" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.18", "serde", ] @@ -527,7 +549,7 @@ checksum = "4a5f821f30344862a0b6eb9a1c2eb91dfb2ff44c7489f37152a526cdcab79264" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-rlp", "alloy-serde", "derive_more 1.0.0", @@ -545,10 +567,10 @@ dependencies = [ "alloy-consensus-any", "alloy-eips", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-rlp", "alloy-serde", - "alloy-sol-types", + "alloy-sol-types 0.8.18", "itertools 0.13.0", "serde", "serde_json", @@ -561,7 +583,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd38207e056cc7d1372367fbb4560ddf9107cbd20731743f641246bf0dede149" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-rpc-types-eth", "alloy-serde", "serde", @@ -575,7 +597,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae0465c71d4dced7525f408d84873aeebb71faf807d22d74c4a426430ccd9b55" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.18", "serde", "serde_json", ] @@ -586,7 +608,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bfa395ad5cc952c82358d31e4c68b27bf4a89a5456d9b27e226e77dac50e4ff" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.18", "async-trait", "auto_impl", "elliptic-curve", @@ -602,7 +624,7 @@ checksum = "fbdc63ce9eda1283fcbaca66ba4a414b841c0e3edbeef9c86a71242fc9e84ccc" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-signer", "async-trait", "k256", @@ -610,20 +632,52 @@ dependencies = [ "thiserror 2.0.8", ] +[[package]] +name = "alloy-sol-macro" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b40397ddcdcc266f59f959770f601ce1280e699a91fc1862f29cef91707cd09" +dependencies = [ + "alloy-sol-macro-expander 0.7.7", + "alloy-sol-macro-input 0.7.7", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "alloy-sol-macro" version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a07b74d48661ab2e4b50bb5950d74dbff5e61dd8ed03bb822281b706d54ebacb" dependencies = [ - "alloy-sol-macro-expander", - "alloy-sol-macro-input", + "alloy-sol-macro-expander 0.8.18", + "alloy-sol-macro-input 0.8.18", "proc-macro-error2", "proc-macro2", "quote", "syn 2.0.90", ] +[[package]] +name = "alloy-sol-macro-expander" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "867a5469d61480fea08c7333ffeca52d5b621f5ca2e44f271b117ec1fc9a0525" +dependencies = [ + "alloy-sol-macro-input 0.7.7", + "const-hex", + "heck 0.5.0", + "indexmap 2.7.0", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.90", + "syn-solidity 0.7.7", + "tiny-keccak", +] + [[package]] name = "alloy-sol-macro-expander" version = "0.8.18" @@ -631,7 +685,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19cc9c7f20b90f9be1a8f71a3d8e283a43745137b0837b1a1cb13159d37cad72" dependencies = [ "alloy-json-abi", - "alloy-sol-macro-input", + "alloy-sol-macro-input 0.8.18", "const-hex", "heck 0.5.0", "indexmap 2.7.0", @@ -639,10 +693,25 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.90", - "syn-solidity", + "syn-solidity 0.8.18", "tiny-keccak", ] +[[package]] +name = "alloy-sol-macro-input" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e482dc33a32b6fadbc0f599adea520bd3aaa585c141a80b404d0a3e3fa72528" +dependencies = [ + "const-hex", + "dunce", + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.90", + "syn-solidity 0.7.7", +] + [[package]] name = "alloy-sol-macro-input" version = "0.8.18" @@ -657,7 +726,7 @@ dependencies = [ "quote", "serde_json", "syn 2.0.90", - "syn-solidity", + "syn-solidity 0.8.18", ] [[package]] @@ -670,6 +739,17 @@ dependencies = [ "winnow", ] +[[package]] +name = "alloy-sol-types" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" +dependencies = [ + "alloy-primitives 0.7.7", + "alloy-sol-macro 0.7.7", + "const-hex", +] + [[package]] name = "alloy-sol-types" version = "0.8.18" @@ -677,8 +757,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3b478bc9c0c4737a04cd976accde4df7eba0bdc0d90ad6ff43d58bc93cf79c1" dependencies = [ "alloy-json-abi", - "alloy-primitives", - "alloy-sol-macro", + "alloy-primitives 0.8.18", + "alloy-sol-macro 0.8.18", "const-hex", "serde", ] @@ -761,7 +841,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6917c79e837aa7b77b7a6dae9f89cbe15313ac161c4d3cfaf8909ef21f3d22d8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.18", "alloy-rlp", "arrayvec 0.7.6", "derive_more 1.0.0", @@ -4474,6 +4554,17 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fortuples" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87630a8087e9cac4b7edfb6ee5e250ddca9112b57b6b17d8f5107375a3a8eace" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "forwarded-header-value" version = "0.1.1" @@ -6335,6 +6426,23 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +[[package]] +name = "ismp" +version = "0.2.2" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +dependencies = [ + "anyhow", + "derive_more 1.0.0", + "displaydoc", + "hex", + "parity-scale-codec", + "primitive-types 0.12.2", + "scale-info", + "serde", + "serde-hex-utils", + "thiserror 2.0.8", +] + [[package]] name = "itertools" version = "0.10.5" @@ -9463,6 +9571,22 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-hyperbridge" +version = "1.15.3" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +dependencies = [ + "anyhow", + "frame-support", + "frame-system", + "ismp", + "pallet-ismp", + "parity-scale-codec", + "primitive-types 0.12.2", + "scale-info", + "sp-std", +] + [[package]] name = "pallet-identity" version = "37.0.0" @@ -9527,6 +9651,29 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-ismp" +version = "1.15.3" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +dependencies = [ + "anyhow", + "fortuples", + "frame-benchmarking", + "frame-support", + "frame-system", + "ismp", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-multi-asset-delegation" version = "1.2.5" @@ -10012,6 +10159,30 @@ dependencies = [ "sp-timestamp", ] +[[package]] +name = "pallet-token-gateway" +version = "1.15.1" +dependencies = [ + "alloy-primitives 0.7.7", + "alloy-sol-macro 0.7.7", + "alloy-sol-types 0.7.7", + "anyhow", + "frame-support", + "frame-system", + "ismp", + "log", + "pallet-hyperbridge", + "pallet-ismp", + "parity-scale-codec", + "primitive-types 0.12.2", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "tangle-primitives", + "token-gateway-primitives", +] + [[package]] name = "pallet-transaction-payment" version = "37.0.1" @@ -10545,6 +10716,16 @@ dependencies = [ "plotters-backend", ] +[[package]] +name = "polkadot-ckb-merkle-mountain-range" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b44320e5f7ce2c18227537a3032ae5b2c476a7e8eddba45333e1011fc31b92" +dependencies = [ + "cfg-if", + "itertools 0.10.5", +] + [[package]] name = "polkadot-core-primitives" version = "15.0.0" @@ -13759,6 +13940,16 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-hex-utils" +version = "0.1.0" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +dependencies = [ + "anyhow", + "hex", + "serde", +] + [[package]] name = "serde_bytes" version = "0.11.15" @@ -14657,6 +14848,23 @@ dependencies = [ "sp-application-crypto", ] +[[package]] +name = "sp-mmr-primitives" +version = "34.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" +dependencies = [ + "log", + "parity-scale-codec", + "polkadot-ckb-merkle-mountain-range", + "scale-info", + "serde", + "sp-api", + "sp-core", + "sp-debug-derive", + "sp-runtime", + "thiserror 1.0.69", +] + [[package]] name = "sp-npos-elections" version = "34.0.0" @@ -15711,6 +15919,18 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn-solidity" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c837dc8852cb7074e46b444afb81783140dab12c58867b49fb3898fbafedf7ea" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "syn-solidity" version = "0.8.18" @@ -16453,6 +16673,27 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "token-gateway-primitives" +version = "1.15.1" +dependencies = [ + "alloy-primitives 0.7.7", + "alloy-sol-macro 0.7.7", + "alloy-sol-types 0.7.7", + "anyhow", + "frame-support", + "frame-system", + "ismp", + "log", + "pallet-ismp", + "parity-scale-codec", + "primitive-types 0.12.2", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", +] + [[package]] name = "tokio" version = "1.42.0" diff --git a/Cargo.toml b/Cargo.toml index 6ae37ceff..0648f74ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -372,6 +372,24 @@ rpc-trace = { path = "client/rpc/trace" } rpc-txpool = { path = "client/rpc/txpool" } evm-tracer = { path = "evm-tracer", default-features = false } +# Hyperbridge EVM necessary dependencies +alloy-sol-macro = "0.7.7" +alloy-sol-types = { version = "0.7.7", default-features = false } +alloy-primitives = { version = "0.7.7", default-features = false, features = ["rlp"] } + +# Hyperbridge +token-gateway-primitives = { path = "pallets/token-gateway/primitives" } +pallet-token-gateway = { path = "pallets/token-gateway" } +pallet-ismp = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +pallet-ismp-rpc = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407" } +pallet-ismp-runtime-api = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +ismp-parachain = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +ismp-parachain-inherent = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +ismp-parachain-runtime-api = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +ismp = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +pallet-hyperbridge = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +anyhow = { version = "1.0.93", default-features = false } + # Polkadot XCM xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk.git", branch = "stable2407", default-features = false } xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk.git", branch = "stable2407", default-features = false } diff --git a/pallets/token-gateway/Cargo.toml b/pallets/token-gateway/Cargo.toml new file mode 100644 index 000000000..995e29624 --- /dev/null +++ b/pallets/token-gateway/Cargo.toml @@ -0,0 +1,58 @@ +[package] +name = "pallet-token-gateway" +version = "1.15.1" +edition = "2021" +description = "A substrate implementation of the token gateway protocol" +authors = ["Polytope Labs "] +license = "Apache-2.0" +repository = "https://github.com/polytope-labs/hyperbridge" +homepage = "https://docs.hyperbridge.network/developers/polkadot/tokengateway" +documentation = "https://docs.rs/pallet-token-gateway" +keywords = ["substrate", "polkadot-sdk", "ISMP", "interoperability", "pallet-assets"] +readme = "./README.md" + +[dependencies] +frame-support = { workspace = true } +frame-system = { workspace = true } +sp-runtime = { workspace = true } +sp-core = { workspace = true } +sp-io = { workspace = true } +primitive-types = { workspace = true } + +ismp = { workspace = true } +pallet-ismp = { workspace = true } + +log = { workspace = true } +parity-scale-codec = { workspace = true, default-features = false } +scale-info = { workspace = true } +anyhow = { workspace = true } + +alloy-primitives = { workspace = true } +alloy-sol-macro = { workspace = true } +alloy-sol-types = { workspace = true } + +token-gateway-primitives = { workspace = true, default-features = false } +pallet-hyperbridge = { workspace = true } +tangle-primitives = { workspace = true } + +[features] +default = ["std"] +std = [ + "parity-scale-codec/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-core/std", + "sp-io/std", + "primitive-types/std", + "ismp/std", + "pallet-ismp/std", + "log/std", + "scale-info/std", + "anyhow/std", + "alloy-primitives/std", + "pallet-hyperbridge/std", + "token-gateway-primitives/std", + "tangle-primitives/std", +] +try-runtime = [] \ No newline at end of file diff --git a/pallets/token-gateway/primitives/Cargo.toml b/pallets/token-gateway/primitives/Cargo.toml new file mode 100644 index 000000000..1caf10505 --- /dev/null +++ b/pallets/token-gateway/primitives/Cargo.toml @@ -0,0 +1,52 @@ +[package] +name = "token-gateway-primitives" +version = "1.15.1" +edition = "2021" +description = "A collection of types used by token gateway" +authors = ["Polytope Labs "] +license = "Apache-2.0" +repository = "https://github.com/polytope-labs/hyperbridge" +homepage = "https://docs.hyperbridge.network/developers/polkadot/tokengateway" +documentation = "https://docs.rs/pallet-token-gateway" +keywords = ["substrate", "polkadot-sdk", "ISMP", "interoperability", "pallet-assets"] +readme = "./README.md" + +[dependencies] +frame-support = { workspace = true } +frame-system = { workspace = true } +sp-runtime = { workspace = true } +sp-core = { workspace = true } +sp-io = { workspace = true } +primitive-types = { workspace = true } + +ismp = { workspace = true } +pallet-ismp = { workspace = true } + +log = { workspace = true } +parity-scale-codec = { workspace = true, default-features = false } +scale-info = { workspace = true } +anyhow = { workspace = true } + +alloy-primitives = { workspace = true } +alloy-sol-macro = { workspace = true } +alloy-sol-types = { workspace = true } + + +[features] +default = ["std"] +std = [ + "parity-scale-codec/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-core/std", + "sp-io/std", + "primitive-types/std", + "ismp/std", + "pallet-ismp/std", + "log/std", + "scale-info/std", + "anyhow/std", + "alloy-primitives/std", +] +try-runtime = [] \ No newline at end of file diff --git a/pallets/token-gateway/primitives/src/lib.rs b/pallets/token-gateway/primitives/src/lib.rs new file mode 100644 index 000000000..e21c6b1c9 --- /dev/null +++ b/pallets/token-gateway/primitives/src/lib.rs @@ -0,0 +1,91 @@ +// Copyright (C) Polytope Labs Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! This library contains types shared with token gateway and other pallets +#![cfg_attr(not(feature = "std"), no_std)] + +use ismp::host::StateMachine; +use sp_core::{ConstU32, H160, H256}; +use sp_runtime::BoundedVec; + +extern crate alloc; +use alloc::vec::Vec; +use parity_scale_codec::{Decode, Encode}; + +/// The token registry Id +pub const REGISTRY: [u8; 8] = *b"registry"; + +/// Token Gateway Id for substrate chains +/// Module Id is the last 20 bytes of the keccak hash of the pallet id +pub fn token_gateway_id() -> H160 { + let hash = sp_io::hashing::keccak_256(b"tokengty"); + H160::from_slice(&hash[12..32]) +} + +pub fn token_governor_id() -> Vec { + REGISTRY.to_vec() +} + +/// Holds metadata relevant to a multi-chain native asset +#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, Default)] +pub struct AssetMetadata { + /// The asset name + pub name: BoundedVec>, + /// The asset symbol + pub symbol: BoundedVec>, + /// The asset decimals of the ERC6160 or ERC20 counterpart of this asset + pub decimals: u8, + /// Asset's minimum balance, only used by substrate chains + pub minimum_balance: Option, +} + +/// A struct for deregistering asset id on pallet-token-gateway +#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, Default)] +pub struct DeregisterAssets { + pub asset_ids: Vec, +} + +/// Holds data required for multi-chain native asset registration +#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq)] +pub struct GatewayAssetRegistration { + /// The asset name + pub name: BoundedVec>, + /// The asset symbol + pub symbol: BoundedVec>, + /// The list of chains to create the asset on + pub chains: Vec, + /// Minimum balance for the asset, for substrate chains, + pub minimum_balance: Option, +} + +/// Allows a user to update their multi-chain native token potentially on multiple chains +#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, Default)] +pub struct GatewayAssetUpdate { + /// The asset identifier + pub asset_id: H256, + /// Chains to add support for the asset on + pub add_chains: BoundedVec>, + /// Chains to delist the asset from + pub remove_chains: BoundedVec>, + /// Chains to change the asset admin on + pub new_admins: BoundedVec<(StateMachine, H160), ConstU32<100>>, +} + +/// Holds data required for multi-chain native asset registration +#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq)] +pub enum RemoteERC6160AssetRegistration { + CreateAsset(GatewayAssetRegistration), + UpdateAsset(GatewayAssetUpdate), +} diff --git a/pallets/token-gateway/src/impls.rs b/pallets/token-gateway/src/impls.rs new file mode 100644 index 000000000..77f5d3692 --- /dev/null +++ b/pallets/token-gateway/src/impls.rs @@ -0,0 +1,108 @@ +// Copyright (C) Polytope Labs Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Pallet Implementations +use alloc::string::ToString; +use frame_support::PalletId; +use sp_core::U256; +use sp_runtime::traits::AccountIdConversion; +use token_gateway_primitives::token_gateway_id; + +use crate::{Config, Pallet}; + +impl Pallet { + pub fn pallet_account() -> T::AccountId { + let mut inner = [0u8; 8]; + inner.copy_from_slice(&token_gateway_id().0[0..8]); + PalletId(inner).into_account_truncating() + } + + pub fn is_token_gateway(id: &[u8]) -> bool { + id == &token_gateway_id().0 + } +} + +/// Converts an ERC20 U256 to a u128 +pub fn convert_to_balance( + value: U256, + erc_decimals: u8, + final_decimals: u8, +) -> Result { + let dec_str = (value + / U256::from(10u128.pow(erc_decimals.saturating_sub(final_decimals) as u32))) + .to_string(); + dec_str.parse().map_err(|e| anyhow::anyhow!("{e:?}")) +} + +/// Converts a u128 to an Erc20 denomination +pub fn convert_to_erc20(value: u128, erc_decimals: u8, decimals: u8) -> U256 { + U256::from(value) * U256::from(10u128.pow(erc_decimals.saturating_sub(decimals) as u32)) +} + +#[cfg(test)] +mod tests { + use sp_core::U256; + use sp_runtime::Permill; + use std::ops::Mul; + + use super::{convert_to_balance, convert_to_erc20}; + + #[test] + fn test_per_mill() { + let per_mill = Permill::from_parts(1_000); + + println!("{}", per_mill.mul(20_000_000u128)); + } + + #[test] + fn balance_conversions() { + let supposedly_small_u256 = U256::from_dec_str("1000000000000000000").unwrap(); + // convert erc20 value to dot value + let converted_balance = convert_to_balance(supposedly_small_u256, 18, 10).unwrap(); + println!("{}", converted_balance); + + let dot = 10_000_000_000u128; + + assert_eq!(converted_balance, dot); + + // Convert 1 dot to erc20 + + let dot = 10_000_000_000u128; + let erc_20_val = convert_to_erc20(dot, 18, 10); + assert_eq!(erc_20_val, U256::from_dec_str("1000000000000000000").unwrap()); + + // Convert 6 decimal ERC 20 + let supposedly_small_u256 = U256::from_dec_str("1000000000000000000").unwrap(); + // convert erc20 value to 18 decimal value + let converted_balance = convert_to_balance(supposedly_small_u256, 6, 18).unwrap(); + println!("{}", converted_balance); + } + + #[test] + fn max_value_check() { + let max = U256::MAX; + + let converted_balance = convert_to_balance(max, 18, 10); + assert!(converted_balance.is_err()) + } + + #[test] + fn min_value_check() { + let min = U256::from(1u128); + + let converted_balance = convert_to_balance(min, 18, 10).unwrap(); + assert_eq!(converted_balance, 0); + } +} diff --git a/pallets/token-gateway/src/lib.rs b/pallets/token-gateway/src/lib.rs new file mode 100644 index 000000000..d283b8593 --- /dev/null +++ b/pallets/token-gateway/src/lib.rs @@ -0,0 +1,658 @@ +// Copyright (C) Polytope Labs Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! The token gateway enables asset transfers to EVM instances of token gateway +#![cfg_attr(not(feature = "std"), no_std)] + +extern crate alloc; + +pub mod impls; +pub mod types; +use crate::impls::{convert_to_balance, convert_to_erc20}; +use alloy_sol_types::SolValue; +use anyhow::anyhow; +use frame_support::{ + ensure, + pallet_prelude::Weight, + traits::{ + fungibles::{self, Mutate}, + tokens::{fungible::Mutate as FungibleMutate, Fortitude, Precision, Preservation}, + Currency, ExistenceRequirement, + }, +}; + +use ismp::{ + events::Meta, + router::{PostRequest, Request, Response, Timeout}, +}; + +use sp_core::{Get, U256}; +use token_gateway_primitives::{token_gateway_id, token_governor_id}; +pub use types::*; + +use alloc::{string::ToString, vec, vec::Vec}; +use ismp::module::IsmpModule; +use primitive_types::H256; + +use tangle_primitives::{ + AssetMetadata as AssetMetadataBifrost, CurrencyId, CurrencyIdMapping, TokenInfo, +}; +// Re-export pallet items so that they can be accessed from the crate namespace. +pub use pallet::*; + +#[frame_support::pallet] +pub mod pallet { + use alloc::collections::BTreeMap; + use pallet_hyperbridge::PALLET_HYPERBRIDGE; + use sp_runtime::traits::AccountIdConversion; + + use super::*; + use frame_support::{ + pallet_prelude::*, + traits::{tokens::Preservation, Currency, ExistenceRequirement}, + }; + use frame_system::pallet_prelude::*; + use ismp::{ + dispatcher::{DispatchPost, DispatchRequest, FeeMetadata, IsmpDispatcher}, + host::StateMachine, + }; + use pallet_hyperbridge::{SubstrateHostParams, VersionedHostParams}; + use sp_runtime::traits::Zero; + use token_gateway_primitives::{GatewayAssetUpdate, RemoteERC6160AssetRegistration}; + + #[pallet::pallet] + #[pallet::without_storage_info] + pub struct Pallet(_); + + /// The pallet's configuration trait. + #[pallet::config] + pub trait Config: + frame_system::Config + pallet_ismp::Config + pallet_hyperbridge::Config + { + /// The overarching runtime event type. + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + + /// The [`IsmpDispatcher`] for dispatching cross-chain requests + type Dispatcher: IsmpDispatcher; + + /// A currency implementation for interacting with the native asset + type NativeCurrency: Currency; + + /// A funded account that would be set as asset admin and also make payments for asset + /// creation + type AssetAdmin: Get; + + /// Fungible asset implementation + type Assets: fungibles::Mutate + + fungibles::Inspect; + + /// The native asset ID + type NativeAssetId: Get>; + + /// A trait that can be used to create new asset Ids + type AssetIdFactory: CreateAssetId>; + + /// The decimals of the native currency + #[pallet::constant] + type Decimals: Get; + + /// Origin type that will be used to enforce permissions. + type ControlOrigin: EnsureOrigin; + + /// Convert Location to `T::CurrencyId`. + type CurrencyIdConvert: CurrencyIdMapping>; + } + + /// Assets supported by this instance of token gateway + /// A map of the local asset id to the token gateway asset id + #[pallet::storage] + pub type SupportedAssets = + StorageMap<_, Blake2_128Concat, AssetId, H256, OptionQuery>; + + /// Assets that originate from this chain + #[pallet::storage] + pub type NativeAssets = + StorageMap<_, Blake2_128Concat, AssetId, bool, ValueQuery>; + + /// Assets supported by this instance of token gateway + /// A map of the token gateway asset id to the local asset id + #[pallet::storage] + pub type LocalAssets = StorageMap<_, Identity, H256, AssetId, OptionQuery>; + + /// The decimals used by the EVM counterpart of this asset + #[pallet::storage] + pub type Decimals = StorageMap<_, Blake2_128Concat, AssetId, u8, OptionQuery>; + + /// The token gateway adresses on different chains + #[pallet::storage] + pub type TokenGatewayAddresses = + StorageMap<_, Blake2_128Concat, StateMachine, Vec, OptionQuery>; + + /// Pallet events that functions in this pallet can emit. + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// An asset has been teleported + AssetTeleported { + /// Source account on the relaychain + from: T::AccountId, + /// beneficiary account on destination + to: H256, + /// Amount transferred + amount: <::NativeCurrency as Currency>::Balance, + /// Destination chain + dest: StateMachine, + /// Request commitment + commitment: H256, + }, + + /// An asset has been received and transferred to the beneficiary's account + AssetReceived { + /// beneficiary account on relaychain + beneficiary: T::AccountId, + /// Amount transferred + amount: <::NativeCurrency as Currency>::Balance, + /// Destination chain + source: StateMachine, + }, + + /// An asset has been refunded and transferred to the beneficiary's account + AssetRefunded { + /// beneficiary account on relaychain + beneficiary: T::AccountId, + /// Amount transferred + amount: <::NativeCurrency as Currency>::Balance, + /// Destination chain + source: StateMachine, + }, + + /// ERC6160 asset creation request dispatched to hyperbridge + ERC6160AssetRegistrationDispatched { + /// Request commitment + commitment: H256, + }, + } + + /// Errors that can be returned by this pallet. + #[pallet::error] + pub enum Error { + /// A asset that has not been registered + UnregisteredAsset, + /// Error while teleporting asset + AssetTeleportError, + /// Coprocessor was not configured in the runtime + CoprocessorNotConfigured, + /// Asset or update Dispatch Error + DispatchError, + /// Asset Id creation failed + AssetCreationError, + /// Asset decimals not found + AssetDecimalsNotFound, + /// Protocol Params have not been initialized + NotInitialized, + /// Unknown Asset + UnknownAsset, + } + + #[pallet::call] + impl Pallet + where + ::AccountId: From<[u8; 32]>, + u128: From<<::NativeCurrency as Currency>::Balance>, + ::Balance: + From<<::NativeCurrency as Currency>::Balance>, + <::Assets as fungibles::Inspect>::Balance: + From<<::NativeCurrency as Currency>::Balance>, + <::Assets as fungibles::Inspect>::Balance: From, + [u8; 32]: From<::AccountId>, + { + /// Teleports a registered asset + /// locks the asset and dispatches a request to token gateway on the destination + #[pallet::call_index(0)] + #[pallet::weight(weight())] + pub fn teleport( + origin: OriginFor, + params: TeleportParams< + AssetId, + <::NativeCurrency as Currency>::Balance, + >, + ) -> DispatchResult { + let who = ensure_signed(origin)?; + + let dispatcher = ::Dispatcher::default(); + let asset_id = SupportedAssets::::get(params.asset_id.clone()) + .ok_or_else(|| Error::::UnregisteredAsset)?; + let decimals = if params.asset_id == T::NativeAssetId::get() { + // Custody funds in pallet + ::NativeCurrency::transfer( + &who, + &Self::pallet_account(), + params.amount, + ExistenceRequirement::AllowDeath, + )?; + T::Decimals::get() + } else { + let is_native = NativeAssets::::get(params.asset_id.clone()); + if is_native { + ::Assets::transfer( + params.asset_id.clone(), + &who, + &Self::pallet_account(), + params.amount.into(), + Preservation::Expendable, + )?; + } else { + // Assets that do not originate from this chain are burned + ::Assets::burn_from( + params.asset_id.clone(), + &who, + params.amount.into(), + Preservation::Expendable, + Precision::Exact, + Fortitude::Polite, + )?; + } + params + .asset_id + .decimals() + .unwrap_or( + T::CurrencyIdConvert::get_currency_metadata(params.asset_id) + .map_or(12, |metatata| metatata.decimals.into()), + ) + .into() + }; + + let to = params.recepient.0; + let from: [u8; 32] = who.clone().into(); + let erc_decimals = Decimals::::get(params.asset_id) + .ok_or_else(|| Error::::AssetDecimalsNotFound)?; + + let body = Body { + amount: { + let amount: u128 = params.amount.into(); + let mut bytes = [0u8; 32]; + convert_to_erc20(amount, erc_decimals, decimals).to_big_endian(&mut bytes); + alloy_primitives::U256::from_be_bytes(bytes) + }, + asset_id: asset_id.0.into(), + redeem: params.redeem, + from: from.into(), + to: to.into(), + }; + + let dispatch_post = DispatchPost { + dest: params.destination, + from: token_gateway_id().0.to_vec(), + to: params.token_gateway, + timeout: params.timeout, + body: { + // Prefix with the handleIncomingAsset enum variant + let mut encoded = vec![0]; + encoded.extend_from_slice(&Body::abi_encode(&body)); + encoded + }, + }; + + let metadata = FeeMetadata { payer: who.clone(), fee: params.relayer_fee.into() }; + let commitment = dispatcher + .dispatch_request(DispatchRequest::Post(dispatch_post), metadata) + .map_err(|_| Error::::AssetTeleportError)?; + + Self::deposit_event(Event::::AssetTeleported { + from: who, + to: params.recepient, + dest: params.destination, + amount: params.amount, + commitment, + }); + Ok(()) + } + + /// Set the token gateway address for specified chains + #[pallet::call_index(1)] + #[pallet::weight(weight())] + pub fn set_token_gateway_addresses( + origin: OriginFor, + addresses: BTreeMap>, + ) -> DispatchResult { + T::AdminOrigin::ensure_origin(origin)?; + for (chain, address) in addresses { + TokenGatewayAddresses::::insert(chain, address.clone()); + } + Ok(()) + } + + /// Registers a multi-chain ERC6160 asset. The asset should not already exist. + /// + /// This works by dispatching a request to the TokenGateway module on each requested chain + /// to create the asset. + /// `native` should be true if this asset originates from this chain + #[pallet::call_index(2)] + #[pallet::weight(weight())] + pub fn create_erc6160_asset( + origin: OriginFor, + asset: AssetRegistration>, + native: bool, + ) -> DispatchResult { + T::ControlOrigin::ensure_origin(origin)?; + let who = T::AssetAdmin::get(); + + // charge hyperbridge fees + let VersionedHostParams::V1(SubstrateHostParams { asset_registration_fee, .. }) = + pallet_hyperbridge::Pallet::::host_params(); + + if asset_registration_fee != Zero::zero() { + T::Currency::transfer( + &who, + &PALLET_HYPERBRIDGE.into_account_truncating(), + asset_registration_fee.into(), + Preservation::Expendable, + )?; + } + + let asset_id: H256 = sp_io::hashing::keccak_256(asset.reg.symbol.as_ref()).into(); + // If the local asset id already exists we do not change it's metadata we only store + // the mapping to its token gateway asset id + + SupportedAssets::::insert(asset.local_id.clone(), asset_id.clone()); + NativeAssets::::insert(asset.local_id.clone(), native); + LocalAssets::::insert(asset_id, asset.local_id.clone()); + // All ERC6160 assets use 18 decimals + Decimals::::insert(asset.local_id, 18); + + let dispatcher = ::Dispatcher::default(); + let dispatch_post = DispatchPost { + dest: T::Coprocessor::get().ok_or_else(|| Error::::CoprocessorNotConfigured)?, + from: token_gateway_id().0.to_vec(), + to: token_governor_id(), + timeout: 0, + body: { RemoteERC6160AssetRegistration::CreateAsset(asset.reg).encode() }, + }; + + let metadata = FeeMetadata { payer: who, fee: Default::default() }; + + let commitment = dispatcher + .dispatch_request(DispatchRequest::Post(dispatch_post), metadata) + .map_err(|_| Error::::DispatchError)?; + Self::deposit_event(Event::::ERC6160AssetRegistrationDispatched { commitment }); + + Ok(()) + } + + /// Registers a multi-chain ERC6160 asset. The asset should not already exist. + /// + /// This works by dispatching a request to the TokenGateway module on each requested chain + /// to create the asset. + #[pallet::call_index(3)] + #[pallet::weight(weight())] + pub fn update_erc6160_asset( + origin: OriginFor, + asset: GatewayAssetUpdate, + ) -> DispatchResult { + T::ControlOrigin::ensure_origin(origin)?; + let who = T::AssetAdmin::get(); + + // charge hyperbridge fees + let VersionedHostParams::V1(SubstrateHostParams { asset_registration_fee, .. }) = + pallet_hyperbridge::Pallet::::host_params(); + + if asset_registration_fee != Zero::zero() { + T::Currency::transfer( + &who, + &PALLET_HYPERBRIDGE.into_account_truncating(), + asset_registration_fee.into(), + Preservation::Expendable, + )?; + } + + let dispatcher = ::Dispatcher::default(); + let dispatch_post = DispatchPost { + dest: T::Coprocessor::get().ok_or_else(|| Error::::CoprocessorNotConfigured)?, + from: token_gateway_id().0.to_vec(), + to: token_governor_id(), + timeout: 0, + body: { RemoteERC6160AssetRegistration::UpdateAsset(asset).encode() }, + }; + + let metadata = FeeMetadata { payer: who, fee: Default::default() }; + + let commitment = dispatcher + .dispatch_request(DispatchRequest::Post(dispatch_post), metadata) + .map_err(|_| Error::::DispatchError)?; + Self::deposit_event(Event::::ERC6160AssetRegistrationDispatched { commitment }); + + Ok(()) + } + } + + // Hack for implementing the [`Default`] bound needed for + // [`IsmpDispatcher`](ismp::dispatcher::IsmpDispatcher) and + // [`IsmpModule`](ismp::module::IsmpModule) + impl Default for Pallet { + fn default() -> Self { + Self(PhantomData) + } + } +} + +impl IsmpModule for Pallet +where + ::AccountId: From<[u8; 32]>, + <::NativeCurrency as Currency>::Balance: From, + <::Assets as fungibles::Inspect>::Balance: From, +{ + fn on_accept( + &self, + PostRequest { body, from, source, dest, nonce, .. }: PostRequest, + ) -> Result<(), anyhow::Error> { + ensure!( + from == TokenGatewayAddresses::::get(source).unwrap_or_default().to_vec() + || from == token_gateway_id().0.to_vec(), + ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Unknown source contract address".to_string(), + meta: Meta { source, dest, nonce }, + } + ); + + let body = Body::abi_decode(&mut &body[1..], true).map_err(|_| { + ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to decode request body".to_string(), + meta: Meta { source, dest, nonce }, + } + })?; + + let local_asset_id = + LocalAssets::::get(H256::from(body.asset_id.0)).ok_or_else(|| { + ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Unknown asset".to_string(), + meta: Meta { source, dest, nonce }, + } + })?; + + let decimals = if local_asset_id == T::NativeAssetId::get() { + T::Decimals::get() + } else { + local_asset_id + .decimals() + .unwrap_or( + T::CurrencyIdConvert::get_currency_metadata(local_asset_id) + .map_or(12, |metatata| metatata.decimals.into()), + ) + .into() + }; + let erc_decimals = Decimals::::get(local_asset_id.clone()) + .ok_or_else(|| anyhow!("Asset decimals not configured"))?; + let amount = convert_to_balance( + U256::from_big_endian(&body.amount.to_be_bytes::<32>()), + erc_decimals, + decimals, + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Trying to withdraw Invalid amount".to_string(), + meta: Meta { source, dest, nonce }, + })?; + let beneficiary: T::AccountId = body.to.0.into(); + if local_asset_id == T::NativeAssetId::get() { + ::NativeCurrency::transfer( + &Pallet::::pallet_account(), + &beneficiary, + amount.into(), + ExistenceRequirement::AllowDeath, + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to complete asset transfer".to_string(), + meta: Meta { source, dest, nonce }, + })?; + } else { + // Assets that do not originate from this chain are minted + let is_native = NativeAssets::::get(local_asset_id.clone()); + if is_native { + ::Assets::transfer( + local_asset_id, + &Pallet::::pallet_account(), + &beneficiary, + amount.into(), + Preservation::Expendable, + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to complete asset transfer".to_string(), + meta: Meta { source, dest, nonce }, + })?; + } else { + ::Assets::mint_into(local_asset_id, &beneficiary, amount.into()) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to complete asset transfer".to_string(), + meta: Meta { source, dest, nonce }, + })?; + } + } + + Self::deposit_event(Event::::AssetReceived { + beneficiary, + amount: amount.into(), + source, + }); + Ok(()) + } + + fn on_response(&self, _response: Response) -> Result<(), anyhow::Error> { + Err(anyhow!("Module does not accept responses".to_string())) + } + + fn on_timeout(&self, request: Timeout) -> Result<(), anyhow::Error> { + match request { + Timeout::Request(Request::Post(PostRequest { body, source, dest, nonce, .. })) => { + let body = Body::abi_decode(&mut &body[1..], true).map_err(|_| { + ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to decode request body".to_string(), + meta: Meta { source, dest, nonce }, + } + })?; + let beneficiary = body.from.0.into(); + let local_asset_id = LocalAssets::::get(H256::from(body.asset_id.0)) + .ok_or_else(|| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Unknown asset".to_string(), + meta: Meta { source, dest, nonce }, + })?; + let decimals = if local_asset_id == T::NativeAssetId::get() { + T::Decimals::get() + } else { + local_asset_id + .decimals() + .unwrap_or( + T::CurrencyIdConvert::get_currency_metadata(local_asset_id) + .map_or(12, |metatata| metatata.decimals.into()), + ) + .into() + }; + let erc_decimals = Decimals::::get(local_asset_id.clone()) + .ok_or_else(|| anyhow!("Asset decimals not configured"))?; + let amount = convert_to_balance( + U256::from_big_endian(&body.amount.to_be_bytes::<32>()), + erc_decimals, + decimals, + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Trying to withdraw Invalid amount".to_string(), + meta: Meta { source, dest, nonce }, + })?; + + if local_asset_id == T::NativeAssetId::get() { + ::NativeCurrency::transfer( + &Pallet::::pallet_account(), + &beneficiary, + amount.into(), + ExistenceRequirement::AllowDeath, + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to complete asset transfer".to_string(), + meta: Meta { source, dest, nonce }, + })?; + } else { + // Assets that do not originate from this chain are minted + let is_native = NativeAssets::::get(local_asset_id.clone()); + if is_native { + ::Assets::transfer( + local_asset_id, + &Pallet::::pallet_account(), + &beneficiary, + amount.into(), + Preservation::Expendable, + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to complete asset transfer".to_string(), + meta: Meta { source, dest, nonce }, + })?; + } else { + ::Assets::mint_into( + local_asset_id, + &beneficiary, + amount.into(), + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to complete asset transfer".to_string(), + meta: Meta { source, dest, nonce }, + })?; + } + } + + Pallet::::deposit_event(Event::::AssetRefunded { + beneficiary, + amount: amount.into(), + source: dest, + }); + }, + Timeout::Request(Request::Get(get)) => Err(ismp::error::Error::ModuleDispatchError { + msg: "Tried to timeout unsupported request type".to_string(), + meta: Meta { source: get.source, dest: get.dest, nonce: get.nonce }, + })?, + + Timeout::Response(response) => Err(ismp::error::Error::ModuleDispatchError { + msg: "Tried to timeout unsupported request type".to_string(), + meta: Meta { + source: response.source_chain(), + dest: response.dest_chain(), + nonce: response.nonce(), + }, + })?, + } + Ok(()) + } +} + +/// Static weights because benchmarks suck, and we'll be getting PolkaVM soon anyways +fn weight() -> Weight { + Weight::from_parts(300_000_000, 0) +} diff --git a/pallets/token-gateway/src/types.rs b/pallets/token-gateway/src/types.rs new file mode 100644 index 000000000..d143061c2 --- /dev/null +++ b/pallets/token-gateway/src/types.rs @@ -0,0 +1,85 @@ +// Copyright (C) Polytope Labs Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Pallet types + +use alloc::vec::Vec; +use anyhow::anyhow; +use frame_support::{pallet_prelude::*, traits::fungibles}; +use ismp::host::StateMachine; +use primitive_types::H256; + +use crate::Config; + +pub type AssetId = + <::Assets as fungibles::Inspect<::AccountId>>::AssetId; + +/// Asset teleportation parameters +#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq)] +pub struct TeleportParams { + /// Asset Id registered on Hyperbridge + pub asset_id: AssetId, + /// Destination state machine + pub destination: StateMachine, + /// Receiving account on destination + pub recepient: H256, + /// Amount to be sent + pub amount: Balance, + /// Request timeout + pub timeout: u64, + /// Token gateway address + pub token_gateway: Vec, + /// Relayer fee + pub relayer_fee: Balance, + /// Redeem native erc20 assets + pub redeem: bool, +} + +/// Local asset Id and its corresponding token gateway asset id +#[derive(Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, RuntimeDebug)] +pub struct AssetRegistration { + /// Local Asset Id should already exist + pub local_id: AssetId, + /// MNT Asset registration details + pub reg: token_gateway_primitives::GatewayAssetRegistration, +} + +alloy_sol_macro::sol! { + #![sol(all_derives)] + struct Body { + // Amount of the asset to be sent + uint256 amount; + // The asset identifier + bytes32 asset_id; + // Flag to redeem the erc20 asset on the destination + bool redeem; + // Sender address + bytes32 from; + // Recipient address + bytes32 to; + } +} + +/// A trait that helps in creating new asset ids in the runtime +pub trait CreateAssetId { + /// Should return a unique asset id + fn create_asset_id(symbol: Vec) -> Result; +} + +impl CreateAssetId for () { + fn create_asset_id(_symbol: Vec) -> Result { + Err(anyhow!("Unimplemented")) + } +} diff --git a/primitives/src/traits/assets.rs b/primitives/src/traits/assets.rs index 3bec28eab..aa11986ce 100644 --- a/primitives/src/traits/assets.rs +++ b/primitives/src/traits/assets.rs @@ -3,3 +3,17 @@ pub trait NextAssetId { /// Get the next available asset ID fn next_asset_id() -> Option; } + +/// A mapping between CurrencyId and AssetMetadata. +pub trait CurrencyIdMapping { + /// Returns the AssetMetadata associated with a given `AssetIds`. + fn get_asset_metadata(asset_ids: AssetIds) -> Option; + /// Returns the AssetMetadata associated with a given `CurrencyId`. + fn get_currency_metadata(currency_id: CurrencyId) -> Option; + /// Returns the Location associated with a given CurrencyId. + fn get_location(currency_id: &CurrencyId) -> Option; + /// Returns the CurrencyId associated with a given Location. + fn get_currency_id(location: &Location) -> Option; + /// Returns all currencies in currencyMetadata. + fn get_all_currency() -> Vec; +} diff --git a/runtime/testnet/Cargo.toml b/runtime/testnet/Cargo.toml index 38798cf5a..580b08d5b 100644 --- a/runtime/testnet/Cargo.toml +++ b/runtime/testnet/Cargo.toml @@ -124,7 +124,7 @@ pallet-evm-precompile-sha3fips = { workspace = true } pallet-evm-precompile-simple = { workspace = true } pallet-hotfix-sufficients = { workspace = true } -## Tangle precompiles +# Tangle precompiles pallet-evm-precompile-batch = { workspace = true } pallet-evm-precompile-call-permit = { workspace = true } pallet-evm-precompile-democracy = { workspace = true } @@ -142,11 +142,17 @@ pallet-evm-precompile-multi-asset-delegation = { workspace = true } pallet-evm-precompile-services = { workspace = true } pallet-evm-precompile-tangle-lst = { workspace = true } precompile-utils = { workspace = true } - evm-tracer = { workspace = true } rpc-primitives-debug = { workspace = true } rpc-primitives-txpool = { workspace = true } +# Hyperbridge +# pallet-ismp = { workspace = true, features = ["unsigned"] } +# pallet-ismp-runtime-api = { workspace = true } +# ismp = { workspace = true } +# pallet-hyperbridge = { workspace = true } +# pallet-token-gateway = { workspace = true } + # XCM xcm = { workspace = true } xcm-builder = { workspace = true } diff --git a/runtime/testnet/src/hyperbridge.rs b/runtime/testnet/src/hyperbridge.rs new file mode 100644 index 000000000..8bd282f5f --- /dev/null +++ b/runtime/testnet/src/hyperbridge.rs @@ -0,0 +1,115 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::governance::TechAdminOrCouncil; +use crate::{Balances, Ismp, IsmpParachain, NativeCurrencyId, Runtime, RuntimeEvent, Timestamp}; +use crate::{BncDecimals, Currencies}; +use crate::{TokenGateway, Treasury}; +use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{AccountId, Balance}; +use frame_support::parameter_types; +use ismp::{host::StateMachine, module::IsmpModule, router::IsmpRouter}; +use sp_core::Get; +use sp_std::boxed::Box; +use sp_std::vec::Vec; + +impl pallet_hyperbridge::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + // pallet-ismp implements the IsmpHost + type IsmpHost = Ismp; +} + +parameter_types! { + // The hyperbridge parachain on Polkadot + pub const Coprocessor: Option = Some(StateMachine::Polkadot(3367)); + // The host state machine of this pallet, your state machine id goes here + pub const HostStateMachine: StateMachine = StateMachine::Polkadot(2030); // polkadot +} + +impl pallet_ismp::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + // Modify the consensus client's permissions, for example, TechAdmin + type AdminOrigin = TechAdminOrCouncil; + // The state machine identifier of the chain -- parachain id + type HostStateMachine = HostStateMachine; + type TimestampProvider = Timestamp; + // The router provides the implementation for the IsmpModule as the module id. + type Router = Router; + type Balance = Balance; + // The token used to collect fees, only stablecoins are supported + type Currency = Balances; + // Co-processor + type Coprocessor = Coprocessor; + // A tuple of types implementing the ConsensusClient interface, which defines all consensus algorithms supported by this protocol deployment + type ConsensusClients = (ismp_parachain::ParachainConsensusClient,); + type WeightProvider = (); + type OffchainDB = (); +} + +impl ismp_parachain::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + // pallet-ismp implements the IsmpHost + type IsmpHost = Ismp; +} + +#[derive(Default)] +pub struct Router; + +impl IsmpRouter for Router { + fn module_for_id(&self, id: Vec) -> Result, anyhow::Error> { + match id.as_slice() { + pallet_hyperbridge::PALLET_HYPERBRIDGE_ID => { + Ok(Box::new(pallet_hyperbridge::Pallet::::default())) + }, + id if TokenGateway::is_token_gateway(&id) => { + Ok(Box::new(pallet_token_gateway::Pallet::::default())) + }, + _ => Err(ismp::Error::ModuleNotFound(id))?, + } + } +} + +/// Should provide an account that is funded and can be used to pay for asset creation +pub struct AssetAdmin; +impl Get for AssetAdmin { + fn get() -> AccountId { + Treasury::account_id() + } +} + +impl pallet_token_gateway::Config for Runtime { + // configure the runtime event + type RuntimeEvent = RuntimeEvent; + // Configured as Pallet Ismp + type Dispatcher = Ismp; + // Configured as Pallet Assets + type Assets = Currencies; + // Configured as Pallet balances + type NativeCurrency = Balances; + // AssetAdmin account + type AssetAdmin = AssetAdmin; + // The Native asset Id + type NativeAssetId = NativeCurrencyId; + // A type that provides a function for creating unique asset ids + // A concrete implementation for your specific runtime is required + type AssetIdFactory = (); + // The precision of the native asset + type Decimals = BncDecimals; + type ControlOrigin = TechAdminOrCouncil; + type CurrencyIdConvert = AssetIdMaps; +} From e7ba975b7d4a8becc21fb4b0971b4767b5fd33ce Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Fri, 24 Jan 2025 00:04:47 +0900 Subject: [PATCH 02/16] chore: cleanup and integrate into testnet runtime --- Cargo.lock | 1412 ++++++++++--------- Cargo.toml | 11 +- pallets/token-gateway/README.md | 88 ++ pallets/token-gateway/primitives/README.md | 7 + pallets/token-gateway/primitives/src/lib.rs | 24 +- pallets/token-gateway/src/benchmarking.rs | 163 +++ pallets/token-gateway/src/impls.rs | 6 +- pallets/token-gateway/src/lib.rs | 381 +++-- pallets/token-gateway/src/types.rs | 96 +- pallets/token-gateway/src/weights.rs | 33 + primitives/src/traits/assets.rs | 12 +- runtime/testnet/Cargo.toml | 35 +- runtime/testnet/src/hyperbridge.rs | 51 +- runtime/testnet/src/lib.rs | 64 + 14 files changed, 1514 insertions(+), 869 deletions(-) create mode 100644 pallets/token-gateway/README.md create mode 100644 pallets/token-gateway/primitives/README.md create mode 100644 pallets/token-gateway/src/benchmarking.rs create mode 100644 pallets/token-gateway/src/weights.rs diff --git a/Cargo.lock b/Cargo.lock index 4fff0de03..18e32fdef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -137,11 +137,11 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.1.53" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da226340862e036ab26336dc99ca85311c6b662267c1440e1733890fd688802c" +checksum = "4ab9d1367c6ffb90c93fb4a9a4989530aa85112438c6f73a734067255d348469" dependencies = [ - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "num_enum", "strum 0.26.3", ] @@ -153,7 +153,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4138dc275554afa6f18c4217262ac9388790b2fc393c2dfe03c51d357abf013" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-rlp", "alloy-serde", "alloy-trie", @@ -172,7 +172,7 @@ checksum = "0fa04e1882c31288ce1028fdf31b6ea94cfa9eafa2e497f903ded631c8c6a42c" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-rlp", "alloy-serde", "serde", @@ -188,40 +188,40 @@ dependencies = [ "alloy-json-abi", "alloy-network", "alloy-network-primitives", - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-provider", "alloy-pubsub", "alloy-rpc-types-eth", - "alloy-sol-types 0.8.18", + "alloy-sol-types 0.8.19", "alloy-transport", "futures 0.3.31", "futures-util", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] name = "alloy-core" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0713007d14d88a6edb8e248cddab783b698dbb954a28b8eee4bab21cfb7e578" +checksum = "648275bb59110f88cc5fa9a176845e52a554ebfebac2d21220bcda8c9220f797" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-rlp", - "alloy-sol-types 0.8.18", + "alloy-sol-types 0.8.19", ] [[package]] name = "alloy-dyn-abi" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44e3b98c37b3218924cd1d2a8570666b89662be54e5b182643855f783ea68b33" +checksum = "bc9138f4f0912793642d453523c3116bd5d9e11de73b70177aa7cb3e94b98ad2" dependencies = [ "alloy-json-abi", - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-sol-type-parser", - "alloy-sol-types 0.8.18", + "alloy-sol-types 0.8.19", "const-hex", "itoa", "serde", @@ -235,7 +235,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" dependencies = [ - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-rlp", "serde", ] @@ -246,7 +246,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cabf647eb4650c91a9d38cb6f972bb320009e7e9d61765fb688a86f1563b33e8" dependencies = [ - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-rlp", "derive_more 1.0.0", "k256", @@ -261,7 +261,7 @@ checksum = "52dd5869ed09e399003e0e0ec6903d981b2a92e74c5d37e6b40890bad2517526" dependencies = [ "alloy-eip2930", "alloy-eip7702", - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-rlp", "alloy-serde", "c-kzg", @@ -278,7 +278,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7d2a7fe5c1a9bd6793829ea21a636f30fc2b3f5d2e7418ba86d96e41dd1f460" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-serde", "alloy-trie", "serde", @@ -286,11 +286,11 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "731ea743b3d843bc657e120fb1d1e9cc94f5dab8107e35a82125a63e6420a102" +checksum = "24acd2f5ba97c7a320e67217274bc81fe3c3174b8e6144ec875d9d54e760e278" dependencies = [ - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-sol-type-parser", "serde", "serde_json", @@ -302,11 +302,11 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2008bedb8159a255b46b7c8614516eda06679ea82f620913679afbd8031fea72" dependencies = [ - "alloy-primitives 0.8.18", - "alloy-sol-types 0.8.18", + "alloy-primitives 0.8.19", + "alloy-sol-types 0.8.19", "serde", "serde_json", - "thiserror 2.0.8", + "thiserror 2.0.11", "tracing", ] @@ -321,18 +321,18 @@ dependencies = [ "alloy-eips", "alloy-json-rpc", "alloy-network-primitives", - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-rpc-types-any", "alloy-rpc-types-eth", "alloy-serde", "alloy-signer", - "alloy-sol-types 0.8.18", + "alloy-sol-types 0.8.19", "async-trait", "auto_impl", "futures-utils-wasm", "serde", "serde_json", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -343,7 +343,7 @@ checksum = "f31c3c6b71340a1d076831823f09cb6e02de01de5c6630a9631bdb36f947ff80" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-serde", "serde", ] @@ -372,9 +372,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "788bb18e8f61d5d9340b52143f27771daf7e1dccbaf2741621d2493f9debf52e" +checksum = "ec878088ec6283ce1e90d280316aadd3d6ce3de06ff63d68953c855e7e447e92" dependencies = [ "alloy-rlp", "bytes", @@ -383,7 +383,7 @@ dependencies = [ "derive_more 1.0.0", "foldhash", "hashbrown 0.15.2", - "indexmap 2.7.0", + "indexmap 2.7.1", "itoa", "k256", "keccak-asm", @@ -409,7 +409,7 @@ dependencies = [ "alloy-json-rpc", "alloy-network", "alloy-network-primitives", - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-pubsub", "alloy-rpc-client", "alloy-rpc-types-debug", @@ -432,7 +432,7 @@ dependencies = [ "schnellru", "serde", "serde_json", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "tracing", "url", @@ -446,7 +446,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2269fd635f7b505f27c63a3cb293148cd02301efce4c8bdd9ff54fbfc4a20e23" dependencies = [ "alloy-json-rpc", - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-transport", "bimap", "futures 0.3.31", @@ -460,9 +460,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f542548a609dca89fcd72b3b9f355928cf844d4363c5eed9c5273a3dd225e097" +checksum = "3d6c1d995bff8d011f7cd6c81820d51825e6e06d6db73914c1630ecf544d83d6" dependencies = [ "alloy-rlp-derive", "arrayvec 0.7.6", @@ -471,13 +471,13 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a833d97bf8a5f0f878daf2c8451fff7de7f9de38baa5a45d936ec718d81255a" +checksum = "a40e1ef334153322fd878d07e86af7a529bcb86b2439525920a88eba87bcf943" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -487,7 +487,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d06a292b37e182e514903ede6e623b9de96420e8109ce300da288a96d88b7e4b" dependencies = [ "alloy-json-rpc", - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-pubsub", "alloy-transport", "alloy-transport-http", @@ -512,7 +512,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9383845dd924939e7ab0298bbfe231505e20928907d7905aa3bf112287305e06" dependencies = [ - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-rpc-types-engine", "alloy-rpc-types-eth", "alloy-rpc-types-trace", @@ -537,7 +537,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "358d6a8d7340b9eb1a7589a6c1fb00df2c9b26e90737fa5ed0108724dd8dac2c" dependencies = [ - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "serde", ] @@ -549,7 +549,7 @@ checksum = "4a5f821f30344862a0b6eb9a1c2eb91dfb2ff44c7489f37152a526cdcab79264" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-rlp", "alloy-serde", "derive_more 1.0.0", @@ -567,14 +567,14 @@ dependencies = [ "alloy-consensus-any", "alloy-eips", "alloy-network-primitives", - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-rlp", "alloy-serde", - "alloy-sol-types 0.8.18", + "alloy-sol-types 0.8.19", "itertools 0.13.0", "serde", "serde_json", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -583,12 +583,12 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd38207e056cc7d1372367fbb4560ddf9107cbd20731743f641246bf0dede149" dependencies = [ - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-rpc-types-eth", "alloy-serde", "serde", "serde_json", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -597,7 +597,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae0465c71d4dced7525f408d84873aeebb71faf807d22d74c4a426430ccd9b55" dependencies = [ - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "serde", "serde_json", ] @@ -608,12 +608,12 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bfa395ad5cc952c82358d31e4c68b27bf4a89a5456d9b27e226e77dac50e4ff" dependencies = [ - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "async-trait", "auto_impl", "elliptic-curve", "k256", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -624,12 +624,12 @@ checksum = "fbdc63ce9eda1283fcbaca66ba4a414b841c0e3edbeef9c86a71242fc9e84ccc" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-signer", "async-trait", "k256", "rand", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -643,21 +643,21 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "alloy-sol-macro" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a07b74d48661ab2e4b50bb5950d74dbff5e61dd8ed03bb822281b706d54ebacb" +checksum = "8d039d267aa5cbb7732fa6ce1fd9b5e9e29368f580f80ba9d7a8450c794de4b2" dependencies = [ - "alloy-sol-macro-expander 0.8.18", - "alloy-sol-macro-input 0.8.18", + "alloy-sol-macro-expander 0.8.19", + "alloy-sol-macro-input 0.8.19", "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -669,31 +669,31 @@ dependencies = [ "alloy-sol-macro-input 0.7.7", "const-hex", "heck 0.5.0", - "indexmap 2.7.0", + "indexmap 2.7.1", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "syn-solidity 0.7.7", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-expander" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19cc9c7f20b90f9be1a8f71a3d8e283a43745137b0837b1a1cb13159d37cad72" +checksum = "620ae5eee30ee7216a38027dec34e0585c55099f827f92f50d11e3d2d3a4a954" dependencies = [ "alloy-json-abi", - "alloy-sol-macro-input 0.8.18", + "alloy-sol-macro-input 0.8.19", "const-hex", "heck 0.5.0", - "indexmap 2.7.0", + "indexmap 2.7.1", "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.90", - "syn-solidity 0.8.18", + "syn 2.0.96", + "syn-solidity 0.8.19", "tiny-keccak", ] @@ -708,15 +708,15 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "syn-solidity 0.7.7", ] [[package]] name = "alloy-sol-macro-input" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713b7e6dfe1cb2f55c80fb05fd22ed085a1b4e48217611365ed0ae598a74c6ac" +checksum = "ad9f7d057e00f8c5994e4ff4492b76532c51ead39353aa2ed63f8c50c0f4d52e" dependencies = [ "alloy-json-abi", "const-hex", @@ -725,15 +725,15 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.90", - "syn-solidity 0.8.18", + "syn 2.0.96", + "syn-solidity 0.8.19", ] [[package]] name = "alloy-sol-type-parser" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1eda2711ab2e1fb517fc6e2ffa9728c9a232e296d16810810e6957b781a1b8bc" +checksum = "74e60b084fe1aef8acecda2743ff2d93c18ff3eb67a2d3b12f62582a1e66ef5e" dependencies = [ "serde", "winnow", @@ -752,13 +752,13 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b478bc9c0c4737a04cd976accde4df7eba0bdc0d90ad6ff43d58bc93cf79c1" +checksum = "c1382302752cd751efd275f4d6ef65877ddf61e0e6f5ac84ef4302b79a33a31a" dependencies = [ "alloy-json-abi", - "alloy-primitives 0.8.18", - "alloy-sol-macro 0.8.18", + "alloy-primitives 0.8.19", + "alloy-sol-macro 0.8.19", "const-hex", "serde", ] @@ -775,7 +775,7 @@ dependencies = [ "futures-utils-wasm", "serde", "serde_json", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "tower 0.5.2", "tracing", @@ -827,7 +827,7 @@ dependencies = [ "alloy-transport", "futures 0.3.31", "http 1.2.0", - "rustls 0.23.20", + "rustls 0.23.21", "serde_json", "tokio", "tokio-tungstenite 0.24.0", @@ -841,7 +841,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6917c79e837aa7b77b7a6dae9f89cbe15313ac161c4d3cfaf8909ef21f3d22d8" dependencies = [ - "alloy-primitives 0.8.18", + "alloy-primitives 0.8.19", "alloy-rlp", "arrayvec 0.7.6", "derive_more 1.0.0", @@ -922,19 +922,20 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.6" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", + "once_cell", "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "approx" @@ -956,7 +957,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1313,7 +1314,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "synstructure 0.13.1", ] @@ -1336,7 +1337,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1405,7 +1406,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix 0.38.42", + "rustix 0.38.44", "slab", "tracing", "windows-sys 0.59.0", @@ -1417,7 +1418,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 5.3.1", + "event-listener 5.4.0", "event-listener-strategy", "pin-project-lite", ] @@ -1446,9 +1447,9 @@ dependencies = [ "async-task", "blocking", "cfg-if", - "event-listener 5.3.1", + "event-listener 5.4.0", "futures-lite", - "rustix 0.38.42", + "rustix 0.38.44", "tracing", ] @@ -1464,7 +1465,7 @@ dependencies = [ "cfg-if", "futures-core", "futures-io", - "rustix 0.38.42", + "rustix 0.38.44", "signal-hook-registry", "slab", "windows-sys 0.59.0", @@ -1489,7 +1490,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1500,13 +1501,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1567,13 +1568,13 @@ dependencies = [ [[package]] name = "auto_impl" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +checksum = "e12882f59de5360c748c4cbf569a042d5fb0eb515f7bea9c1f470b47f6ffbd73" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1598,7 +1599,7 @@ dependencies = [ "cfg-if", "libc", "miniz_oxide", - "object 0.36.5", + "object 0.36.7", "rustc-demangle", "windows-targets 0.52.6", ] @@ -1687,13 +1688,13 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.25", + "prettyplease 0.2.29", "proc-macro2", "quote", "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1762,9 +1763,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bitvec" @@ -1774,6 +1775,7 @@ checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", "radium", + "serde", "tap", "wyz", ] @@ -1917,9 +1919,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.11.1" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8" +checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" dependencies = [ "memchr", "regex-automata 0.4.9", @@ -1955,9 +1957,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.20.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" [[package]] name = "byteorder" @@ -2046,7 +2048,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.24", + "semver 1.0.25", "serde", "serde_json", "thiserror 1.0.69", @@ -2060,7 +2062,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.24", + "semver 1.0.25", "serde", "serde_json", "thiserror 1.0.69", @@ -2080,9 +2082,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.4" +version = "1.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" +checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" dependencies = [ "jobserver", "libc", @@ -2246,6 +2248,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ckb-merkle-mountain-range" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ccb671c5921be8a84686e6212ca184cb1d7c51cadcdbfcbd1cc3f042f5dfb8" +dependencies = [ + "cfg-if", +] + [[package]] name = "clang-sys" version = "1.8.1" @@ -2259,9 +2270,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.23" +version = "4.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" +checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" dependencies = [ "clap_builder", "clap_derive", @@ -2269,9 +2280,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.23" +version = "4.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" +checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" dependencies = [ "anstream", "anstyle", @@ -2282,14 +2293,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -2751,9 +2762,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] name = "crypto-bigint" @@ -2822,6 +2833,22 @@ dependencies = [ "cipher 0.4.4", ] +[[package]] +name = "cumulus-primitives-core" +version = "0.15.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" +dependencies = [ + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-primitives", + "scale-info", + "sp-api", + "sp-runtime", + "sp-trie", + "staging-xcm", +] + [[package]] name = "curve25519-dalek" version = "4.1.3" @@ -2847,14 +2874,14 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "cxx" -version = "1.0.135" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d44ff199ff93242c3afe480ab588d544dd08d72e92885e152ffebc670f076ad" +checksum = "0fc894913dccfed0f84106062c284fa021c3ba70cb1d78797d6f5165d4492e45" dependencies = [ "cc", "cxxbridge-cmd", @@ -2866,47 +2893,47 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.135" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66fd8f17ad454fc1e4f4ab83abffcc88a532e90350d3ffddcb73030220fcbd52" +checksum = "503b2bfb6b3e8ce7f95d865a67419451832083d3186958290cee6c53e39dfcfe" dependencies = [ "cc", "codespan-reporting", "proc-macro2", "quote", "scratch", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "cxxbridge-cmd" -version = "1.0.135" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4717c9c806a9e07fdcb34c84965a414ea40fafe57667187052cf1eb7f5e8a8a9" +checksum = "e0d2cb64a95b4b5a381971482235c4db2e0208302a962acdbe314db03cbbe2fb" dependencies = [ "clap", "codespan-reporting", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "cxxbridge-flags" -version = "1.0.135" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f6515329bf3d98f4073101c7866ff2bec4e635a13acb82e3f3753fff0bf43cb" +checksum = "5f797b0206463c9c2a68ed605ab28892cca784f1ef066050f4942e3de26ad885" [[package]] name = "cxxbridge-macro" -version = "1.0.135" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb93e6a7ce8ec985c02bbb758237a31598b340acbbc3c19c5a4fa6adaaac92ab" +checksum = "e79010a2093848e65a3e0f7062d3f02fb2ef27f866416dfe436fccfa73d3bb59" dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -2930,7 +2957,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -2941,7 +2968,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -2973,15 +3000,15 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "0e60eed09d8c01d3cee5b7d30acb059b76614c918fa0f992e0dd6eeb10daad6f" [[package]] name = "data-encoding-macro" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" +checksum = "5b16d9d0d88a5273d830dac8b78ceb217ffc9b1d5404e5597a3542515329405b" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -2989,12 +3016,12 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" +checksum = "1145d32e826a7748b69ee8fc62d3e6355ff7f1051df53141e7048162fc90481b" dependencies = [ "data-encoding", - "syn 1.0.109", + "syn 2.0.96", ] [[package]] @@ -3070,7 +3097,7 @@ checksum = "74ef43543e701c01ad77d3a5922755c6a1d71b22d942cb8042be4994b380caff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3081,7 +3108,7 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3092,7 +3119,7 @@ checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3105,7 +3132,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.1", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3126,7 +3153,7 @@ dependencies = [ "convert_case 0.6.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "unicode-xid", ] @@ -3235,7 +3262,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3259,7 +3286,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.90", + "syn 2.0.96", "termcolor", "toml 0.8.19", "walkdir", @@ -3399,7 +3426,7 @@ source = "git+https://github.com/webb-tools/Ed448-Goldilocks#5af06c81541ed19e245 dependencies = [ "elliptic-curve", "rand_core", - "serdect 0.3.0-rc.0", + "serdect 0.3.0", "sha3", "subtle 2.6.1", "zeroize", @@ -3426,7 +3453,7 @@ dependencies = [ "enum-ordinalize 4.3.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3537,7 +3564,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3550,7 +3577,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3570,27 +3597,27 @@ checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "enumflags2" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" +checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" dependencies = [ "enumflags2_derive", ] [[package]] name = "enumflags2_derive" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" +checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3775,14 +3802,14 @@ dependencies = [ "ethers-core", "ethers-etherscan", "eyre", - "prettyplease 0.2.25", + "prettyplease 0.2.29", "proc-macro2", "quote", "regex", "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.90", + "syn 2.0.96", "toml 0.8.19", "walkdir", ] @@ -3800,7 +3827,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3826,7 +3853,7 @@ dependencies = [ "serde", "serde_json", "strum 0.26.3", - "syn 2.0.90", + "syn 2.0.96", "tempfile", "thiserror 1.0.69", "tiny-keccak", @@ -3842,7 +3869,7 @@ dependencies = [ "chrono", "ethers-core", "reqwest 0.11.27", - "semver 1.0.24", + "semver 1.0.25", "serde", "serde_json", "thiserror 1.0.69", @@ -3951,7 +3978,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.24", + "semver 1.0.25", "serde", "serde_json", "solang-parser", @@ -3972,9 +3999,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "5.3.1" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" dependencies = [ "concurrent-queue", "parking", @@ -3987,7 +4014,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" dependencies = [ - "event-listener 5.3.1", + "event-listener 5.4.0", "pin-project-lite", ] @@ -4106,10 +4133,10 @@ dependencies = [ "blake2 0.10.6", "file-guard", "fs-err", - "prettyplease 0.2.25", + "prettyplease 0.2.29", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4540,7 +4567,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "parity-scale-codec", ] @@ -4688,7 +4715,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-support", "frame-support-procedural", @@ -4712,7 +4739,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "42.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "Inflector", "array-bytes", @@ -4776,18 +4803,18 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "14.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "frame-election-provider-support" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -4803,7 +4830,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "aquamarine", "frame-support", @@ -4845,7 +4872,7 @@ dependencies = [ [[package]] name = "frame-metadata-hash-extension" version = "0.5.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "array-bytes", "docify", @@ -4859,8 +4886,8 @@ dependencies = [ [[package]] name = "frame-support" -version = "37.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +version = "37.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "aquamarine", "array-bytes", @@ -4901,7 +4928,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "30.0.4" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "Inflector", "cfg-expr", @@ -4914,35 +4941,35 @@ dependencies = [ "proc-macro2", "quote", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "frame-support-procedural-tools" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "frame-support-procedural-tools-derive" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "frame-system" version = "37.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "cfg-if", "docify", @@ -4962,7 +4989,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -4976,7 +5003,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "docify", "parity-scale-codec", @@ -4986,7 +5013,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-support", "parity-scale-codec", @@ -4996,9 +5023,9 @@ dependencies = [ [[package]] name = "frost-core" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5afd375261c34d31ff24dad068382f4bc3c95010c919d4fb8d483dc3d85c023" +checksum = "1858230cabb6792a5020daf4b0074f57b7d1e2a520ac544c77f102babee62ff4" dependencies = [ "byteorder", "const-crc32-nostd", @@ -5006,9 +5033,9 @@ dependencies = [ "derive-getters", "document-features", "hex", - "itertools 0.13.0", + "itertools 0.14.0", "rand_core", - "thiserror 1.0.69", + "thiserror 2.0.11", "thiserror-nostd-notrait", "visibility", "zeroize", @@ -5016,9 +5043,9 @@ dependencies = [ [[package]] name = "frost-ed25519" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4186731878c57b4e4d5d1103c8e0d2a827d3cb63cf577826ce29d52c34be7d39" +checksum = "c350ac3d0463a009a061aba12b67920acee94338951c849bb4c492d55223dece" dependencies = [ "curve25519-dalek", "document-features", @@ -5043,9 +5070,9 @@ dependencies = [ [[package]] name = "frost-p256" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235c7f29e912d63953881fc9ee942922c0f63e97ce011e3af8772ced55db4fa6" +checksum = "aef561eda6f686941c6082c3ccef8b0c2f44eb84cd951b6a660f98c4d9348ad4" dependencies = [ "document-features", "frost-core", @@ -5070,9 +5097,9 @@ dependencies = [ [[package]] name = "frost-rerandomized" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9d77595060546b53543d96b83dbeacaf3907e40a89763a8bb22124812b0cb6" +checksum = "e8a3b10d9c1e9f298522510940b5b8c3d55040420517ec8d2bb86c4c2d1ae3ee" dependencies = [ "derive-getters", "document-features", @@ -5083,9 +5110,9 @@ dependencies = [ [[package]] name = "frost-ristretto255" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3f0e065fb99f6abb96b58bd63fd7a6255efe37ee9672d97a7404ac644e54a7" +checksum = "0dd77a6e22b83079654472bbabc7a0b1197116b80bf01d15b76f132dc9fe9f3a" dependencies = [ "curve25519-dalek", "document-features", @@ -5097,9 +5124,9 @@ dependencies = [ [[package]] name = "frost-secp256k1" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52edea5a88d11135b2bf069f03e756d405d39c5a1c9c9f4d6147505948d7fff7" +checksum = "2d4890a0cdd6897a4af81016ec3299e4eb3a459d6468933d2a385302241662b5" dependencies = [ "document-features", "frost-core", @@ -5226,9 +5253,9 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" dependencies = [ "fastrand", "futures-core", @@ -5255,7 +5282,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -5346,9 +5373,9 @@ dependencies = [ [[package]] name = "generic-ec" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ac0dbefcc2e3240d740f62913ba9b1176b4e50bb14218093baa140b01406f44" +checksum = "8de1099ac0b4d87261d67ff5d4ed400af617a1da40b58908d759b9cf5fd8ed27" dependencies = [ "generic-ec-core", "generic-ec-curves", @@ -5364,9 +5391,9 @@ dependencies = [ [[package]] name = "generic-ec-core" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c0350c4b769e9d6cb9af9300c30ad28bcb665bc351a2197eafcb07b0dd4318b" +checksum = "dcba5fdf70cc3ce5805c487f8523b4ceeb32e8ec5237c71ffd93c1ca47a97fee" dependencies = [ "generic-array 0.14.7", "rand_core", @@ -5377,9 +5404,9 @@ dependencies = [ [[package]] name = "generic-ec-curves" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13b9342a074a45ff3ec1ffe919b41f8ed7b84a29b2b2f1dd8d8dbdfc4c1055c6" +checksum = "4c7c6d23001a5eb60eec2b785a63d2ca965fdfbaf3314b3b46df047398369e28" dependencies = [ "elliptic-curve", "generic-ec-core", @@ -5464,9 +5491,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "gloo-net" @@ -5534,6 +5561,48 @@ dependencies = [ "spinning_top", ] +[[package]] +name = "grandpa-verifier" +version = "0.1.1" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +dependencies = [ + "anyhow", + "derive_more 0.99.18", + "finality-grandpa", + "frame-support", + "grandpa-verifier-primitives", + "parity-scale-codec", + "serde", + "sp-consensus-grandpa", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-storage", + "sp-trie", + "substrate-state-machine", +] + +[[package]] +name = "grandpa-verifier-primitives" +version = "0.1.1" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +dependencies = [ + "anyhow", + "finality-grandpa", + "frame-support", + "ismp", + "log", + "parity-scale-codec", + "sp-consensus-grandpa", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-storage", + "sp-trie", +] + [[package]] name = "group" version = "0.13.0" @@ -5557,7 +5626,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.7.0", + "indexmap 2.7.1", "slab", "tokio", "tokio-util", @@ -5576,7 +5645,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.2.0", - "indexmap 2.7.0", + "indexmap 2.7.1", "slab", "tokio", "tokio-util", @@ -6120,7 +6189,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -6276,7 +6345,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -6317,9 +6386,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -6405,19 +6474,19 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "is-terminal" -version = "0.4.13" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" dependencies = [ "hermit-abi 0.4.0", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6440,7 +6509,32 @@ dependencies = [ "scale-info", "serde", "serde-hex-utils", - "thiserror 2.0.8", + "thiserror 2.0.11", +] + +[[package]] +name = "ismp-grandpa" +version = "1.15.3" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +dependencies = [ + "ckb-merkle-mountain-range", + "cumulus-primitives-core", + "finality-grandpa", + "frame-support", + "frame-system", + "grandpa-verifier", + "grandpa-verifier-primitives", + "ismp", + "pallet-ismp", + "parity-scale-codec", + "primitive-types 0.12.2", + "scale-info", + "sp-consensus-aura", + "sp-core", + "sp-io", + "sp-runtime", + "sp-trie", + "substrate-state-machine", ] [[package]] @@ -6479,6 +6573,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.14" @@ -6516,9 +6619,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -6564,7 +6667,7 @@ dependencies = [ "http 1.2.0", "jsonrpsee-core 0.24.7", "pin-project", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-pki-types", "rustls-platform-verifier", "soketto", @@ -6632,7 +6735,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -6878,9 +6981,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.168" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libloading" @@ -7229,7 +7332,7 @@ dependencies = [ "proc-macro-warning 0.4.2", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7338,7 +7441,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "libc", "redox_syscall 0.5.8", ] @@ -7419,9 +7522,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.20" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" +checksum = "df9b68e50e6e0b26f672573834882eb57759f6db9b3be2ea3c35c91188bb4eaa" dependencies = [ "cc", "pkg-config", @@ -7445,9 +7548,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linked_hash_set" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" +checksum = "bae85b5be22d9843c80e5fc80e9b64c8a3b1f98f867c709956eca3efff4e92e2" dependencies = [ "linked-hash-map", ] @@ -7469,9 +7572,9 @@ checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "lioness" @@ -7505,7 +7608,7 @@ dependencies = [ "futures 0.3.31", "futures-timer", "hex-literal 0.4.1", - "indexmap 2.7.0", + "indexmap 2.7.1", "libc", "mockall 0.12.1", "multiaddr 0.17.1", @@ -7564,9 +7667,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" [[package]] name = "lru" @@ -7588,9 +7691,9 @@ dependencies = [ [[package]] name = "lz4" -version = "1.28.0" +version = "1.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d1febb2b4a79ddd1980eede06a8f7902197960aa0383ffcfdd62fe723036725" +checksum = "a20b523e860d03443e98350ceaac5e71c6ba89aea7d960769ec3ce37f4de5af4" dependencies = [ "lz4-sys", ] @@ -7623,7 +7726,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7637,7 +7740,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7648,7 +7751,7 @@ checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7659,7 +7762,7 @@ checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7715,7 +7818,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.42", + "rustix 0.38.44", ] [[package]] @@ -7794,9 +7897,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ "adler2", ] @@ -7863,7 +7966,7 @@ dependencies = [ "fragile", "lazy_static", "mockall_derive 0.12.1", - "predicates 3.1.2", + "predicates 3.1.3", "predicates-tree", ] @@ -7888,7 +7991,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -8110,17 +8213,16 @@ dependencies = [ [[package]] name = "netlink-proto" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b33524dc0968bfad349684447bfce6db937a9ac3332a1fe60c0c5a5ce63f21" +checksum = "b2741a6c259755922e3ed29ebce3b299cc2160c4acae94b465b5938ab02c2bbe" dependencies = [ "bytes", "futures 0.3.31", "log", "netlink-packet-core", "netlink-sys", - "thiserror 1.0.69", - "tokio", + "thiserror 2.0.11", ] [[package]] @@ -8279,7 +8381,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -8358,10 +8460,10 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -8400,9 +8502,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -8480,7 +8582,7 @@ version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "cfg-if", "foreign-types", "libc", @@ -8497,7 +8599,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -8590,7 +8692,7 @@ dependencies = [ [[package]] name = "pallet-assets" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -8606,7 +8708,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-support", "frame-system", @@ -8619,7 +8721,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -8642,7 +8744,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "aquamarine", "docify", @@ -8663,7 +8765,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "docify", "frame-benchmarking", @@ -8691,8 +8793,8 @@ dependencies = [ [[package]] name = "pallet-bounties" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +version = "36.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -8709,7 +8811,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -8727,7 +8829,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -8743,7 +8845,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -8775,7 +8877,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8797,7 +8899,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8810,7 +8912,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -9537,7 +9639,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -9590,7 +9692,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "enumflags2", "frame-benchmarking", @@ -9606,7 +9708,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -9625,7 +9727,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -9641,7 +9743,7 @@ dependencies = [ [[package]] name = "pallet-insecure-randomness-collective-flip" version = "25.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-support", "frame-system", @@ -9674,6 +9776,20 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-ismp-runtime-api" +version = "1.15.3" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +dependencies = [ + "ismp", + "pallet-ismp", + "parity-scale-codec", + "primitive-types 0.12.2", + "serde", + "sp-api", + "sp-mmr-primitives", +] + [[package]] name = "pallet-multi-asset-delegation" version = "1.2.5" @@ -9750,7 +9866,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -9765,7 +9881,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-support", "frame-system", @@ -9783,7 +9899,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-support", "frame-system", @@ -9817,7 +9933,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -9833,7 +9949,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -9929,7 +10045,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "docify", "frame-benchmarking", @@ -10027,7 +10143,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-support", "frame-system", @@ -10048,7 +10164,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -10070,18 +10186,18 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "pallet-sudo" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "docify", "frame-benchmarking", @@ -10143,7 +10259,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "36.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "docify", "frame-benchmarking", @@ -10186,7 +10302,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "37.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-support", "frame-system", @@ -10201,7 +10317,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "jsonrpsee 0.23.2", "pallet-transaction-payment-rpc-runtime-api", @@ -10217,7 +10333,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -10229,7 +10345,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "36.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "docify", "frame-benchmarking", @@ -10247,7 +10363,7 @@ dependencies = [ [[package]] name = "pallet-tx-pause" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "docify", "frame-benchmarking", @@ -10264,7 +10380,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "37.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -10279,7 +10395,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-benchmarking", "frame-support", @@ -10511,7 +10627,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror 2.0.8", + "thiserror 2.0.11", "ucd-trie", ] @@ -10535,7 +10651,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -10556,7 +10672,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.7.0", + "indexmap 2.7.1", ] [[package]] @@ -10580,35 +10696,35 @@ dependencies = [ [[package]] name = "phf" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", - "phf_shared 0.11.2", + "phf_shared 0.11.3", ] [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ - "phf_shared 0.11.2", + "phf_shared 0.11.3", "rand", ] [[package]] name = "phf_macros" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", - "phf_shared 0.11.2", + "phf_shared 0.11.3", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -10622,38 +10738,38 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ - "siphasher 0.3.11", + "siphasher 1.0.1", ] [[package]] name = "pin-project" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -10729,7 +10845,7 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "parity-scale-codec", "scale-info", @@ -10740,7 +10856,7 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "bounded-collections", "derive_more 0.99.18", @@ -10753,6 +10869,32 @@ dependencies = [ "sp-weights", ] +[[package]] +name = "polkadot-primitives" +version = "15.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" +dependencies = [ + "bitvec", + "hex-literal 0.4.1", + "log", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-authority-discovery", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-staking", +] + [[package]] name = "polkadot-sdk" version = "0.7.0" @@ -10811,7 +10953,7 @@ dependencies = [ "polkavm-common", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -10821,7 +10963,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ "polkavm-derive-impl", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -10855,7 +10997,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.42", + "rustix 0.38.44", "tracing", "windows-sys 0.59.0", ] @@ -10952,7 +11094,7 @@ source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219 dependencies = [ "case", "num_enum", - "prettyplease 0.2.25", + "prettyplease 0.2.29", "proc-macro2", "quote", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", @@ -10981,9 +11123,9 @@ dependencies = [ [[package]] name = "predicates" -version = "3.1.2" +version = "3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9086cc7640c29a356d1a29fd134380bee9d8f79a17410aa76e7ad295f42c97" +checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" dependencies = [ "anstyle", "predicates-core", @@ -10991,15 +11133,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8177bee8e75d6846599c6b9ff679ed51e882816914eec639944d7c9aa11931" +checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa" [[package]] name = "predicates-tree" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b740d195ed3166cd147c8047ec98db0e22ec019eb8eeb76d343b795304fb13" +checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c" dependencies = [ "predicates-core", "termtree", @@ -11017,12 +11159,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" dependencies = [ "proc-macro2", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -11141,7 +11283,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -11152,7 +11294,7 @@ checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -11163,14 +11305,14 @@ checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -11209,7 +11351,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -11220,7 +11362,7 @@ checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.6.0", + "bitflags 2.8.0", "lazy_static", "num-traits", "rand", @@ -11281,17 +11423,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", - "heck 0.5.0", + "heck 0.4.1", "itertools 0.12.1", "log", "multimap 0.10.0", "once_cell", "petgraph", - "prettyplease 0.2.25", + "prettyplease 0.2.29", "prost 0.12.6", "prost-types 0.12.6", "regex", - "syn 2.0.90", + "syn 2.0.96", "tempfile", ] @@ -11318,7 +11460,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -11350,9 +11492,9 @@ dependencies = [ [[package]] name = "quanta" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773ce68d0bb9bc7ef20be3536ffe94e223e1f365bd374108b2659fac0c65cfe6" +checksum = "3bd1fe6824cea6538803de3ff1bc0cf3949024db3d43c9643024bfb33a807c0e" dependencies = [ "crossbeam-utils", "libc", @@ -11490,9 +11632,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -11564,11 +11706,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.2.0" +version = "11.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" +checksum = "c6928fa44c097620b706542d428957635951bade7143269085389d42c8a4927e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", ] [[package]] @@ -11630,7 +11772,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", ] [[package]] @@ -11661,7 +11803,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -12172,7 +12314,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.24", + "semver 1.0.25", ] [[package]] @@ -12200,14 +12342,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.42" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "errno", "libc", - "linux-raw-sys 0.4.14", + "linux-raw-sys 0.4.15", "windows-sys 0.59.0", ] @@ -12236,9 +12378,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.20" +version = "0.23.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" +checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" dependencies = [ "log", "once_cell", @@ -12309,7 +12451,7 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-native-certs 0.7.3", "rustls-platform-verifier-android", "rustls-webpki 0.102.8", @@ -12348,9 +12490,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "rusty-fork" @@ -12402,9 +12544,9 @@ dependencies = [ [[package]] name = "safe_arch" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3460605018fdc9612bce72735cba0d27efbcd9904780d44c7e3a9948f96148a" +checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" dependencies = [ "bytemuck", ] @@ -12430,7 +12572,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "log", "sp-core", @@ -12441,7 +12583,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "futures 0.3.31", "futures-timer", @@ -12463,7 +12605,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.42.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "parity-scale-codec", "sp-api", @@ -12478,7 +12620,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "array-bytes", "docify", @@ -12505,18 +12647,18 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "sc-cli" version = "0.46.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "array-bytes", "chrono", @@ -12557,7 +12699,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "fnv", "futures 0.3.31", @@ -12584,7 +12726,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "hash-db", "kvdb", @@ -12610,7 +12752,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "async-trait", "futures 0.3.31", @@ -12634,7 +12776,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "async-trait", "futures 0.3.31", @@ -12663,7 +12805,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "async-trait", "fork-tree", @@ -12699,7 +12841,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "futures 0.3.31", "jsonrpsee 0.23.2", @@ -12721,7 +12863,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "fork-tree", "parity-scale-codec", @@ -12734,7 +12876,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.29.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "ahash", "array-bytes", @@ -12778,7 +12920,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" version = "0.29.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "finality-grandpa", "futures 0.3.31", @@ -12798,7 +12940,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.45.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "assert_matches", "async-trait", @@ -12833,7 +12975,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "async-trait", "futures 0.3.31", @@ -12856,7 +12998,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.40.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -12879,7 +13021,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.35.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "polkavm", "sc-allocator", @@ -12892,7 +13034,7 @@ dependencies = [ [[package]] name = "sc-executor-polkavm" version = "0.32.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "log", "polkavm", @@ -12903,7 +13045,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.35.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "anyhow", "cfg-if", @@ -12921,7 +13063,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "ansi_term", "futures 0.3.31", @@ -12938,7 +13080,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "33.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "array-bytes", "parking_lot 0.12.3", @@ -12952,7 +13094,7 @@ dependencies = [ [[package]] name = "sc-mixnet" version = "0.14.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "array-bytes", "arrayvec 0.7.6", @@ -12981,7 +13123,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.44.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -13032,7 +13174,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -13050,7 +13192,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "ahash", "futures 0.3.31", @@ -13069,7 +13211,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -13090,7 +13232,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -13127,7 +13269,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "array-bytes", "futures 0.3.31", @@ -13146,7 +13288,7 @@ dependencies = [ [[package]] name = "sc-network-types" version = "0.12.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "bs58 0.5.1", "ed25519-dalek", @@ -13163,7 +13305,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "array-bytes", "bytes", @@ -13197,7 +13339,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -13206,7 +13348,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "futures 0.3.31", "jsonrpsee 0.23.2", @@ -13238,7 +13380,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "jsonrpsee 0.23.2", "parity-scale-codec", @@ -13258,7 +13400,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "16.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "forwarded-header-value", "futures 0.3.31", @@ -13280,7 +13422,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "array-bytes", "futures 0.3.31", @@ -13312,7 +13454,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.45.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "async-trait", "directories", @@ -13376,7 +13518,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.36.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "log", "parity-scale-codec", @@ -13387,7 +13529,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "derive_more 0.99.18", "futures 0.3.31", @@ -13408,7 +13550,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "chrono", "futures 0.3.31", @@ -13428,7 +13570,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "ansi_term", "chrono", @@ -13458,18 +13600,18 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "sc-transaction-pool" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "async-trait", "futures 0.3.31", @@ -13496,7 +13638,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "async-trait", "futures 0.3.31", @@ -13512,7 +13654,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "async-channel 1.9.0", "futures 0.3.31", @@ -13573,7 +13715,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -13601,7 +13743,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -13627,7 +13769,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -13649,7 +13791,7 @@ dependencies = [ "proc-macro2", "quote", "scale-info", - "syn 2.0.90", + "syn 2.0.96", "thiserror 1.0.69", ] @@ -13684,9 +13826,9 @@ dependencies = [ [[package]] name = "schnellru" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" +checksum = "356285bbf17bea63d9e52e96bd18f039672ac92b55b8cb997d6162a2a37d1649" dependencies = [ "ahash", "cfg-if", @@ -13850,7 +13992,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "core-foundation", "core-foundation-sys", "libc", @@ -13860,9 +14002,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.13.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -13897,9 +14039,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" dependencies = [ "serde", ] @@ -13933,9 +14075,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] @@ -13961,20 +14103,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" dependencies = [ "itoa", "memchr", @@ -14022,7 +14164,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -14037,9 +14179,9 @@ dependencies = [ [[package]] name = "serdect" -version = "0.3.0-rc.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a504c8ee181e3e594d84052f983d60afe023f4d94d050900be18062bbbf7b58" +checksum = "f42f67da2385b51a5f9652db9c93d78aeaf7610bf5ec366080b6de810604af53" dependencies = [ "base16ct", "serde", @@ -14170,9 +14312,9 @@ dependencies = [ [[package]] name = "similar" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" dependencies = [ "bstr", "unicode-segmentation", @@ -14180,9 +14322,9 @@ dependencies = [ [[package]] name = "similar-asserts" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe85670573cd6f0fa97940f26e7e6601213c3b0555246c24234131f88c5709e" +checksum = "9f08357795f0d604ea7d7130f22c74b03838c959bdb14adde3142aab4d18a293" dependencies = [ "console", "similar", @@ -14194,7 +14336,7 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cae9a3fcdadafb6d97f4c0e007e4247b114ee0f119f650c3cbf3a8b3a1479694" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", ] [[package]] @@ -14205,13 +14347,13 @@ checksum = "620a1d43d70e142b1d46a929af51d44f383db9c7a2ec122de2cd992ccfcf3c18" [[package]] name = "simple_asn1" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" dependencies = [ "num-bigint 0.4.6", "num-traits", - "thiserror 1.0.69", + "thiserror 2.0.11", "time", ] @@ -14297,7 +14439,7 @@ dependencies = [ "derive_more 0.99.18", "ed25519-zebra", "either", - "event-listener 5.3.1", + "event-listener 5.4.0", "fnv", "futures-lite", "futures-util", @@ -14346,7 +14488,7 @@ dependencies = [ "bs58 0.5.1", "derive_more 0.99.18", "either", - "event-listener 5.3.1", + "event-listener 5.4.0", "fnv", "futures-channel", "futures-lite", @@ -14469,7 +14611,7 @@ dependencies = [ [[package]] name = "sp-api" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "docify", "hash-db", @@ -14491,7 +14633,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "Inflector", "blake2 0.10.6", @@ -14499,13 +14641,13 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "sp-application-crypto" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "parity-scale-codec", "scale-info", @@ -14517,7 +14659,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "docify", "integer-sqrt", @@ -14528,10 +14670,22 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "sp-authority-discovery" +version = "34.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-runtime", +] + [[package]] name = "sp-block-builder" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "sp-api", "sp-inherents", @@ -14541,7 +14695,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "37.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "futures 0.3.31", "parity-scale-codec", @@ -14560,7 +14714,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.40.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "async-trait", "futures 0.3.31", @@ -14575,7 +14729,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.40.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "async-trait", "parity-scale-codec", @@ -14591,7 +14745,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.40.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "async-trait", "parity-scale-codec", @@ -14609,7 +14763,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "finality-grandpa", "log", @@ -14626,7 +14780,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.40.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "parity-scale-codec", "scale-info", @@ -14637,7 +14791,7 @@ dependencies = [ [[package]] name = "sp-core" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "array-bytes", "bitflags 1.3.2", @@ -14697,7 +14851,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "blake2b_simd", "byteorder", @@ -14710,17 +14864,17 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "quote", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "sp-database" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "kvdb", "parking_lot 0.12.3", @@ -14729,17 +14883,17 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "sp-externalities" version = "0.29.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "environmental", "parity-scale-codec", @@ -14749,7 +14903,7 @@ dependencies = [ [[package]] name = "sp-genesis-builder" version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "parity-scale-codec", "scale-info", @@ -14761,7 +14915,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -14774,7 +14928,7 @@ dependencies = [ [[package]] name = "sp-io" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "bytes", "docify", @@ -14800,7 +14954,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "sp-core", "sp-runtime", @@ -14810,7 +14964,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.40.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -14821,7 +14975,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "thiserror 1.0.69", "zstd 0.12.4", @@ -14830,7 +14984,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "frame-metadata 16.0.0", "parity-scale-codec", @@ -14840,7 +14994,7 @@ dependencies = [ [[package]] name = "sp-mixnet" version = "0.12.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "parity-scale-codec", "scale-info", @@ -14868,7 +15022,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "parity-scale-codec", "scale-info", @@ -14881,7 +15035,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "sp-api", "sp-core", @@ -14891,7 +15045,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "backtrace", "lazy_static", @@ -14901,7 +15055,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "32.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "rustc-hash 1.1.0", "serde", @@ -14911,7 +15065,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "39.0.3" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "docify", "either", @@ -14937,7 +15091,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -14956,20 +15110,20 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "Inflector", "expander", "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "sp-session" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "parity-scale-codec", "scale-info", @@ -14983,7 +15137,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -14996,7 +15150,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "hash-db", "log", @@ -15016,7 +15170,7 @@ dependencies = [ [[package]] name = "sp-statement-store" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "aes-gcm", "curve25519-dalek", @@ -15040,12 +15194,12 @@ dependencies = [ [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" [[package]] name = "sp-storage" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "impl-serde 0.4.0", "parity-scale-codec", @@ -15057,7 +15211,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "async-trait", "parity-scale-codec", @@ -15069,7 +15223,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "parity-scale-codec", "tracing", @@ -15080,7 +15234,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "sp-api", "sp-runtime", @@ -15089,7 +15243,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "async-trait", "parity-scale-codec", @@ -15103,7 +15257,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "ahash", "hash-db", @@ -15126,7 +15280,7 @@ dependencies = [ [[package]] name = "sp-version" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "impl-serde 0.4.0", "parity-scale-codec", @@ -15143,18 +15297,18 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "sp-wasm-interface" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -15166,7 +15320,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "31.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -15253,7 +15407,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.7.0", + "indexmap 2.7.1", "log", "memchr", "native-tls", @@ -15355,7 +15509,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-xcm" version = "14.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "array-bytes", "bounded-collections", @@ -15370,47 +15524,6 @@ dependencies = [ "xcm-procedural", ] -[[package]] -name = "staging-xcm-builder" -version = "16.0.3" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "pallet-transaction-payment", - "parity-scale-codec", - "polkadot-parachain-primitives", - "scale-info", - "sp-arithmetic", - "sp-io", - "sp-runtime", - "sp-weights", - "staging-xcm", - "staging-xcm-executor", -] - -[[package]] -name = "staging-xcm-executor" -version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" -dependencies = [ - "environmental", - "frame-benchmarking", - "frame-support", - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-weights", - "staging-xcm", - "tracing", -] - [[package]] name = "stark-curve" version = "0.1.3" @@ -15426,9 +15539,9 @@ dependencies = [ [[package]] name = "starknet-crypto" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded22ccf4cb9e572ce3f77de6066af53560cd2520d508876c83bb1e6b29d5cbc" +checksum = "039a3bad70806b494c9e6b21c5238a6c8a373d66a26071859deb0ccca6f93634" dependencies = [ "crypto-bigint", "hex", @@ -15587,13 +15700,13 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "substrate-bip39" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "hmac 0.12.1", "pbkdf2 0.12.2", @@ -15624,7 +15737,7 @@ checksum = "b285e7d183a32732fdc119f3d81b7915790191fad602b7c709ef247073c77a2e" [[package]] name = "substrate-frame-rpc-system" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "docify", "frame-system-rpc-runtime-api", @@ -15644,7 +15757,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "http-body-util", "hyper 1.5.2", @@ -15655,10 +15768,29 @@ dependencies = [ "tokio", ] +[[package]] +name = "substrate-state-machine" +version = "1.15.3" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +dependencies = [ + "frame-support", + "hash-db", + "ismp", + "pallet-ismp", + "parity-scale-codec", + "primitive-types 0.12.2", + "scale-info", + "serde", + "sp-consensus-aura", + "sp-consensus-babe", + "sp-runtime", + "sp-trie", +] + [[package]] name = "substrate-wasm-builder" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "array-bytes", "build-helper", @@ -15748,7 +15880,7 @@ dependencies = [ "scale-info", "scale-typegen", "subxt-metadata", - "syn 2.0.90", + "syn 2.0.96", "thiserror 1.0.69", ] @@ -15821,7 +15953,7 @@ dependencies = [ "scale-typegen", "subxt-codegen", "subxt-utils-fetchmetadata", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -15888,7 +16020,7 @@ dependencies = [ "hex", "once_cell", "reqwest 0.11.27", - "semver 1.0.24", + "semver 1.0.25", "serde", "serde_json", "sha2 0.10.8", @@ -15910,9 +16042,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -15928,19 +16060,19 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "syn-solidity" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e89d8bf2768d277f40573c83a02a099e96d96dd3104e13ea676194e61ac4b0" +checksum = "b84e4d83a0a6704561302b917a932484e1cae2d8c6354c64be8b7bac1c1fe057" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -15978,7 +16110,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -15998,7 +16130,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "core-foundation", "system-configuration-sys 0.6.0", ] @@ -16290,6 +16422,7 @@ dependencies = [ name = "tangle-testnet-runtime" version = "1.2.5" dependencies = [ + "anyhow", "evm-tracer", "fixed", "fp-evm", @@ -16305,6 +16438,8 @@ dependencies = [ "frame-system-rpc-runtime-api", "hex", "hex-literal 0.4.1", + "ismp", + "ismp-grandpa", "log", "num_enum", "pallet-airdrop-claims", @@ -16352,10 +16487,13 @@ dependencies = [ "pallet-evm-precompileset-assets-erc20", "pallet-grandpa", "pallet-hotfix-sufficients", + "pallet-hyperbridge", "pallet-identity", "pallet-im-online", "pallet-indices", "pallet-insecure-randomness-collective-flip", + "pallet-ismp", + "pallet-ismp-runtime-api", "pallet-multi-asset-delegation", "pallet-multisig", "pallet-nomination-pools", @@ -16381,7 +16519,6 @@ dependencies = [ "pallet-utility", "pallet-vesting", "parity-scale-codec", - "polkadot-parachain-primitives", "precompile-utils", "primitive-types 0.12.2", "rpc-primitives-debug", @@ -16395,6 +16532,7 @@ dependencies = [ "sp-genesis-builder", "sp-inherents", "sp-io", + "sp-mmr-primitives", "sp-offchain", "sp-runtime", "sp-session", @@ -16403,9 +16541,6 @@ dependencies = [ "sp-storage", "sp-transaction-pool", "sp-version", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", "static_assertions", "substrate-wasm-builder", "tangle-crypto-primitives", @@ -16426,14 +16561,15 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if", "fastrand", + "getrandom", "once_cell", - "rustix 0.38.42", + "rustix 0.38.44", "windows-sys 0.59.0", ] @@ -16463,15 +16599,15 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" dependencies = [ - "rustix 0.38.42", + "rustix 0.38.44", "windows-sys 0.59.0", ] [[package]] name = "termtree" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" [[package]] name = "tg-frost-core" @@ -16497,7 +16633,7 @@ dependencies = [ "serdect 0.2.0", "sp-std", "subtle 2.6.1", - "thiserror 2.0.8", + "thiserror 2.0.11", "thiserror-nostd-notrait", "visibility", "zeroize", @@ -16514,11 +16650,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.8" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ - "thiserror-impl 2.0.8", + "thiserror-impl 2.0.11", ] [[package]] @@ -16529,18 +16665,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "thiserror-impl" -version = "2.0.8" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -16560,7 +16696,7 @@ checksum = "585e5ef40a784ce60b49c67d762110688d211d395d39e096be204535cf64590e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -16660,9 +16796,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -16696,9 +16832,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.42.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", @@ -16714,13 +16850,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -16749,7 +16885,7 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.20", + "rustls 0.23.21", "tokio", ] @@ -16789,7 +16925,7 @@ checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" dependencies = [ "futures-util", "log", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-pki-types", "tokio", "tokio-rustls 0.26.1", @@ -16847,7 +16983,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.7.1", "serde", "serde_spanned", "toml_datetime", @@ -16890,7 +17026,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "bytes", "http 1.2.0", "http-body 1.0.1", @@ -16932,7 +17068,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -17132,7 +17268,7 @@ dependencies = [ "httparse", "log", "rand", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-pki-types", "sha1", "thiserror 1.0.69", @@ -17180,7 +17316,7 @@ checksum = "603329303137e0d59238ee4d6b9c085eada8e2a9d20666f3abd9dadf8f8543f4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -17361,9 +17497,9 @@ dependencies = [ [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "vcpkg" @@ -17385,7 +17521,7 @@ checksum = "d674d135b4a8c1d7e813e2f8d1c9a58308aee4a680323066025e53132218bd91" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -17454,34 +17590,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.49" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", @@ -17492,9 +17629,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -17502,22 +17639,25 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "wasm-instrument" @@ -17853,9 +17993,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", @@ -17905,14 +18045,14 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.42", + "rustix 0.38.44", ] [[package]] name = "wide" -version = "0.7.30" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e6db2670d2be78525979e9a5f9c69d296fd7d670549fe9ebf70f8708cb5019" +checksum = "41b5576b9a81633f3e8df296ce0063042a73507636cbe956c61133dd7034ab22" dependencies = [ "bytemuck", "safe_arch", @@ -18254,9 +18394,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.6.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" dependencies = [ "memchr", ] @@ -18360,19 +18500,19 @@ dependencies = [ [[package]] name = "xcm-procedural" version = "10.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#f2081f6657f011634a483e3a4c91e54150c974c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "xml-rs" -version = "0.8.24" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8b391c9a790b496184c29f7f93b9ed5b16abb306c05415b68bcc16e4d06432" +checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4" [[package]] name = "xmltree" @@ -18439,7 +18579,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "synstructure 0.13.1", ] @@ -18461,7 +18601,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -18481,7 +18621,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "synstructure 0.13.1", ] @@ -18502,7 +18642,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -18524,7 +18664,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 0648f74ee..f3574ed03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -383,19 +383,12 @@ pallet-token-gateway = { path = "pallets/token-gateway" } pallet-ismp = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } pallet-ismp-rpc = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407" } pallet-ismp-runtime-api = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } -ismp-parachain = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } -ismp-parachain-inherent = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } -ismp-parachain-runtime-api = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +ismp-grandpa = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } ismp = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } pallet-hyperbridge = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +sp-mmr-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false } anyhow = { version = "1.0.93", default-features = false } -# Polkadot XCM -xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk.git", branch = "stable2407", default-features = false } -xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk.git", branch = "stable2407", default-features = false } -xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk.git", branch = "stable2407", default-features = false } -polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "stable2407", default-features = false } - # Subxt subxt = { version = "0.38.0", default-features = false } subxt-core = { version = "0.38.0", default-features = false } diff --git a/pallets/token-gateway/README.md b/pallets/token-gateway/README.md new file mode 100644 index 000000000..89571eeb5 --- /dev/null +++ b/pallets/token-gateway/README.md @@ -0,0 +1,88 @@ +# Pallet Token Gateway + +This allows polkadot-sdk chains make cross-chain asset transfers to and from each other as well EVM chains using Hyperbridge. + +## Overview + +The Pallet allows the [`CreateOrigin`](https://docs.rs/pallet-token-gateway/latest/pallet_token_gateway/pallet/trait.Config.html#associatedtype.CreateOrigin) to dispatch calls for setting token gateway addresses, creating and updating assets. +This enables receiving assets from those configured chains. Assets can also be received with a runtime call to be dispatched. This call must be signed by the beneficiary of the incoming assets. Assets can also be sent with some calldata, this calldata is an opaque blob of bytes +whose interpretation is left up to the recipient token gateway implementation. For polkadot-sdk chains, it must be a scale-encoded runtime call, for EVM chains it must be an abi-encoded contract call. + +## Adding to Runtime + +The first step is to implement the pallet config for the runtime. + +```rust,ignore +use frame_support::parameter_types; +use ismp::module::IsmpModule; +use ismp::router::IsmpRouter; +use pallet_token_gateway::types::NativeAssetLocation; + +parameter_types! { + // Set the correct precision for the native currency + pub const Decimals: u8 = 12; +} + + +/// A constant value that represents the native asset +const NativeAssetId: u32 = 0; + + +/// Should provide an account that is funded and can be used to pay for asset creation +pub struct AssetAdmin; + +impl Get for AssetAdmin { + fn get() -> AccountId { + Treasury::account_id() + } +} + +impl pallet_token_gateway::Config for Runtime { + // configure the runtime event + type RuntimeEvent = RuntimeEvent; + // pallet_ismp or pallet_hyperbridge + type Dispatcher = pallet_hyperbridge::Pallet; + // Pallet Assets + type Assets = Assets; + // Pallet balances + type Currency = Balances; + // AssetAdmin account + type AssetAdmin = AssetAdmin; + // The Native asset Id + type NativeAssetId = NativeAssetId; + // The precision of the native asset + type Decimals = Decimals; +} + +// Add the pallet to your ISMP router to receive assets from external chains +#[derive(Default)] +struct Router; +impl IsmpRouter for Router { + fn module_for_id(&self, id: Vec) -> Result, anyhow::Error> { + let module = match id.as_slice() { + id if TokenGateway::is_token_gateway(&id) => Box::new(TokenGateway::default()), + _ => Err(Error::ModuleNotFound(id))? + }; + Ok(module) + } +} +``` + +## Setting up + +The pallet requires some setting up before the teleport function is available for use in the runtime. + +1. Register your native assets directly on `Hyperbridge` by dispatching `create_erc6160_asset`. +2. Set token gateway addresses for the EVM chains of interest by dispatching the `set_token_gateway_addresses` extrinsic. These addresses are used to validate incoming messages. + +## Dispatchable Functions + +- `teleport` - This function is used to bridge assets through Hyperbridge. +- `set_token_gateway_addresses` - This call allows the `AdminOrigin` origin to set the token gateway address for supported chains. +- `create_erc6160_asset` - This call dispatches a request to Hyperbridge to create multi chain native assets on token gateway deployments +- `update_erc6160_asset` - This priviledged call dispatches a request to Hyperbridge to update multi chain native assets on token gateway deployments +- `update_asset_precision` - This priviledged call is used to set or update the precision for an asset deployed on a remote chain + +## License + +This library is licensed under the Apache 2.0 License, Copyright (c) 2025 Polytope Labs. diff --git a/pallets/token-gateway/primitives/README.md b/pallets/token-gateway/primitives/README.md new file mode 100644 index 000000000..18ee0fd7f --- /dev/null +++ b/pallets/token-gateway/primitives/README.md @@ -0,0 +1,7 @@ +# Token Gateway Primitives + +A collection of types used by [pallet-token-gateway](https://crates.io/crates/pallet-token-gateway) + +## License + +This library is licensed under the Apache 2.0 License, Copyright (c) 2025 Polytope Labs. diff --git a/pallets/token-gateway/primitives/src/lib.rs b/pallets/token-gateway/primitives/src/lib.rs index e21c6b1c9..02130e48d 100644 --- a/pallets/token-gateway/primitives/src/lib.rs +++ b/pallets/token-gateway/primitives/src/lib.rs @@ -13,9 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! This library contains types shared with token gateway and other pallets +#![doc = include_str!("../README.md")] #![cfg_attr(not(feature = "std"), no_std)] +use alloy_primitives::hex; use ismp::host::StateMachine; use sp_core::{ConstU32, H160, H256}; use sp_runtime::BoundedVec; @@ -24,19 +25,13 @@ extern crate alloc; use alloc::vec::Vec; use parity_scale_codec::{Decode, Encode}; -/// The token registry Id -pub const REGISTRY: [u8; 8] = *b"registry"; +/// Pallet Token Governor's module ID for ISMP requests +pub const TOKEN_GOVERNOR_ID: [u8; 8] = *b"registry"; -/// Token Gateway Id for substrate chains -/// Module Id is the last 20 bytes of the keccak hash of the pallet id -pub fn token_gateway_id() -> H160 { - let hash = sp_io::hashing::keccak_256(b"tokengty"); - H160::from_slice(&hash[12..32]) -} - -pub fn token_governor_id() -> Vec { - REGISTRY.to_vec() -} +/// Pallet Token Gateway's module ID for ISMP requests +/// +/// Derived from `keccak_256(b"tokengty")[12..]` +pub const PALLET_TOKEN_GATEWAY_ID: [u8; 20] = hex!("a09b1c60e8650245f92518c8a17314878c4043ed"); /// Holds metadata relevant to a multi-chain native asset #[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, Default)] @@ -54,6 +49,7 @@ pub struct AssetMetadata { /// A struct for deregistering asset id on pallet-token-gateway #[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, Default)] pub struct DeregisterAssets { + /// List of asset ids to deregister pub asset_ids: Vec, } @@ -86,6 +82,8 @@ pub struct GatewayAssetUpdate { /// Holds data required for multi-chain native asset registration #[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq)] pub enum RemoteERC6160AssetRegistration { + /// Asset creation message CreateAsset(GatewayAssetRegistration), + /// Asset modification message UpdateAsset(GatewayAssetUpdate), } diff --git a/pallets/token-gateway/src/benchmarking.rs b/pallets/token-gateway/src/benchmarking.rs new file mode 100644 index 000000000..33a0ca755 --- /dev/null +++ b/pallets/token-gateway/src/benchmarking.rs @@ -0,0 +1,163 @@ +#![cfg(feature = "runtime-benchmarks")] + +use crate::{types::*, *}; +use frame_benchmarking::v2::*; +use frame_support::{ + traits::{fungible, fungibles, Currency}, + BoundedVec, +}; +use frame_system::RawOrigin; +use ismp::host::StateMachine; +use scale_info::prelude::collections::BTreeMap; +use sp_runtime::AccountId32; +use token_gateway_primitives::{GatewayAssetRegistration, GatewayAssetUpdate}; + +#[benchmarks( + where + <::NativeCurrency as Currency>::Balance: From, + ::AccountId: From<[u8; 32]>, + u128: From<<::NativeCurrency as Currency>::Balance>, + T::Balance: From, + ::Balance: From<<::NativeCurrency as Currency>::Balance>, + <::Assets as fungibles::Inspect>::Balance: From<<::NativeCurrency as Currency>::Balance>, + <::Assets as fungibles::Inspect>::Balance: From, + [u8; 32]: From<::AccountId>, + ::RuntimeOrigin: From>, +)] +mod benches { + use super::*; + + #[benchmark] + fn create_erc6160_asset(x: Linear<1, 100>) -> Result<(), BenchmarkError> { + let account: T::AccountId = whitelisted_caller(); + + let asset_details = GatewayAssetRegistration { + name: BoundedVec::try_from(b"Spectre".to_vec()).unwrap(), + symbol: BoundedVec::try_from(b"SPC".to_vec()).unwrap(), + chains: vec![StateMachine::Evm(100)], + minimum_balance: Some(10), + }; + + let mut precision = BTreeMap::new(); + for i in 0..x { + precision.insert(StateMachine::Evm(i as u32), 18); + } + + let asset = AssetRegistration { + local_id: T::NativeAssetId::get(), + reg: asset_details, + native: true, + precision, + }; + + >::set_balance(&account, u128::MAX.into()); + + #[extrinsic_call] + _(RawOrigin::Signed(account), asset); + + Ok(()) + } + + #[benchmark] + fn teleport() -> Result<(), BenchmarkError> { + let account: T::AccountId = whitelisted_caller(); + + let asset_id = T::NativeAssetId::get(); + + Pallet::::create_erc6160_asset( + RawOrigin::Signed(account.clone()).into(), + AssetRegistration { + local_id: asset_id.clone(), + reg: GatewayAssetRegistration { + name: BoundedVec::try_from(b"Spectre".to_vec()).unwrap(), + symbol: BoundedVec::try_from(b"SPC".to_vec()).unwrap(), + chains: vec![StateMachine::Evm(100)], + minimum_balance: None, + }, + native: true, + precision: vec![(StateMachine::Evm(100), 18)].into_iter().collect(), + }, + )?; + + let _ = T::NativeCurrency::deposit_creating(&account, u128::MAX.into()); + let teleport_params = TeleportParams { + asset_id, + destination: StateMachine::Evm(100), + recepient: H256::from([1u8; 32]), + amount: 10_000_000_000_000u128.into(), + timeout: 0, + token_gateway: vec![1, 2, 3, 4, 5], + relayer_fee: 0u128.into(), + call_data: None, + redeem: false, + }; + + #[extrinsic_call] + _(RawOrigin::Signed(account), teleport_params); + Ok(()) + } + + #[benchmark] + fn set_token_gateway_addresses(x: Linear<1, 100>) -> Result<(), BenchmarkError> { + let account: T::AccountId = whitelisted_caller(); + + let mut addresses = BTreeMap::new(); + for i in 0..x { + let addr = i.to_string().as_bytes().to_vec(); + addresses.insert(StateMachine::Evm(100), addr); + } + + #[extrinsic_call] + _(RawOrigin::Signed(account), addresses); + Ok(()) + } + + #[benchmark] + fn update_erc6160_asset() -> Result<(), BenchmarkError> { + let account: T::AccountId = whitelisted_caller(); + + let local_id = T::NativeAssetId::get(); + + Pallet::::create_erc6160_asset( + RawOrigin::Signed(account.clone()).into(), + AssetRegistration { + local_id, + reg: GatewayAssetRegistration { + name: BoundedVec::try_from(b"Spectre".to_vec()).unwrap(), + symbol: BoundedVec::try_from(b"SPC".to_vec()).unwrap(), + chains: vec![StateMachine::Evm(100)], + minimum_balance: None, + }, + native: true, + precision: Default::default(), + }, + )?; + + let asset_update = GatewayAssetUpdate { + asset_id: sp_io::hashing::keccak_256(b"SPC".as_ref()).into(), + add_chains: BoundedVec::try_from(vec![StateMachine::Evm(200)]).unwrap(), + remove_chains: BoundedVec::try_from(Vec::new()).unwrap(), + new_admins: BoundedVec::try_from(Vec::new()).unwrap(), + }; + + #[extrinsic_call] + _(RawOrigin::Signed(account), asset_update); + Ok(()) + } + + #[benchmark] + fn update_asset_precision(x: Linear<1, 100>) -> Result<(), BenchmarkError> { + let account: T::AccountId = whitelisted_caller(); + + let mut precisions = BTreeMap::new(); + for i in 0..x { + precisions.insert(StateMachine::Evm(i as u32), 18); + } + + let update = PrecisionUpdate { asset_id: T::NativeAssetId::get(), precisions }; + + #[extrinsic_call] + _(RawOrigin::Signed(account), update); + Ok(()) + } +} diff --git a/pallets/token-gateway/src/impls.rs b/pallets/token-gateway/src/impls.rs index 77f5d3692..852c82c85 100644 --- a/pallets/token-gateway/src/impls.rs +++ b/pallets/token-gateway/src/impls.rs @@ -18,19 +18,19 @@ use alloc::string::ToString; use frame_support::PalletId; use sp_core::U256; use sp_runtime::traits::AccountIdConversion; -use token_gateway_primitives::token_gateway_id; +use token_gateway_primitives::PALLET_TOKEN_GATEWAY_ID; use crate::{Config, Pallet}; impl Pallet { pub fn pallet_account() -> T::AccountId { let mut inner = [0u8; 8]; - inner.copy_from_slice(&token_gateway_id().0[0..8]); + inner.copy_from_slice(&PALLET_TOKEN_GATEWAY_ID[0..8]); PalletId(inner).into_account_truncating() } pub fn is_token_gateway(id: &[u8]) -> bool { - id == &token_gateway_id().0 + id == &PALLET_TOKEN_GATEWAY_ID } } diff --git a/pallets/token-gateway/src/lib.rs b/pallets/token-gateway/src/lib.rs index d283b8593..fef8fb2e6 100644 --- a/pallets/token-gateway/src/lib.rs +++ b/pallets/token-gateway/src/lib.rs @@ -13,42 +13,45 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! The token gateway enables asset transfers to EVM instances of token gateway +#![doc = include_str!("../README.md")] #![cfg_attr(not(feature = "std"), no_std)] extern crate alloc; pub mod impls; pub mod types; + +mod benchmarking; +mod weights; use crate::impls::{convert_to_balance, convert_to_erc20}; use alloy_sol_types::SolValue; use anyhow::anyhow; use frame_support::{ ensure, - pallet_prelude::Weight, traits::{ fungibles::{self, Mutate}, - tokens::{fungible::Mutate as FungibleMutate, Fortitude, Precision, Preservation}, + tokens::{fungible::Mutate as FungibleMutate, Preservation}, Currency, ExistenceRequirement, }, }; +use parity_scale_codec::{Decode, Encode}; +pub use weights::WeightInfo; use ismp::{ events::Meta, router::{PostRequest, Request, Response, Timeout}, }; -use sp_core::{Get, U256}; -use token_gateway_primitives::{token_gateway_id, token_governor_id}; -pub use types::*; +use sp_core::{Get, H160, U256}; +use sp_runtime::{traits::Dispatchable, MultiSignature}; +use token_gateway_primitives::{PALLET_TOKEN_GATEWAY_ID, TOKEN_GOVERNOR_ID}; +use types::{AssetId, Body, BodyWithCall, EvmToSubstrate, RequestBody, SubstrateCalldata}; use alloc::{string::ToString, vec, vec::Vec}; +use frame_system::RawOrigin; use ismp::module::IsmpModule; use primitive_types::H256; -use tangle_primitives::{ - AssetMetadata as AssetMetadataBifrost, CurrencyId, CurrencyIdMapping, TokenInfo, -}; // Re-export pallet items so that they can be accessed from the crate namespace. pub use pallet::*; @@ -57,11 +60,15 @@ pub mod pallet { use alloc::collections::BTreeMap; use pallet_hyperbridge::PALLET_HYPERBRIDGE; use sp_runtime::traits::AccountIdConversion; + use types::{AssetRegistration, PrecisionUpdate, TeleportParams}; use super::*; use frame_support::{ pallet_prelude::*, - traits::{tokens::Preservation, Currency, ExistenceRequirement}, + traits::{ + tokens::{Fortitude, Precision, Preservation}, + Currency, ExistenceRequirement, WithdrawReasons, + }, }; use frame_system::pallet_prelude::*; use ismp::{ @@ -94,25 +101,26 @@ pub mod pallet { /// creation type AssetAdmin: Get; + /// Account that is authorized to create and update assets. + type CreateOrigin: EnsureOrigin; + /// Fungible asset implementation - type Assets: fungibles::Mutate - + fungibles::Inspect; + type Assets: fungibles::Mutate + + fungibles::metadata::Mutate; /// The native asset ID type NativeAssetId: Get>; - /// A trait that can be used to create new asset Ids - type AssetIdFactory: CreateAssetId>; - /// The decimals of the native currency #[pallet::constant] type Decimals: Get; - /// Origin type that will be used to enforce permissions. - type ControlOrigin: EnsureOrigin; + /// A trait that converts an evm address to a substrate account + /// Used for authenticating incoming cross-chain runtime calls. + type EvmToSubstrate: EvmToSubstrate; - /// Convert Location to `T::CurrencyId`. - type CurrencyIdConvert: CurrencyIdMapping>; + /// Weight information for extrinsics in this pallet + type WeightInfo: WeightInfo; } /// Assets supported by this instance of token gateway @@ -133,7 +141,15 @@ pub mod pallet { /// The decimals used by the EVM counterpart of this asset #[pallet::storage] - pub type Decimals = StorageMap<_, Blake2_128Concat, AssetId, u8, OptionQuery>; + pub type Precisions = StorageDoubleMap< + _, + Blake2_128Concat, + AssetId, + Blake2_128Concat, + StateMachine, + u8, + OptionQuery, + >; /// The token gateway adresses on different chains #[pallet::storage] @@ -146,12 +162,12 @@ pub mod pallet { pub enum Event { /// An asset has been teleported AssetTeleported { - /// Source account on the relaychain + /// Source account from: T::AccountId, /// beneficiary account on destination to: H256, /// Amount transferred - amount: <::NativeCurrency as Currency>::Balance, + amount: >::Balance, /// Destination chain dest: StateMachine, /// Request commitment @@ -204,6 +220,8 @@ pub mod pallet { NotInitialized, /// Unknown Asset UnknownAsset, + /// Only root or asset owner can update asset + NotAssetOwner, } #[pallet::call] @@ -221,7 +239,7 @@ pub mod pallet { /// Teleports a registered asset /// locks the asset and dispatches a request to token gateway on the destination #[pallet::call_index(0)] - #[pallet::weight(weight())] + #[pallet::weight(T::WeightInfo::teleport())] pub fn teleport( origin: OriginFor, params: TeleportParams< @@ -230,18 +248,32 @@ pub mod pallet { >, ) -> DispatchResult { let who = ensure_signed(origin)?; - let dispatcher = ::Dispatcher::default(); let asset_id = SupportedAssets::::get(params.asset_id.clone()) .ok_or_else(|| Error::::UnregisteredAsset)?; let decimals = if params.asset_id == T::NativeAssetId::get() { // Custody funds in pallet - ::NativeCurrency::transfer( - &who, - &Self::pallet_account(), - params.amount, - ExistenceRequirement::AllowDeath, - )?; + let is_native = NativeAssets::::get(T::NativeAssetId::get()); + if is_native { + ::NativeCurrency::transfer( + &who, + &Self::pallet_account(), + params.amount, + ExistenceRequirement::AllowDeath, + )?; + } else { + // Reduce total supply + let imbalance = ::NativeCurrency::burn(params.amount); + // Burn amount from account + ::NativeCurrency::settle( + &who, + imbalance, + WithdrawReasons::TRANSFER, + ExistenceRequirement::AllowDeath, + ) + .map_err(|_| Error::::AssetTeleportError)?; + } + T::Decimals::get() } else { let is_native = NativeAssets::::get(params.asset_id.clone()); @@ -264,40 +296,55 @@ pub mod pallet { Fortitude::Polite, )?; } - params - .asset_id - .decimals() - .unwrap_or( - T::CurrencyIdConvert::get_currency_metadata(params.asset_id) - .map_or(12, |metatata| metatata.decimals.into()), - ) - .into() + + >::decimals( + params.asset_id.clone(), + ) }; let to = params.recepient.0; let from: [u8; 32] = who.clone().into(); - let erc_decimals = Decimals::::get(params.asset_id) + let erc_decimals = Precisions::::get(params.asset_id, params.destination) .ok_or_else(|| Error::::AssetDecimalsNotFound)?; - let body = Body { - amount: { - let amount: u128 = params.amount.into(); - let mut bytes = [0u8; 32]; - convert_to_erc20(amount, erc_decimals, decimals).to_big_endian(&mut bytes); - alloy_primitives::U256::from_be_bytes(bytes) + let body = match params.call_data { + Some(data) => { + let body = BodyWithCall { + amount: { + let amount: u128 = params.amount.into(); + let mut bytes = [0u8; 32]; + convert_to_erc20(amount, erc_decimals, decimals) + .to_big_endian(&mut bytes); + alloy_primitives::U256::from_be_bytes(bytes) + }, + asset_id: asset_id.0.into(), + redeem: params.redeem, + from: from.into(), + to: to.into(), + data: data.into(), + }; + + // Prefix with the handleIncomingAsset enum variant + let mut encoded = vec![0]; + encoded.extend_from_slice(&BodyWithCall::abi_encode(&body)); + encoded }, - asset_id: asset_id.0.into(), - redeem: params.redeem, - from: from.into(), - to: to.into(), - }; - let dispatch_post = DispatchPost { - dest: params.destination, - from: token_gateway_id().0.to_vec(), - to: params.token_gateway, - timeout: params.timeout, - body: { + None => { + let body = Body { + amount: { + let amount: u128 = params.amount.into(); + let mut bytes = [0u8; 32]; + convert_to_erc20(amount, erc_decimals, decimals) + .to_big_endian(&mut bytes); + alloy_primitives::U256::from_be_bytes(bytes) + }, + asset_id: asset_id.0.into(), + redeem: params.redeem, + from: from.into(), + to: to.into(), + }; + // Prefix with the handleIncomingAsset enum variant let mut encoded = vec![0]; encoded.extend_from_slice(&Body::abi_encode(&body)); @@ -305,6 +352,14 @@ pub mod pallet { }, }; + let dispatch_post = DispatchPost { + dest: params.destination, + from: PALLET_TOKEN_GATEWAY_ID.to_vec(), + to: params.token_gateway, + timeout: params.timeout, + body, + }; + let metadata = FeeMetadata { payer: who.clone(), fee: params.relayer_fee.into() }; let commitment = dispatcher .dispatch_request(DispatchRequest::Post(dispatch_post), metadata) @@ -322,12 +377,12 @@ pub mod pallet { /// Set the token gateway address for specified chains #[pallet::call_index(1)] - #[pallet::weight(weight())] + #[pallet::weight(T::WeightInfo::set_token_gateway_addresses(addresses.len() as u32))] pub fn set_token_gateway_addresses( origin: OriginFor, addresses: BTreeMap>, ) -> DispatchResult { - T::AdminOrigin::ensure_origin(origin)?; + T::CreateOrigin::ensure_origin(origin)?; for (chain, address) in addresses { TokenGatewayAddresses::::insert(chain, address.clone()); } @@ -340,15 +395,13 @@ pub mod pallet { /// to create the asset. /// `native` should be true if this asset originates from this chain #[pallet::call_index(2)] - #[pallet::weight(weight())] + #[pallet::weight(T::WeightInfo::create_erc6160_asset(asset.precision.len() as u32))] pub fn create_erc6160_asset( origin: OriginFor, asset: AssetRegistration>, - native: bool, ) -> DispatchResult { - T::ControlOrigin::ensure_origin(origin)?; + T::CreateOrigin::ensure_origin(origin)?; let who = T::AssetAdmin::get(); - // charge hyperbridge fees let VersionedHostParams::V1(SubstrateHostParams { asset_registration_fee, .. }) = pallet_hyperbridge::Pallet::::host_params(); @@ -367,16 +420,17 @@ pub mod pallet { // the mapping to its token gateway asset id SupportedAssets::::insert(asset.local_id.clone(), asset_id.clone()); - NativeAssets::::insert(asset.local_id.clone(), native); + NativeAssets::::insert(asset.local_id.clone(), asset.native); LocalAssets::::insert(asset_id, asset.local_id.clone()); - // All ERC6160 assets use 18 decimals - Decimals::::insert(asset.local_id, 18); + for (state_machine, precision) in asset.precision { + Precisions::::insert(asset.local_id.clone(), state_machine, precision); + } let dispatcher = ::Dispatcher::default(); let dispatch_post = DispatchPost { dest: T::Coprocessor::get().ok_or_else(|| Error::::CoprocessorNotConfigured)?, - from: token_gateway_id().0.to_vec(), - to: token_governor_id(), + from: PALLET_TOKEN_GATEWAY_ID.to_vec(), + to: TOKEN_GOVERNOR_ID.to_vec(), timeout: 0, body: { RemoteERC6160AssetRegistration::CreateAsset(asset.reg).encode() }, }; @@ -396,12 +450,12 @@ pub mod pallet { /// This works by dispatching a request to the TokenGateway module on each requested chain /// to create the asset. #[pallet::call_index(3)] - #[pallet::weight(weight())] + #[pallet::weight(T::WeightInfo::update_erc6160_asset())] pub fn update_erc6160_asset( origin: OriginFor, asset: GatewayAssetUpdate, ) -> DispatchResult { - T::ControlOrigin::ensure_origin(origin)?; + T::CreateOrigin::ensure_origin(origin)?; let who = T::AssetAdmin::get(); // charge hyperbridge fees @@ -420,8 +474,8 @@ pub mod pallet { let dispatcher = ::Dispatcher::default(); let dispatch_post = DispatchPost { dest: T::Coprocessor::get().ok_or_else(|| Error::::CoprocessorNotConfigured)?, - from: token_gateway_id().0.to_vec(), - to: token_governor_id(), + from: PALLET_TOKEN_GATEWAY_ID.to_vec(), + to: TOKEN_GOVERNOR_ID.to_vec(), timeout: 0, body: { RemoteERC6160AssetRegistration::UpdateAsset(asset).encode() }, }; @@ -435,6 +489,20 @@ pub mod pallet { Ok(()) } + + /// Update the precision for an existing asset + #[pallet::call_index(4)] + #[pallet::weight(T::WeightInfo::update_asset_precision(update.precisions.len() as u32))] + pub fn update_asset_precision( + origin: OriginFor, + update: PrecisionUpdate>, + ) -> DispatchResult { + T::CreateOrigin::ensure_origin(origin)?; + for (chain, precision) in update.precisions { + Precisions::::insert(update.asset_id.clone(), chain, precision); + } + Ok(()) + } } // Hack for implementing the [`Default`] bound needed for @@ -457,21 +525,23 @@ where &self, PostRequest { body, from, source, dest, nonce, .. }: PostRequest, ) -> Result<(), anyhow::Error> { + let expected = TokenGatewayAddresses::::get(source) + .ok_or_else(|| anyhow!("Not configured to receive assets from {source:?}"))?; ensure!( - from == TokenGatewayAddresses::::get(source).unwrap_or_default().to_vec() - || from == token_gateway_id().0.to_vec(), + from == expected, ismp::error::Error::ModuleDispatchError { msg: "Token Gateway: Unknown source contract address".to_string(), meta: Meta { source, dest, nonce }, } ); - let body = Body::abi_decode(&mut &body[1..], true).map_err(|_| { - ismp::error::Error::ModuleDispatchError { - msg: "Token Gateway: Failed to decode request body".to_string(), - meta: Meta { source, dest, nonce }, - } - })?; + let body: RequestBody = if let Ok(body) = Body::abi_decode(&mut &body[1..], true) { + body.into() + } else if let Ok(body) = BodyWithCall::abi_decode(&mut &body[1..], true) { + body.into() + } else { + Err(anyhow!("Token Gateway: Failed to decode request body"))? + }; let local_asset_id = LocalAssets::::get(H256::from(body.asset_id.0)).ok_or_else(|| { @@ -484,15 +554,11 @@ where let decimals = if local_asset_id == T::NativeAssetId::get() { T::Decimals::get() } else { - local_asset_id - .decimals() - .unwrap_or( - T::CurrencyIdConvert::get_currency_metadata(local_asset_id) - .map_or(12, |metatata| metatata.decimals.into()), - ) - .into() + >::decimals( + local_asset_id.clone(), + ) }; - let erc_decimals = Decimals::::get(local_asset_id.clone()) + let erc_decimals = Precisions::::get(local_asset_id.clone(), source) .ok_or_else(|| anyhow!("Asset decimals not configured"))?; let amount = convert_to_balance( U256::from_big_endian(&body.amount.to_be_bytes::<32>()), @@ -505,16 +571,24 @@ where })?; let beneficiary: T::AccountId = body.to.0.into(); if local_asset_id == T::NativeAssetId::get() { - ::NativeCurrency::transfer( - &Pallet::::pallet_account(), - &beneficiary, - amount.into(), - ExistenceRequirement::AllowDeath, - ) - .map_err(|_| ismp::error::Error::ModuleDispatchError { - msg: "Token Gateway: Failed to complete asset transfer".to_string(), - meta: Meta { source, dest, nonce }, - })?; + let is_native = NativeAssets::::get(T::NativeAssetId::get()); + if is_native { + ::NativeCurrency::transfer( + &Pallet::::pallet_account(), + &beneficiary, + amount.into(), + ExistenceRequirement::AllowDeath, + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to complete asset transfer".to_string(), + meta: Meta { source, dest, nonce }, + })?; + } else { + // Increase total supply + let imbalance = ::NativeCurrency::issue(amount.into()); + // Mint into the beneficiary account + ::NativeCurrency::resolve_creating(&beneficiary, imbalance); + } } else { // Assets that do not originate from this chain are minted let is_native = NativeAssets::::get(local_asset_id.clone()); @@ -539,6 +613,63 @@ where } } + if let Some(call_data) = body.data { + let substrate_data = SubstrateCalldata::decode(&mut &call_data.0[..]) + .map_err(|err| anyhow!("Calldata decode error: {err:?}"))?; + // Verify signature against encoded runtime call + let nonce = frame_system::Pallet::::account_nonce(beneficiary.clone()); + let payload = (nonce, substrate_data.runtime_call.clone()).encode(); + let message = sp_io::hashing::keccak_256(&payload); + + let multi_signature = MultiSignature::decode(&mut &*substrate_data.signature) + .map_err(|err| anyhow!("Signature decode error: {err:?}"))?; + + match multi_signature { + MultiSignature::Ed25519(sig) => { + let pub_key = body.to.0.as_slice().try_into().map_err(|_| { + anyhow!("Failed to decode beneficiary as Ed25519 public key") + })?; + if !sp_io::crypto::ed25519_verify(&sig, message.as_ref(), &pub_key) { + Err(anyhow!( + "Failed to verify ed25519 signature before dispatching token gateway call" + ))? + } + }, + MultiSignature::Sr25519(sig) => { + let pub_key = body.to.0.as_slice().try_into().map_err(|_| { + anyhow!("Failed to decode beneficiary as Sr25519 public key") + })?; + if !sp_io::crypto::sr25519_verify(&sig, message.as_ref(), &pub_key) { + Err(anyhow!( + "Failed to verify sr25519 signature before dispatching token gateway call" + ))? + } + }, + MultiSignature::Ecdsa(sig) => { + let pub_key = sp_io::crypto::secp256k1_ecdsa_recover(&sig.0, &message) + .map_err(|_| { + anyhow!("Failed to recover ecdsa public key from signature") + })?; + let eth_address = + H160::from_slice(&sp_io::hashing::keccak_256(&pub_key[..])[12..]); + let substrate_account = T::EvmToSubstrate::convert(eth_address); + if substrate_account != beneficiary { + Err(anyhow!( + "Failed to verify signature before dispatching token gateway call" + ))? + } + }, + } + + let runtime_call = T::RuntimeCall::decode(&mut &*substrate_data.runtime_call) + .map_err(|err| anyhow!("RuntimeCall decode error: {err:?}"))?; + runtime_call + .dispatch(RawOrigin::Signed(beneficiary.clone()).into()) + .map_err(|e| anyhow!("Call dispatch executed with error {:?}", e.error))?; + // Increase account nonce to ensure the call cannot be replayed + frame_system::Pallet::::inc_account_nonce(beneficiary.clone()); + } + Self::deposit_event(Event::::AssetReceived { beneficiary, amount: amount.into(), @@ -554,12 +685,13 @@ where fn on_timeout(&self, request: Timeout) -> Result<(), anyhow::Error> { match request { Timeout::Request(Request::Post(PostRequest { body, source, dest, nonce, .. })) => { - let body = Body::abi_decode(&mut &body[1..], true).map_err(|_| { - ismp::error::Error::ModuleDispatchError { - msg: "Token Gateway: Failed to decode request body".to_string(), - meta: Meta { source, dest, nonce }, - } - })?; + let body: RequestBody = if let Ok(body) = Body::abi_decode(&mut &body[1..], true) { + body.into() + } else if let Ok(body) = BodyWithCall::abi_decode(&mut &body[1..], true) { + body.into() + } else { + Err(anyhow!("Token Gateway: Failed to decode request body"))? + }; let beneficiary = body.from.0.into(); let local_asset_id = LocalAssets::::get(H256::from(body.asset_id.0)) .ok_or_else(|| ismp::error::Error::ModuleDispatchError { @@ -569,15 +701,11 @@ where let decimals = if local_asset_id == T::NativeAssetId::get() { T::Decimals::get() } else { - local_asset_id - .decimals() - .unwrap_or( - T::CurrencyIdConvert::get_currency_metadata(local_asset_id) - .map_or(12, |metatata| metatata.decimals.into()), - ) - .into() + >::decimals( + local_asset_id.clone(), + ) }; - let erc_decimals = Decimals::::get(local_asset_id.clone()) + let erc_decimals = Precisions::::get(local_asset_id.clone(), dest) .ok_or_else(|| anyhow!("Asset decimals not configured"))?; let amount = convert_to_balance( U256::from_big_endian(&body.amount.to_be_bytes::<32>()), @@ -590,16 +718,22 @@ where })?; if local_asset_id == T::NativeAssetId::get() { - ::NativeCurrency::transfer( - &Pallet::::pallet_account(), - &beneficiary, - amount.into(), - ExistenceRequirement::AllowDeath, - ) - .map_err(|_| ismp::error::Error::ModuleDispatchError { - msg: "Token Gateway: Failed to complete asset transfer".to_string(), - meta: Meta { source, dest, nonce }, - })?; + let is_native = NativeAssets::::get(T::NativeAssetId::get()); + if is_native { + ::NativeCurrency::transfer( + &Pallet::::pallet_account(), + &beneficiary, + amount.into(), + ExistenceRequirement::AllowDeath, + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to complete asset transfer".to_string(), + meta: Meta { source, dest, nonce }, + })?; + } else { + let imbalance = ::NativeCurrency::issue(amount.into()); + ::NativeCurrency::resolve_creating(&beneficiary, imbalance); + } } else { // Assets that do not originate from this chain are minted let is_native = NativeAssets::::get(local_asset_id.clone()); @@ -651,8 +785,3 @@ where Ok(()) } } - -/// Static weights because benchmarks suck, and we'll be getting PolkaVM soon anyways -fn weight() -> Weight { - Weight::from_parts(300_000_000, 0) -} diff --git a/pallets/token-gateway/src/types.rs b/pallets/token-gateway/src/types.rs index d143061c2..e8651b755 100644 --- a/pallets/token-gateway/src/types.rs +++ b/pallets/token-gateway/src/types.rs @@ -15,11 +15,11 @@ //! Pallet types -use alloc::vec::Vec; -use anyhow::anyhow; +use alloc::{collections::BTreeMap, vec::Vec}; use frame_support::{pallet_prelude::*, traits::fungibles}; use ismp::host::StateMachine; use primitive_types::H256; +use sp_core::H160; use crate::Config; @@ -43,6 +43,8 @@ pub struct TeleportParams { pub token_gateway: Vec, /// Relayer fee pub relayer_fee: Balance, + /// Optional call data to be executed on the destination chain + pub call_data: Option>, /// Redeem native erc20 assets pub redeem: bool, } @@ -54,6 +56,19 @@ pub struct AssetRegistration { pub local_id: AssetId, /// MNT Asset registration details pub reg: token_gateway_primitives::GatewayAssetRegistration, + /// Flag that asserts if this asset is custodied and originally minted on this chain + pub native: bool, + /// Precision of asset on supported chains + pub precision: BTreeMap, +} + +/// Update the precision of an asset +#[derive(Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, RuntimeDebug)] +pub struct PrecisionUpdate { + /// Asset Id + pub asset_id: AssetId, + /// New precisions + pub precisions: BTreeMap, } alloy_sol_macro::sol! { @@ -70,16 +85,79 @@ alloy_sol_macro::sol! { // Recipient address bytes32 to; } + + struct BodyWithCall { + // Amount of the asset to be sent + uint256 amount; + // The asset identifier + bytes32 asset_id; + // Flag to redeem the erc20 asset on the destination + bool redeem; + // Sender address + bytes32 from; + // Recipient address + bytes32 to; + // Calldata to be passed to the asset destination + bytes data; + } +} + +#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq)] +pub struct SubstrateCalldata { + /// A scale encoded encoded [MultiSignature](sp_runtime::MultiSignature) of the beneficiary's + /// account nonce and the encoded runtime call + pub signature: Vec, + /// Encoded Runtime call that should be executed + pub runtime_call: Vec, +} + +/// Type that encapsulates both types of token gateway request bodies +pub struct RequestBody { + pub amount: alloy_primitives::U256, + pub asset_id: alloy_primitives::FixedBytes<32>, + pub redeem: bool, + pub from: alloy_primitives::FixedBytes<32>, + pub to: alloy_primitives::FixedBytes<32>, + pub data: Option, +} + +impl From for RequestBody { + fn from(value: Body) -> Self { + RequestBody { + amount: value.amount, + asset_id: value.asset_id, + redeem: value.redeem, + from: value.from, + to: value.to, + data: None, + } + } +} + +impl From for RequestBody { + fn from(value: BodyWithCall) -> Self { + RequestBody { + amount: value.amount, + asset_id: value.asset_id, + redeem: value.redeem, + from: value.from, + to: value.to, + data: Some(value.data), + } + } } -/// A trait that helps in creating new asset ids in the runtime -pub trait CreateAssetId { - /// Should return a unique asset id - fn create_asset_id(symbol: Vec) -> Result; +pub trait EvmToSubstrate { + fn convert(addr: H160) -> T::AccountId; } -impl CreateAssetId for () { - fn create_asset_id(_symbol: Vec) -> Result { - Err(anyhow!("Unimplemented")) +impl EvmToSubstrate for () +where + ::AccountId: From<[u8; 32]>, +{ + fn convert(addr: H160) -> ::AccountId { + let mut account = [0u8; 32]; + account[12..].copy_from_slice(&addr.0); + account.into() } } diff --git a/pallets/token-gateway/src/weights.rs b/pallets/token-gateway/src/weights.rs new file mode 100644 index 000000000..a2e759dfa --- /dev/null +++ b/pallets/token-gateway/src/weights.rs @@ -0,0 +1,33 @@ +use frame_support::weights::Weight; + +// ============================== INTERFACE ============================================ // +/// Weight functions needed for `pallet_token_gateway. +pub trait WeightInfo { + fn create_erc6160_asset(x: u32) -> Weight; + fn teleport() -> Weight; + fn set_token_gateway_addresses(x: u32) -> Weight; + fn update_erc6160_asset() -> Weight; + fn update_asset_precision(x: u32) -> Weight; +} + +impl WeightInfo for () { + fn create_erc6160_asset(_x: u32) -> Weight { + Weight::zero() + } + + fn teleport() -> Weight { + Weight::zero() + } + + fn set_token_gateway_addresses(_x: u32) -> Weight { + Weight::zero() + } + + fn update_erc6160_asset() -> Weight { + Weight::zero() + } + + fn update_asset_precision(_x: u32) -> Weight { + Weight::zero() + } +} diff --git a/primitives/src/traits/assets.rs b/primitives/src/traits/assets.rs index aa11986ce..50e0a13ea 100644 --- a/primitives/src/traits/assets.rs +++ b/primitives/src/traits/assets.rs @@ -5,15 +5,7 @@ pub trait NextAssetId { } /// A mapping between CurrencyId and AssetMetadata. -pub trait CurrencyIdMapping { +pub trait AssetIdMapping { /// Returns the AssetMetadata associated with a given `AssetIds`. - fn get_asset_metadata(asset_ids: AssetIds) -> Option; - /// Returns the AssetMetadata associated with a given `CurrencyId`. - fn get_currency_metadata(currency_id: CurrencyId) -> Option; - /// Returns the Location associated with a given CurrencyId. - fn get_location(currency_id: &CurrencyId) -> Option; - /// Returns the CurrencyId associated with a given Location. - fn get_currency_id(location: &Location) -> Option; - /// Returns all currencies in currencyMetadata. - fn get_all_currency() -> Vec; + fn get_asset_metadata(asset_id: AssetId) -> Option; } diff --git a/runtime/testnet/Cargo.toml b/runtime/testnet/Cargo.toml index 580b08d5b..956dd79a3 100644 --- a/runtime/testnet/Cargo.toml +++ b/runtime/testnet/Cargo.toml @@ -147,17 +147,13 @@ rpc-primitives-debug = { workspace = true } rpc-primitives-txpool = { workspace = true } # Hyperbridge -# pallet-ismp = { workspace = true, features = ["unsigned"] } -# pallet-ismp-runtime-api = { workspace = true } -# ismp = { workspace = true } -# pallet-hyperbridge = { workspace = true } -# pallet-token-gateway = { workspace = true } - -# XCM -xcm = { workspace = true } -xcm-builder = { workspace = true } -xcm-executor = { workspace = true } -polkadot-parachain-primitives = { workspace = true } +pallet-ismp = { workspace = true, features = ["unsigned"] } +pallet-ismp-runtime-api = { workspace = true } +pallet-hyperbridge = { workspace = true } +sp-mmr-primitives = { workspace = true } +ismp = { workspace = true } +ismp-grandpa = { workspace = true } +anyhow = { workspace = true } [features] runtime-benchmarks = [ @@ -182,10 +178,11 @@ runtime-benchmarks = [ # Tangle "pallet-services/runtime-benchmarks", "pallet-airdrop-claims/runtime-benchmarks", - - "xcm-builder/runtime-benchmarks", "pallet-multi-asset-delegation/runtime-benchmarks", "pallet-tangle-lst-benchmarking/runtime-benchmarks", + + # Hyperbridge + "pallet-ismp/runtime-benchmarks", ] default = ["std", "with-rocksdb-weights", "evm-tracing"] local-testing = [] @@ -313,11 +310,13 @@ std = [ "pallet-evm-precompile-services/std", "pallet-evm-precompile-tangle-lst/std", - # XCM - "xcm/std", - "xcm-builder/std", - "xcm-executor/std", - "polkadot-parachain-primitives/std", + # Hyperbridge + "pallet-hyperbridge/std", + "pallet-ismp/std", + "ismp/std", + "ismp-grandpa/std", + "pallet-ismp-runtime-api/std", + "sp-mmr-primitives/std", ] integration-tests = ["tangle-primitives/integration-tests"] with-rocksdb-weights = [] diff --git a/runtime/testnet/src/hyperbridge.rs b/runtime/testnet/src/hyperbridge.rs index 8bd282f5f..857c4bebc 100644 --- a/runtime/testnet/src/hyperbridge.rs +++ b/runtime/testnet/src/hyperbridge.rs @@ -16,17 +16,12 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::governance::TechAdminOrCouncil; -use crate::{Balances, Ismp, IsmpParachain, NativeCurrencyId, Runtime, RuntimeEvent, Timestamp}; -use crate::{BncDecimals, Currencies}; -use crate::{TokenGateway, Treasury}; -use bifrost_asset_registry::AssetIdMaps; -use bifrost_primitives::{AccountId, Balance}; +use crate::{Balances, EnsureRootOrHalfCouncil, Ismp, Runtime, RuntimeEvent, Timestamp}; use frame_support::parameter_types; use ismp::{host::StateMachine, module::IsmpModule, router::IsmpRouter}; -use sp_core::Get; use sp_std::boxed::Box; use sp_std::vec::Vec; +use tangle_primitives::Balance; impl pallet_hyperbridge::Config for Runtime { type RuntimeEvent = RuntimeEvent; @@ -44,7 +39,7 @@ parameter_types! { impl pallet_ismp::Config for Runtime { type RuntimeEvent = RuntimeEvent; // Modify the consensus client's permissions, for example, TechAdmin - type AdminOrigin = TechAdminOrCouncil; + type AdminOrigin = EnsureRootOrHalfCouncil; // The state machine identifier of the chain -- parachain id type HostStateMachine = HostStateMachine; type TimestampProvider = Timestamp; @@ -56,15 +51,14 @@ impl pallet_ismp::Config for Runtime { // Co-processor type Coprocessor = Coprocessor; // A tuple of types implementing the ConsensusClient interface, which defines all consensus algorithms supported by this protocol deployment - type ConsensusClients = (ismp_parachain::ParachainConsensusClient,); + type ConsensusClients = (ismp_grandpa::consensus::GrandpaConsensusClient,); type WeightProvider = (); type OffchainDB = (); } -impl ismp_parachain::Config for Runtime { +impl ismp_grandpa::Config for Runtime { type RuntimeEvent = RuntimeEvent; - // pallet-ismp implements the IsmpHost - type IsmpHost = Ismp; + type IsmpHost = pallet_ismp::Pallet; } #[derive(Default)] @@ -76,40 +70,7 @@ impl IsmpRouter for Router { pallet_hyperbridge::PALLET_HYPERBRIDGE_ID => { Ok(Box::new(pallet_hyperbridge::Pallet::::default())) }, - id if TokenGateway::is_token_gateway(&id) => { - Ok(Box::new(pallet_token_gateway::Pallet::::default())) - }, _ => Err(ismp::Error::ModuleNotFound(id))?, } } } - -/// Should provide an account that is funded and can be used to pay for asset creation -pub struct AssetAdmin; -impl Get for AssetAdmin { - fn get() -> AccountId { - Treasury::account_id() - } -} - -impl pallet_token_gateway::Config for Runtime { - // configure the runtime event - type RuntimeEvent = RuntimeEvent; - // Configured as Pallet Ismp - type Dispatcher = Ismp; - // Configured as Pallet Assets - type Assets = Currencies; - // Configured as Pallet balances - type NativeCurrency = Balances; - // AssetAdmin account - type AssetAdmin = AssetAdmin; - // The Native asset Id - type NativeAssetId = NativeCurrencyId; - // A type that provides a function for creating unique asset ids - // A concrete implementation for your specific runtime is required - type AssetIdFactory = (); - // The precision of the native asset - type Decimals = BncDecimals; - type ControlOrigin = TechAdminOrCouncil; - type CurrencyIdConvert = AssetIdMaps; -} diff --git a/runtime/testnet/src/lib.rs b/runtime/testnet/src/lib.rs index e2adbb7bc..7d0ec8678 100644 --- a/runtime/testnet/src/lib.rs +++ b/runtime/testnet/src/lib.rs @@ -23,6 +23,7 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); mod filters; pub mod frontier_evm; +pub mod hyperbridge; pub mod impls; pub mod migrations; pub mod precompiles; @@ -44,12 +45,18 @@ use frame_support::{ }; use frame_system::EnsureSigned; use frontier_evm::DefaultBaseFeePerGas; +use ismp::{ + consensus::{ConsensusClientId, StateMachineHeight, StateMachineId}, + host::StateMachine, + router::{Request, Response}, +}; use pallet_election_provider_multi_phase::{GeometricDepositBase, SolutionAccuracyOf}; use pallet_evm::GasWeightMapping; use pallet_grandpa::{ fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, }; use pallet_im_online::sr25519::AuthorityId as ImOnlineId; +use pallet_ismp::offchain::{Leaf, Proof, ProofKeys}; use pallet_multi_asset_delegation::RoundChangeSessionManager; use pallet_services_rpc_runtime_api::BlockNumberOf; use pallet_session::historical::{self as pallet_session_historical, NoteHistoricalRoot}; @@ -1295,6 +1302,10 @@ construct_runtime!( Lst: pallet_tangle_lst = 52, Rewards: pallet_rewards = 53, + Ismp: pallet_ismp = 54, + IsmpGrandpa: ismp_grandpa = 55, + Hyperbridge: pallet_hyperbridge = 56, + } ); @@ -2219,6 +2230,59 @@ impl_runtime_apis! { } } + impl pallet_ismp_runtime_api::IsmpRuntimeApi::Hash> for Runtime { + fn host_state_machine() -> StateMachine { + ::HostStateMachine::get() + } + + fn challenge_period(state_machine_id: StateMachineId) -> Option { + pallet_ismp::Pallet::::challenge_period(state_machine_id) + } + + /// Generate a proof for the provided leaf indices + fn generate_proof( + keys: ProofKeys + ) -> Result<(Vec, Proof<::Hash>), sp_mmr_primitives::Error> { + pallet_ismp::Pallet::::generate_proof(keys) + } + + /// Fetch all ISMP events in the block, should only be called from runtime-api. + fn block_events() -> Vec<::ismp::events::Event> { + pallet_ismp::Pallet::::block_events() + } + + /// Fetch all ISMP events and their extrinsic metadata, should only be called from runtime-api. + fn block_events_with_metadata() -> Vec<(::ismp::events::Event, Option)> { + pallet_ismp::Pallet::::block_events_with_metadata() + } + + /// Return the scale encoded consensus state + fn consensus_state(id: ConsensusClientId) -> Option> { + pallet_ismp::Pallet::::consensus_states(id) + } + + /// Return the timestamp this client was last updated in seconds + fn state_machine_update_time(height: StateMachineHeight) -> Option { + pallet_ismp::Pallet::::state_machine_update_time(height) + } + + /// Return the latest height of the state machine + fn latest_state_machine_height(id: StateMachineId) -> Option { + pallet_ismp::Pallet::::latest_state_machine_height(id) + } + + + /// Get actual requests + fn requests(commitments: Vec) -> Vec { + pallet_ismp::Pallet::::requests(commitments) + } + + /// Get actual requests + fn responses(commitments: Vec) -> Vec { + pallet_ismp::Pallet::::responses(commitments) + } + } + #[cfg(feature = "runtime-benchmarks")] impl frame_benchmarking::Benchmark for Runtime { fn benchmark_metadata(extra: bool) -> ( From d52a8c86e67f1443488e6b6c38d02bd1ff7d20ac Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Fri, 24 Jan 2025 23:27:56 +0900 Subject: [PATCH 03/16] chore: remove token-gateway --- Cargo.lock | 215 +----- pallets/token-gateway/Cargo.toml | 58 -- pallets/token-gateway/README.md | 88 --- pallets/token-gateway/primitives/Cargo.toml | 52 -- pallets/token-gateway/primitives/README.md | 7 - pallets/token-gateway/primitives/src/lib.rs | 89 --- pallets/token-gateway/src/benchmarking.rs | 163 ---- pallets/token-gateway/src/impls.rs | 108 --- pallets/token-gateway/src/lib.rs | 787 -------------------- pallets/token-gateway/src/types.rs | 163 ---- pallets/token-gateway/src/weights.rs | 33 - 11 files changed, 39 insertions(+), 1724 deletions(-) delete mode 100644 pallets/token-gateway/Cargo.toml delete mode 100644 pallets/token-gateway/README.md delete mode 100644 pallets/token-gateway/primitives/Cargo.toml delete mode 100644 pallets/token-gateway/primitives/README.md delete mode 100644 pallets/token-gateway/primitives/src/lib.rs delete mode 100644 pallets/token-gateway/src/benchmarking.rs delete mode 100644 pallets/token-gateway/src/impls.rs delete mode 100644 pallets/token-gateway/src/lib.rs delete mode 100644 pallets/token-gateway/src/types.rs delete mode 100644 pallets/token-gateway/src/weights.rs diff --git a/Cargo.lock b/Cargo.lock index 18e32fdef..ed4613e73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -141,7 +141,7 @@ version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ab9d1367c6ffb90c93fb4a9a4989530aa85112438c6f73a734067255d348469" dependencies = [ - "alloy-primitives 0.8.19", + "alloy-primitives", "num_enum", "strum 0.26.3", ] @@ -153,7 +153,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4138dc275554afa6f18c4217262ac9388790b2fc393c2dfe03c51d357abf013" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-rlp", "alloy-serde", "alloy-trie", @@ -172,7 +172,7 @@ checksum = "0fa04e1882c31288ce1028fdf31b6ea94cfa9eafa2e497f903ded631c8c6a42c" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-rlp", "alloy-serde", "serde", @@ -188,11 +188,11 @@ dependencies = [ "alloy-json-abi", "alloy-network", "alloy-network-primitives", - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-provider", "alloy-pubsub", "alloy-rpc-types-eth", - "alloy-sol-types 0.8.19", + "alloy-sol-types", "alloy-transport", "futures 0.3.31", "futures-util", @@ -207,9 +207,9 @@ checksum = "648275bb59110f88cc5fa9a176845e52a554ebfebac2d21220bcda8c9220f797" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-rlp", - "alloy-sol-types 0.8.19", + "alloy-sol-types", ] [[package]] @@ -219,9 +219,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc9138f4f0912793642d453523c3116bd5d9e11de73b70177aa7cb3e94b98ad2" dependencies = [ "alloy-json-abi", - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-sol-type-parser", - "alloy-sol-types 0.8.19", + "alloy-sol-types", "const-hex", "itoa", "serde", @@ -235,7 +235,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" dependencies = [ - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-rlp", "serde", ] @@ -246,7 +246,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cabf647eb4650c91a9d38cb6f972bb320009e7e9d61765fb688a86f1563b33e8" dependencies = [ - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-rlp", "derive_more 1.0.0", "k256", @@ -261,7 +261,7 @@ checksum = "52dd5869ed09e399003e0e0ec6903d981b2a92e74c5d37e6b40890bad2517526" dependencies = [ "alloy-eip2930", "alloy-eip7702", - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-rlp", "alloy-serde", "c-kzg", @@ -278,7 +278,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7d2a7fe5c1a9bd6793829ea21a636f30fc2b3f5d2e7418ba86d96e41dd1f460" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-serde", "alloy-trie", "serde", @@ -290,7 +290,7 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24acd2f5ba97c7a320e67217274bc81fe3c3174b8e6144ec875d9d54e760e278" dependencies = [ - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-sol-type-parser", "serde", "serde_json", @@ -302,8 +302,8 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2008bedb8159a255b46b7c8614516eda06679ea82f620913679afbd8031fea72" dependencies = [ - "alloy-primitives 0.8.19", - "alloy-sol-types 0.8.19", + "alloy-primitives", + "alloy-sol-types", "serde", "serde_json", "thiserror 2.0.11", @@ -321,12 +321,12 @@ dependencies = [ "alloy-eips", "alloy-json-rpc", "alloy-network-primitives", - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-rpc-types-any", "alloy-rpc-types-eth", "alloy-serde", "alloy-signer", - "alloy-sol-types 0.8.19", + "alloy-sol-types", "async-trait", "auto_impl", "futures-utils-wasm", @@ -343,33 +343,11 @@ checksum = "f31c3c6b71340a1d076831823f09cb6e02de01de5c6630a9631bdb36f947ff80" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-serde", "serde", ] -[[package]] -name = "alloy-primitives" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" -dependencies = [ - "alloy-rlp", - "bytes", - "cfg-if", - "const-hex", - "derive_more 0.99.18", - "hex-literal 0.4.1", - "itoa", - "k256", - "keccak-asm", - "proptest", - "rand", - "ruint", - "serde", - "tiny-keccak", -] - [[package]] name = "alloy-primitives" version = "0.8.19" @@ -409,7 +387,7 @@ dependencies = [ "alloy-json-rpc", "alloy-network", "alloy-network-primitives", - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-pubsub", "alloy-rpc-client", "alloy-rpc-types-debug", @@ -446,7 +424,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2269fd635f7b505f27c63a3cb293148cd02301efce4c8bdd9ff54fbfc4a20e23" dependencies = [ "alloy-json-rpc", - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-transport", "bimap", "futures 0.3.31", @@ -487,7 +465,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d06a292b37e182e514903ede6e623b9de96420e8109ce300da288a96d88b7e4b" dependencies = [ "alloy-json-rpc", - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-pubsub", "alloy-transport", "alloy-transport-http", @@ -512,7 +490,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9383845dd924939e7ab0298bbfe231505e20928907d7905aa3bf112287305e06" dependencies = [ - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-rpc-types-engine", "alloy-rpc-types-eth", "alloy-rpc-types-trace", @@ -537,7 +515,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "358d6a8d7340b9eb1a7589a6c1fb00df2c9b26e90737fa5ed0108724dd8dac2c" dependencies = [ - "alloy-primitives 0.8.19", + "alloy-primitives", "serde", ] @@ -549,7 +527,7 @@ checksum = "4a5f821f30344862a0b6eb9a1c2eb91dfb2ff44c7489f37152a526cdcab79264" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-rlp", "alloy-serde", "derive_more 1.0.0", @@ -567,10 +545,10 @@ dependencies = [ "alloy-consensus-any", "alloy-eips", "alloy-network-primitives", - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-rlp", "alloy-serde", - "alloy-sol-types 0.8.19", + "alloy-sol-types", "itertools 0.13.0", "serde", "serde_json", @@ -583,7 +561,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd38207e056cc7d1372367fbb4560ddf9107cbd20731743f641246bf0dede149" dependencies = [ - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-rpc-types-eth", "alloy-serde", "serde", @@ -597,7 +575,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae0465c71d4dced7525f408d84873aeebb71faf807d22d74c4a426430ccd9b55" dependencies = [ - "alloy-primitives 0.8.19", + "alloy-primitives", "serde", "serde_json", ] @@ -608,7 +586,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bfa395ad5cc952c82358d31e4c68b27bf4a89a5456d9b27e226e77dac50e4ff" dependencies = [ - "alloy-primitives 0.8.19", + "alloy-primitives", "async-trait", "auto_impl", "elliptic-curve", @@ -624,7 +602,7 @@ checksum = "fbdc63ce9eda1283fcbaca66ba4a414b841c0e3edbeef9c86a71242fc9e84ccc" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-signer", "async-trait", "k256", @@ -632,52 +610,20 @@ dependencies = [ "thiserror 2.0.11", ] -[[package]] -name = "alloy-sol-macro" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b40397ddcdcc266f59f959770f601ce1280e699a91fc1862f29cef91707cd09" -dependencies = [ - "alloy-sol-macro-expander 0.7.7", - "alloy-sol-macro-input 0.7.7", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.96", -] - [[package]] name = "alloy-sol-macro" version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d039d267aa5cbb7732fa6ce1fd9b5e9e29368f580f80ba9d7a8450c794de4b2" dependencies = [ - "alloy-sol-macro-expander 0.8.19", - "alloy-sol-macro-input 0.8.19", + "alloy-sol-macro-expander", + "alloy-sol-macro-input", "proc-macro-error2", "proc-macro2", "quote", "syn 2.0.96", ] -[[package]] -name = "alloy-sol-macro-expander" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "867a5469d61480fea08c7333ffeca52d5b621f5ca2e44f271b117ec1fc9a0525" -dependencies = [ - "alloy-sol-macro-input 0.7.7", - "const-hex", - "heck 0.5.0", - "indexmap 2.7.1", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.96", - "syn-solidity 0.7.7", - "tiny-keccak", -] - [[package]] name = "alloy-sol-macro-expander" version = "0.8.19" @@ -685,7 +631,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "620ae5eee30ee7216a38027dec34e0585c55099f827f92f50d11e3d2d3a4a954" dependencies = [ "alloy-json-abi", - "alloy-sol-macro-input 0.8.19", + "alloy-sol-macro-input", "const-hex", "heck 0.5.0", "indexmap 2.7.1", @@ -693,25 +639,10 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn-solidity 0.8.19", + "syn-solidity", "tiny-keccak", ] -[[package]] -name = "alloy-sol-macro-input" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e482dc33a32b6fadbc0f599adea520bd3aaa585c141a80b404d0a3e3fa72528" -dependencies = [ - "const-hex", - "dunce", - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.96", - "syn-solidity 0.7.7", -] - [[package]] name = "alloy-sol-macro-input" version = "0.8.19" @@ -726,7 +657,7 @@ dependencies = [ "quote", "serde_json", "syn 2.0.96", - "syn-solidity 0.8.19", + "syn-solidity", ] [[package]] @@ -739,17 +670,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "alloy-sol-types" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" -dependencies = [ - "alloy-primitives 0.7.7", - "alloy-sol-macro 0.7.7", - "const-hex", -] - [[package]] name = "alloy-sol-types" version = "0.8.19" @@ -757,8 +677,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1382302752cd751efd275f4d6ef65877ddf61e0e6f5ac84ef4302b79a33a31a" dependencies = [ "alloy-json-abi", - "alloy-primitives 0.8.19", - "alloy-sol-macro 0.8.19", + "alloy-primitives", + "alloy-sol-macro", "const-hex", "serde", ] @@ -841,7 +761,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6917c79e837aa7b77b7a6dae9f89cbe15313ac161c4d3cfaf8909ef21f3d22d8" dependencies = [ - "alloy-primitives 0.8.19", + "alloy-primitives", "alloy-rlp", "arrayvec 0.7.6", "derive_more 1.0.0", @@ -10275,30 +10195,6 @@ dependencies = [ "sp-timestamp", ] -[[package]] -name = "pallet-token-gateway" -version = "1.15.1" -dependencies = [ - "alloy-primitives 0.7.7", - "alloy-sol-macro 0.7.7", - "alloy-sol-types 0.7.7", - "anyhow", - "frame-support", - "frame-system", - "ismp", - "log", - "pallet-hyperbridge", - "pallet-ismp", - "parity-scale-codec", - "primitive-types 0.12.2", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "tangle-primitives", - "token-gateway-primitives", -] - [[package]] name = "pallet-transaction-payment" version = "37.0.1" @@ -16051,18 +15947,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "syn-solidity" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c837dc8852cb7074e46b444afb81783140dab12c58867b49fb3898fbafedf7ea" -dependencies = [ - "paste", - "proc-macro2", - "quote", - "syn 2.0.96", -] - [[package]] name = "syn-solidity" version = "0.8.19" @@ -16809,27 +16693,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" -[[package]] -name = "token-gateway-primitives" -version = "1.15.1" -dependencies = [ - "alloy-primitives 0.7.7", - "alloy-sol-macro 0.7.7", - "alloy-sol-types 0.7.7", - "anyhow", - "frame-support", - "frame-system", - "ismp", - "log", - "pallet-ismp", - "parity-scale-codec", - "primitive-types 0.12.2", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", -] - [[package]] name = "tokio" version = "1.43.0" diff --git a/pallets/token-gateway/Cargo.toml b/pallets/token-gateway/Cargo.toml deleted file mode 100644 index 995e29624..000000000 --- a/pallets/token-gateway/Cargo.toml +++ /dev/null @@ -1,58 +0,0 @@ -[package] -name = "pallet-token-gateway" -version = "1.15.1" -edition = "2021" -description = "A substrate implementation of the token gateway protocol" -authors = ["Polytope Labs "] -license = "Apache-2.0" -repository = "https://github.com/polytope-labs/hyperbridge" -homepage = "https://docs.hyperbridge.network/developers/polkadot/tokengateway" -documentation = "https://docs.rs/pallet-token-gateway" -keywords = ["substrate", "polkadot-sdk", "ISMP", "interoperability", "pallet-assets"] -readme = "./README.md" - -[dependencies] -frame-support = { workspace = true } -frame-system = { workspace = true } -sp-runtime = { workspace = true } -sp-core = { workspace = true } -sp-io = { workspace = true } -primitive-types = { workspace = true } - -ismp = { workspace = true } -pallet-ismp = { workspace = true } - -log = { workspace = true } -parity-scale-codec = { workspace = true, default-features = false } -scale-info = { workspace = true } -anyhow = { workspace = true } - -alloy-primitives = { workspace = true } -alloy-sol-macro = { workspace = true } -alloy-sol-types = { workspace = true } - -token-gateway-primitives = { workspace = true, default-features = false } -pallet-hyperbridge = { workspace = true } -tangle-primitives = { workspace = true } - -[features] -default = ["std"] -std = [ - "parity-scale-codec/std", - "frame-support/std", - "frame-system/std", - "sp-runtime/std", - "sp-core/std", - "sp-io/std", - "primitive-types/std", - "ismp/std", - "pallet-ismp/std", - "log/std", - "scale-info/std", - "anyhow/std", - "alloy-primitives/std", - "pallet-hyperbridge/std", - "token-gateway-primitives/std", - "tangle-primitives/std", -] -try-runtime = [] \ No newline at end of file diff --git a/pallets/token-gateway/README.md b/pallets/token-gateway/README.md deleted file mode 100644 index 89571eeb5..000000000 --- a/pallets/token-gateway/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# Pallet Token Gateway - -This allows polkadot-sdk chains make cross-chain asset transfers to and from each other as well EVM chains using Hyperbridge. - -## Overview - -The Pallet allows the [`CreateOrigin`](https://docs.rs/pallet-token-gateway/latest/pallet_token_gateway/pallet/trait.Config.html#associatedtype.CreateOrigin) to dispatch calls for setting token gateway addresses, creating and updating assets. -This enables receiving assets from those configured chains. Assets can also be received with a runtime call to be dispatched. This call must be signed by the beneficiary of the incoming assets. Assets can also be sent with some calldata, this calldata is an opaque blob of bytes -whose interpretation is left up to the recipient token gateway implementation. For polkadot-sdk chains, it must be a scale-encoded runtime call, for EVM chains it must be an abi-encoded contract call. - -## Adding to Runtime - -The first step is to implement the pallet config for the runtime. - -```rust,ignore -use frame_support::parameter_types; -use ismp::module::IsmpModule; -use ismp::router::IsmpRouter; -use pallet_token_gateway::types::NativeAssetLocation; - -parameter_types! { - // Set the correct precision for the native currency - pub const Decimals: u8 = 12; -} - - -/// A constant value that represents the native asset -const NativeAssetId: u32 = 0; - - -/// Should provide an account that is funded and can be used to pay for asset creation -pub struct AssetAdmin; - -impl Get for AssetAdmin { - fn get() -> AccountId { - Treasury::account_id() - } -} - -impl pallet_token_gateway::Config for Runtime { - // configure the runtime event - type RuntimeEvent = RuntimeEvent; - // pallet_ismp or pallet_hyperbridge - type Dispatcher = pallet_hyperbridge::Pallet; - // Pallet Assets - type Assets = Assets; - // Pallet balances - type Currency = Balances; - // AssetAdmin account - type AssetAdmin = AssetAdmin; - // The Native asset Id - type NativeAssetId = NativeAssetId; - // The precision of the native asset - type Decimals = Decimals; -} - -// Add the pallet to your ISMP router to receive assets from external chains -#[derive(Default)] -struct Router; -impl IsmpRouter for Router { - fn module_for_id(&self, id: Vec) -> Result, anyhow::Error> { - let module = match id.as_slice() { - id if TokenGateway::is_token_gateway(&id) => Box::new(TokenGateway::default()), - _ => Err(Error::ModuleNotFound(id))? - }; - Ok(module) - } -} -``` - -## Setting up - -The pallet requires some setting up before the teleport function is available for use in the runtime. - -1. Register your native assets directly on `Hyperbridge` by dispatching `create_erc6160_asset`. -2. Set token gateway addresses for the EVM chains of interest by dispatching the `set_token_gateway_addresses` extrinsic. These addresses are used to validate incoming messages. - -## Dispatchable Functions - -- `teleport` - This function is used to bridge assets through Hyperbridge. -- `set_token_gateway_addresses` - This call allows the `AdminOrigin` origin to set the token gateway address for supported chains. -- `create_erc6160_asset` - This call dispatches a request to Hyperbridge to create multi chain native assets on token gateway deployments -- `update_erc6160_asset` - This priviledged call dispatches a request to Hyperbridge to update multi chain native assets on token gateway deployments -- `update_asset_precision` - This priviledged call is used to set or update the precision for an asset deployed on a remote chain - -## License - -This library is licensed under the Apache 2.0 License, Copyright (c) 2025 Polytope Labs. diff --git a/pallets/token-gateway/primitives/Cargo.toml b/pallets/token-gateway/primitives/Cargo.toml deleted file mode 100644 index 1caf10505..000000000 --- a/pallets/token-gateway/primitives/Cargo.toml +++ /dev/null @@ -1,52 +0,0 @@ -[package] -name = "token-gateway-primitives" -version = "1.15.1" -edition = "2021" -description = "A collection of types used by token gateway" -authors = ["Polytope Labs "] -license = "Apache-2.0" -repository = "https://github.com/polytope-labs/hyperbridge" -homepage = "https://docs.hyperbridge.network/developers/polkadot/tokengateway" -documentation = "https://docs.rs/pallet-token-gateway" -keywords = ["substrate", "polkadot-sdk", "ISMP", "interoperability", "pallet-assets"] -readme = "./README.md" - -[dependencies] -frame-support = { workspace = true } -frame-system = { workspace = true } -sp-runtime = { workspace = true } -sp-core = { workspace = true } -sp-io = { workspace = true } -primitive-types = { workspace = true } - -ismp = { workspace = true } -pallet-ismp = { workspace = true } - -log = { workspace = true } -parity-scale-codec = { workspace = true, default-features = false } -scale-info = { workspace = true } -anyhow = { workspace = true } - -alloy-primitives = { workspace = true } -alloy-sol-macro = { workspace = true } -alloy-sol-types = { workspace = true } - - -[features] -default = ["std"] -std = [ - "parity-scale-codec/std", - "frame-support/std", - "frame-system/std", - "sp-runtime/std", - "sp-core/std", - "sp-io/std", - "primitive-types/std", - "ismp/std", - "pallet-ismp/std", - "log/std", - "scale-info/std", - "anyhow/std", - "alloy-primitives/std", -] -try-runtime = [] \ No newline at end of file diff --git a/pallets/token-gateway/primitives/README.md b/pallets/token-gateway/primitives/README.md deleted file mode 100644 index 18ee0fd7f..000000000 --- a/pallets/token-gateway/primitives/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Token Gateway Primitives - -A collection of types used by [pallet-token-gateway](https://crates.io/crates/pallet-token-gateway) - -## License - -This library is licensed under the Apache 2.0 License, Copyright (c) 2025 Polytope Labs. diff --git a/pallets/token-gateway/primitives/src/lib.rs b/pallets/token-gateway/primitives/src/lib.rs deleted file mode 100644 index 02130e48d..000000000 --- a/pallets/token-gateway/primitives/src/lib.rs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (C) Polytope Labs Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#![doc = include_str!("../README.md")] -#![cfg_attr(not(feature = "std"), no_std)] - -use alloy_primitives::hex; -use ismp::host::StateMachine; -use sp_core::{ConstU32, H160, H256}; -use sp_runtime::BoundedVec; - -extern crate alloc; -use alloc::vec::Vec; -use parity_scale_codec::{Decode, Encode}; - -/// Pallet Token Governor's module ID for ISMP requests -pub const TOKEN_GOVERNOR_ID: [u8; 8] = *b"registry"; - -/// Pallet Token Gateway's module ID for ISMP requests -/// -/// Derived from `keccak_256(b"tokengty")[12..]` -pub const PALLET_TOKEN_GATEWAY_ID: [u8; 20] = hex!("a09b1c60e8650245f92518c8a17314878c4043ed"); - -/// Holds metadata relevant to a multi-chain native asset -#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, Default)] -pub struct AssetMetadata { - /// The asset name - pub name: BoundedVec>, - /// The asset symbol - pub symbol: BoundedVec>, - /// The asset decimals of the ERC6160 or ERC20 counterpart of this asset - pub decimals: u8, - /// Asset's minimum balance, only used by substrate chains - pub minimum_balance: Option, -} - -/// A struct for deregistering asset id on pallet-token-gateway -#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, Default)] -pub struct DeregisterAssets { - /// List of asset ids to deregister - pub asset_ids: Vec, -} - -/// Holds data required for multi-chain native asset registration -#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq)] -pub struct GatewayAssetRegistration { - /// The asset name - pub name: BoundedVec>, - /// The asset symbol - pub symbol: BoundedVec>, - /// The list of chains to create the asset on - pub chains: Vec, - /// Minimum balance for the asset, for substrate chains, - pub minimum_balance: Option, -} - -/// Allows a user to update their multi-chain native token potentially on multiple chains -#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, Default)] -pub struct GatewayAssetUpdate { - /// The asset identifier - pub asset_id: H256, - /// Chains to add support for the asset on - pub add_chains: BoundedVec>, - /// Chains to delist the asset from - pub remove_chains: BoundedVec>, - /// Chains to change the asset admin on - pub new_admins: BoundedVec<(StateMachine, H160), ConstU32<100>>, -} - -/// Holds data required for multi-chain native asset registration -#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq)] -pub enum RemoteERC6160AssetRegistration { - /// Asset creation message - CreateAsset(GatewayAssetRegistration), - /// Asset modification message - UpdateAsset(GatewayAssetUpdate), -} diff --git a/pallets/token-gateway/src/benchmarking.rs b/pallets/token-gateway/src/benchmarking.rs deleted file mode 100644 index 33a0ca755..000000000 --- a/pallets/token-gateway/src/benchmarking.rs +++ /dev/null @@ -1,163 +0,0 @@ -#![cfg(feature = "runtime-benchmarks")] - -use crate::{types::*, *}; -use frame_benchmarking::v2::*; -use frame_support::{ - traits::{fungible, fungibles, Currency}, - BoundedVec, -}; -use frame_system::RawOrigin; -use ismp::host::StateMachine; -use scale_info::prelude::collections::BTreeMap; -use sp_runtime::AccountId32; -use token_gateway_primitives::{GatewayAssetRegistration, GatewayAssetUpdate}; - -#[benchmarks( - where - <::NativeCurrency as Currency>::Balance: From, - ::AccountId: From<[u8; 32]>, - u128: From<<::NativeCurrency as Currency>::Balance>, - T::Balance: From, - ::Balance: From<<::NativeCurrency as Currency>::Balance>, - <::Assets as fungibles::Inspect>::Balance: From<<::NativeCurrency as Currency>::Balance>, - <::Assets as fungibles::Inspect>::Balance: From, - [u8; 32]: From<::AccountId>, - ::RuntimeOrigin: From>, -)] -mod benches { - use super::*; - - #[benchmark] - fn create_erc6160_asset(x: Linear<1, 100>) -> Result<(), BenchmarkError> { - let account: T::AccountId = whitelisted_caller(); - - let asset_details = GatewayAssetRegistration { - name: BoundedVec::try_from(b"Spectre".to_vec()).unwrap(), - symbol: BoundedVec::try_from(b"SPC".to_vec()).unwrap(), - chains: vec![StateMachine::Evm(100)], - minimum_balance: Some(10), - }; - - let mut precision = BTreeMap::new(); - for i in 0..x { - precision.insert(StateMachine::Evm(i as u32), 18); - } - - let asset = AssetRegistration { - local_id: T::NativeAssetId::get(), - reg: asset_details, - native: true, - precision, - }; - - >::set_balance(&account, u128::MAX.into()); - - #[extrinsic_call] - _(RawOrigin::Signed(account), asset); - - Ok(()) - } - - #[benchmark] - fn teleport() -> Result<(), BenchmarkError> { - let account: T::AccountId = whitelisted_caller(); - - let asset_id = T::NativeAssetId::get(); - - Pallet::::create_erc6160_asset( - RawOrigin::Signed(account.clone()).into(), - AssetRegistration { - local_id: asset_id.clone(), - reg: GatewayAssetRegistration { - name: BoundedVec::try_from(b"Spectre".to_vec()).unwrap(), - symbol: BoundedVec::try_from(b"SPC".to_vec()).unwrap(), - chains: vec![StateMachine::Evm(100)], - minimum_balance: None, - }, - native: true, - precision: vec![(StateMachine::Evm(100), 18)].into_iter().collect(), - }, - )?; - - let _ = T::NativeCurrency::deposit_creating(&account, u128::MAX.into()); - let teleport_params = TeleportParams { - asset_id, - destination: StateMachine::Evm(100), - recepient: H256::from([1u8; 32]), - amount: 10_000_000_000_000u128.into(), - timeout: 0, - token_gateway: vec![1, 2, 3, 4, 5], - relayer_fee: 0u128.into(), - call_data: None, - redeem: false, - }; - - #[extrinsic_call] - _(RawOrigin::Signed(account), teleport_params); - Ok(()) - } - - #[benchmark] - fn set_token_gateway_addresses(x: Linear<1, 100>) -> Result<(), BenchmarkError> { - let account: T::AccountId = whitelisted_caller(); - - let mut addresses = BTreeMap::new(); - for i in 0..x { - let addr = i.to_string().as_bytes().to_vec(); - addresses.insert(StateMachine::Evm(100), addr); - } - - #[extrinsic_call] - _(RawOrigin::Signed(account), addresses); - Ok(()) - } - - #[benchmark] - fn update_erc6160_asset() -> Result<(), BenchmarkError> { - let account: T::AccountId = whitelisted_caller(); - - let local_id = T::NativeAssetId::get(); - - Pallet::::create_erc6160_asset( - RawOrigin::Signed(account.clone()).into(), - AssetRegistration { - local_id, - reg: GatewayAssetRegistration { - name: BoundedVec::try_from(b"Spectre".to_vec()).unwrap(), - symbol: BoundedVec::try_from(b"SPC".to_vec()).unwrap(), - chains: vec![StateMachine::Evm(100)], - minimum_balance: None, - }, - native: true, - precision: Default::default(), - }, - )?; - - let asset_update = GatewayAssetUpdate { - asset_id: sp_io::hashing::keccak_256(b"SPC".as_ref()).into(), - add_chains: BoundedVec::try_from(vec![StateMachine::Evm(200)]).unwrap(), - remove_chains: BoundedVec::try_from(Vec::new()).unwrap(), - new_admins: BoundedVec::try_from(Vec::new()).unwrap(), - }; - - #[extrinsic_call] - _(RawOrigin::Signed(account), asset_update); - Ok(()) - } - - #[benchmark] - fn update_asset_precision(x: Linear<1, 100>) -> Result<(), BenchmarkError> { - let account: T::AccountId = whitelisted_caller(); - - let mut precisions = BTreeMap::new(); - for i in 0..x { - precisions.insert(StateMachine::Evm(i as u32), 18); - } - - let update = PrecisionUpdate { asset_id: T::NativeAssetId::get(), precisions }; - - #[extrinsic_call] - _(RawOrigin::Signed(account), update); - Ok(()) - } -} diff --git a/pallets/token-gateway/src/impls.rs b/pallets/token-gateway/src/impls.rs deleted file mode 100644 index 852c82c85..000000000 --- a/pallets/token-gateway/src/impls.rs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (C) Polytope Labs Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Pallet Implementations -use alloc::string::ToString; -use frame_support::PalletId; -use sp_core::U256; -use sp_runtime::traits::AccountIdConversion; -use token_gateway_primitives::PALLET_TOKEN_GATEWAY_ID; - -use crate::{Config, Pallet}; - -impl Pallet { - pub fn pallet_account() -> T::AccountId { - let mut inner = [0u8; 8]; - inner.copy_from_slice(&PALLET_TOKEN_GATEWAY_ID[0..8]); - PalletId(inner).into_account_truncating() - } - - pub fn is_token_gateway(id: &[u8]) -> bool { - id == &PALLET_TOKEN_GATEWAY_ID - } -} - -/// Converts an ERC20 U256 to a u128 -pub fn convert_to_balance( - value: U256, - erc_decimals: u8, - final_decimals: u8, -) -> Result { - let dec_str = (value - / U256::from(10u128.pow(erc_decimals.saturating_sub(final_decimals) as u32))) - .to_string(); - dec_str.parse().map_err(|e| anyhow::anyhow!("{e:?}")) -} - -/// Converts a u128 to an Erc20 denomination -pub fn convert_to_erc20(value: u128, erc_decimals: u8, decimals: u8) -> U256 { - U256::from(value) * U256::from(10u128.pow(erc_decimals.saturating_sub(decimals) as u32)) -} - -#[cfg(test)] -mod tests { - use sp_core::U256; - use sp_runtime::Permill; - use std::ops::Mul; - - use super::{convert_to_balance, convert_to_erc20}; - - #[test] - fn test_per_mill() { - let per_mill = Permill::from_parts(1_000); - - println!("{}", per_mill.mul(20_000_000u128)); - } - - #[test] - fn balance_conversions() { - let supposedly_small_u256 = U256::from_dec_str("1000000000000000000").unwrap(); - // convert erc20 value to dot value - let converted_balance = convert_to_balance(supposedly_small_u256, 18, 10).unwrap(); - println!("{}", converted_balance); - - let dot = 10_000_000_000u128; - - assert_eq!(converted_balance, dot); - - // Convert 1 dot to erc20 - - let dot = 10_000_000_000u128; - let erc_20_val = convert_to_erc20(dot, 18, 10); - assert_eq!(erc_20_val, U256::from_dec_str("1000000000000000000").unwrap()); - - // Convert 6 decimal ERC 20 - let supposedly_small_u256 = U256::from_dec_str("1000000000000000000").unwrap(); - // convert erc20 value to 18 decimal value - let converted_balance = convert_to_balance(supposedly_small_u256, 6, 18).unwrap(); - println!("{}", converted_balance); - } - - #[test] - fn max_value_check() { - let max = U256::MAX; - - let converted_balance = convert_to_balance(max, 18, 10); - assert!(converted_balance.is_err()) - } - - #[test] - fn min_value_check() { - let min = U256::from(1u128); - - let converted_balance = convert_to_balance(min, 18, 10).unwrap(); - assert_eq!(converted_balance, 0); - } -} diff --git a/pallets/token-gateway/src/lib.rs b/pallets/token-gateway/src/lib.rs deleted file mode 100644 index fef8fb2e6..000000000 --- a/pallets/token-gateway/src/lib.rs +++ /dev/null @@ -1,787 +0,0 @@ -// Copyright (C) Polytope Labs Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#![doc = include_str!("../README.md")] -#![cfg_attr(not(feature = "std"), no_std)] - -extern crate alloc; - -pub mod impls; -pub mod types; - -mod benchmarking; -mod weights; -use crate::impls::{convert_to_balance, convert_to_erc20}; -use alloy_sol_types::SolValue; -use anyhow::anyhow; -use frame_support::{ - ensure, - traits::{ - fungibles::{self, Mutate}, - tokens::{fungible::Mutate as FungibleMutate, Preservation}, - Currency, ExistenceRequirement, - }, -}; -use parity_scale_codec::{Decode, Encode}; -pub use weights::WeightInfo; - -use ismp::{ - events::Meta, - router::{PostRequest, Request, Response, Timeout}, -}; - -use sp_core::{Get, H160, U256}; -use sp_runtime::{traits::Dispatchable, MultiSignature}; -use token_gateway_primitives::{PALLET_TOKEN_GATEWAY_ID, TOKEN_GOVERNOR_ID}; -use types::{AssetId, Body, BodyWithCall, EvmToSubstrate, RequestBody, SubstrateCalldata}; - -use alloc::{string::ToString, vec, vec::Vec}; -use frame_system::RawOrigin; -use ismp::module::IsmpModule; -use primitive_types::H256; - -// Re-export pallet items so that they can be accessed from the crate namespace. -pub use pallet::*; - -#[frame_support::pallet] -pub mod pallet { - use alloc::collections::BTreeMap; - use pallet_hyperbridge::PALLET_HYPERBRIDGE; - use sp_runtime::traits::AccountIdConversion; - use types::{AssetRegistration, PrecisionUpdate, TeleportParams}; - - use super::*; - use frame_support::{ - pallet_prelude::*, - traits::{ - tokens::{Fortitude, Precision, Preservation}, - Currency, ExistenceRequirement, WithdrawReasons, - }, - }; - use frame_system::pallet_prelude::*; - use ismp::{ - dispatcher::{DispatchPost, DispatchRequest, FeeMetadata, IsmpDispatcher}, - host::StateMachine, - }; - use pallet_hyperbridge::{SubstrateHostParams, VersionedHostParams}; - use sp_runtime::traits::Zero; - use token_gateway_primitives::{GatewayAssetUpdate, RemoteERC6160AssetRegistration}; - - #[pallet::pallet] - #[pallet::without_storage_info] - pub struct Pallet(_); - - /// The pallet's configuration trait. - #[pallet::config] - pub trait Config: - frame_system::Config + pallet_ismp::Config + pallet_hyperbridge::Config - { - /// The overarching runtime event type. - type RuntimeEvent: From> + IsType<::RuntimeEvent>; - - /// The [`IsmpDispatcher`] for dispatching cross-chain requests - type Dispatcher: IsmpDispatcher; - - /// A currency implementation for interacting with the native asset - type NativeCurrency: Currency; - - /// A funded account that would be set as asset admin and also make payments for asset - /// creation - type AssetAdmin: Get; - - /// Account that is authorized to create and update assets. - type CreateOrigin: EnsureOrigin; - - /// Fungible asset implementation - type Assets: fungibles::Mutate - + fungibles::metadata::Mutate; - - /// The native asset ID - type NativeAssetId: Get>; - - /// The decimals of the native currency - #[pallet::constant] - type Decimals: Get; - - /// A trait that converts an evm address to a substrate account - /// Used for authenticating incoming cross-chain runtime calls. - type EvmToSubstrate: EvmToSubstrate; - - /// Weight information for extrinsics in this pallet - type WeightInfo: WeightInfo; - } - - /// Assets supported by this instance of token gateway - /// A map of the local asset id to the token gateway asset id - #[pallet::storage] - pub type SupportedAssets = - StorageMap<_, Blake2_128Concat, AssetId, H256, OptionQuery>; - - /// Assets that originate from this chain - #[pallet::storage] - pub type NativeAssets = - StorageMap<_, Blake2_128Concat, AssetId, bool, ValueQuery>; - - /// Assets supported by this instance of token gateway - /// A map of the token gateway asset id to the local asset id - #[pallet::storage] - pub type LocalAssets = StorageMap<_, Identity, H256, AssetId, OptionQuery>; - - /// The decimals used by the EVM counterpart of this asset - #[pallet::storage] - pub type Precisions = StorageDoubleMap< - _, - Blake2_128Concat, - AssetId, - Blake2_128Concat, - StateMachine, - u8, - OptionQuery, - >; - - /// The token gateway adresses on different chains - #[pallet::storage] - pub type TokenGatewayAddresses = - StorageMap<_, Blake2_128Concat, StateMachine, Vec, OptionQuery>; - - /// Pallet events that functions in this pallet can emit. - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] - pub enum Event { - /// An asset has been teleported - AssetTeleported { - /// Source account - from: T::AccountId, - /// beneficiary account on destination - to: H256, - /// Amount transferred - amount: >::Balance, - /// Destination chain - dest: StateMachine, - /// Request commitment - commitment: H256, - }, - - /// An asset has been received and transferred to the beneficiary's account - AssetReceived { - /// beneficiary account on relaychain - beneficiary: T::AccountId, - /// Amount transferred - amount: <::NativeCurrency as Currency>::Balance, - /// Destination chain - source: StateMachine, - }, - - /// An asset has been refunded and transferred to the beneficiary's account - AssetRefunded { - /// beneficiary account on relaychain - beneficiary: T::AccountId, - /// Amount transferred - amount: <::NativeCurrency as Currency>::Balance, - /// Destination chain - source: StateMachine, - }, - - /// ERC6160 asset creation request dispatched to hyperbridge - ERC6160AssetRegistrationDispatched { - /// Request commitment - commitment: H256, - }, - } - - /// Errors that can be returned by this pallet. - #[pallet::error] - pub enum Error { - /// A asset that has not been registered - UnregisteredAsset, - /// Error while teleporting asset - AssetTeleportError, - /// Coprocessor was not configured in the runtime - CoprocessorNotConfigured, - /// Asset or update Dispatch Error - DispatchError, - /// Asset Id creation failed - AssetCreationError, - /// Asset decimals not found - AssetDecimalsNotFound, - /// Protocol Params have not been initialized - NotInitialized, - /// Unknown Asset - UnknownAsset, - /// Only root or asset owner can update asset - NotAssetOwner, - } - - #[pallet::call] - impl Pallet - where - ::AccountId: From<[u8; 32]>, - u128: From<<::NativeCurrency as Currency>::Balance>, - ::Balance: - From<<::NativeCurrency as Currency>::Balance>, - <::Assets as fungibles::Inspect>::Balance: - From<<::NativeCurrency as Currency>::Balance>, - <::Assets as fungibles::Inspect>::Balance: From, - [u8; 32]: From<::AccountId>, - { - /// Teleports a registered asset - /// locks the asset and dispatches a request to token gateway on the destination - #[pallet::call_index(0)] - #[pallet::weight(T::WeightInfo::teleport())] - pub fn teleport( - origin: OriginFor, - params: TeleportParams< - AssetId, - <::NativeCurrency as Currency>::Balance, - >, - ) -> DispatchResult { - let who = ensure_signed(origin)?; - let dispatcher = ::Dispatcher::default(); - let asset_id = SupportedAssets::::get(params.asset_id.clone()) - .ok_or_else(|| Error::::UnregisteredAsset)?; - let decimals = if params.asset_id == T::NativeAssetId::get() { - // Custody funds in pallet - let is_native = NativeAssets::::get(T::NativeAssetId::get()); - if is_native { - ::NativeCurrency::transfer( - &who, - &Self::pallet_account(), - params.amount, - ExistenceRequirement::AllowDeath, - )?; - } else { - // Reduce total supply - let imbalance = ::NativeCurrency::burn(params.amount); - // Burn amount from account - ::NativeCurrency::settle( - &who, - imbalance, - WithdrawReasons::TRANSFER, - ExistenceRequirement::AllowDeath, - ) - .map_err(|_| Error::::AssetTeleportError)?; - } - - T::Decimals::get() - } else { - let is_native = NativeAssets::::get(params.asset_id.clone()); - if is_native { - ::Assets::transfer( - params.asset_id.clone(), - &who, - &Self::pallet_account(), - params.amount.into(), - Preservation::Expendable, - )?; - } else { - // Assets that do not originate from this chain are burned - ::Assets::burn_from( - params.asset_id.clone(), - &who, - params.amount.into(), - Preservation::Expendable, - Precision::Exact, - Fortitude::Polite, - )?; - } - - >::decimals( - params.asset_id.clone(), - ) - }; - - let to = params.recepient.0; - let from: [u8; 32] = who.clone().into(); - let erc_decimals = Precisions::::get(params.asset_id, params.destination) - .ok_or_else(|| Error::::AssetDecimalsNotFound)?; - - let body = match params.call_data { - Some(data) => { - let body = BodyWithCall { - amount: { - let amount: u128 = params.amount.into(); - let mut bytes = [0u8; 32]; - convert_to_erc20(amount, erc_decimals, decimals) - .to_big_endian(&mut bytes); - alloy_primitives::U256::from_be_bytes(bytes) - }, - asset_id: asset_id.0.into(), - redeem: params.redeem, - from: from.into(), - to: to.into(), - data: data.into(), - }; - - // Prefix with the handleIncomingAsset enum variant - let mut encoded = vec![0]; - encoded.extend_from_slice(&BodyWithCall::abi_encode(&body)); - encoded - }, - - None => { - let body = Body { - amount: { - let amount: u128 = params.amount.into(); - let mut bytes = [0u8; 32]; - convert_to_erc20(amount, erc_decimals, decimals) - .to_big_endian(&mut bytes); - alloy_primitives::U256::from_be_bytes(bytes) - }, - asset_id: asset_id.0.into(), - redeem: params.redeem, - from: from.into(), - to: to.into(), - }; - - // Prefix with the handleIncomingAsset enum variant - let mut encoded = vec![0]; - encoded.extend_from_slice(&Body::abi_encode(&body)); - encoded - }, - }; - - let dispatch_post = DispatchPost { - dest: params.destination, - from: PALLET_TOKEN_GATEWAY_ID.to_vec(), - to: params.token_gateway, - timeout: params.timeout, - body, - }; - - let metadata = FeeMetadata { payer: who.clone(), fee: params.relayer_fee.into() }; - let commitment = dispatcher - .dispatch_request(DispatchRequest::Post(dispatch_post), metadata) - .map_err(|_| Error::::AssetTeleportError)?; - - Self::deposit_event(Event::::AssetTeleported { - from: who, - to: params.recepient, - dest: params.destination, - amount: params.amount, - commitment, - }); - Ok(()) - } - - /// Set the token gateway address for specified chains - #[pallet::call_index(1)] - #[pallet::weight(T::WeightInfo::set_token_gateway_addresses(addresses.len() as u32))] - pub fn set_token_gateway_addresses( - origin: OriginFor, - addresses: BTreeMap>, - ) -> DispatchResult { - T::CreateOrigin::ensure_origin(origin)?; - for (chain, address) in addresses { - TokenGatewayAddresses::::insert(chain, address.clone()); - } - Ok(()) - } - - /// Registers a multi-chain ERC6160 asset. The asset should not already exist. - /// - /// This works by dispatching a request to the TokenGateway module on each requested chain - /// to create the asset. - /// `native` should be true if this asset originates from this chain - #[pallet::call_index(2)] - #[pallet::weight(T::WeightInfo::create_erc6160_asset(asset.precision.len() as u32))] - pub fn create_erc6160_asset( - origin: OriginFor, - asset: AssetRegistration>, - ) -> DispatchResult { - T::CreateOrigin::ensure_origin(origin)?; - let who = T::AssetAdmin::get(); - // charge hyperbridge fees - let VersionedHostParams::V1(SubstrateHostParams { asset_registration_fee, .. }) = - pallet_hyperbridge::Pallet::::host_params(); - - if asset_registration_fee != Zero::zero() { - T::Currency::transfer( - &who, - &PALLET_HYPERBRIDGE.into_account_truncating(), - asset_registration_fee.into(), - Preservation::Expendable, - )?; - } - - let asset_id: H256 = sp_io::hashing::keccak_256(asset.reg.symbol.as_ref()).into(); - // If the local asset id already exists we do not change it's metadata we only store - // the mapping to its token gateway asset id - - SupportedAssets::::insert(asset.local_id.clone(), asset_id.clone()); - NativeAssets::::insert(asset.local_id.clone(), asset.native); - LocalAssets::::insert(asset_id, asset.local_id.clone()); - for (state_machine, precision) in asset.precision { - Precisions::::insert(asset.local_id.clone(), state_machine, precision); - } - - let dispatcher = ::Dispatcher::default(); - let dispatch_post = DispatchPost { - dest: T::Coprocessor::get().ok_or_else(|| Error::::CoprocessorNotConfigured)?, - from: PALLET_TOKEN_GATEWAY_ID.to_vec(), - to: TOKEN_GOVERNOR_ID.to_vec(), - timeout: 0, - body: { RemoteERC6160AssetRegistration::CreateAsset(asset.reg).encode() }, - }; - - let metadata = FeeMetadata { payer: who, fee: Default::default() }; - - let commitment = dispatcher - .dispatch_request(DispatchRequest::Post(dispatch_post), metadata) - .map_err(|_| Error::::DispatchError)?; - Self::deposit_event(Event::::ERC6160AssetRegistrationDispatched { commitment }); - - Ok(()) - } - - /// Registers a multi-chain ERC6160 asset. The asset should not already exist. - /// - /// This works by dispatching a request to the TokenGateway module on each requested chain - /// to create the asset. - #[pallet::call_index(3)] - #[pallet::weight(T::WeightInfo::update_erc6160_asset())] - pub fn update_erc6160_asset( - origin: OriginFor, - asset: GatewayAssetUpdate, - ) -> DispatchResult { - T::CreateOrigin::ensure_origin(origin)?; - let who = T::AssetAdmin::get(); - - // charge hyperbridge fees - let VersionedHostParams::V1(SubstrateHostParams { asset_registration_fee, .. }) = - pallet_hyperbridge::Pallet::::host_params(); - - if asset_registration_fee != Zero::zero() { - T::Currency::transfer( - &who, - &PALLET_HYPERBRIDGE.into_account_truncating(), - asset_registration_fee.into(), - Preservation::Expendable, - )?; - } - - let dispatcher = ::Dispatcher::default(); - let dispatch_post = DispatchPost { - dest: T::Coprocessor::get().ok_or_else(|| Error::::CoprocessorNotConfigured)?, - from: PALLET_TOKEN_GATEWAY_ID.to_vec(), - to: TOKEN_GOVERNOR_ID.to_vec(), - timeout: 0, - body: { RemoteERC6160AssetRegistration::UpdateAsset(asset).encode() }, - }; - - let metadata = FeeMetadata { payer: who, fee: Default::default() }; - - let commitment = dispatcher - .dispatch_request(DispatchRequest::Post(dispatch_post), metadata) - .map_err(|_| Error::::DispatchError)?; - Self::deposit_event(Event::::ERC6160AssetRegistrationDispatched { commitment }); - - Ok(()) - } - - /// Update the precision for an existing asset - #[pallet::call_index(4)] - #[pallet::weight(T::WeightInfo::update_asset_precision(update.precisions.len() as u32))] - pub fn update_asset_precision( - origin: OriginFor, - update: PrecisionUpdate>, - ) -> DispatchResult { - T::CreateOrigin::ensure_origin(origin)?; - for (chain, precision) in update.precisions { - Precisions::::insert(update.asset_id.clone(), chain, precision); - } - Ok(()) - } - } - - // Hack for implementing the [`Default`] bound needed for - // [`IsmpDispatcher`](ismp::dispatcher::IsmpDispatcher) and - // [`IsmpModule`](ismp::module::IsmpModule) - impl Default for Pallet { - fn default() -> Self { - Self(PhantomData) - } - } -} - -impl IsmpModule for Pallet -where - ::AccountId: From<[u8; 32]>, - <::NativeCurrency as Currency>::Balance: From, - <::Assets as fungibles::Inspect>::Balance: From, -{ - fn on_accept( - &self, - PostRequest { body, from, source, dest, nonce, .. }: PostRequest, - ) -> Result<(), anyhow::Error> { - let expected = TokenGatewayAddresses::::get(source) - .ok_or_else(|| anyhow!("Not configured to receive assets from {source:?}"))?; - ensure!( - from == expected, - ismp::error::Error::ModuleDispatchError { - msg: "Token Gateway: Unknown source contract address".to_string(), - meta: Meta { source, dest, nonce }, - } - ); - - let body: RequestBody = if let Ok(body) = Body::abi_decode(&mut &body[1..], true) { - body.into() - } else if let Ok(body) = BodyWithCall::abi_decode(&mut &body[1..], true) { - body.into() - } else { - Err(anyhow!("Token Gateway: Failed to decode request body"))? - }; - - let local_asset_id = - LocalAssets::::get(H256::from(body.asset_id.0)).ok_or_else(|| { - ismp::error::Error::ModuleDispatchError { - msg: "Token Gateway: Unknown asset".to_string(), - meta: Meta { source, dest, nonce }, - } - })?; - - let decimals = if local_asset_id == T::NativeAssetId::get() { - T::Decimals::get() - } else { - >::decimals( - local_asset_id.clone(), - ) - }; - let erc_decimals = Precisions::::get(local_asset_id.clone(), source) - .ok_or_else(|| anyhow!("Asset decimals not configured"))?; - let amount = convert_to_balance( - U256::from_big_endian(&body.amount.to_be_bytes::<32>()), - erc_decimals, - decimals, - ) - .map_err(|_| ismp::error::Error::ModuleDispatchError { - msg: "Token Gateway: Trying to withdraw Invalid amount".to_string(), - meta: Meta { source, dest, nonce }, - })?; - let beneficiary: T::AccountId = body.to.0.into(); - if local_asset_id == T::NativeAssetId::get() { - let is_native = NativeAssets::::get(T::NativeAssetId::get()); - if is_native { - ::NativeCurrency::transfer( - &Pallet::::pallet_account(), - &beneficiary, - amount.into(), - ExistenceRequirement::AllowDeath, - ) - .map_err(|_| ismp::error::Error::ModuleDispatchError { - msg: "Token Gateway: Failed to complete asset transfer".to_string(), - meta: Meta { source, dest, nonce }, - })?; - } else { - // Increase total supply - let imbalance = ::NativeCurrency::issue(amount.into()); - // Mint into the beneficiary account - ::NativeCurrency::resolve_creating(&beneficiary, imbalance); - } - } else { - // Assets that do not originate from this chain are minted - let is_native = NativeAssets::::get(local_asset_id.clone()); - if is_native { - ::Assets::transfer( - local_asset_id, - &Pallet::::pallet_account(), - &beneficiary, - amount.into(), - Preservation::Expendable, - ) - .map_err(|_| ismp::error::Error::ModuleDispatchError { - msg: "Token Gateway: Failed to complete asset transfer".to_string(), - meta: Meta { source, dest, nonce }, - })?; - } else { - ::Assets::mint_into(local_asset_id, &beneficiary, amount.into()) - .map_err(|_| ismp::error::Error::ModuleDispatchError { - msg: "Token Gateway: Failed to complete asset transfer".to_string(), - meta: Meta { source, dest, nonce }, - })?; - } - } - - if let Some(call_data) = body.data { - let substrate_data = SubstrateCalldata::decode(&mut &call_data.0[..]) - .map_err(|err| anyhow!("Calldata decode error: {err:?}"))?; - // Verify signature against encoded runtime call - let nonce = frame_system::Pallet::::account_nonce(beneficiary.clone()); - let payload = (nonce, substrate_data.runtime_call.clone()).encode(); - let message = sp_io::hashing::keccak_256(&payload); - - let multi_signature = MultiSignature::decode(&mut &*substrate_data.signature) - .map_err(|err| anyhow!("Signature decode error: {err:?}"))?; - - match multi_signature { - MultiSignature::Ed25519(sig) => { - let pub_key = body.to.0.as_slice().try_into().map_err(|_| { - anyhow!("Failed to decode beneficiary as Ed25519 public key") - })?; - if !sp_io::crypto::ed25519_verify(&sig, message.as_ref(), &pub_key) { - Err(anyhow!( - "Failed to verify ed25519 signature before dispatching token gateway call" - ))? - } - }, - MultiSignature::Sr25519(sig) => { - let pub_key = body.to.0.as_slice().try_into().map_err(|_| { - anyhow!("Failed to decode beneficiary as Sr25519 public key") - })?; - if !sp_io::crypto::sr25519_verify(&sig, message.as_ref(), &pub_key) { - Err(anyhow!( - "Failed to verify sr25519 signature before dispatching token gateway call" - ))? - } - }, - MultiSignature::Ecdsa(sig) => { - let pub_key = sp_io::crypto::secp256k1_ecdsa_recover(&sig.0, &message) - .map_err(|_| { - anyhow!("Failed to recover ecdsa public key from signature") - })?; - let eth_address = - H160::from_slice(&sp_io::hashing::keccak_256(&pub_key[..])[12..]); - let substrate_account = T::EvmToSubstrate::convert(eth_address); - if substrate_account != beneficiary { - Err(anyhow!( - "Failed to verify signature before dispatching token gateway call" - ))? - } - }, - } - - let runtime_call = T::RuntimeCall::decode(&mut &*substrate_data.runtime_call) - .map_err(|err| anyhow!("RuntimeCall decode error: {err:?}"))?; - runtime_call - .dispatch(RawOrigin::Signed(beneficiary.clone()).into()) - .map_err(|e| anyhow!("Call dispatch executed with error {:?}", e.error))?; - // Increase account nonce to ensure the call cannot be replayed - frame_system::Pallet::::inc_account_nonce(beneficiary.clone()); - } - - Self::deposit_event(Event::::AssetReceived { - beneficiary, - amount: amount.into(), - source, - }); - Ok(()) - } - - fn on_response(&self, _response: Response) -> Result<(), anyhow::Error> { - Err(anyhow!("Module does not accept responses".to_string())) - } - - fn on_timeout(&self, request: Timeout) -> Result<(), anyhow::Error> { - match request { - Timeout::Request(Request::Post(PostRequest { body, source, dest, nonce, .. })) => { - let body: RequestBody = if let Ok(body) = Body::abi_decode(&mut &body[1..], true) { - body.into() - } else if let Ok(body) = BodyWithCall::abi_decode(&mut &body[1..], true) { - body.into() - } else { - Err(anyhow!("Token Gateway: Failed to decode request body"))? - }; - let beneficiary = body.from.0.into(); - let local_asset_id = LocalAssets::::get(H256::from(body.asset_id.0)) - .ok_or_else(|| ismp::error::Error::ModuleDispatchError { - msg: "Token Gateway: Unknown asset".to_string(), - meta: Meta { source, dest, nonce }, - })?; - let decimals = if local_asset_id == T::NativeAssetId::get() { - T::Decimals::get() - } else { - >::decimals( - local_asset_id.clone(), - ) - }; - let erc_decimals = Precisions::::get(local_asset_id.clone(), dest) - .ok_or_else(|| anyhow!("Asset decimals not configured"))?; - let amount = convert_to_balance( - U256::from_big_endian(&body.amount.to_be_bytes::<32>()), - erc_decimals, - decimals, - ) - .map_err(|_| ismp::error::Error::ModuleDispatchError { - msg: "Token Gateway: Trying to withdraw Invalid amount".to_string(), - meta: Meta { source, dest, nonce }, - })?; - - if local_asset_id == T::NativeAssetId::get() { - let is_native = NativeAssets::::get(T::NativeAssetId::get()); - if is_native { - ::NativeCurrency::transfer( - &Pallet::::pallet_account(), - &beneficiary, - amount.into(), - ExistenceRequirement::AllowDeath, - ) - .map_err(|_| ismp::error::Error::ModuleDispatchError { - msg: "Token Gateway: Failed to complete asset transfer".to_string(), - meta: Meta { source, dest, nonce }, - })?; - } else { - let imbalance = ::NativeCurrency::issue(amount.into()); - ::NativeCurrency::resolve_creating(&beneficiary, imbalance); - } - } else { - // Assets that do not originate from this chain are minted - let is_native = NativeAssets::::get(local_asset_id.clone()); - if is_native { - ::Assets::transfer( - local_asset_id, - &Pallet::::pallet_account(), - &beneficiary, - amount.into(), - Preservation::Expendable, - ) - .map_err(|_| ismp::error::Error::ModuleDispatchError { - msg: "Token Gateway: Failed to complete asset transfer".to_string(), - meta: Meta { source, dest, nonce }, - })?; - } else { - ::Assets::mint_into( - local_asset_id, - &beneficiary, - amount.into(), - ) - .map_err(|_| ismp::error::Error::ModuleDispatchError { - msg: "Token Gateway: Failed to complete asset transfer".to_string(), - meta: Meta { source, dest, nonce }, - })?; - } - } - - Pallet::::deposit_event(Event::::AssetRefunded { - beneficiary, - amount: amount.into(), - source: dest, - }); - }, - Timeout::Request(Request::Get(get)) => Err(ismp::error::Error::ModuleDispatchError { - msg: "Tried to timeout unsupported request type".to_string(), - meta: Meta { source: get.source, dest: get.dest, nonce: get.nonce }, - })?, - - Timeout::Response(response) => Err(ismp::error::Error::ModuleDispatchError { - msg: "Tried to timeout unsupported request type".to_string(), - meta: Meta { - source: response.source_chain(), - dest: response.dest_chain(), - nonce: response.nonce(), - }, - })?, - } - Ok(()) - } -} diff --git a/pallets/token-gateway/src/types.rs b/pallets/token-gateway/src/types.rs deleted file mode 100644 index e8651b755..000000000 --- a/pallets/token-gateway/src/types.rs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (C) Polytope Labs Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Pallet types - -use alloc::{collections::BTreeMap, vec::Vec}; -use frame_support::{pallet_prelude::*, traits::fungibles}; -use ismp::host::StateMachine; -use primitive_types::H256; -use sp_core::H160; - -use crate::Config; - -pub type AssetId = - <::Assets as fungibles::Inspect<::AccountId>>::AssetId; - -/// Asset teleportation parameters -#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq)] -pub struct TeleportParams { - /// Asset Id registered on Hyperbridge - pub asset_id: AssetId, - /// Destination state machine - pub destination: StateMachine, - /// Receiving account on destination - pub recepient: H256, - /// Amount to be sent - pub amount: Balance, - /// Request timeout - pub timeout: u64, - /// Token gateway address - pub token_gateway: Vec, - /// Relayer fee - pub relayer_fee: Balance, - /// Optional call data to be executed on the destination chain - pub call_data: Option>, - /// Redeem native erc20 assets - pub redeem: bool, -} - -/// Local asset Id and its corresponding token gateway asset id -#[derive(Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, RuntimeDebug)] -pub struct AssetRegistration { - /// Local Asset Id should already exist - pub local_id: AssetId, - /// MNT Asset registration details - pub reg: token_gateway_primitives::GatewayAssetRegistration, - /// Flag that asserts if this asset is custodied and originally minted on this chain - pub native: bool, - /// Precision of asset on supported chains - pub precision: BTreeMap, -} - -/// Update the precision of an asset -#[derive(Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, RuntimeDebug)] -pub struct PrecisionUpdate { - /// Asset Id - pub asset_id: AssetId, - /// New precisions - pub precisions: BTreeMap, -} - -alloy_sol_macro::sol! { - #![sol(all_derives)] - struct Body { - // Amount of the asset to be sent - uint256 amount; - // The asset identifier - bytes32 asset_id; - // Flag to redeem the erc20 asset on the destination - bool redeem; - // Sender address - bytes32 from; - // Recipient address - bytes32 to; - } - - struct BodyWithCall { - // Amount of the asset to be sent - uint256 amount; - // The asset identifier - bytes32 asset_id; - // Flag to redeem the erc20 asset on the destination - bool redeem; - // Sender address - bytes32 from; - // Recipient address - bytes32 to; - // Calldata to be passed to the asset destination - bytes data; - } -} - -#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq)] -pub struct SubstrateCalldata { - /// A scale encoded encoded [MultiSignature](sp_runtime::MultiSignature) of the beneficiary's - /// account nonce and the encoded runtime call - pub signature: Vec, - /// Encoded Runtime call that should be executed - pub runtime_call: Vec, -} - -/// Type that encapsulates both types of token gateway request bodies -pub struct RequestBody { - pub amount: alloy_primitives::U256, - pub asset_id: alloy_primitives::FixedBytes<32>, - pub redeem: bool, - pub from: alloy_primitives::FixedBytes<32>, - pub to: alloy_primitives::FixedBytes<32>, - pub data: Option, -} - -impl From for RequestBody { - fn from(value: Body) -> Self { - RequestBody { - amount: value.amount, - asset_id: value.asset_id, - redeem: value.redeem, - from: value.from, - to: value.to, - data: None, - } - } -} - -impl From for RequestBody { - fn from(value: BodyWithCall) -> Self { - RequestBody { - amount: value.amount, - asset_id: value.asset_id, - redeem: value.redeem, - from: value.from, - to: value.to, - data: Some(value.data), - } - } -} - -pub trait EvmToSubstrate { - fn convert(addr: H160) -> T::AccountId; -} - -impl EvmToSubstrate for () -where - ::AccountId: From<[u8; 32]>, -{ - fn convert(addr: H160) -> ::AccountId { - let mut account = [0u8; 32]; - account[12..].copy_from_slice(&addr.0); - account.into() - } -} diff --git a/pallets/token-gateway/src/weights.rs b/pallets/token-gateway/src/weights.rs deleted file mode 100644 index a2e759dfa..000000000 --- a/pallets/token-gateway/src/weights.rs +++ /dev/null @@ -1,33 +0,0 @@ -use frame_support::weights::Weight; - -// ============================== INTERFACE ============================================ // -/// Weight functions needed for `pallet_token_gateway. -pub trait WeightInfo { - fn create_erc6160_asset(x: u32) -> Weight; - fn teleport() -> Weight; - fn set_token_gateway_addresses(x: u32) -> Weight; - fn update_erc6160_asset() -> Weight; - fn update_asset_precision(x: u32) -> Weight; -} - -impl WeightInfo for () { - fn create_erc6160_asset(_x: u32) -> Weight { - Weight::zero() - } - - fn teleport() -> Weight { - Weight::zero() - } - - fn set_token_gateway_addresses(_x: u32) -> Weight { - Weight::zero() - } - - fn update_erc6160_asset() -> Weight { - Weight::zero() - } - - fn update_asset_precision(_x: u32) -> Weight { - Weight::zero() - } -} From 7a16a145027df000203dcb6e27226f5d0ed7b93f Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Sat, 25 Jan 2025 17:00:14 +0900 Subject: [PATCH 04/16] chore: fix commit hash --- Cargo.lock | 64 +++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed4613e73..dfc37d04b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4112,7 +4112,7 @@ dependencies = [ [[package]] name = "fc-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "async-trait", "fp-storage", @@ -4124,7 +4124,7 @@ dependencies = [ [[package]] name = "fc-cli" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "clap", "ethereum-types", @@ -4142,7 +4142,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "async-trait", "fp-consensus", @@ -4158,7 +4158,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "async-trait", "ethereum", @@ -4188,7 +4188,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "fc-db", "fc-storage", @@ -4211,7 +4211,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "ethereum", "ethereum-types", @@ -4265,7 +4265,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "ethereum", "ethereum-types", @@ -4280,7 +4280,7 @@ dependencies = [ [[package]] name = "fc-storage" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "ethereum", "ethereum-types", @@ -4525,7 +4525,7 @@ dependencies = [ [[package]] name = "fp-account" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "hex", "impl-serde 0.4.0", @@ -4544,7 +4544,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "ethereum", "parity-scale-codec", @@ -4555,7 +4555,7 @@ dependencies = [ [[package]] name = "fp-dynamic-fee" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "async-trait", "sp-core", @@ -4565,7 +4565,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "ethereum", "ethereum-types", @@ -4577,7 +4577,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "evm", "frame-support", @@ -4592,7 +4592,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "ethereum", "ethereum-types", @@ -4608,7 +4608,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "frame-support", "parity-scale-codec", @@ -4620,7 +4620,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "parity-scale-codec", "serde", @@ -8700,7 +8700,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "fp-evm", "frame-support", @@ -8782,7 +8782,7 @@ dependencies = [ [[package]] name = "pallet-dynamic-fee" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "fp-dynamic-fee", "fp-evm", @@ -8850,7 +8850,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "ethereum", "ethereum-types", @@ -8872,7 +8872,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "environmental", "evm", @@ -8895,7 +8895,7 @@ dependencies = [ [[package]] name = "pallet-evm-chain-id" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "frame-support", "frame-system", @@ -8956,7 +8956,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-blake2" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "fp-evm", ] @@ -8964,7 +8964,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-bn128" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "fp-evm", "sp-core", @@ -8999,7 +8999,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-curve25519" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "curve25519-dalek", "fp-evm", @@ -9034,7 +9034,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-dispatch" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "fp-evm", "frame-support", @@ -9046,7 +9046,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-ed25519" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "ed25519-dalek", "fp-evm", @@ -9055,7 +9055,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "fp-evm", "num", @@ -9271,7 +9271,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "fp-evm", "tiny-keccak", @@ -9280,7 +9280,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "fp-evm", "ripemd", @@ -9581,7 +9581,7 @@ dependencies = [ [[package]] name = "pallet-hotfix-sufficients" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -10957,7 +10957,7 @@ dependencies = [ [[package]] name = "precompile-utils" version = "0.1.0" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "derive_more 0.99.18", "environmental", @@ -10986,7 +10986,7 @@ dependencies = [ [[package]] name = "precompile-utils-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" +source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" dependencies = [ "case", "num_enum", From 20aac66ba08ec449ea7372f3ae81cefa9c57a2d0 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Sun, 26 Jan 2025 17:13:55 +0900 Subject: [PATCH 05/16] chore: fix dep link --- Cargo.lock | 64 +++++++++++++++++++++++++++--------------------------- Cargo.toml | 64 +++++++++++++++++++++++++++--------------------------- 2 files changed, 64 insertions(+), 64 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dfc37d04b..bcbcb3272 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4112,7 +4112,7 @@ dependencies = [ [[package]] name = "fc-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "async-trait", "fp-storage", @@ -4124,7 +4124,7 @@ dependencies = [ [[package]] name = "fc-cli" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "clap", "ethereum-types", @@ -4142,7 +4142,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "async-trait", "fp-consensus", @@ -4158,7 +4158,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "async-trait", "ethereum", @@ -4188,7 +4188,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "fc-db", "fc-storage", @@ -4211,7 +4211,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "ethereum", "ethereum-types", @@ -4265,7 +4265,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "ethereum", "ethereum-types", @@ -4280,7 +4280,7 @@ dependencies = [ [[package]] name = "fc-storage" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "ethereum", "ethereum-types", @@ -4525,7 +4525,7 @@ dependencies = [ [[package]] name = "fp-account" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "hex", "impl-serde 0.4.0", @@ -4544,7 +4544,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "ethereum", "parity-scale-codec", @@ -4555,7 +4555,7 @@ dependencies = [ [[package]] name = "fp-dynamic-fee" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "async-trait", "sp-core", @@ -4565,7 +4565,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "ethereum", "ethereum-types", @@ -4577,7 +4577,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "evm", "frame-support", @@ -4592,7 +4592,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "ethereum", "ethereum-types", @@ -4608,7 +4608,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "frame-support", "parity-scale-codec", @@ -4620,7 +4620,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "parity-scale-codec", "serde", @@ -8700,7 +8700,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "fp-evm", "frame-support", @@ -8782,7 +8782,7 @@ dependencies = [ [[package]] name = "pallet-dynamic-fee" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "fp-dynamic-fee", "fp-evm", @@ -8850,7 +8850,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "ethereum", "ethereum-types", @@ -8872,7 +8872,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "environmental", "evm", @@ -8895,7 +8895,7 @@ dependencies = [ [[package]] name = "pallet-evm-chain-id" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "frame-support", "frame-system", @@ -8956,7 +8956,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-blake2" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "fp-evm", ] @@ -8964,7 +8964,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-bn128" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "fp-evm", "sp-core", @@ -8999,7 +8999,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-curve25519" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "curve25519-dalek", "fp-evm", @@ -9034,7 +9034,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-dispatch" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "fp-evm", "frame-support", @@ -9046,7 +9046,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-ed25519" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "ed25519-dalek", "fp-evm", @@ -9055,7 +9055,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "fp-evm", "num", @@ -9271,7 +9271,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "fp-evm", "tiny-keccak", @@ -9280,7 +9280,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "fp-evm", "ripemd", @@ -9581,7 +9581,7 @@ dependencies = [ [[package]] name = "pallet-hotfix-sufficients" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "frame-benchmarking", "frame-support", @@ -10957,7 +10957,7 @@ dependencies = [ [[package]] name = "precompile-utils" version = "0.1.0" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "derive_more 0.99.18", "environmental", @@ -10986,7 +10986,7 @@ dependencies = [ [[package]] name = "precompile-utils-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/frontier.git?branch=stable2407#fb9b95d64aa442a1ce6ffba51777243729a783c9" +source = "git+https://github.com/polkadot-evm/frontier?branch=stable2407#2e219e17a526125da003e64ef22ec037917083fa" dependencies = [ "case", "num_enum", diff --git a/Cargo.toml b/Cargo.toml index 572512092..4c57a2671 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -270,48 +270,48 @@ sp-state-machine = { git = "https://github.com/paritytech/polkadot-sdk", branch sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false } # Frontier Client -fc-cli = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -fc-consensus = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407" } -fc-db = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -fc-mapping-sync = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -fc-rpc = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -fc-rpc-core = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407" } -fc-storage = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407" } -fc-api = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } +fc-cli = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +fc-consensus = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407" } +fc-db = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +fc-mapping-sync = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +fc-rpc = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +fc-rpc-core = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407" } +fc-storage = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407" } +fc-api = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } # Frontier Primitive -fp-account = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false, features = [ +fp-account = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false, features = [ "serde", ] } -fp-consensus = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -fp-dynamic-fee = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -fp-ethereum = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -fp-evm = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false, features = [ +fp-consensus = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +fp-dynamic-fee = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +fp-ethereum = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +fp-evm = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false, features = [ "serde", ] } -fp-rpc = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -fp-self-contained = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false, features = [ +fp-rpc = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +fp-self-contained = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false, features = [ "serde", ] } -fp-storage = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } +fp-storage = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } # Frontier FRAME -pallet-base-fee = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -pallet-dynamic-fee = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -pallet-ethereum = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -pallet-evm = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -pallet-evm-chain-id = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -pallet-evm-precompile-blake2 = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -pallet-evm-precompile-bn128 = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -pallet-evm-precompile-curve25519 = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -pallet-evm-precompile-dispatch = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -pallet-evm-precompile-ed25519 = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -pallet-evm-precompile-modexp = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -pallet-evm-precompile-sha3fips = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -pallet-evm-precompile-simple = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -pallet-evm-test-vector-support = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407" } -pallet-hotfix-sufficients = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } -precompile-utils = { git = "https://github.com/paritytech/frontier.git", branch = "stable2407", default-features = false } +pallet-base-fee = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +pallet-dynamic-fee = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +pallet-ethereum = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +pallet-evm = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +pallet-evm-chain-id = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +pallet-evm-precompile-blake2 = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +pallet-evm-precompile-bn128 = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +pallet-evm-precompile-curve25519 = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +pallet-evm-precompile-dispatch = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +pallet-evm-precompile-ed25519 = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +pallet-evm-precompile-modexp = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +pallet-evm-precompile-sha3fips = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +pallet-evm-precompile-simple = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +pallet-evm-test-vector-support = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407" } +pallet-hotfix-sufficients = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } +precompile-utils = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2407", default-features = false } # Local precompiles evm-erc20-utils = { path = "precompiles/erc20-utils", default-features = false } From 4da1c794000ab0e2acc9df669b6364a6a8c2a5c1 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Wed, 19 Feb 2025 19:51:47 -0700 Subject: [PATCH 06/16] chore: remove unused trait --- primitives/src/traits/assets.rs | 6 ------ runtime/testnet/src/hyperbridge.rs | 3 ++- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/primitives/src/traits/assets.rs b/primitives/src/traits/assets.rs index 50e0a13ea..3bec28eab 100644 --- a/primitives/src/traits/assets.rs +++ b/primitives/src/traits/assets.rs @@ -3,9 +3,3 @@ pub trait NextAssetId { /// Get the next available asset ID fn next_asset_id() -> Option; } - -/// A mapping between CurrencyId and AssetMetadata. -pub trait AssetIdMapping { - /// Returns the AssetMetadata associated with a given `AssetIds`. - fn get_asset_metadata(asset_id: AssetId) -> Option; -} diff --git a/runtime/testnet/src/hyperbridge.rs b/runtime/testnet/src/hyperbridge.rs index 857c4bebc..58fcc45b6 100644 --- a/runtime/testnet/src/hyperbridge.rs +++ b/runtime/testnet/src/hyperbridge.rs @@ -1,5 +1,6 @@ -// This file is part of Bifrost. +// This file is part of Tangle. +// Copyright (C) Tangle Foundation // Copyright (C) Liebi Technologies PTE. LTD. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 From 826a72e2ecea5e786d594c239216b4eff0b69f5d Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Wed, 19 Feb 2025 20:37:43 -0700 Subject: [PATCH 07/16] chore: fix state machine id --- runtime/testnet/src/hyperbridge.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/testnet/src/hyperbridge.rs b/runtime/testnet/src/hyperbridge.rs index 58fcc45b6..cd1ecdf13 100644 --- a/runtime/testnet/src/hyperbridge.rs +++ b/runtime/testnet/src/hyperbridge.rs @@ -34,7 +34,7 @@ parameter_types! { // The hyperbridge parachain on Polkadot pub const Coprocessor: Option = Some(StateMachine::Polkadot(3367)); // The host state machine of this pallet, your state machine id goes here - pub const HostStateMachine: StateMachine = StateMachine::Polkadot(2030); // polkadot + pub const HostStateMachine: StateMachine = StateMachine::Substrate(5845u32.to_be_bytes()); } impl pallet_ismp::Config for Runtime { From 63d44ade7068151829c406fbe2646b524b9f4323 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Thu, 20 Feb 2025 20:21:09 -0700 Subject: [PATCH 08/16] chore: update branch --- Cargo.lock | 205 ++++++++++++++++------------------------------------- Cargo.toml | 12 ++-- 2 files changed, 68 insertions(+), 149 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8792f86fe..a2fa0e2d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1477,7 +1477,7 @@ checksum = "d0324df9ce91a9840632e865dd3272bd20162023856f1b189b7ae58afa5c6b61" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "frame-support 38.2.0", "frame-system 38.0.0", "pallet-assets 40.0.0", @@ -1505,7 +1505,7 @@ version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c540587f89a03003946b14decef4fcadb083edc4e62f968de245b82e5402e923" dependencies = [ - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "frame-support 38.2.0", "impl-trait-for-tuples", "log", @@ -2290,7 +2290,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c31b53c53d627e2da38f8910807944bf3121e154b5c0ac9e122995af9dfb13ed" dependencies = [ - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "frame-support 38.2.0", "pallet-message-queue", "parity-scale-codec", @@ -3353,7 +3353,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97263a8e758d201ebe81db7cea7b278b4fb869c11442f77acef70138ac1a252f" dependencies = [ - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "frame-benchmarking 38.0.0", "frame-support 38.2.0", "frame-system 38.0.0", @@ -3373,7 +3373,7 @@ checksum = "546403ee1185f4051a74cc9c9d76e82c63cac3fb68e1bf29f61efb5604c96488" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-primitives-proof-size-hostfunction", "environmental", @@ -3384,7 +3384,7 @@ dependencies = [ "log", "pallet-message-queue", "parity-scale-codec", - "polkadot-parachain-primitives 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-parachain-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", "scale-info", @@ -3450,7 +3450,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e49231f6cd8274438b078305dc8ce44c54c0d3f4a28e902589bcbaa53d954608" dependencies = [ - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "frame-support 38.2.0", "frame-system 38.0.0", "parity-scale-codec", @@ -3468,7 +3468,7 @@ checksum = "6f788bdac9474795ea13ba791b55798fb664b2e3da8c3a7385b480c9af4e6539" dependencies = [ "bounded-collections", "bp-xcm-bridge-hub-router", - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "frame-benchmarking 38.0.0", "frame-support 38.2.0", "frame-system 38.0.0", @@ -3493,7 +3493,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f47128f797359951723e2d106a80e592d007bb7446c299958cdbafb1489ddbf0" dependencies = [ "cumulus-pallet-xcm", - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "frame-support 38.2.0", "frame-system 38.0.0", "parity-scale-codec", @@ -3509,29 +3509,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11e7825bcf3cc6c962a5b9b9f47e02dc381109e521d0bc00cad785c65da18471" dependencies = [ "parity-scale-codec", - "polkadot-core-primitives 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-primitives 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-core-primitives", + "polkadot-primitives 15.0.0", "sp-api 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-consensus-aura 0.40.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-runtime 39.0.5", ] -[[package]] -name = "cumulus-primitives-core" -version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#7642d6b5dea6dd7871ef8bbfcb9d48ba8a8b0f77" -dependencies = [ - "parity-scale-codec", - "polkadot-core-primitives 15.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "polkadot-parachain-primitives 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "polkadot-primitives 15.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "scale-info", - "sp-api 34.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "sp-runtime 39.0.3", - "sp-trie 37.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "staging-xcm 14.1.0", -] - [[package]] name = "cumulus-primitives-core" version = "0.16.0" @@ -3539,8 +3523,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c6b5221a4a3097f2ebef66c84c1e6d7a0b8ec7e63f2bd5ae04c1e6d3fc7514e" dependencies = [ "parity-scale-codec", - "polkadot-core-primitives 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-parachain-primitives 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-core-primitives", + "polkadot-parachain-primitives", "polkadot-primitives 16.0.0", "scale-info", "sp-api 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3556,7 +3540,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "842a694901e04a62d88995418dec35c22f7dba2b34d32d2b8de37d6b92f973ff" dependencies = [ "async-trait", - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "parity-scale-codec", "scale-info", "sp-core 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3581,7 +3565,7 @@ version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fc49dfec0ba3438afad73787736cc0dba88d15b5855881f12a4d8b812a72927" dependencies = [ - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "cumulus-primitives-proof-size-hostfunction", "docify", "frame-support 38.2.0", @@ -3598,7 +3582,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33cffb8f010f39ac36b31d38994b8f9d9256d9b5e495d96b4ec59d3e30852d53" dependencies = [ - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "sp-inherents 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-timestamp 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3609,7 +3593,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bdcf4d46dd93f1e6d5dd6d379133566a44042ba6476d04bdcbdb4981c622ae4" dependencies = [ - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "frame-support 38.2.0", "log", "pallet-asset-conversion", @@ -3627,7 +3611,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e570e41c3f05a8143ebff967bbb0c7dcaaa6f0bebd8639b9418b8005b13eda03" dependencies = [ - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "parity-scale-codec", "polkadot-primitives 16.0.0", "sp-runtime 39.0.5", @@ -6621,8 +6605,8 @@ dependencies = [ [[package]] name = "grandpa-verifier" -version = "0.1.1" -source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +version = "0.1.2" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407-1#4c58d522274dadcf4b1fbe8a931d1ebf15df26b8" dependencies = [ "anyhow", "derive_more 0.99.19", @@ -6643,8 +6627,8 @@ dependencies = [ [[package]] name = "grandpa-verifier-primitives" -version = "0.1.1" -source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +version = "0.1.2" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407-1#4c58d522274dadcf4b1fbe8a931d1ebf15df26b8" dependencies = [ "anyhow", "finality-grandpa", @@ -7559,7 +7543,7 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "ismp" version = "0.2.2" -source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407-1#4c58d522274dadcf4b1fbe8a931d1ebf15df26b8" dependencies = [ "anyhow", "derive_more 1.0.0", @@ -7575,11 +7559,11 @@ dependencies = [ [[package]] name = "ismp-grandpa" -version = "1.15.3" -source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +version = "15.0.1" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407-1#4c58d522274dadcf4b1fbe8a931d1ebf15df26b8" dependencies = [ + "anyhow", "ckb-merkle-mountain-range", - "cumulus-primitives-core 0.15.0", "finality-grandpa", "frame-support 37.1.0", "frame-system 37.1.0", @@ -7594,6 +7578,7 @@ dependencies = [ "sp-core 34.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", "sp-io 38.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", "sp-runtime 39.0.3", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", "sp-trie 37.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", "substrate-state-machine", ] @@ -9958,7 +9943,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-application-crypto 38.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-authority-discovery 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-authority-discovery", "sp-runtime 39.0.5", ] @@ -10468,7 +10453,7 @@ dependencies = [ "pallet-utility 38.0.0", "pallet-xcm", "parity-scale-codec", - "polkadot-parachain-primitives 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-parachain-primitives", "polkadot-primitives 16.0.0", "polkadot-runtime-parachains", "scale-info", @@ -11548,8 +11533,8 @@ dependencies = [ [[package]] name = "pallet-hyperbridge" -version = "1.15.3" -source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +version = "15.0.0" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407-1#4c58d522274dadcf4b1fbe8a931d1ebf15df26b8" dependencies = [ "anyhow", "frame-support 37.1.0", @@ -11696,8 +11681,8 @@ dependencies = [ [[package]] name = "pallet-ismp" -version = "1.15.3" -source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +version = "15.1.0" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407-1#4c58d522274dadcf4b1fbe8a931d1ebf15df26b8" dependencies = [ "anyhow", "fortuples", @@ -11719,8 +11704,8 @@ dependencies = [ [[package]] name = "pallet-ismp-runtime-api" -version = "1.15.3" -source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +version = "15.0.0" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407-1#4c58d522274dadcf4b1fbe8a931d1ebf15df26b8" dependencies = [ "ismp", "pallet-ismp", @@ -11728,7 +11713,6 @@ dependencies = [ "primitive-types 0.12.2", "serde", "sp-api 34.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "sp-mmr-primitives 34.0.0", ] [[package]] @@ -12398,7 +12382,7 @@ dependencies = [ "pallet-utility 38.0.0", "pallet-xcm", "parity-scale-codec", - "polkadot-parachain-primitives 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-parachain-primitives", "polkadot-primitives 16.0.0", "polkadot-runtime-parachains", "scale-info", @@ -13408,7 +13392,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9460a69f409be27c62161d8b4d36ffc32735d09a4f9097f9c789db0cca7196c" dependencies = [ - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "cumulus-primitives-utility", "frame-support 38.2.0", "frame-system 38.0.0", @@ -13441,7 +13425,7 @@ checksum = "287d2db0a2d19466caa579a69f021bfdc6fa352f382c8395dade58d1d0c6adfe" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-test-relay-sproof-builder", "frame-support 38.2.0", @@ -13452,7 +13436,7 @@ dependencies = [ "pallet-timestamp 37.0.0", "pallet-xcm", "parity-scale-codec", - "polkadot-parachain-primitives 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-parachain-primitives", "sp-consensus-aura 0.40.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-io 38.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -13940,17 +13924,6 @@ dependencies = [ "sp-runtime 39.0.5", ] -[[package]] -name = "polkadot-core-primitives" -version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#7642d6b5dea6dd7871ef8bbfcb9d48ba8a8b0f77" -dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "sp-runtime 39.0.3", -] - [[package]] name = "polkadot-parachain-primitives" version = "14.0.0" @@ -13960,7 +13933,7 @@ dependencies = [ "bounded-collections", "derive_more 0.99.19", "parity-scale-codec", - "polkadot-core-primitives 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-core-primitives", "scale-info", "serde", "sp-core 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -13968,22 +13941,6 @@ dependencies = [ "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "polkadot-parachain-primitives" -version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#7642d6b5dea6dd7871ef8bbfcb9d48ba8a8b0f77" -dependencies = [ - "bounded-collections", - "derive_more 0.99.19", - "parity-scale-codec", - "polkadot-core-primitives 15.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "scale-info", - "serde", - "sp-core 34.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "sp-runtime 39.0.3", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", -] - [[package]] name = "polkadot-primitives" version = "15.0.0" @@ -13994,14 +13951,14 @@ dependencies = [ "hex-literal 0.4.1", "log", "parity-scale-codec", - "polkadot-core-primitives 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-parachain-primitives 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-core-primitives", + "polkadot-parachain-primitives", "scale-info", "serde", "sp-api 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-application-crypto 38.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-authority-discovery 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-authority-discovery", "sp-consensus-slots 0.40.1", "sp-core 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-inherents 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -14011,32 +13968,6 @@ dependencies = [ "sp-staking 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "polkadot-primitives" -version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" -dependencies = [ - "bitvec", - "hex-literal 0.4.1", - "log", - "parity-scale-codec", - "polkadot-core-primitives 15.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "polkadot-parachain-primitives 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "scale-info", - "serde", - "sp-api 34.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "sp-application-crypto 38.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "sp-authority-discovery 34.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "sp-consensus-slots 0.40.0", - "sp-core 34.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "sp-inherents 34.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "sp-io 38.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "sp-keystore 0.40.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "sp-runtime 39.0.3", - "sp-staking 34.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", -] - [[package]] name = "polkadot-primitives" version = "16.0.0" @@ -14047,14 +13978,14 @@ dependencies = [ "hex-literal 0.4.1", "log", "parity-scale-codec", - "polkadot-core-primitives 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-parachain-primitives 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-core-primitives", + "polkadot-parachain-primitives", "scale-info", "serde", "sp-api 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-application-crypto 38.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-authority-discovery 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-authority-discovery", "sp-consensus-slots 0.40.1", "sp-core 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-inherents 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -14153,8 +14084,8 @@ dependencies = [ "pallet-timestamp 37.0.0", "pallet-vesting 38.0.0", "parity-scale-codec", - "polkadot-core-primitives 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-parachain-primitives 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-core-primitives", + "polkadot-parachain-primitives", "polkadot-primitives 16.0.0", "polkadot-runtime-metrics", "rand", @@ -14208,7 +14139,7 @@ dependencies = [ "cumulus-pallet-xcmp-queue", "cumulus-ping", "cumulus-primitives-aura", - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-primitives-proof-size-hostfunction", "cumulus-primitives-storage-weight-reclaim", @@ -14331,8 +14262,8 @@ dependencies = [ "pallet-xcm-bridge-hub-router", "parachains-common", "parachains-runtimes-test-utils", - "polkadot-core-primitives 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-parachain-primitives 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-core-primitives", + "polkadot-parachain-primitives", "polkadot-primitives 16.0.0", "polkadot-runtime-common", "polkadot-runtime-metrics", @@ -14359,7 +14290,7 @@ dependencies = [ "sp-api-proc-macro 20.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-application-crypto 38.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-authority-discovery 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-authority-discovery", "sp-block-builder 34.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-consensus-aura 0.40.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-consensus-babe 0.40.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -17820,7 +17751,7 @@ dependencies = [ [[package]] name = "serde-hex-utils" version = "0.1.0" -source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407-1#4c58d522274dadcf4b1fbe8a931d1ebf15df26b8" dependencies = [ "anyhow", "hex", @@ -18325,7 +18256,7 @@ dependencies = [ "frame-system 38.0.0", "hex-literal 0.4.1", "parity-scale-codec", - "polkadot-parachain-primitives 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-parachain-primitives", "scale-info", "serde", "snowbridge-beacon-primitives", @@ -18811,18 +18742,6 @@ dependencies = [ "sp-runtime 39.0.5", ] -[[package]] -name = "sp-authority-discovery" -version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#7642d6b5dea6dd7871ef8bbfcb9d48ba8a8b0f77" -dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-api 34.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "sp-application-crypto 38.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "sp-runtime 39.0.3", -] - [[package]] name = "sp-block-builder" version = "34.0.0" @@ -20361,7 +20280,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d28266dfddbfff721d70ad2f873380845b569adfab32f257cf97d9cedd894b68" dependencies = [ - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "frame-support 38.2.0", "frame-system 38.0.0", "parity-scale-codec", @@ -20420,7 +20339,7 @@ dependencies = [ "pallet-asset-conversion", "pallet-transaction-payment 38.0.2", "parity-scale-codec", - "polkadot-parachain-primitives 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-parachain-primitives", "scale-info", "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-io 38.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -20710,8 +20629,8 @@ dependencies = [ [[package]] name = "substrate-state-machine" -version = "1.15.3" -source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#a89682f739022dd67dda3858f72e6745135d758e" +version = "15.0.0" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407-1#4c58d522274dadcf4b1fbe8a931d1ebf15df26b8" dependencies = [ "frame-support 37.1.0", "hash-db", @@ -21579,9 +21498,9 @@ version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94bceae6f7c89d47daff6c7e05f712551a01379f61b07d494661941144878589" dependencies = [ - "cumulus-primitives-core 0.16.0", + "cumulus-primitives-core", "frame-support 38.2.0", - "polkadot-core-primitives 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-core-primitives", "rococo-runtime-constants", "smallvec", "sp-runtime 39.0.5", @@ -23546,8 +23465,8 @@ dependencies = [ "frame-system 38.0.0", "parity-scale-codec", "paste", - "polkadot-core-primitives 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-parachain-primitives 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-core-primitives", + "polkadot-parachain-primitives", "polkadot-primitives 16.0.0", "polkadot-runtime-parachains", "scale-info", diff --git a/Cargo.toml b/Cargo.toml index 601ad16d8..6f3da6a2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -383,12 +383,12 @@ alloy-primitives = { version = "0.7.7", default-features = false, features # Hyperbridge token-gateway-primitives = { path = "pallets/token-gateway/primitives" } pallet-token-gateway = { path = "pallets/token-gateway" } -pallet-ismp = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } -pallet-ismp-rpc = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407" } -pallet-ismp-runtime-api = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } -ismp-grandpa = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } -ismp = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } -pallet-hyperbridge = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +pallet-ismp = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407-1", default-features = false } +pallet-ismp-rpc = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407-1" } +pallet-ismp-runtime-api = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407-1", default-features = false } +ismp-grandpa = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407-1", default-features = false } +ismp = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407-1", default-features = false } +pallet-hyperbridge = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407-1", default-features = false } sp-mmr-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false } anyhow = { version = "1.0.93", default-features = false } From 242201a2fff368136a70a52adb03367ea69633e8 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Thu, 20 Feb 2025 22:24:17 -0700 Subject: [PATCH 09/16] chore: fix --- runtime/testnet/src/hyperbridge.rs | 1 + runtime/testnet/src/lib.rs | 15 --------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/runtime/testnet/src/hyperbridge.rs b/runtime/testnet/src/hyperbridge.rs index cd1ecdf13..082f1df86 100644 --- a/runtime/testnet/src/hyperbridge.rs +++ b/runtime/testnet/src/hyperbridge.rs @@ -60,6 +60,7 @@ impl pallet_ismp::Config for Runtime { impl ismp_grandpa::Config for Runtime { type RuntimeEvent = RuntimeEvent; type IsmpHost = pallet_ismp::Pallet; + type WeightInfo = (); } #[derive(Default)] diff --git a/runtime/testnet/src/lib.rs b/runtime/testnet/src/lib.rs index 842bfbfcc..9936c83a4 100644 --- a/runtime/testnet/src/lib.rs +++ b/runtime/testnet/src/lib.rs @@ -2284,45 +2284,30 @@ impl_runtime_apis! { pallet_ismp::Pallet::::challenge_period(state_machine_id) } - /// Generate a proof for the provided leaf indices - fn generate_proof( - keys: ProofKeys - ) -> Result<(Vec, Proof<::Hash>), sp_mmr_primitives::Error> { - pallet_ismp::Pallet::::generate_proof(keys) - } - - /// Fetch all ISMP events in the block, should only be called from runtime-api. fn block_events() -> Vec<::ismp::events::Event> { pallet_ismp::Pallet::::block_events() } - /// Fetch all ISMP events and their extrinsic metadata, should only be called from runtime-api. fn block_events_with_metadata() -> Vec<(::ismp::events::Event, Option)> { pallet_ismp::Pallet::::block_events_with_metadata() } - /// Return the scale encoded consensus state fn consensus_state(id: ConsensusClientId) -> Option> { pallet_ismp::Pallet::::consensus_states(id) } - /// Return the timestamp this client was last updated in seconds fn state_machine_update_time(height: StateMachineHeight) -> Option { pallet_ismp::Pallet::::state_machine_update_time(height) } - /// Return the latest height of the state machine fn latest_state_machine_height(id: StateMachineId) -> Option { pallet_ismp::Pallet::::latest_state_machine_height(id) } - - /// Get actual requests fn requests(commitments: Vec) -> Vec { pallet_ismp::Pallet::::requests(commitments) } - /// Get actual requests fn responses(commitments: Vec) -> Vec { pallet_ismp::Pallet::::responses(commitments) } From 5c93108f805ae1ae02cb166d5185ee40bafaae14 Mon Sep 17 00:00:00 2001 From: drewstone Date: Thu, 20 Feb 2025 22:49:27 -0700 Subject: [PATCH 10/16] Update runtime/testnet/src/hyperbridge.rs Co-authored-by: Seun Lanlege --- runtime/testnet/src/hyperbridge.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/testnet/src/hyperbridge.rs b/runtime/testnet/src/hyperbridge.rs index 082f1df86..53785f75a 100644 --- a/runtime/testnet/src/hyperbridge.rs +++ b/runtime/testnet/src/hyperbridge.rs @@ -34,7 +34,7 @@ parameter_types! { // The hyperbridge parachain on Polkadot pub const Coprocessor: Option = Some(StateMachine::Polkadot(3367)); // The host state machine of this pallet, your state machine id goes here - pub const HostStateMachine: StateMachine = StateMachine::Substrate(5845u32.to_be_bytes()); + pub const HostStateMachine: StateMachine = StateMachine::Substrate(*b"TNGL"); } impl pallet_ismp::Config for Runtime { From b23ff34255da28104ee84227c7ef144446f855a2 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Thu, 20 Feb 2025 23:07:19 -0700 Subject: [PATCH 11/16] chore: add token gateway --- Cargo.lock | 158 +++++++++++++++++- Cargo.toml | 2 +- runtime/testnet/Cargo.toml | 2 + runtime/testnet/src/hyperbridge.rs | 57 ++++++- runtime/testnet/src/lib.rs | 4 +- runtime/testnet/src/weights/ismp_grandpa.rs | 62 +++++++ runtime/testnet/src/weights/mod.rs | 2 + .../src/weights/pallet_token_gateway.rs | 112 +++++++++++++ 8 files changed, 383 insertions(+), 16 deletions(-) create mode 100644 runtime/testnet/src/weights/ismp_grandpa.rs create mode 100644 runtime/testnet/src/weights/mod.rs create mode 100644 runtime/testnet/src/weights/pallet_token_gateway.rs diff --git a/Cargo.lock b/Cargo.lock index a24592ce1..a1063f35c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -392,6 +392,28 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "alloy-primitives" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 0.99.19", + "hex-literal 0.4.1", + "itoa", + "k256", + "keccak-asm", + "proptest", + "rand", + "ruint", + "serde", + "tiny-keccak", +] + [[package]] name = "alloy-primitives" version = "0.8.21" @@ -671,20 +693,52 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "alloy-sol-macro" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b40397ddcdcc266f59f959770f601ce1280e699a91fc1862f29cef91707cd09" +dependencies = [ + "alloy-sol-macro-expander 0.7.7", + "alloy-sol-macro-input 0.7.7", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "alloy-sol-macro" version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2708e27f58d747423ae21d31b7a6625159bd8d867470ddd0256f396a68efa11" dependencies = [ - "alloy-sol-macro-expander", - "alloy-sol-macro-input", + "alloy-sol-macro-expander 0.8.21", + "alloy-sol-macro-input 0.8.21", "proc-macro-error2", "proc-macro2", "quote", "syn 2.0.98", ] +[[package]] +name = "alloy-sol-macro-expander" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "867a5469d61480fea08c7333ffeca52d5b621f5ca2e44f271b117ec1fc9a0525" +dependencies = [ + "alloy-sol-macro-input 0.7.7", + "const-hex", + "heck 0.5.0", + "indexmap 2.7.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.98", + "syn-solidity 0.7.7", + "tiny-keccak", +] + [[package]] name = "alloy-sol-macro-expander" version = "0.8.21" @@ -692,7 +746,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6b7984d7e085dec382d2c5ef022b533fcdb1fe6129200af30ebf5afddb6a361" dependencies = [ "alloy-json-abi", - "alloy-sol-macro-input", + "alloy-sol-macro-input 0.8.21", "const-hex", "heck 0.5.0", "indexmap 2.7.1", @@ -704,6 +758,21 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "alloy-sol-macro-input" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e482dc33a32b6fadbc0f599adea520bd3aaa585c141a80b404d0a3e3fa72528" +dependencies = [ + "const-hex", + "dunce", + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.98", + "syn-solidity 0.7.7", +] + [[package]] name = "alloy-sol-macro-input" version = "0.8.21" @@ -743,6 +812,17 @@ dependencies = [ "serde", ] +[[package]] +name = "alloy-sol-types" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" +dependencies = [ + "alloy-primitives 0.7.7", + "alloy-sol-macro 0.7.7", + "const-hex", +] + [[package]] name = "alloy-sol-types" version = "0.8.21" @@ -4433,7 +4513,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -7531,7 +7611,7 @@ checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" dependencies = [ "hermit-abi 0.4.0", "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -13045,6 +13125,31 @@ dependencies = [ "sp-runtime 39.0.5", ] +[[package]] +name = "pallet-token-gateway" +version = "15.2.0" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407-1#4c58d522274dadcf4b1fbe8a931d1ebf15df26b8" +dependencies = [ + "alloy-primitives 0.7.7", + "alloy-sol-macro 0.7.7", + "alloy-sol-types 0.7.7", + "anyhow", + "frame-benchmarking 37.0.0", + "frame-support 37.1.0", + "frame-system 37.1.0", + "ismp", + "log", + "pallet-hyperbridge", + "pallet-ismp", + "parity-scale-codec", + "primitive-types 0.12.2", + "scale-info", + "sp-core 34.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", + "sp-io 38.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", + "sp-runtime 39.0.3", + "token-gateway-primitives", +] + [[package]] name = "pallet-transaction-payment" version = "37.0.1" @@ -15917,7 +16022,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -19396,7 +19501,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#39e71bd58f282508db334a424ca6c2997d94acf5" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#7642d6b5dea6dd7871ef8bbfcb9d48ba8a8b0f77" dependencies = [ "log", "parity-scale-codec", @@ -20946,6 +21051,18 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "syn-solidity" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c837dc8852cb7074e46b444afb81783140dab12c58867b49fb3898fbafedf7ea" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "syn-solidity" version = "0.8.21" @@ -21395,6 +21512,7 @@ dependencies = [ "pallet-tangle-lst", "pallet-tangle-lst-benchmarking", "pallet-timestamp 36.0.1", + "pallet-token-gateway", "pallet-transaction-payment 37.0.1", "pallet-transaction-payment-rpc-runtime-api 37.0.0", "pallet-treasury 36.0.1", @@ -21453,7 +21571,7 @@ dependencies = [ "getrandom 0.3.1", "once_cell", "rustix 0.38.44", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -21708,6 +21826,28 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "token-gateway-primitives" +version = "15.0.0" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407-1#4c58d522274dadcf4b1fbe8a931d1ebf15df26b8" +dependencies = [ + "alloy-primitives 0.7.7", + "alloy-sol-macro 0.7.7", + "alloy-sol-types 0.7.7", + "anyhow", + "frame-support 37.1.0", + "frame-system 37.1.0", + "ismp", + "log", + "pallet-ismp", + "parity-scale-codec", + "primitive-types 0.12.2", + "scale-info", + "sp-core 34.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", + "sp-io 38.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", + "sp-runtime 39.0.3", +] + [[package]] name = "tokio" version = "1.43.0" @@ -22997,7 +23137,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index e445b1f3f..4575a906d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -382,7 +382,7 @@ alloy-primitives = { version = "0.7.7", default-features = false, features # Hyperbridge token-gateway-primitives = { path = "pallets/token-gateway/primitives" } -pallet-token-gateway = { path = "pallets/token-gateway" } +pallet-token-gateway = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407-1", default-features = false } pallet-ismp = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407-1", default-features = false } pallet-ismp-rpc = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407-1" } pallet-ismp-runtime-api = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407-1", default-features = false } diff --git a/runtime/testnet/Cargo.toml b/runtime/testnet/Cargo.toml index 956dd79a3..583e33f94 100644 --- a/runtime/testnet/Cargo.toml +++ b/runtime/testnet/Cargo.toml @@ -150,6 +150,7 @@ rpc-primitives-txpool = { workspace = true } pallet-ismp = { workspace = true, features = ["unsigned"] } pallet-ismp-runtime-api = { workspace = true } pallet-hyperbridge = { workspace = true } +pallet-token-gateway = { workspace = true } sp-mmr-primitives = { workspace = true } ismp = { workspace = true } ismp-grandpa = { workspace = true } @@ -313,6 +314,7 @@ std = [ # Hyperbridge "pallet-hyperbridge/std", "pallet-ismp/std", + "pallet-token-gateway/std", "ismp/std", "ismp-grandpa/std", "pallet-ismp-runtime-api/std", diff --git a/runtime/testnet/src/hyperbridge.rs b/runtime/testnet/src/hyperbridge.rs index 53785f75a..749532cda 100644 --- a/runtime/testnet/src/hyperbridge.rs +++ b/runtime/testnet/src/hyperbridge.rs @@ -17,7 +17,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::{Balances, EnsureRootOrHalfCouncil, Ismp, Runtime, RuntimeEvent, Timestamp}; +use crate::{ + AccountId, Assets, Balances, EnsureRoot, EnsureRootOrHalfCouncil, Get, Ismp, Runtime, + RuntimeEvent, Timestamp, Treasury, H160, +}; +use ::pallet_token_gateway::types::EvmToSubstrate; use frame_support::parameter_types; use ismp::{host::StateMachine, module::IsmpModule, router::IsmpRouter}; use sp_std::boxed::Box; @@ -52,15 +56,15 @@ impl pallet_ismp::Config for Runtime { // Co-processor type Coprocessor = Coprocessor; // A tuple of types implementing the ConsensusClient interface, which defines all consensus algorithms supported by this protocol deployment - type ConsensusClients = (ismp_grandpa::consensus::GrandpaConsensusClient,); + type ConsensusClients = (::ismp_grandpa::consensus::GrandpaConsensusClient,); type WeightProvider = (); type OffchainDB = (); } -impl ismp_grandpa::Config for Runtime { +impl ::ismp_grandpa::Config for Runtime { type RuntimeEvent = RuntimeEvent; type IsmpHost = pallet_ismp::Pallet; - type WeightInfo = (); + type WeightInfo = crate::weights::ismp_grandpa::WeightInfo; } #[derive(Default)] @@ -76,3 +80,48 @@ impl IsmpRouter for Router { } } } + +pub struct EvmToSubstrateFactory; + +impl EvmToSubstrate for EvmToSubstrateFactory { + fn convert(addr: H160) -> AccountId { + let mut account = [0u8; 32]; + account[12..].copy_from_slice(&addr.0); + account.into() + } +} + +/// Should provide an account that is funded and can be used to pay for asset creation +pub struct AssetAdmin; +impl Get for AssetAdmin { + fn get() -> AccountId { + Treasury::account_id() + } +} + +parameter_types! { + // A constant that should represent the native asset id, this id must be unique to the native currency + pub const NativeAssetId: u32 = 0; + // Set the correct decimals for the native currency + pub const Decimals: u8 = 18; +} + +impl ::pallet_token_gateway::Config for Runtime { + // configure the runtime event + type RuntimeEvent = RuntimeEvent; + // Configured as Pallet Ismp + type Dispatcher = pallet_hyperbridge::Pallet; + // Configured as Pallet Assets + type Assets = Assets; + // Configured as Pallet balances + type NativeCurrency = Balances; + // AssetAdmin account + type AssetAdmin = AssetAdmin; + // The Native asset Id + type NativeAssetId = NativeAssetId; + // The precision of the native asset + type Decimals = Decimals; + type EvmToSubstrate = EvmToSubstrateFactory; + type WeightInfo = crate::weights::pallet_token_gateway::SubstrateWeight; + type CreateOrigin = EnsureRoot; +} diff --git a/runtime/testnet/src/lib.rs b/runtime/testnet/src/lib.rs index 086dd6f8c..00a708495 100644 --- a/runtime/testnet/src/lib.rs +++ b/runtime/testnet/src/lib.rs @@ -29,6 +29,7 @@ pub mod migrations; pub mod precompiles; pub mod tangle_services; pub mod voter_bags; +pub mod weights; use frame_election_provider_support::{ bounds::{ElectionBounds, ElectionBoundsBuilder}, @@ -58,7 +59,6 @@ use pallet_grandpa::{ fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, }; use pallet_im_online::sr25519::AuthorityId as ImOnlineId; -use pallet_ismp::offchain::{Leaf, Proof, ProofKeys}; use pallet_multi_asset_delegation::RoundChangeSessionManager; use pallet_services_rpc_runtime_api::BlockNumberOf; use pallet_session::historical::{self as pallet_session_historical, NoteHistoricalRoot}; @@ -1321,7 +1321,7 @@ construct_runtime!( Ismp: pallet_ismp = 55, IsmpGrandpa: ismp_grandpa = 56, Hyperbridge: pallet_hyperbridge = 57, - + TokenGateway: pallet_token_gateway = 58, } ); diff --git a/runtime/testnet/src/weights/ismp_grandpa.rs b/runtime/testnet/src/weights/ismp_grandpa.rs new file mode 100644 index 000000000..73ab2f7e8 --- /dev/null +++ b/runtime/testnet/src/weights/ismp_grandpa.rs @@ -0,0 +1,62 @@ + +//! Autogenerated weights for `ismp_grandpa` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 +//! DATE: 2024-12-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `polytope-labs`, CPU: `AMD Ryzen Threadripper PRO 5995WX 64-Cores` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// target/release/hyperbridge +// benchmark +// pallet +// --wasm-execution=compiled +// --pallet=ismp_grandpa +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --genesis-builder=runtime +// --runtime=./target/release/wbuild/gargantua-runtime/gargantua_runtime.compact.wasm +// --output=parachain/runtimes/gargantua/src/weights/ismp_grandpa.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `ismp_grandpa`. +pub struct WeightInfo(PhantomData); +impl ismp_grandpa::WeightInfo for WeightInfo { + /// Storage: `IsmpGrandpa::SupportedStateMachines` (r:0 w:100) + /// Proof: `IsmpGrandpa::SupportedStateMachines` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[1, 100]`. + fn add_state_machines(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 6_913_000 picoseconds. + Weight::from_parts(7_832_568, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 7_710 + .saturating_add(Weight::from_parts(1_434_418, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + } + /// Storage: `IsmpGrandpa::SupportedStateMachines` (r:0 w:100) + /// Proof: `IsmpGrandpa::SupportedStateMachines` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[1, 100]`. + fn remove_state_machines(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 7_204_000 picoseconds. + Weight::from_parts(5_126_127, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 8_195 + .saturating_add(Weight::from_parts(1_417_249, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + } +} \ No newline at end of file diff --git a/runtime/testnet/src/weights/mod.rs b/runtime/testnet/src/weights/mod.rs new file mode 100644 index 000000000..d89101a2f --- /dev/null +++ b/runtime/testnet/src/weights/mod.rs @@ -0,0 +1,2 @@ +pub mod ismp_grandpa; +pub mod pallet_token_gateway; diff --git a/runtime/testnet/src/weights/pallet_token_gateway.rs b/runtime/testnet/src/weights/pallet_token_gateway.rs new file mode 100644 index 000000000..546b7df08 --- /dev/null +++ b/runtime/testnet/src/weights/pallet_token_gateway.rs @@ -0,0 +1,112 @@ +//! Autogenerated weights for pallet_token_gateway +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 +//! DATE: 2025-02-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `192.168.1.5`, CPU: `` +//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/cere +// benchmark +// pallet +// --chain +// dev +// --wasm-execution=compiled +// --pallet +// pallet_token_gateway +// --extrinsic +// * +// --steps +// 50 +// --repeat +// 20 +// --output=./runtime/cere-dev/src/weights/pallet_token_gateway.rs +// --template=./.maintain/frame-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + + +/// Weights for pallet_token_gateway using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl pallet_token_gateway::WeightInfo for SubstrateWeight { + // Storage: `Hyperbridge::HostParams` (r:1 w:0) + // Proof: `Hyperbridge::HostParams` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `Ismp::Nonce` (r:1 w:1) + // Proof: `Ismp::Nonce` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `TokenGateway::Precisions` (r:0 w:100) + // Proof: `TokenGateway::Precisions` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `TokenGateway::NativeAssets` (r:0 w:1) + // Proof: `TokenGateway::NativeAssets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `TokenGateway::LocalAssets` (r:0 w:1) + // Proof: `TokenGateway::LocalAssets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `TokenGateway::SupportedAssets` (r:0 w:1) + // Proof: `TokenGateway::SupportedAssets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747356aa03068021c89766e6f0dc869c` (r:1 w:1) + // Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747356aa03068021c89766e6f0dc869c` (r:1 w:1) + // Storage: UNKNOWN KEY `0x526571756573745061796d656e7456aa03068021c89766e6f0dc869cadd7cfc2` (r:0 w:1) + // Proof: UNKNOWN KEY `0x526571756573745061796d656e7456aa03068021c89766e6f0dc869cadd7cfc2` (r:0 w:1) + /// The range of component `x` is `[1, 100]`. + fn create_erc6160_asset(x: u32, ) -> Weight { + Weight::from_parts(22_256_047_u64, 0) + // Standard Error: 3_063 + .saturating_add(Weight::from_parts(1_733_865_u64, 0).saturating_mul(x as u64)) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(6_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(x as u64))) + } + // Storage: `TokenGateway::SupportedAssets` (r:1 w:0) + // Proof: `TokenGateway::SupportedAssets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `TokenGateway::NativeAssets` (r:1 w:0) + // Proof: `TokenGateway::NativeAssets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:1 w:1) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `TokenGateway::Precisions` (r:1 w:0) + // Proof: `TokenGateway::Precisions` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Hyperbridge::HostParams` (r:1 w:0) + // Proof: `Hyperbridge::HostParams` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `Ismp::Nonce` (r:1 w:1) + // Proof: `Ismp::Nonce` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74733d1fa1ad95382c59b20b8fe912a8` (r:1 w:1) + // Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74733d1fa1ad95382c59b20b8fe912a8` (r:1 w:1) + // Storage: UNKNOWN KEY `0x526571756573745061796d656e743d1fa1ad95382c59b20b8fe912a8853bf587` (r:0 w:1) + // Proof: UNKNOWN KEY `0x526571756573745061796d656e743d1fa1ad95382c59b20b8fe912a8853bf587` (r:0 w:1) + fn teleport() -> Weight { + Weight::from_parts(62_000_000_u64, 0) + .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + // Storage: `TokenGateway::TokenGatewayAddresses` (r:0 w:1) + // Proof: `TokenGateway::TokenGatewayAddresses` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `x` is `[1, 100]`. + fn set_token_gateway_addresses(_x: u32, ) -> Weight { + Weight::from_parts(3_897_505_u64, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + // Storage: `Hyperbridge::HostParams` (r:1 w:0) + // Proof: `Hyperbridge::HostParams` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `Ismp::Nonce` (r:1 w:1) + // Proof: `Ismp::Nonce` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747399c5cd93560a9d5b3112b189670f` (r:1 w:1) + // Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747399c5cd93560a9d5b3112b189670f` (r:1 w:1) + // Storage: UNKNOWN KEY `0x526571756573745061796d656e7499c5cd93560a9d5b3112b189670f2bf0f746` (r:0 w:1) + // Proof: UNKNOWN KEY `0x526571756573745061796d656e7499c5cd93560a9d5b3112b189670f2bf0f746` (r:0 w:1) + fn update_erc6160_asset() -> Weight { + Weight::from_parts(21_000_000_u64, 0) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + // Storage: `TokenGateway::Precisions` (r:0 w:100) + // Proof: `TokenGateway::Precisions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `x` is `[1, 100]`. + fn update_asset_precision(x: u32, ) -> Weight { + Weight::from_parts(1_255_030_u64, 0) + // Standard Error: 2_019 + .saturating_add(Weight::from_parts(1_723_090_u64, 0).saturating_mul(x as u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(x as u64))) + } +} \ No newline at end of file From 38c01e617936f9db640904e1e6a804f9e620e820 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Sat, 22 Feb 2025 00:51:03 -0700 Subject: [PATCH 12/16] chore: add token gateway to hyperbridge router --- runtime/testnet/src/hyperbridge.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/testnet/src/hyperbridge.rs b/runtime/testnet/src/hyperbridge.rs index 749532cda..2ecd4d30f 100644 --- a/runtime/testnet/src/hyperbridge.rs +++ b/runtime/testnet/src/hyperbridge.rs @@ -19,11 +19,11 @@ use crate::{ AccountId, Assets, Balances, EnsureRoot, EnsureRootOrHalfCouncil, Get, Ismp, Runtime, - RuntimeEvent, Timestamp, Treasury, H160, + RuntimeEvent, Timestamp, TokenGateway, Treasury, H160, }; -use ::pallet_token_gateway::types::EvmToSubstrate; use frame_support::parameter_types; use ismp::{host::StateMachine, module::IsmpModule, router::IsmpRouter}; +use pallet_token_gateway::types::EvmToSubstrate; use sp_std::boxed::Box; use sp_std::vec::Vec; use tangle_primitives::Balance; @@ -76,6 +76,7 @@ impl IsmpRouter for Router { pallet_hyperbridge::PALLET_HYPERBRIDGE_ID => { Ok(Box::new(pallet_hyperbridge::Pallet::::default())) }, + id if TokenGateway::is_token_gateway(id) => Ok(Box::new(TokenGateway::default())), _ => Err(ismp::Error::ModuleNotFound(id))?, } } From 3522a853c9ce43b460fc89e71e5d380297be3b8a Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Sun, 23 Feb 2025 00:59:17 -0700 Subject: [PATCH 13/16] chore: merge main and remove sp-mmr-primitives --- Cargo.lock | 1 - Cargo.toml | 1 - runtime/testnet/Cargo.toml | 6 ------ 3 files changed, 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3b303d67c..a817f07af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -21536,7 +21536,6 @@ dependencies = [ "sp-genesis-builder 0.15.0", "sp-inherents 34.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", "sp-io 38.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", - "sp-mmr-primitives 34.0.0", "sp-offchain 34.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2407)", "sp-runtime 39.0.3", "sp-session 35.0.0", diff --git a/Cargo.toml b/Cargo.toml index 4575a906d..d8c6dd181 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -389,7 +389,6 @@ pallet-ismp-runtime-api = { git = "https://github.com/polytope-labs/hyperbri ismp-grandpa = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407-1", default-features = false } ismp = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407-1", default-features = false } pallet-hyperbridge = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407-1", default-features = false } -sp-mmr-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false } anyhow = { version = "1.0.93", default-features = false } # Subxt diff --git a/runtime/testnet/Cargo.toml b/runtime/testnet/Cargo.toml index b1707e259..234c3aba8 100644 --- a/runtime/testnet/Cargo.toml +++ b/runtime/testnet/Cargo.toml @@ -151,7 +151,6 @@ pallet-ismp = { workspace = true, features = ["unsigned"] } pallet-ismp-runtime-api = { workspace = true } pallet-hyperbridge = { workspace = true } pallet-token-gateway = { workspace = true } -sp-mmr-primitives = { workspace = true } ismp = { workspace = true } ismp-grandpa = { workspace = true } anyhow = { workspace = true } @@ -182,10 +181,6 @@ runtime-benchmarks = [ "pallet-multi-asset-delegation/runtime-benchmarks", "pallet-tangle-lst-benchmarking/runtime-benchmarks", "pallet-rewards/runtime-benchmarks" - - # Hyperbridge - "pallet-ismp/runtime-benchmarks", - ] default = ["std", "with-rocksdb-weights", "evm-tracing"] local-testing = [] @@ -320,7 +315,6 @@ std = [ "ismp/std", "ismp-grandpa/std", "pallet-ismp-runtime-api/std", - "sp-mmr-primitives/std", ] integration-tests = ["tangle-primitives/integration-tests"] with-rocksdb-weights = [] From 77b0b00eed056aae2b9cb3d842e5dabd0c5f816c Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Mon, 24 Feb 2025 09:52:18 -0700 Subject: [PATCH 14/16] chore: increase testnet block size limit --- runtime/testnet/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/testnet/src/lib.rs b/runtime/testnet/src/lib.rs index 8f83f933e..758eed110 100644 --- a/runtime/testnet/src/lib.rs +++ b/runtime/testnet/src/lib.rs @@ -192,7 +192,7 @@ pub fn native_version() -> NativeVersion { NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } } -pub const MAXIMUM_BLOCK_LENGTH: u32 = 5 * 1024 * 1024; +pub const MAXIMUM_BLOCK_LENGTH: u32 = (15 * 1024 * 1024 / 2); parameter_types! { pub const Version: RuntimeVersion = VERSION; From 1b29ab346674c7deadb7f9f72b56d4c4bcfc305b Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Wed, 26 Feb 2025 01:23:43 -0700 Subject: [PATCH 15/16] chore: use 8mb --- runtime/testnet/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/testnet/src/lib.rs b/runtime/testnet/src/lib.rs index 758eed110..d5c98e924 100644 --- a/runtime/testnet/src/lib.rs +++ b/runtime/testnet/src/lib.rs @@ -192,7 +192,7 @@ pub fn native_version() -> NativeVersion { NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } } -pub const MAXIMUM_BLOCK_LENGTH: u32 = (15 * 1024 * 1024 / 2); +pub const MAXIMUM_BLOCK_LENGTH: u32 = 8 * 1024 * 1024; parameter_types! { pub const Version: RuntimeVersion = VERSION; From 7f69b81295eea9e6b9cca92eee6e63f8c3055653 Mon Sep 17 00:00:00 2001 From: drewstone Date: Thu, 27 Feb 2025 01:39:35 -0700 Subject: [PATCH 16/16] Update runtime/testnet/src/hyperbridge.rs Co-authored-by: David Salami <31099392+Wizdave97@users.noreply.github.com> --- runtime/testnet/src/hyperbridge.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/testnet/src/hyperbridge.rs b/runtime/testnet/src/hyperbridge.rs index 2ecd4d30f..772710cb9 100644 --- a/runtime/testnet/src/hyperbridge.rs +++ b/runtime/testnet/src/hyperbridge.rs @@ -36,7 +36,7 @@ impl pallet_hyperbridge::Config for Runtime { parameter_types! { // The hyperbridge parachain on Polkadot - pub const Coprocessor: Option = Some(StateMachine::Polkadot(3367)); + pub const Coprocessor: Option = Some(StateMachine::Kusama(4009)); // The host state machine of this pallet, your state machine id goes here pub const HostStateMachine: StateMachine = StateMachine::Substrate(*b"TNGL"); }