diff --git a/Cargo.lock b/Cargo.lock index 2eb7eb4f2..80fa7d09a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,9 +179,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.81" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" +checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" [[package]] name = "approx" @@ -374,7 +374,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.61", "time", ] @@ -390,7 +390,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.61", "time", ] @@ -1100,53 +1100,19 @@ dependencies = [ ] [[package]] -name = "bifrost-integration-tests" +name = "bifrost-ismp" version = "0.8.0" dependencies = [ - "bifrost-asset-registry", - "bifrost-currencies", - "bifrost-polkadot-runtime", - "bifrost-primitives", - "bifrost-runtime-common", - "bifrost-slp", - "bifrost-vtoken-voting", - "bifrost-xcm-interface", - "cumulus-pallet-parachain-system", - "cumulus-primitives-core", - "env_logger", + "anyhow", "frame-support", "frame-system", - "hex-literal 0.4.1", - "log", - "orml-tokens", - "orml-traits", - "orml-xtokens", - "pallet-assets", + "ismp", "pallet-balances", - "pallet-conviction-voting", - "pallet-message-queue", - "pallet-referenda", - "pallet-staking", - "pallet-xcm", - "parachains-common", + "pallet-ismp", "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-parachain-primitives", - "polkadot-runtime-common", - "polkadot-runtime-parachains", "scale-info", - "serde", "sp-core", - "sp-io", "sp-runtime", - "sp-staking", - "sp-std", - "staging-parachain-info", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", - "xcm-emulator", - "xcm-simulator", ] [[package]] @@ -1309,6 +1275,7 @@ dependencies = [ name = "bifrost-polkadot-runtime" version = "0.8.0" dependencies = [ + "anyhow", "bb-bnc", "bb-bnc-rpc-runtime-api", "bifrost-asset-registry", @@ -1322,6 +1289,7 @@ dependencies = [ "bifrost-fee-share", "bifrost-flexible-fee", "bifrost-flexible-fee-rpc-runtime-api", + "bifrost-ismp", "bifrost-parachain-staking", "bifrost-primitives", "bifrost-runtime-common", @@ -1363,6 +1331,7 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "hex-literal 0.4.1", + "ismp", "lend-market", "lend-market-rpc-runtime-api", "leverage-staking", @@ -1400,8 +1369,10 @@ dependencies = [ "pallet-evm-precompile-modexp", "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", + "pallet-hyperbridge", "pallet-identity", "pallet-indices", + "pallet-ismp", "pallet-membership", "pallet-message-queue", "pallet-multisig", @@ -2401,7 +2372,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68534a48cbf63a4b1323c433cf21238c9ec23711e0df13b08c33e5c2082663ce" dependencies = [ - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -2542,7 +2513,7 @@ dependencies = [ "semver 1.0.18", "serde", "serde_json", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -2691,6 +2662,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.6.1" @@ -3281,7 +3261,7 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -3623,7 +3603,7 @@ dependencies = [ "sp-blockchain", "sp-state-machine", "sp-version", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -3693,7 +3673,7 @@ dependencies = [ "sp-state-machine", "sp-storage", "sp-version", - "thiserror", + "thiserror 1.0.61", "tokio", "tokio-util", "tracing", @@ -3918,6 +3898,27 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "unicode-xid", +] + [[package]] name = "difflib" version = "0.4.0" @@ -4503,7 +4504,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec6f82451ff7f0568c6181287189126d492b5654e30a788add08027b6363d019" dependencies = [ "fatality-proc-macro", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -4545,7 +4546,7 @@ dependencies = [ "sp-block-builder", "sp-consensus", "sp-runtime", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -4651,7 +4652,7 @@ dependencies = [ "sp-storage", "sp-timestamp", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.61", "tokio", ] @@ -4694,7 +4695,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e182f7dbc2ef73d9ef67351c5fbbea084729c48362d3ce9dd44c28e32e277fe5" dependencies = [ "libc", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -4838,6 +4839,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" @@ -4845,7 +4857,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835f84f38484cc86f110a805655697908257fb9a7af005234060891557198e9" dependencies = [ "nonempty", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -5028,7 +5040,7 @@ dependencies = [ "sp-storage", "sp-trie", "sp-wasm-interface", - "thiserror", + "thiserror 1.0.61", "thousands", ] @@ -5550,7 +5562,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.61", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -5659,7 +5671,7 @@ dependencies = [ "pest_derive", "serde", "serde_json", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -6260,6 +6272,24 @@ dependencies = [ "winapi", ] +[[package]] +name = "ismp" +version = "0.2.2" +source = "git+https://github.com/bifrost-io/hyperbridge?branch=stable2407#b814ef3a015c1821fb0c7ec11e559cf4ddad7598" +dependencies = [ + "anyhow", + "derive_more 1.0.0", + "displaydoc", + "hex", + "parity-scale-codec", + "primitive-types", + "scale-info", + "serde", + "serde-hex-utils", + "serde_json", + "thiserror 2.0.8", +] + [[package]] name = "itertools" version = "0.10.5" @@ -6294,7 +6324,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.61", "walkdir", ] @@ -6357,7 +6387,7 @@ dependencies = [ "rustls-pki-types", "rustls-platform-verifier", "soketto 0.8.0", - "thiserror", + "thiserror 1.0.61", "tokio", "tokio-rustls 0.26.0", "tokio-util", @@ -6387,7 +6417,7 @@ dependencies = [ "rustc-hash", "serde", "serde_json", - "thiserror", + "thiserror 1.0.61", "tokio", "tokio-stream", "tracing", @@ -6412,7 +6442,7 @@ dependencies = [ "rustls-platform-verifier", "serde", "serde_json", - "thiserror", + "thiserror 1.0.61", "tokio", "tower", "tracing", @@ -6452,7 +6482,7 @@ dependencies = [ "serde", "serde_json", "soketto 0.8.0", - "thiserror", + "thiserror 1.0.61", "tokio", "tokio-stream", "tokio-util", @@ -6470,7 +6500,7 @@ dependencies = [ "http 1.1.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -6567,7 +6597,7 @@ checksum = "1530c5b973eeed4ac216af7e24baf5737645a6272e361f1fb95710678b67d9cc" dependencies = [ "enumflags2", "libc", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -6735,7 +6765,7 @@ dependencies = [ "multiaddr 0.18.1", "pin-project", "rw-stream-sink", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -6785,7 +6815,7 @@ dependencies = [ "rand", "rw-stream-sink", "smallvec", - "thiserror", + "thiserror 1.0.61", "unsigned-varint 0.7.2", "void", ] @@ -6825,7 +6855,7 @@ dependencies = [ "quick-protobuf", "quick-protobuf-codec", "smallvec", - "thiserror", + "thiserror 1.0.61", "void", ] @@ -6842,7 +6872,7 @@ dependencies = [ "quick-protobuf", "rand", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.61", "tracing", "zeroize", ] @@ -6870,7 +6900,7 @@ dependencies = [ "rand", "sha2 0.10.8", "smallvec", - "thiserror", + "thiserror 1.0.61", "uint", "unsigned-varint 0.7.2", "void", @@ -6934,7 +6964,7 @@ dependencies = [ "sha2 0.10.8", "snow", "static_assertions", - "thiserror", + "thiserror 1.0.61", "x25519-dalek", "zeroize", ] @@ -6977,7 +7007,7 @@ dependencies = [ "ring 0.16.20", "rustls 0.21.7", "socket2 0.5.7", - "thiserror", + "thiserror 1.0.61", "tokio", ] @@ -7066,7 +7096,7 @@ dependencies = [ "ring 0.16.20", "rustls 0.21.7", "rustls-webpki 0.101.4", - "thiserror", + "thiserror 1.0.61", "x509-parser 0.15.1", "yasna", ] @@ -7117,7 +7147,7 @@ dependencies = [ "pin-project-lite", "rw-stream-sink", "soketto 0.8.0", - "thiserror", + "thiserror 1.0.61", "url", "webpki-roots 0.25.2", ] @@ -7131,7 +7161,7 @@ dependencies = [ "futures 0.3.31", "libp2p-core", "log", - "thiserror", + "thiserror 1.0.61", "yamux", ] @@ -7321,7 +7351,7 @@ dependencies = [ "socket2 0.5.7", "static_assertions", "str0m", - "thiserror", + "thiserror 1.0.61", "tokio", "tokio-stream", "tokio-tungstenite", @@ -7658,7 +7688,7 @@ dependencies = [ "rand_chacha", "rand_distr", "subtle 2.5.0", - "thiserror", + "thiserror 1.0.61", "zeroize", ] @@ -7681,6 +7711,24 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "mmr-primitives" +version = "1.15.1" +source = "git+https://github.com/bifrost-io/hyperbridge?branch=stable2407#b814ef3a015c1821fb0c7ec11e559cf4ddad7598" +dependencies = [ + "ckb-merkle-mountain-range", + "frame-system", + "ismp", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", +] + [[package]] name = "mmr-rpc" version = "37.0.0" @@ -7993,7 +8041,7 @@ dependencies = [ "anyhow", "byteorder", "paste", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -8007,7 +8055,7 @@ dependencies = [ "log", "netlink-packet-core", "netlink-sys", - "thiserror", + "thiserror 1.0.61", "tokio", ] @@ -8032,7 +8080,7 @@ checksum = "ae72fd9dbd7f55dda80c00d66acc3b2130436fcba9ea89118fc508eaae48dfb0" dependencies = [ "cc", "libc", - "thiserror", + "thiserror 1.0.61", "winapi", ] @@ -8372,7 +8420,7 @@ dependencies = [ "orchestra-proc-macro", "pin-project", "prioritized-metered-channel", - "thiserror", + "thiserror 1.0.61", "tracing", ] @@ -8580,13 +8628,11 @@ name = "pallet-asset-tx-payment" version = "37.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" dependencies = [ - "frame-benchmarking", "frame-support", "frame-system", "pallet-transaction-payment", "parity-scale-codec", "scale-info", - "serde", "sp-core", "sp-io", "sp-runtime", @@ -8826,7 +8872,6 @@ name = "pallet-collator-selection" version = "18.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" dependencies = [ - "frame-benchmarking", "frame-support", "frame-system", "log", @@ -9075,7 +9120,7 @@ dependencies = [ name = "pallet-evm-precompile-call-permit" version = "0.1.3" dependencies = [ - "derive_more", + "derive_more 0.99.18", "evm", "fp-evm", "frame-support", @@ -9180,6 +9225,22 @@ dependencies = [ "sp-staking", ] +[[package]] +name = "pallet-hyperbridge" +version = "1.15.1" +source = "git+https://github.com/bifrost-io/hyperbridge?branch=stable2407#b814ef3a015c1821fb0c7ec11e559cf4ddad7598" +dependencies = [ + "anyhow", + "frame-support", + "frame-system", + "ismp", + "pallet-ismp", + "parity-scale-codec", + "primitive-types", + "scale-info", + "sp-std", +] + [[package]] name = "pallet-identity" version = "37.0.0" @@ -9231,6 +9292,30 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-ismp" +version = "1.15.1" +source = "git+https://github.com/bifrost-io/hyperbridge?branch=stable2407#b814ef3a015c1821fb0c7ec11e559cf4ddad7598" +dependencies = [ + "anyhow", + "fortuples", + "frame-benchmarking", + "frame-support", + "frame-system", + "ismp", + "log", + "mmr-primitives", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-membership" version = "37.0.0" @@ -10126,7 +10211,7 @@ version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" dependencies = [ - "thiserror", + "thiserror 1.0.61", "ucd-trie", ] @@ -10263,7 +10348,7 @@ name = "polkadot-availability-distribution" version = "17.0.1" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" dependencies = [ - "derive_more", + "derive_more 0.99.18", "fatality", "futures 0.3.31", "parity-scale-codec", @@ -10278,7 +10363,7 @@ dependencies = [ "schnellru", "sp-core", "sp-keystore", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10300,7 +10385,7 @@ dependencies = [ "rand", "sc-network", "schnellru", - "thiserror", + "thiserror 1.0.61", "tokio", "tracing-gum", ] @@ -10340,7 +10425,7 @@ dependencies = [ "sp-maybe-compressed-blob", "sp-runtime", "substrate-build-script-utils", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -10360,7 +10445,7 @@ dependencies = [ "sp-core", "sp-keystore", "sp-runtime", - "thiserror", + "thiserror 1.0.61", "tokio-util", "tracing-gum", ] @@ -10381,7 +10466,7 @@ name = "polkadot-dispute-distribution" version = "17.0.1" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" dependencies = [ - "derive_more", + "derive_more 0.99.18", "fatality", "futures 0.3.31", "futures-timer", @@ -10397,7 +10482,7 @@ dependencies = [ "schnellru", "sp-application-crypto", "sp-keystore", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10412,7 +10497,7 @@ dependencies = [ "reed-solomon-novelpoly", "sp-core", "sp-trie", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -10456,7 +10541,7 @@ dependencies = [ "polkadot-primitives", "sc-network", "sp-consensus", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10474,7 +10559,7 @@ dependencies = [ "polkadot-primitives", "sp-core", "sp-maybe-compressed-blob", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10484,7 +10569,7 @@ version = "17.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" dependencies = [ "bitvec", - "derive_more", + "derive_more 0.99.18", "futures 0.3.31", "futures-timer", "itertools 0.11.0", @@ -10507,7 +10592,7 @@ dependencies = [ "sp-consensus", "sp-consensus-slots", "sp-runtime", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10529,7 +10614,7 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "sp-consensus", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10549,7 +10634,7 @@ dependencies = [ "polkadot-statement-table", "schnellru", "sp-keystore", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10563,7 +10648,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "sp-keystore", - "thiserror", + "thiserror 1.0.61", "tracing-gum", "wasm-timer", ] @@ -10618,7 +10703,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10637,7 +10722,7 @@ dependencies = [ "polkadot-primitives", "sc-keystore", "schnellru", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10654,7 +10739,7 @@ dependencies = [ "polkadot-primitives", "sp-blockchain", "sp-inherents", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10668,7 +10753,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10686,7 +10771,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "schnellru", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10714,7 +10799,7 @@ dependencies = [ "slotmap", "sp-core", "tempfile", - "thiserror", + "thiserror 1.0.61", "tokio", "tracing-gum", ] @@ -10731,7 +10816,7 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "sp-keystore", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10757,7 +10842,7 @@ dependencies = [ "sp-externalities", "sp-io", "sp-tracing", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10791,7 +10876,7 @@ dependencies = [ "sc-network", "sc-network-types", "sp-core", - "thiserror", + "thiserror 1.0.61", "tokio", ] @@ -10822,7 +10907,7 @@ dependencies = [ "async-channel", "async-trait", "bitvec", - "derive_more", + "derive_more 0.99.18", "fatality", "futures 0.3.31", "hex", @@ -10836,7 +10921,7 @@ dependencies = [ "sc-network-types", "sp-runtime", "strum 0.26.3", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10859,7 +10944,7 @@ dependencies = [ "sp-keystore", "sp-maybe-compressed-blob", "sp-runtime", - "thiserror", + "thiserror 1.0.61", "zstd 0.12.4", ] @@ -10880,7 +10965,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf dependencies = [ "async-trait", "bitvec", - "derive_more", + "derive_more 0.99.18", "fatality", "futures 0.3.31", "orchestra", @@ -10900,7 +10985,7 @@ dependencies = [ "sp-consensus-babe", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -10909,7 +10994,7 @@ version = "17.1.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" dependencies = [ "async-trait", - "derive_more", + "derive_more 0.99.18", "fatality", "futures 0.3.31", "futures-channel", @@ -10935,7 +11020,7 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-keystore", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -10967,7 +11052,7 @@ version = "14.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" dependencies = [ "bounded-collections", - "derive_more", + "derive_more 0.99.18", "parity-scale-codec", "polkadot-core-primitives", "scale-info", @@ -11107,7 +11192,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf dependencies = [ "bitflags 1.3.2", "bitvec", - "derive_more", + "derive_more 0.99.18", "frame-benchmarking", "frame-support", "frame-system", @@ -11259,7 +11344,7 @@ dependencies = [ "sp-weights", "staging-xcm", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.61", "tracing-gum", "westend-runtime", "xcm-runtime-apis", @@ -11284,7 +11369,7 @@ dependencies = [ "polkadot-primitives", "sp-keystore", "sp-staking", - "thiserror", + "thiserror 1.0.61", "tracing-gum", ] @@ -11452,7 +11537,7 @@ name = "precompile-utils" version = "0.1.0" source = "git+https://github.com/bifrost-io/frontier?branch=release-polkadot-stable2407#81ebdfa2d6b75e2ef85311ffda6a8f1fe56e3834" dependencies = [ - "derive_more", + "derive_more 0.99.18", "environmental", "evm", "fp-evm", @@ -11573,11 +11658,11 @@ checksum = "a172e6cc603231f2cf004232eabcecccc0da53ba576ab286ef7baa0cfc7927ad" dependencies = [ "coarsetime", "crossbeam-queue", - "derive_more", + "derive_more 0.99.18", "futures 0.3.31", "futures-timer", "nanorand", - "thiserror", + "thiserror 1.0.61", "tracing", ] @@ -11672,7 +11757,7 @@ dependencies = [ "lazy_static", "memchr", "parking_lot 0.12.3", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -11854,7 +11939,7 @@ dependencies = [ "asynchronous-codec", "bytes", "quick-protobuf", - "thiserror", + "thiserror 1.0.61", "unsigned-varint 0.7.2", ] @@ -11870,7 +11955,7 @@ dependencies = [ "quinn-udp 0.3.2", "rustc-hash", "rustls 0.20.9", - "thiserror", + "thiserror 1.0.61", "tokio", "tracing", "webpki", @@ -11889,7 +11974,7 @@ dependencies = [ "quinn-udp 0.4.1", "rustc-hash", "rustls 0.21.7", - "thiserror", + "thiserror 1.0.61", "tokio", "tracing", ] @@ -11906,7 +11991,7 @@ dependencies = [ "rustc-hash", "rustls 0.20.9", "slab", - "thiserror", + "thiserror 1.0.61", "tinyvec", "tracing", "webpki", @@ -11924,7 +12009,7 @@ dependencies = [ "rustc-hash", "rustls 0.21.7", "slab", - "thiserror", + "thiserror 1.0.61", "tinyvec", "tracing", ] @@ -12101,7 +12186,7 @@ checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom", "redox_syscall 0.2.16", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -12110,10 +12195,10 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87413ebb313323d431e85d0afc5a68222aaed972843537cbfe5f061cf1b4bcab" dependencies = [ - "derive_more", + "derive_more 0.99.18", "fs-err", "static_init", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -12445,7 +12530,7 @@ dependencies = [ "netlink-packet-route", "netlink-proto", "nix 0.24.3", - "thiserror", + "thiserror 1.0.61", "tokio", ] @@ -12732,7 +12817,7 @@ dependencies = [ "log", "sp-core", "sp-wasm-interface", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -12762,7 +12847,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -12877,7 +12962,7 @@ dependencies = [ "sp-panic-handler", "sp-runtime", "sp-version", - "thiserror", + "thiserror 1.0.61", "tokio", ] @@ -12955,7 +13040,7 @@ dependencies = [ "sp-runtime", "sp-state-machine", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -12984,7 +13069,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -13020,7 +13105,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -13042,7 +13127,7 @@ dependencies = [ "sp-core", "sp-keystore", "sp-runtime", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -13076,7 +13161,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.61", "tokio", "wasm-timer", ] @@ -13098,7 +13183,7 @@ dependencies = [ "sp-consensus-beefy", "sp-core", "sp-runtime", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -13155,7 +13240,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -13175,7 +13260,7 @@ dependencies = [ "sp-blockchain", "sp-core", "sp-runtime", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -13210,7 +13295,7 @@ dependencies = [ "sp-runtime", "sp-timestamp", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -13268,7 +13353,7 @@ dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", "sp-wasm-interface", - "thiserror", + "thiserror 1.0.61", "wasm-instrument", ] @@ -13329,7 +13414,7 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-keystore", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -13358,7 +13443,7 @@ dependencies = [ "sp-keystore", "sp-mixnet", "sp-runtime", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -13403,7 +13488,7 @@ dependencies = [ "sp-core", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.61", "tokio", "tokio-stream", "unsigned-varint 0.7.2", @@ -13467,7 +13552,7 @@ dependencies = [ "sp-blockchain", "sp-core", "sp-runtime", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -13502,7 +13587,7 @@ dependencies = [ "sp-core", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.61", "tokio", "tokio-stream", ] @@ -13539,7 +13624,7 @@ dependencies = [ "multiaddr 0.18.1", "multihash 0.19.1", "rand", - "thiserror", + "thiserror 1.0.61", "zeroize", ] @@ -13635,7 +13720,7 @@ dependencies = [ "sp-rpc", "sp-runtime", "sp-version", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -13687,7 +13772,7 @@ dependencies = [ "sp-rpc", "sp-runtime", "sp-version", - "thiserror", + "thiserror 1.0.61", "tokio", "tokio-stream", ] @@ -13750,7 +13835,7 @@ dependencies = [ "static_init", "substrate-prometheus-endpoint", "tempfile", - "thiserror", + "thiserror 1.0.61", "tokio", "tracing", "tracing-futures", @@ -13776,7 +13861,7 @@ dependencies = [ "fs4", "log", "sp-core", - "thiserror", + "thiserror 1.0.61", "tokio", ] @@ -13796,7 +13881,7 @@ dependencies = [ "serde_json", "sp-blockchain", "sp-runtime", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -13804,7 +13889,7 @@ name = "sc-sysinfo" version = "37.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" dependencies = [ - "derive_more", + "derive_more 0.99.18", "futures 0.3.31", "libc", "log", @@ -13836,7 +13921,7 @@ dependencies = [ "sc-utils", "serde", "serde_json", - "thiserror", + "thiserror 1.0.61", "wasm-timer", ] @@ -13864,7 +13949,7 @@ dependencies = [ "sp-rpc", "sp-runtime", "sp-tracing", - "thiserror", + "thiserror 1.0.61", "tracing", "tracing-log", "tracing-subscriber", @@ -13905,7 +13990,7 @@ dependencies = [ "sp-tracing", "sp-transaction-pool", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -13921,7 +14006,7 @@ dependencies = [ "sp-blockchain", "sp-core", "sp-runtime", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -13955,7 +14040,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" dependencies = [ - "derive_more", + "derive_more 0.99.18", "parity-scale-codec", "scale-bits", "scale-type-resolver", @@ -13970,7 +14055,7 @@ checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ "bitvec", "cfg-if", - "derive_more", + "derive_more 0.99.18", "parity-scale-codec", "scale-info-derive", "serde", @@ -14083,7 +14168,7 @@ dependencies = [ "log", "rand", "slab", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -14206,6 +14291,16 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-hex-utils" +version = "0.1.0" +source = "git+https://github.com/bifrost-io/hyperbridge?branch=stable2407#b814ef3a015c1821fb0c7ec11e559cf4ddad7598" +dependencies = [ + "anyhow", + "hex", + "serde", +] + [[package]] name = "serde_bytes" version = "0.11.12" @@ -14519,7 +14614,7 @@ dependencies = [ "bs58 0.5.0", "chacha20", "crossbeam-queue", - "derive_more", + "derive_more 0.99.18", "ed25519-zebra", "either", "event-listener 2.5.3", @@ -14568,7 +14663,7 @@ dependencies = [ "async-lock 2.8.0", "base64 0.21.2", "blake2-rfc", - "derive_more", + "derive_more 0.99.18", "either", "event-listener 2.5.3", "fnv", @@ -14687,7 +14782,7 @@ dependencies = [ "sp-state-machine", "sp-trie", "sp-version", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -14767,7 +14862,7 @@ dependencies = [ "sp-database", "sp-runtime", "sp-state-machine", - "thiserror", + "thiserror 1.0.61", "tracing", ] @@ -14783,7 +14878,7 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -14908,7 +15003,7 @@ dependencies = [ "sp-storage", "ss58-registry", "substrate-bip39", - "thiserror", + "thiserror 1.0.61", "tracing", "w3f-bls", "zeroize", @@ -14988,7 +15083,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -15043,7 +15138,7 @@ name = "sp-maybe-compressed-blob" version = "11.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" dependencies = [ - "thiserror", + "thiserror 1.0.61", "zstd 0.12.4", ] @@ -15082,7 +15177,7 @@ dependencies = [ "sp-core", "sp-debug-derive", "sp-runtime", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -15228,7 +15323,7 @@ dependencies = [ "sp-externalities", "sp-panic-handler", "sp-trie", - "thiserror", + "thiserror 1.0.61", "tracing", "trie-db", ] @@ -15253,7 +15348,7 @@ dependencies = [ "sp-externalities", "sp-runtime", "sp-runtime-interface", - "thiserror", + "thiserror 1.0.61", "x25519-dalek", ] @@ -15283,7 +15378,7 @@ dependencies = [ "parity-scale-codec", "sp-inherents", "sp-runtime", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -15337,7 +15432,7 @@ dependencies = [ "schnellru", "sp-core", "sp-externalities", - "thiserror", + "thiserror 1.0.61", "tracing", "trie-db", "trie-root", @@ -15357,7 +15452,7 @@ dependencies = [ "sp-runtime", "sp-std", "sp-version-proc-macro", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -15475,7 +15570,7 @@ dependencies = [ "sha2 0.10.8", "smallvec", "sqlformat", - "thiserror", + "thiserror 1.0.61", "tokio", "tokio-stream", "tracing", @@ -15578,7 +15673,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-statement-store", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -15703,7 +15798,7 @@ dependencies = [ "sctp-proto", "serde", "sha-1 0.10.1", - "thiserror", + "thiserror 1.0.61", "tracing", ] @@ -15844,7 +15939,7 @@ dependencies = [ "hyper-util", "log", "prometheus", - "thiserror", + "thiserror 1.0.61", "tokio", ] @@ -16043,7 +16138,16 @@ version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.61", +] + +[[package]] +name = "thiserror" +version = "2.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" +dependencies = [ + "thiserror-impl 2.0.8", ] [[package]] @@ -16077,6 +16181,17 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "thiserror-impl" +version = "2.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "thousands" version = "0.2.0" @@ -16526,7 +16641,7 @@ dependencies = [ "rand", "smallvec", "socket2 0.4.9", - "thiserror", + "thiserror 1.0.61", "tinyvec", "tokio", "tracing", @@ -16551,7 +16666,7 @@ dependencies = [ "once_cell", "rand", "smallvec", - "thiserror", + "thiserror 1.0.61", "tinyvec", "tokio", "tracing", @@ -16573,7 +16688,7 @@ dependencies = [ "rand", "resolv-conf", "smallvec", - "thiserror", + "thiserror 1.0.61", "tokio", "tracing", "trust-dns-proto 0.23.2", @@ -16606,7 +16721,7 @@ dependencies = [ "rand", "rustls 0.21.7", "sha1", - "thiserror", + "thiserror 1.0.61", "url", "utf-8", ] @@ -16809,7 +16924,7 @@ dependencies = [ "rand_core", "sha2 0.10.8", "sha3", - "thiserror", + "thiserror 1.0.61", "zeroize", ] @@ -16930,7 +17045,7 @@ dependencies = [ "strum 0.24.1", "strum_macros 0.24.3", "tempfile", - "thiserror", + "thiserror 1.0.61", "wasm-opt-cxx-sys", "wasm-opt-sys", ] @@ -17097,7 +17212,7 @@ dependencies = [ "log", "object 0.30.4", "target-lexicon", - "thiserror", + "thiserror 1.0.61", "wasmparser", "wasmtime-cranelift-shared", "wasmtime-environ", @@ -17132,7 +17247,7 @@ dependencies = [ "object 0.30.4", "serde", "target-lexicon", - "thiserror", + "thiserror 1.0.61", "wasmparser", "wasmtime-types", ] @@ -17215,7 +17330,7 @@ checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" dependencies = [ "cranelift-entity", "serde", - "thiserror", + "thiserror 1.0.61", "wasmparser", ] @@ -17744,7 +17859,7 @@ dependencies = [ "nom", "oid-registry 0.6.1", "rusticata-macros", - "thiserror", + "thiserror 1.0.61", "time", ] @@ -17761,44 +17876,10 @@ dependencies = [ "nom", "oid-registry 0.7.0", "rusticata-macros", - "thiserror", + "thiserror 1.0.61", "time", ] -[[package]] -name = "xcm-emulator" -version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" -dependencies = [ - "cumulus-pallet-parachain-system", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core", - "cumulus-primitives-parachain-inherent", - "cumulus-test-relay-sproof-builder", - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "lazy_static", - "log", - "pallet-balances", - "pallet-message-queue", - "parachains-common", - "parity-scale-codec", - "paste", - "polkadot-parachain-primitives", - "polkadot-primitives", - "polkadot-runtime-parachains", - "sp-arithmetic", - "sp-core", - "sp-crypto-hashing", - "sp-io", - "sp-runtime", - "sp-std", - "sp-tracing", - "staging-xcm", - "staging-xcm-executor", -] - [[package]] name = "xcm-procedural" version = "10.1.0" diff --git a/Cargo.toml b/Cargo.toml index ab5349084..6e4d0bc65 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,13 +31,14 @@ members = [ "pallets/channel-commission", "pallets/clouds-convert", "pallets/vbnc-convert", + "pallets/ismp", "runtime/bifrost-kusama", "runtime/bifrost-polkadot/src/evm/evm-utility/macro", "runtime/bifrost-polkadot/src/evm/precompiles/call-permit", "runtime/bifrost-polkadot", - "integration-tests" +# "integration-tests" ] resolver = "2" @@ -102,6 +103,7 @@ pallet-evm-accounts = { path = "pallets/evm-accounts", defaul pallet-evm-accounts-rpc-runtime-api = { path = "pallets/evm-accounts/rpc/runtime-api", default-features = false } pallet-prices = { path = "pallets/prices", default-features = false } pallet-traits = { path = "pallets/traits", default-features = false } +bifrost-ismp = { path = "pallets/ismp", default-features = false } # Zenlink merkle-distributor = { git = "https://github.com/bifrost-io/Zenlink-DEX-Module", branch = "release-polkadot-stable2407", default-features = false } @@ -151,6 +153,12 @@ pallet-evm-precompile-sha3fips = { git = "https://github.com/bifrost-io/frontier pallet-evm-precompile-simple = { git = "https://github.com/bifrost-io/frontier", branch = "release-polkadot-stable2407", default-features = false } precompile-utils = { git = "https://github.com/bifrost-io/frontier", branch = "release-polkadot-stable2407", default-features = false } +# Hyperbridge +pallet-ismp = { git = "https://github.com/bifrost-io/hyperbridge", branch = "stable2407", default-features = false } +ismp = { git = "https://github.com/bifrost-io/hyperbridge", branch = "stable2407", default-features = false } +pallet-hyperbridge = { git = "https://github.com/bifrost-io/hyperbridge", branch = "stable2407", default-features = false } +anyhow = { version = "1.0.93", default-features = false } + # polkadot-sdk (wasm) cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false } cumulus-client-consensus-proposer = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false } diff --git a/pallets/ismp/Cargo.toml b/pallets/ismp/Cargo.toml new file mode 100644 index 000000000..38e417ded --- /dev/null +++ b/pallets/ismp/Cargo.toml @@ -0,0 +1,47 @@ +[package] +authors = ["Liebi Technologies "] +edition = "2021" +name = "bifrost-ismp" +version = "0.8.0" + +[package.metadata.docs.rs] +targets = ['x86_64-unknown-linux-gnu'] + +[dependencies] +# crates.io +codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } +scale-info = { workspace = true, default-features = false, features = ["derive"] } +anyhow = { workspace = true, default-features = false } + +# polytope labs +ismp = { workspace = true, default-features = false } +pallet-ismp = { workspace = true, default-features = false } + +# substrate +frame-support = { workspace = true } +frame-system = { workspace = true } +pallet-balances = { workspace = true } +sp-runtime = { workspace = true } +sp-core = { workspace = true } + +[dev-dependencies] + +[features] +default = ["std"] +std = [ + "codec/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "scale-info/std", + "ismp/std", + "pallet-ismp/std", + "pallet-balances/std", + "anyhow/std" +] + +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", +] diff --git a/pallets/ismp/src/lib.rs b/pallets/ismp/src/lib.rs new file mode 100644 index 000000000..c62062fe5 --- /dev/null +++ b/pallets/ismp/src/lib.rs @@ -0,0 +1,273 @@ +// 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 . + +//! ISMP Assets +//! Simple Demo for Asset transfer over ISMP +#![cfg_attr(not(feature = "std"), no_std)] +#![deny(missing_docs)] + +extern crate alloc; + +use alloc::{format, string::String}; +use frame_support::pallet_prelude::RuntimeDebug; +use frame_support::PalletId; +use ismp::{ + error::Error as IsmpError, + module::IsmpModule, + router::{PostRequest, Request, Response, Timeout}, +}; +pub use pallet::*; +use pallet_ismp::ModuleId; +use sp_core::H160; + +/// Transfer payload +/// This would be encoded to bytes as the request data +#[derive( + Clone, codec::Encode, codec::Decode, scale_info::TypeInfo, PartialEq, Eq, RuntimeDebug, +)] +pub struct Payload { + /// Destination account + pub to: AccountId, + /// Source account + pub from: AccountId, + /// Amount to be transferred + pub amount: Balance, +} + +/// Extrisnic params for evm dispatch +#[derive( + Clone, codec::Encode, codec::Decode, scale_info::TypeInfo, PartialEq, Eq, RuntimeDebug, +)] +pub struct EvmParams { + /// Destination module + pub module: H160, + /// Destination EVM host + pub destination: u32, + /// Timeout timestamp on destination chain in seconds + pub timeout: u64, + /// Request count + pub count: u64, +} + +#[frame_support::pallet] +pub mod pallet { + use super::*; + use crate::alloc::string::ToString; + use alloc::{vec, vec::Vec}; + use frame_support::{ + pallet_prelude::*, + traits::{ + fungible::{Inspect, Mutate}, + tokens::Balance, + }, + }; + use frame_system::pallet_prelude::*; + use ismp::{ + consensus::{StateCommitment, StateMachineHeight}, + dispatcher::{DispatchPost, DispatchRequest, FeeMetadata, IsmpDispatcher}, + host::{IsmpHost, StateMachine}, + }; + + /// [`IsmpModule`] module identifier for incoming requests from hyperbridge + pub const PALLET_BIFROST_ID: &'static [u8] = b"ismp-bnc"; + + /// [`PalletId`] where protocol fees will be collected + pub const PALLET_ID: ModuleId = ModuleId::Pallet(PalletId(*b"ismp-bnc")); + + #[pallet::pallet] + pub struct Pallet(_); + + impl Default for Pallet { + fn default() -> Self { + Self(PhantomData) + } + } + + /// Pallet Configuration + #[pallet::config] + pub trait Config: frame_system::Config + pallet_ismp::Config { + /// Overarching event + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + /// Native balance + type Balance: Balance + + Into<>::Balance> + + From; + /// Native currency implementation + type NativeCurrency: Mutate; + /// Ismp message disptacher + type IsmpHost: IsmpHost + + IsmpDispatcher::Balance> + + Default; + } + + /// Pallet events + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// Some balance has been received + BalanceReceived { + /// Source account + from: T::AccountId, + /// Receiving account + to: T::AccountId, + /// Amount that was received + amount: ::Balance, + /// Source chain's Id + source_chain: StateMachine, + }, + /// Request data receieved + Request { + /// Source of the request + source: StateMachine, + /// utf-8 decoded data + data: String, + }, + /// Get response recieved + GetResponse(Vec>>), + } + + /// Pallet Errors + #[pallet::error] + pub enum Error { + /// Error encountered when initializing transfer + TransferFailed, + } + + // Pallet implements [`Hooks`] trait to define some logic to execute in some context. + #[pallet::hooks] + impl Hooks> for Pallet {} + + #[pallet::call] + impl Pallet { + /// Dispatch request to a connected EVM chain. + #[pallet::weight(Weight::from_parts(1_000_000, 0))] + #[pallet::call_index(0)] + pub fn dispatch_to_evm(origin: OriginFor, params: EvmParams) -> DispatchResult { + let origin = ensure_signed(origin)?; + let post = DispatchPost { + dest: StateMachine::Evm(params.destination), + from: PALLET_ID.to_bytes(), + to: params.module.0.to_vec(), + timeout: params.timeout, + body: b"Hello from polkadot".to_vec(), + }; + let dispatcher = T::IsmpHost::default(); + for _ in 0..params.count { + // dispatch the request + dispatcher + .dispatch_request( + DispatchRequest::Post(post.clone()), + FeeMetadata { + payer: origin.clone(), + fee: Default::default(), + }, + ) + .map_err(|_| Error::::TransferFailed)?; + } + Ok(()) + } + + /// Insert an unverified state commitment into the host, this is for testing purposes only. + #[pallet::weight(Weight::from_parts(1_000_000, 0))] + #[pallet::call_index(1)] + pub fn set_state_commitment( + origin: OriginFor, + height: StateMachineHeight, + commitment: StateCommitment, + ) -> DispatchResult { + use ismp::events::{Event, StateMachineUpdated}; + ensure_root(origin)?; + let host = T::IsmpHost::default(); + + // shouldn't return an error + host.store_state_machine_commitment(height, commitment) + .unwrap(); + host.store_state_machine_update_time(height, host.timestamp()) + .unwrap(); + + // deposit the event + pallet_ismp::Pallet::::deposit_pallet_event(Event::StateMachineUpdated( + StateMachineUpdated { + state_machine_id: height.id, + latest_height: height.height, + }, + )); + + Ok(()) + } + } + + impl IsmpModule for Pallet { + fn on_accept(&self, request: PostRequest) -> Result<(), anyhow::Error> { + let source_chain = request.source; + + match source_chain { + StateMachine::Evm(_) => Pallet::::deposit_event(Event::Request { + source: source_chain, + data: unsafe { String::from_utf8_unchecked(request.body) }, + }), + source => Err(IsmpError::Custom(format!("Unsupported source {source:?}")))?, + } + + Ok(()) + } + + fn on_response(&self, response: Response) -> Result<(), anyhow::Error> { + match response { + Response::Post(_) => Err(IsmpError::Custom( + "Balance transfer protocol does not accept post responses".to_string(), + ))?, + Response::Get(res) => Pallet::::deposit_event(Event::::GetResponse( + res.values + .into_iter() + .map(|storage_value| storage_value.value) + .collect(), + )), + }; + + Ok(()) + } + + fn on_timeout(&self, timeout: Timeout) -> Result<(), anyhow::Error> { + let request = match timeout { + Timeout::Request(Request::Post(post)) => Request::Post(post), + _ => Err(IsmpError::Custom( + "Only Post requests allowed, found Get".to_string(), + ))?, + }; + let source_chain = request.source_chain(); + + let payload = ::Balance> as codec::Decode>::decode( + &mut &*request.body().expect("Request has been checked; qed"), + ) + .map_err(|_| IsmpError::Custom("Failed to decode request data".to_string()))?; + >::mint_into( + &payload.from, + payload.amount.into(), + ) + .map_err(|_| IsmpError::Custom("Failed to mint funds".to_string()))?; + Pallet::::deposit_event(Event::::BalanceReceived { + from: payload.from, + to: payload.to, + amount: payload.amount, + source_chain, + }); + Ok(()) + } + } +} diff --git a/runtime/bifrost-polkadot/Cargo.toml b/runtime/bifrost-polkadot/Cargo.toml index f1f823a35..e010e8ef8 100644 --- a/runtime/bifrost-polkadot/Cargo.toml +++ b/runtime/bifrost-polkadot/Cargo.toml @@ -162,7 +162,7 @@ bb-bnc-rpc-runtime-api = { workspace = true } bifrost-vesting = { workspace = true } bifrost-vstoken-conversion = { workspace = true } bifrost-vtoken-minting = { workspace = true } -bifrost-vtoken-voting = { workspace = true, features = [ "polkadot" ] } +bifrost-vtoken-voting = { workspace = true, features = ["polkadot"] } bifrost-xcm-interface = { workspace = true } bifrost-parachain-staking = { workspace = true } lend-market = { workspace = true } @@ -172,6 +172,13 @@ leverage-staking = { workspace = true } bifrost-channel-commission = { workspace = true } bifrost-clouds-convert = { workspace = true } bifrost-vtoken-minting-rpc-runtime-api = { workspace = true } +bifrost-ismp = { workspace = true } + +# Hyperbridge +pallet-ismp = { workspace = true, features = ["unsigned"] } +ismp = { workspace = true } +pallet-hyperbridge = { workspace = true } +anyhow = { workspace = true } [build-dependencies] substrate-wasm-builder = { workspace = true, optional = true } @@ -179,140 +186,136 @@ substrate-wasm-builder = { workspace = true, optional = true } [features] default = ["std"] std = [ - "parity-scale-codec/std", - "log/std", - "scale-info/std", - "strum/std", - - "frame-executive/std", - "frame-metadata-hash-extension/std", - "frame-support/std", - "frame-system-rpc-runtime-api/std", - "frame-system/std", - "frame-try-runtime/std", - "pallet-aura/std", - "pallet-balances/std", - "pallet-bounties/std", - "pallet-collective/std", - "pallet-conviction-voting/std", - "pallet-democracy/std", - "pallet-elections-phragmen/std", - "pallet-identity/std", - "pallet-indices/std", - "pallet-membership/std", - "pallet-multisig/std", - "pallet-preimage/std", - "pallet-proxy/std", - "pallet-ranked-collective/std", - "pallet-referenda/std", - "pallet-scheduler/std", - "pallet-session/std", - "pallet-timestamp/std", - "pallet-tips/std", - "pallet-tx-pause/std", - "pallet-transaction-payment-rpc-runtime-api/std", - "pallet-transaction-payment/std", - "pallet-treasury/std", - "pallet-whitelist/std", - "sp-api/std", - "sp-arithmetic/std", - "sp-block-builder/std", - "sp-consensus-aura/std", - "sp-core/std", - "sp-inherents/std", - "sp-io/std", - "sp-offchain/std", - "sp-runtime/std", - "sp-session/std", - "sp-staking/std", - "sp-std/std", - "sp-transaction-pool/std", - "sp-genesis-builder/std", - - "cumulus-pallet-aura-ext/std", - "cumulus-pallet-parachain-system/std", - "cumulus-pallet-xcm/std", - "cumulus-pallet-xcmp-queue/std", - "cumulus-primitives-aura/std", - "cumulus-primitives-core/std", - "cumulus-primitives-timestamp/std", - "cumulus-primitives-utility/std", - "parachain-info/std", - - "polkadot-primitives/std", - "xcm-builder/std", - "xcm-executor/std", - "xcm/std", - "xcm-runtime-apis/std", - - "orml-tokens/std", - "orml-traits/std", - "orml-unknown-tokens/std", - "orml-xcm-support/std", - "orml-oracle/std", - "orml-xcm/std", - "orml-xtokens/std", - - "merkle-distributor/std", - "zenlink-protocol-runtime-api/std", - "zenlink-protocol/std", - - "bifrost-asset-registry/std", - "bifrost-buy-back/std", - "bifrost-cross-in-out/std", - "bifrost-currencies/std", - "bifrost-farming-rpc-runtime-api/std", - "bifrost-farming/std", - "bifrost-fee-share/std", - "bifrost-flexible-fee-rpc-runtime-api/std", - "bifrost-flexible-fee/std", - "bifrost-primitives/std", - "bifrost-runtime-common/std", - "bifrost-salp-rpc-runtime-api/std", - "bifrost-salp/std", - "bifrost-slp/std", - "bifrost-slp-v2/std", - "bifrost-slpx/std", - "bifrost-stable-pool-rpc-runtime-api/std", - "bifrost-stable-pool/std", - "bifrost-system-staking/std", - "bb-bnc-rpc-runtime-api/std", - "bb-bnc/std", - "bifrost-vesting/std", - "bifrost-vtoken-minting/std", - "bifrost-vtoken-voting/std", - "lend-market/std", - "lend-market-rpc-runtime-api/std", - "pallet-prices/std", - "leverage-staking/std", - "bifrost-xcm-interface/std", - "bifrost-channel-commission/std", - # Frontier - "fp-account/std", - "fp-evm/std", - "fp-rpc/std", - "fp-account/std", - "fp-self-contained/std", - "pallet-base-fee/std", - "pallet-dynamic-fee/std", - "pallet-ethereum/std", - "pallet-evm/std", - "pallet-evm-chain-id/std", - "pallet-evm-precompile-dispatch/std", - "pallet-evm-precompile-modexp/std", - "pallet-evm-precompile-sha3fips/std", - "pallet-evm-precompile-simple/std", - "pallet-evm-precompile-call-permit/std", - "pallet-evm-precompile-bn128/std", - "pallet-evm-precompile-blake2/std", - "pallet-evm-accounts/std", - "pallet-evm-accounts-rpc-runtime-api/std", - "bifrost-clouds-convert/std", - - "bifrost-vtoken-minting-rpc-runtime-api/std", - "bifrost-parachain-staking/std", - - "substrate-wasm-builder" + "parity-scale-codec/std", + "log/std", + "scale-info/std", + "strum/std", + "frame-executive/std", + "frame-metadata-hash-extension/std", + "frame-support/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "frame-try-runtime/std", + "pallet-aura/std", + "pallet-balances/std", + "pallet-bounties/std", + "pallet-collective/std", + "pallet-conviction-voting/std", + "pallet-democracy/std", + "pallet-elections-phragmen/std", + "pallet-identity/std", + "pallet-indices/std", + "pallet-membership/std", + "pallet-multisig/std", + "pallet-preimage/std", + "pallet-proxy/std", + "pallet-ranked-collective/std", + "pallet-referenda/std", + "pallet-scheduler/std", + "pallet-session/std", + "pallet-timestamp/std", + "pallet-tips/std", + "pallet-tx-pause/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-treasury/std", + "pallet-whitelist/std", + "sp-api/std", + "sp-arithmetic/std", + "sp-block-builder/std", + "sp-consensus-aura/std", + "sp-core/std", + "sp-inherents/std", + "sp-io/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-staking/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-genesis-builder/std", + "cumulus-pallet-aura-ext/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-aura/std", + "cumulus-primitives-core/std", + "cumulus-primitives-timestamp/std", + "cumulus-primitives-utility/std", + "parachain-info/std", + "polkadot-primitives/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm/std", + "xcm-runtime-apis/std", + "orml-tokens/std", + "orml-traits/std", + "orml-unknown-tokens/std", + "orml-xcm-support/std", + "orml-oracle/std", + "orml-xcm/std", + "orml-xtokens/std", + "merkle-distributor/std", + "zenlink-protocol-runtime-api/std", + "zenlink-protocol/std", + "bifrost-asset-registry/std", + "bifrost-buy-back/std", + "bifrost-cross-in-out/std", + "bifrost-currencies/std", + "bifrost-farming-rpc-runtime-api/std", + "bifrost-farming/std", + "bifrost-fee-share/std", + "bifrost-flexible-fee-rpc-runtime-api/std", + "bifrost-flexible-fee/std", + "bifrost-primitives/std", + "bifrost-runtime-common/std", + "bifrost-salp-rpc-runtime-api/std", + "bifrost-salp/std", + "bifrost-slp/std", + "bifrost-slp-v2/std", + "bifrost-slpx/std", + "bifrost-stable-pool-rpc-runtime-api/std", + "bifrost-stable-pool/std", + "bifrost-system-staking/std", + "bb-bnc-rpc-runtime-api/std", + "bb-bnc/std", + "bifrost-vesting/std", + "bifrost-vtoken-minting/std", + "bifrost-vtoken-voting/std", + "lend-market/std", + "lend-market-rpc-runtime-api/std", + "pallet-prices/std", + "leverage-staking/std", + "bifrost-xcm-interface/std", + "bifrost-channel-commission/std", + # Frontier + "fp-account/std", + "fp-evm/std", + "fp-rpc/std", + "fp-account/std", + "fp-self-contained/std", + "pallet-base-fee/std", + "pallet-dynamic-fee/std", + "pallet-ethereum/std", + "pallet-evm/std", + "pallet-evm-chain-id/std", + "pallet-evm-precompile-dispatch/std", + "pallet-evm-precompile-modexp/std", + "pallet-evm-precompile-sha3fips/std", + "pallet-evm-precompile-simple/std", + "pallet-evm-precompile-call-permit/std", + "pallet-evm-precompile-bn128/std", + "pallet-evm-precompile-blake2/std", + "pallet-evm-accounts/std", + "pallet-evm-accounts-rpc-runtime-api/std", + "bifrost-clouds-convert/std", + "bifrost-vtoken-minting-rpc-runtime-api/std", + "bifrost-parachain-staking/std", + "substrate-wasm-builder", + "pallet-ismp/std", + "ismp/std", + "pallet-hyperbridge/std", + "anyhow/std", ] with-tracing = ["frame-executive/with-tracing"] @@ -359,80 +362,83 @@ runtime-benchmarks = [ ] try-runtime = [ - "bifrost-asset-registry/try-runtime", - "bifrost-buy-back/try-runtime", - "bifrost-channel-commission/try-runtime", - "bifrost-clouds-convert/try-runtime", - "bifrost-cross-in-out/try-runtime", - "bifrost-currencies/try-runtime", - "bifrost-farming/try-runtime", - "bifrost-fee-share/try-runtime", - "bifrost-flexible-fee/try-runtime", - "bifrost-salp/try-runtime", - "bifrost-slp/try-runtime", - "bifrost-slp-v2/try-runtime", - "bifrost-slpx/try-runtime", - "bifrost-stable-asset/try-runtime", - "bifrost-stable-pool/try-runtime", - "bifrost-system-staking/try-runtime", - "bb-bnc/try-runtime", - "bifrost-vesting/try-runtime", - "bifrost-vstoken-conversion/try-runtime", - "bifrost-vtoken-minting/try-runtime", - "bifrost-vtoken-voting/try-runtime", - "bifrost-xcm-interface/try-runtime", - "cumulus-pallet-aura-ext/try-runtime", - "cumulus-pallet-parachain-system/try-runtime", - "cumulus-pallet-xcm/try-runtime", - "cumulus-pallet-xcmp-queue/try-runtime", - "frame-executive/try-runtime", - "frame-support/try-runtime", - "frame-system/try-runtime", - "frame-try-runtime", - "frame-try-runtime/try-runtime", - "lend-market/try-runtime", - "leverage-staking/try-runtime", - "merkle-distributor/try-runtime", - "orml-oracle/try-runtime", - "orml-tokens/try-runtime", - "orml-unknown-tokens/try-runtime", - "orml-xcm/try-runtime", - "orml-xtokens/try-runtime", - "pallet-aura/try-runtime", - "pallet-authorship/try-runtime", - "pallet-balances/try-runtime", - "pallet-bounties/try-runtime", - "pallet-collective/try-runtime", - "pallet-conviction-voting/try-runtime", - "pallet-democracy/try-runtime", - "pallet-elections-phragmen/try-runtime", - "pallet-identity/try-runtime", - "pallet-indices/try-runtime", - "pallet-membership/try-runtime", - "pallet-multisig/try-runtime", - "pallet-preimage/try-runtime", - "pallet-prices/try-runtime", - "pallet-proxy/try-runtime", - "pallet-ranked-collective/try-runtime", - "pallet-referenda/try-runtime", - "pallet-scheduler/try-runtime", - "pallet-session/try-runtime", - "pallet-timestamp/try-runtime", - "pallet-tips/try-runtime", - "pallet-tx-pause/try-runtime", - "pallet-transaction-payment/try-runtime", - "pallet-treasury/try-runtime", - "pallet-utility/try-runtime", - "pallet-whitelist/try-runtime", - "parachain-info/try-runtime", - "zenlink-protocol/try-runtime", - "fp-self-contained/try-runtime", - "pallet-ethereum/try-runtime", - "pallet-evm-accounts/try-runtime", - "pallet-evm/try-runtime", - "pallet-evm-chain-id/try-runtime", - "pallet-dynamic-fee/try-runtime", - "bifrost-parachain-staking/try-runtime", + "bifrost-asset-registry/try-runtime", + "bifrost-buy-back/try-runtime", + "bifrost-channel-commission/try-runtime", + "bifrost-clouds-convert/try-runtime", + "bifrost-cross-in-out/try-runtime", + "bifrost-currencies/try-runtime", + "bifrost-farming/try-runtime", + "bifrost-fee-share/try-runtime", + "bifrost-flexible-fee/try-runtime", + "bifrost-salp/try-runtime", + "bifrost-slp/try-runtime", + "bifrost-slp-v2/try-runtime", + "bifrost-slpx/try-runtime", + "bifrost-stable-asset/try-runtime", + "bifrost-stable-pool/try-runtime", + "bifrost-system-staking/try-runtime", + "bb-bnc/try-runtime", + "bifrost-vesting/try-runtime", + "bifrost-vstoken-conversion/try-runtime", + "bifrost-vtoken-minting/try-runtime", + "bifrost-vtoken-voting/try-runtime", + "bifrost-xcm-interface/try-runtime", + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", + "frame-executive/try-runtime", + "frame-support/try-runtime", + "frame-system/try-runtime", + "frame-try-runtime", + "frame-try-runtime/try-runtime", + "lend-market/try-runtime", + "leverage-staking/try-runtime", + "merkle-distributor/try-runtime", + "orml-oracle/try-runtime", + "orml-tokens/try-runtime", + "orml-unknown-tokens/try-runtime", + "orml-xcm/try-runtime", + "orml-xtokens/try-runtime", + "pallet-aura/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-bounties/try-runtime", + "pallet-collective/try-runtime", + "pallet-conviction-voting/try-runtime", + "pallet-democracy/try-runtime", + "pallet-elections-phragmen/try-runtime", + "pallet-identity/try-runtime", + "pallet-indices/try-runtime", + "pallet-membership/try-runtime", + "pallet-multisig/try-runtime", + "pallet-preimage/try-runtime", + "pallet-prices/try-runtime", + "pallet-proxy/try-runtime", + "pallet-ranked-collective/try-runtime", + "pallet-referenda/try-runtime", + "pallet-scheduler/try-runtime", + "pallet-session/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-tips/try-runtime", + "pallet-tx-pause/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-treasury/try-runtime", + "pallet-utility/try-runtime", + "pallet-whitelist/try-runtime", + "parachain-info/try-runtime", + "zenlink-protocol/try-runtime", + "fp-self-contained/try-runtime", + "pallet-ethereum/try-runtime", + "pallet-evm-accounts/try-runtime", + "pallet-evm/try-runtime", + "pallet-evm-chain-id/try-runtime", + "pallet-dynamic-fee/try-runtime", + "bifrost-parachain-staking/try-runtime", + "bifrost-ismp/try-runtime", + "pallet-ismp/try-runtime", + "pallet-hyperbridge/try-runtime", ] # Enable the metadata hash generation in the wasm builder. diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index d96b51bdd..af6709736 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -57,6 +57,7 @@ pub use frame_support::{ PalletId, StorageValue, }; use frame_system::limits::{BlockLength, BlockWeights}; +use ismp::{host::StateMachine, module::IsmpModule, router::IsmpRouter}; use orml_oracle::{DataFeeder, DataProvider, DataProviderExtended}; pub use pallet_balances::Call as BalancesCall; pub use pallet_timestamp::Call as TimestampCall; @@ -1644,6 +1645,70 @@ impl bifrost_slp_v2::Config for Runtime { type MaxValidators = ConstU32<256>; } +impl pallet_hyperbridge::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + // pallet-ismp implements the IsmpHost + type IsmpHost = Ismp; +} + +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 = StateMachineProvider; + 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 ConsensusClients = (); + // Optional Merkle Mountain Range overlay tree + type Mmr = pallet_ismp::NoOpMmrTree; + type WeightProvider = (); +} + +pub struct StateMachineProvider; + +impl Get for StateMachineProvider { + fn get() -> StateMachine { + StateMachine::Polkadot(ParachainInfo::get().into()) + } +} + +pub struct Coprocessor; + +impl Get> for Coprocessor { + fn get() -> Option { + Some(StateMachineProvider::get()) + } +} + +#[derive(Default)] +pub struct Router; + +impl IsmpRouter for Router { + fn module_for_id(&self, id: Vec) -> Result, anyhow::Error> { + let module = match id.as_slice() { + bifrost_ismp::PALLET_BIFROST_ID => Box::new(bifrost_ismp::Pallet::::default()), + _ => Err(ismp::Error::ModuleNotFound(id))?, + }; + Ok(module) + } +} + +impl bifrost_ismp::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Balance = Balance; + type NativeCurrency = Balances; + type IsmpHost = Ismp; +} + // Below is the implementation of tokens manipulation functions other than native token. pub struct LocalAssetAdaptor(PhantomData); @@ -1807,6 +1872,11 @@ construct_runtime! { ZenlinkProtocol: zenlink_protocol = 80, MerkleDistributor: merkle_distributor = 81, + // Hyperbridge + Ismp: pallet_ismp = 90, + Hyperbridge: pallet_hyperbridge = 91, + BifrostIsmp: bifrost_ismp = 92, + // Bifrost modules FlexibleFee: bifrost_flexible_fee = 100, Salp: bifrost_salp = 105,