diff --git a/.github/workflows/parachain.yml b/.github/workflows/parachain.yml index 76966ef6c9..71a0083172 100644 --- a/.github/workflows/parachain.yml +++ b/.github/workflows/parachain.yml @@ -30,6 +30,8 @@ jobs: SKIP_WASM_BUILD: 1 steps: - uses: actions/checkout@v2 + with: + submodules: 'true' - uses: actions/cache@v1 with: path: | @@ -61,6 +63,7 @@ jobs: - uses: actions/checkout@v2 with: ref: ${{ github.head_ref }} + submodules: 'true' - uses: actions/cache@v1 with: path: | @@ -80,7 +83,6 @@ jobs: --manifest-path parachain/Cargo.toml --workspace --features runtime-benchmarks - --exclude snowbridge-query-events --exclude snowbridge-ethereum-beacon-client # Run tests for beacon light client, excluding benchmark tests - name: Tests for beacon light client excluding benchmark tests @@ -109,6 +111,7 @@ jobs: - uses: actions/checkout@v2 with: ref: ${{ github.head_ref }} + submodules: 'true' - name: setup rust toolchain run: rustup show - name: run coverage test @@ -118,9 +121,8 @@ jobs: --manifest-path parachain/Cargo.toml --workspace --engine llvm - --out Xml + --out xml --exclude substrate-call-index - --exclude snowbridge-query-events - name: Upload coverage reports to Codecov with GitHub Action uses: codecov/codecov-action@v3 with: @@ -142,7 +144,7 @@ jobs: - name: check bridge-hub runtime run: > cargo check - --manifest-path cumulus/Cargo.toml + --manifest-path polkadot-sdk/Cargo.toml --release --verbose --package bridge-hub-rococo-runtime @@ -158,6 +160,7 @@ jobs: - uses: actions/checkout@v2 with: ref: ${{ github.head_ref }} + submodules: 'true' - uses: actions/cache@v1 with: path: | diff --git a/.gitmodules b/.gitmodules index 0ec54ebe0f..2e4d694e74 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,3 @@ -[submodule "cumulus"] - path = cumulus - url = https://github.com/Snowfork/cumulus - branch = snowbridge [submodule "contracts/lib/forge-std"] path = contracts/lib/forge-std url = https://github.com/foundry-rs/forge-std @@ -14,3 +10,7 @@ [submodule "contracts/lib/canonical-weth"] path = contracts/lib/canonical-weth url = https://github.com/Snowfork/canonical-weth +[submodule "polkadot-sdk"] + path = polkadot-sdk + url = https://github.com/Snowfork/polkadot-sdk.git + branch = polkadot-sdk-update diff --git a/_typos.toml b/_typos.toml index b7fd8c6b7b..682edecf37 100644 --- a/_typos.toml +++ b/_typos.toml @@ -7,7 +7,7 @@ extend-exclude = [ "**/*ffi*.js", "**/*mock*.rs", "**/*data*.rs", - "cumulus/**", + "polkadot-sdk/**", "smoketest/src/parachains", "smoketest/src/contracts", ] diff --git a/hooks/pre-commit b/hooks/pre-commit index 6720b3ed70..1237b1bbc1 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -2,17 +2,6 @@ set -e -# checks that the cumulus submodule is in sync with our substrate dependencies -check_duplicate_versions() { - local duplicates=$(grep -Ei "source = \"git.*$1" cumulus/Cargo.lock parachain/Cargo.lock | sed 's/\.git//g' | sort -u) - local version_count=$(echo "$duplicates" | awk -F':' '{for (i=2; i Result<(), BenchmarkError> { - let caller: T::AccountId = whitelisted_caller(); + let origin = + T::AgentOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; #[extrinsic_call] - _(RawOrigin::Signed(caller)); + _(origin as T::RuntimeOrigin); Ok(()) } #[benchmark] fn create_channel() -> Result<(), BenchmarkError> { - let caller: T::AccountId = whitelisted_caller(); + let agent_origin = + T::AgentOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + let channel_origin = + T::ChannelOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + frame_support::assert_ok!(SnowbridgeControl::::create_agent( - RawOrigin::Signed(caller.clone()).into() + agent_origin as T::RuntimeOrigin )); #[extrinsic_call] - _(RawOrigin::Signed(caller)); + _(channel_origin as T::RuntimeOrigin); Ok(()) } #[benchmark] fn update_channel() -> Result<(), BenchmarkError> { - let caller: T::AccountId = whitelisted_caller(); + let agent_origin = + T::AgentOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + let channel_origin = + T::ChannelOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + frame_support::assert_ok!(SnowbridgeControl::::create_agent( - RawOrigin::Signed(caller.clone()).into() + agent_origin as T::RuntimeOrigin )); frame_support::assert_ok!(SnowbridgeControl::::create_channel( - RawOrigin::Signed(caller.clone()).into() + channel_origin.clone() as T::RuntimeOrigin )); #[extrinsic_call] - _(RawOrigin::Signed(caller), OperatingMode::RejectingOutboundMessages, 1, 1); + _(channel_origin as T::RuntimeOrigin, OperatingMode::RejectingOutboundMessages, 1, 1); Ok(()) } @@ -75,13 +86,14 @@ mod benchmarks { #[benchmark] fn transfer_native_from_agent() -> Result<(), BenchmarkError> { - let caller: T::AccountId = whitelisted_caller(); + let origin = + T::AgentOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; frame_support::assert_ok!(SnowbridgeControl::::create_agent( - RawOrigin::Signed(caller.clone()).into() + origin.clone() as T::RuntimeOrigin )); #[extrinsic_call] - _(RawOrigin::Signed(caller), H160::default(), 1); + _(origin as T::RuntimeOrigin, H160::default(), 1); Ok(()) } diff --git a/parachain/pallets/control/src/lib.rs b/parachain/pallets/control/src/lib.rs index cf006a0284..5aa398d296 100644 --- a/parachain/pallets/control/src/lib.rs +++ b/parachain/pallets/control/src/lib.rs @@ -15,27 +15,29 @@ mod tests; mod benchmarking; pub mod weights; -pub use weights::*; - -use snowbridge_core::{ - outbound::{Command, Message, OperatingMode, OutboundQueue as OutboundQueueTrait, ParaId}, - AgentId, -}; -use sp_core::{H160, H256}; -use sp_runtime::traits::Hash; -use sp_std::prelude::*; -use xcm::prelude::*; -use xcm_executor::traits::ConvertLocation; - +pub use crate::weights::WeightInfo; pub use pallet::*; -pub const LOG_TARGET: &str = "snowbridge-control"; - #[frame_support::pallet] pub mod pallet { - use super::*; - use frame_support::{log, pallet_prelude::*, traits::EnsureOrigin}; + use crate::WeightInfo; + use frame_support::{pallet_prelude::*, traits::EnsureOrigin}; use frame_system::pallet_prelude::*; + use log; + use snowbridge_core::{ + outbound::{Command, Message, OperatingMode, OutboundQueue as OutboundQueueTrait, ParaId}, + AgentId, + }; + use sp_core::{H160, H256}; + use sp_runtime::traits::Hash; + use sp_std::prelude::*; + use xcm::{ + prelude::*, + v3::{Junction::Parachain, Junctions::X1, MultiLocation}, + }; + use xcm_executor::traits::ConvertLocation; + + pub const LOG_TARGET: &str = "snowbridge-control"; #[pallet::pallet] pub struct Pallet(_); diff --git a/parachain/pallets/control/src/mock.rs b/parachain/pallets/control/src/mock.rs index ea0d929304..1751f6eb2f 100644 --- a/parachain/pallets/control/src/mock.rs +++ b/parachain/pallets/control/src/mock.rs @@ -13,23 +13,19 @@ use frame_benchmarking::v2::whitelisted_caller; use snowbridge_core::outbound::{Message, MessageHash, ParaId, SubmitError}; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, AccountId32, }; use xcm::prelude::*; use xcm_builder::{DescribeAllTerminal, DescribeFamily, HashedDescription}; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; type AccountId = AccountId32; +use sp_runtime::BuildStorage; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { System: frame_system, EthereumControl: snowbridge_control, @@ -43,13 +39,10 @@ impl frame_system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type Version = (); @@ -61,6 +54,8 @@ impl frame_system::Config for Test { type SS58Prefix = ConstU16<42>; type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; + type Block = Block; } parameter_types! { @@ -173,7 +168,7 @@ impl EnsureOrigin for EnsureOriginFromTable { } pub struct MockOutboundQueue; -impl snowbridge_control::OutboundQueueTrait for MockOutboundQueue { +impl snowbridge_core::outbound::OutboundQueue for MockOutboundQueue { type Ticket = Message; fn validate(message: &Message) -> Result { @@ -201,7 +196,7 @@ impl snowbridge_control::Config for Test { // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { - let storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); let mut ext: sp_io::TestExternalities = storage.into(); ext.execute_with(|| System::set_block_number(1)); ext diff --git a/parachain/pallets/control/src/tests.rs b/parachain/pallets/control/src/tests.rs index 20cac0a432..5fce9f280e 100644 --- a/parachain/pallets/control/src/tests.rs +++ b/parachain/pallets/control/src/tests.rs @@ -3,8 +3,17 @@ use crate::{mock::*, *}; use frame_support::{assert_ok, traits::EnsureOrigin}; use hex_literal::hex; -use sp_core::H256; +use sp_core::{H160, H256}; use sp_runtime::{AccountId32, DispatchError::BadOrigin}; +use xcm::{ + prelude::AccountKey20, + v3::{ + Junction, + Junction::{PalletInstance, Parachain}, + Junctions::{X1, X2}, + MultiLocation, + }, +}; #[test] fn create_agent_with_unknown_origin_yields_bad_origin() { diff --git a/parachain/pallets/ethereum-beacon-client/Cargo.toml b/parachain/pallets/ethereum-beacon-client/Cargo.toml index 01f617fc2a..3847653637 100644 --- a/parachain/pallets/ethereum-beacon-client/Cargo.toml +++ b/parachain/pallets/ethereum-beacon-client/Cargo.toml @@ -11,39 +11,40 @@ license = "PENDING/TBC" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -serde = { version = "1.0.164", optional = true } +serde = { version = "1.0.188", optional = true } serde_json = { version = "1.0.96", optional = true } -codec = { version = "3.1.5", package = "parity-scale-codec", default-features = false, features = [ "derive" ] } -scale-info = { version = "2.7.0", default-features = false, features = [ "derive" ] } +codec = { version = "3.6.1", package = "parity-scale-codec", default-features = false, features = [ "derive" ] } +scale-info = { version = "2.9.0", default-features = false, features = [ "derive" ] } ssz_rs = { version="0.9.0", default-features = false } ssz_rs_derive = { version="0.9.0", default-features = false } byte-slice-cast = { version = "1.2.1", default-features = false } rlp = { version = "0.5", default-features = false } hex-literal = { version = "0.4.1", optional = true } +log = { version = "0.4.20", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } +frame-benchmarking = { path = "../../../polkadot-sdk/substrate/frame/benchmarking", default-features = false, optional = true} +frame-support = { path = "../../../polkadot-sdk/substrate/frame/support", default-features = false } +frame-system = { path = "../../../polkadot-sdk/substrate/frame/system", default-features = false } +sp-core = { path = "../../../polkadot-sdk/substrate/primitives/core", default-features = false } +sp-std = { path = "../../../polkadot-sdk/substrate/primitives/std", default-features = false } +sp-runtime = { path = "../../../polkadot-sdk/substrate/primitives/runtime", default-features = false } +sp-io = { path = "../../../polkadot-sdk/substrate/primitives/io", default-features = false, optional = true } snowbridge-core = { path = "../../primitives/core", default-features = false } snowbridge-ethereum = { path = "../../primitives/ethereum", default-features = false } primitives = { package = "snowbridge-beacon-primitives", path = "../../primitives/beacon", default-features = false } static_assertions = { version = "1.1.0" } -bp-runtime = { git = "https://github.com/Snowfork/cumulus.git", branch = "snowbridge", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "master", optional = true } -sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "master", optional = true } +bp-runtime = { path = "../../../polkadot-sdk/bridges/primitives/runtime", default-features = false } +pallet-timestamp = { path = "../../../polkadot-sdk/substrate/frame/timestamp", default-features = false, optional = true} [dev-dependencies] rand = "0.8.5" -sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "master" } +sp-keyring = { path = "../../../polkadot-sdk/substrate/primitives/keyring" } serde_json = "1.0.96" hex-literal = "0.4.1" -pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "master" } -sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "master" } -serde = "1.0.164" +pallet-timestamp = { path = "../../../polkadot-sdk/substrate/frame/timestamp" } +sp-io = { path = "../../../polkadot-sdk/substrate/primitives/io" } +serde = "1.0.188" [features] default = ["std"] diff --git a/parachain/pallets/ethereum-beacon-client/fuzz/Cargo.lock b/parachain/pallets/ethereum-beacon-client/fuzz/Cargo.lock index 6b488775b1..1eb9d34776 100644 --- a/parachain/pallets/ethereum-beacon-client/fuzz/Cargo.lock +++ b/parachain/pallets/ethereum-beacon-client/fuzz/Cargo.lock @@ -116,6 +116,20 @@ dependencies = [ "num-traits", ] +[[package]] +name = "aquamarine" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df752953c49ce90719c7bf1fc587bc8227aed04732ea0c0f85e5397d7fdbd1a1" +dependencies = [ + "include_dir", + "itertools", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "arbitrary" version = "1.3.0" @@ -125,11 +139,182 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cde0f2aa063a2a5c28d39b47761aa102bda7c13c84fc118a61b87c7b2f785c" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-scale" +version = "0.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49b08346a3e38e2be792ef53ee168623c9244d968ff00cd70fb9932f6fe36393" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "parity-scale-codec", +] + +[[package]] +name = "ark-secret-scalar" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "ark-transcript", + "digest 0.10.7", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-transcript" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "digest 0.10.7", + "rand_core 0.6.4", + "sha3", +] + [[package]] name = "array-bytes" -version = "4.2.0" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" +checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" [[package]] name = "arrayref" @@ -157,7 +342,7 @@ checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] @@ -181,6 +366,28 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "bandersnatch_vrfs" +version = "0.0.1" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff", + "ark-scale", + "ark-serialize", + "ark-std", + "dleq_vrf", + "fflonk", + "merlin 3.0.0", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "ring", + "sha2 0.10.7", + "zeroize", +] + [[package]] name = "base16ct" version = "0.2.0" @@ -300,12 +507,12 @@ dependencies = [ [[package]] name = "bp-runtime" version = "0.1.0" -source = "git+https://github.com/Snowfork/cumulus.git?branch=snowbridge#9b83c7325df5ec50fec2571f8ff304d40a7e88fe" dependencies = [ "frame-support", "frame-system", "hash-db", "impl-trait-for-tuples", + "log", "num-traits", "parity-scale-codec", "scale-info", @@ -321,9 +528,12 @@ dependencies = [ [[package]] name = "bs58" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "tinyvec", +] [[package]] name = "bumpalo" @@ -372,9 +582,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.3" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "215c0072ecc28f92eeb0eea38ba63ddfcb65c2828c46311d646f1a3ff5f9841c" +checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" dependencies = [ "smallvec", ] @@ -397,12 +607,54 @@ dependencies = [ "winapi", ] +[[package]] +name = "common" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof?rev=0e948f3#0e948f3c28cbacecdd3020403c4841c0eb339213" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "fflonk", + "merlin 3.0.0", +] + +[[package]] +name = "common-path" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" + [[package]] name = "const-oid" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" +[[package]] +name = "const-random" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" +dependencies = [ + "const-random-macro", + "proc-macro-hack", +] + +[[package]] +name = "const-random-macro" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" +dependencies = [ + "getrandom 0.2.10", + "once_cell", + "proc-macro-hack", + "tiny-keccak", +] + [[package]] name = "constant_time_eq" version = "0.2.6" @@ -531,6 +783,33 @@ dependencies = [ "zeroize", ] +[[package]] +name = "curve25519-dalek" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622178105f911d937a42cdb140730ba4a3ed2becd8ae6ce39c7d28b5d75d4588" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms", + "rustc_version", + "subtle", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + [[package]] name = "der" version = "0.7.7" @@ -571,7 +850,7 @@ checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] @@ -617,6 +896,50 @@ dependencies = [ "subtle", ] +[[package]] +name = "dleq_vrf" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-scale", + "ark-secret-scalar", + "ark-serialize", + "ark-std", + "ark-transcript", + "arrayvec 0.7.4", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "docify" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "029de870d175d11969524d91a3fb2cbf6d488b853bff99d41cf65e533ac7d9d2" +dependencies = [ + "docify_macros", +] + +[[package]] +name = "docify_macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cac43324656a1b05eb0186deb51f27d2d891c704c37f34de281ef6297ba193e5" +dependencies = [ + "common-path", + "derive-syn-parse", + "once_cell", + "proc-macro2", + "quote", + "regex", + "syn 2.0.32", + "termcolor", + "toml", + "walkdir", +] + [[package]] name = "dyn-clonable" version = "0.9.0" @@ -654,29 +977,28 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", - "signature 2.1.0", + "signature", "spki", ] [[package]] name = "ed25519" -version = "1.5.3" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ - "signature 1.6.4", + "signature", ] [[package]] name = "ed25519-dalek" -version = "1.0.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" dependencies = [ - "curve25519-dalek 3.2.0", + "curve25519-dalek 4.1.0", "ed25519", - "sha2 0.9.9", - "zeroize", + "sha2 0.10.7", ] [[package]] @@ -801,7 +1123,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] @@ -826,6 +1148,25 @@ dependencies = [ "subtle", ] +[[package]] +name = "fflonk" +version = "0.1.0" +source = "git+https://github.com/w3f/fflonk#26a5045b24e169cffc1f9328ca83d71061145c40" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "merlin 3.0.0", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" + [[package]] name = "fixed-hash" version = "0.8.0" @@ -850,7 +1191,6 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support", "frame-support-procedural", @@ -874,9 +1214,9 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "15.1.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" +checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" dependencies = [ "cfg-if", "parity-scale-codec", @@ -887,9 +1227,10 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ + "aquamarine", "bitflags", + "docify", "environmental", "frame-metadata", "frame-support-procedural", @@ -897,71 +1238,71 @@ dependencies = [ "k256", "log", "macro_magic", - "once_cell", "parity-scale-codec", "paste", "scale-info", "serde", + "serde_json", "smallvec", "sp-api", "sp-arithmetic", "sp-core", "sp-core-hashing-proc-macro", "sp-debug-derive", + "sp-genesis-builder", "sp-inherents", "sp-io", + "sp-metadata-ir", "sp-runtime", "sp-staking", "sp-state-machine", "sp-std", "sp-tracing", "sp-weights", + "static_assertions", "tt-call", ] [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", + "expander", "frame-support-procedural-tools", "itertools", "macro_magic", "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "cfg-if", "frame-support", @@ -1046,7 +1387,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] @@ -1311,6 +1652,25 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "include_dir" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +dependencies = [ + "proc-macro2", + "quote", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -1511,9 +1871,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "mach" @@ -1526,49 +1886,50 @@ dependencies = [ [[package]] name = "macro_magic" -version = "0.3.5" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2d6d7fe4741b5621cf7c8048e472933877c7ea870cbf1420da55ea9f3bb08c" +checksum = "aee866bfee30d2d7e83835a4574aad5b45adba4cc807f2a3bbba974e5d4383c9" dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] name = "macro_magic_core" -version = "0.3.5" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3005604258419767cacc5989c2dd75263f8b33773dd680734f598eb88baf5370" +checksum = "7e766a20fd9c72bab3e1e64ed63f36bd08410e75803813df210d1ce297d7ad00" dependencies = [ + "const-random", "derive-syn-parse", "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] name = "macro_magic_core_macros" -version = "0.3.5" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de6267819c9042df1a9e62ca279e5a34254ad5dfdcb13ff988f560d75576e8b4" +checksum = "c12469fc165526520dff2807c2975310ab47cf7190a45b99b49a7dc8befab17b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] name = "macro_magic_macros" -version = "0.3.5" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc7176ac15ab2ed7f335e2398f729b9562dae0c233705bc1e1e3acd8452d403d" +checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] @@ -1635,6 +1996,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + [[package]] name = "milagro_bls" version = "1.5.0" @@ -1803,18 +2176,16 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#f7e81b9be4fb3f2906a3768fe74d70c8228ab553" dependencies = [ - "frame-benchmarking", "frame-support", "frame-system", "log", "parity-scale-codec", "scale-info", "sp-inherents", - "sp-io", "sp-runtime", "sp-std", + "sp-storage", "sp-timestamp", ] @@ -1932,10 +2303,15 @@ dependencies = [ "spki", ] +[[package]] +name = "platforms" +version = "3.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" + [[package]] name = "polkadot-core-primitives" -version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#09b61286da11921a3dda0a8e4015ceb9ef9cffca" +version = "1.0.0" dependencies = [ "parity-scale-codec", "scale-info", @@ -1945,9 +2321,8 @@ dependencies = [ ] [[package]] -name = "polkadot-parachain" -version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#09b61286da11921a3dda0a8e4015ceb9ef9cffca" +name = "polkadot-parachain-primitives" +version = "1.0.0" dependencies = [ "bounded-collections", "derive_more", @@ -1961,6 +2336,31 @@ dependencies = [ "sp-std", ] +[[package]] +name = "polkadot-primitives" +version = "1.0.0" +dependencies = [ + "bitvec", + "hex-literal", + "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", + "sp-std", +] + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1991,15 +2391,45 @@ dependencies = [ "toml_edit", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + [[package]] name = "proc-macro-warning" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70550716265d1ec349c41f70dd4f964b4fd88394efe4405f0c1da679c4799a07" +checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] @@ -2022,9 +2452,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -2138,7 +2568,7 @@ checksum = "2dfaf0c85b766276c797f3791f5bc6d5bd116b41d53049af2789666b0c0bc9fa" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] @@ -2195,6 +2625,21 @@ dependencies = [ "subtle", ] +[[package]] +name = "ring" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof?rev=0e948f3#0e948f3c28cbacecdd3020403c4841c0eb339213" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "common", + "fflonk", + "merlin 3.0.0", +] + [[package]] name = "rlp" version = "0.5.2" @@ -2281,6 +2726,15 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scale-info" version = "2.9.0" @@ -2328,7 +2782,7 @@ dependencies = [ "arrayvec 0.5.2", "curve25519-dalek 2.1.3", "getrandom 0.1.16", - "merlin", + "merlin 2.0.1", "rand 0.7.3", "rand_core 0.5.1", "sha2 0.8.2", @@ -2391,9 +2845,9 @@ checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.176" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76dc28c9523c5d70816e393136b86d48909cfb27cecaa902d338c19ed47164dc" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] @@ -2409,13 +2863,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.176" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e7b8c5dc823e3b90651ff1d3808419cd14e5ad76de04feaf37da114e7a306f" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] @@ -2429,6 +2883,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +dependencies = [ + "serde", +] + [[package]] name = "sha2" version = "0.8.2" @@ -2484,12 +2947,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" - [[package]] name = "signature" version = "2.1.0" @@ -2559,7 +3016,7 @@ dependencies = [ "frame-support", "frame-system", "parity-scale-codec", - "polkadot-parachain", + "polkadot-primitives", "scale-info", "serde", "snowbridge-beacon-primitives", @@ -2567,7 +3024,7 @@ dependencies = [ "sp-core", "sp-runtime", "sp-std", - "xcm", + "staging-xcm", ] [[package]] @@ -2601,6 +3058,7 @@ dependencies = [ "frame-support", "frame-system", "hex-literal", + "log", "pallet-timestamp", "parity-scale-codec", "rlp", @@ -2634,7 +3092,6 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "hash-db", "log", @@ -2642,6 +3099,7 @@ dependencies = [ "scale-info", "sp-api-proc-macro", "sp-core", + "sp-externalities", "sp-metadata-ir", "sp-runtime", "sp-state-machine", @@ -2654,7 +3112,6 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "Inflector", "blake2", @@ -2662,13 +3119,12 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] name = "sp-application-crypto" version = "23.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", "scale-info", @@ -2681,7 +3137,6 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "16.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "integer-sqrt", "num-traits", @@ -2692,12 +3147,36 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "sp-authority-discovery" +version = "4.0.0-dev" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-consensus-slots" +version = "0.10.0-dev" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-std", + "sp-timestamp", +] + [[package]] name = "sp-core" version = "21.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "array-bytes", + "arrayvec 0.7.4", + "bandersnatch_vrfs", "bitflags", "blake2", "bounded-collections", @@ -2711,7 +3190,7 @@ dependencies = [ "lazy_static", "libsecp256k1", "log", - "merlin", + "merlin 2.0.1", "parity-scale-codec", "parking_lot", "paste", @@ -2733,48 +3212,43 @@ dependencies = [ "substrate-bip39", "thiserror", "tiny-bip39", + "tracing", "zeroize", ] [[package]] name = "sp-core-hashing" version = "9.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "blake2b_simd", "byteorder", "digest 0.10.7", "sha2 0.10.7", "sha3", - "sp-std", "twox-hash", ] [[package]] name = "sp-core-hashing-proc-macro" version = "9.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ - "proc-macro2", "quote", "sp-core-hashing", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] name = "sp-debug-derive" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] name = "sp-externalities" version = "0.19.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "environmental", "parity-scale-codec", @@ -2782,16 +3256,24 @@ dependencies = [ "sp-storage", ] +[[package]] +name = "sp-genesis-builder" +version = "0.1.0" +dependencies = [ + "serde_json", + "sp-api", + "sp-runtime", + "sp-std", +] + [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-core", "sp-runtime", "sp-std", "thiserror", @@ -2800,12 +3282,9 @@ dependencies = [ [[package]] name = "sp-io" version = "23.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "bytes", - "ed25519", "ed25519-dalek", - "futures", "libsecp256k1", "log", "parity-scale-codec", @@ -2826,9 +3305,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.27.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ - "futures", "parity-scale-codec", "parking_lot", "sp-core", @@ -2839,7 +3316,6 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -2850,7 +3326,6 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "backtrace", "lazy_static", @@ -2860,7 +3335,6 @@ dependencies = [ [[package]] name = "sp-runtime" version = "24.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "either", "hash256-std-hasher", @@ -2882,7 +3356,6 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "17.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -2900,20 +3373,19 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "11.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "Inflector", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ + "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "serde", @@ -2925,7 +3397,6 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.28.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "hash-db", "log", @@ -2940,17 +3411,16 @@ dependencies = [ "sp-trie", "thiserror", "tracing", + "trie-db", ] [[package]] name = "sp-std" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" [[package]] name = "sp-storage" version = "13.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "impl-serde", "parity-scale-codec", @@ -2963,7 +3433,6 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#f7e81b9be4fb3f2906a3768fe74d70c8228ab553" dependencies = [ "async-trait", "parity-scale-codec", @@ -2976,7 +3445,6 @@ dependencies = [ [[package]] name = "sp-tracing" version = "10.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", "sp-std", @@ -2988,7 +3456,6 @@ dependencies = [ [[package]] name = "sp-trie" version = "22.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "ahash 0.8.3", "hash-db", @@ -3011,7 +3478,6 @@ dependencies = [ [[package]] name = "sp-version" version = "22.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "impl-serde", "parity-scale-codec", @@ -3028,18 +3494,16 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] name = "sp-wasm-interface" version = "14.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -3052,7 +3516,6 @@ dependencies = [ [[package]] name = "sp-weights" version = "20.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#e976964644d951a1eefaaa85f1d7c7d58211ddf7" dependencies = [ "parity-scale-codec", "scale-info", @@ -3118,6 +3581,22 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "staging-xcm" +version = "1.0.0" +dependencies = [ + "bounded-collections", + "derivative", + "environmental", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-weights", + "xcm-procedural", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -3156,9 +3635,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.27" +version = "2.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" dependencies = [ "proc-macro2", "quote", @@ -3177,24 +3656,33 @@ version = "0.12.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d2faeef5759ab89935255b1a4cd98e0baf99d1085e37d36599c625dac49ae8e" +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] @@ -3250,19 +3738,36 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + [[package]] name = "toml_datetime" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.0.0", + "serde", + "serde_spanned", "toml_datetime", "winnow", ] @@ -3287,7 +3792,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] @@ -3451,6 +3956,16 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -3484,7 +3999,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", "wasm-bindgen-shared", ] @@ -3506,7 +4021,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3685,6 +4200,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -3850,31 +4374,14 @@ dependencies = [ "tap", ] -[[package]] -name = "xcm" -version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#09b61286da11921a3dda0a8e4015ceb9ef9cffca" -dependencies = [ - "bounded-collections", - "derivative", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-weights", - "xcm-procedural", -] - [[package]] name = "xcm-procedural" -version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#09b61286da11921a3dda0a8e4015ceb9ef9cffca" +version = "1.0.0" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] [[package]] @@ -3894,5 +4401,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.32", ] diff --git a/parachain/pallets/ethereum-beacon-client/fuzz/Cargo.toml b/parachain/pallets/ethereum-beacon-client/fuzz/Cargo.toml index 87ae60d87e..b4c62962da 100644 --- a/parachain/pallets/ethereum-beacon-client/fuzz/Cargo.toml +++ b/parachain/pallets/ethereum-beacon-client/fuzz/Cargo.toml @@ -13,7 +13,7 @@ arbitrary = { version = "1", optional = true, features = ["derive"] } snowbridge-ethereum-beacon-client = {path = "..", features = [ "fuzzing" ]} snowbridge-beacon-primitives= {path = "../../../primitives/beacon"} hex-literal = "0.4.1" -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } +sp-core = { path = "../../../../polkadot-sdk/substrate/primitives/core", default-features = false } # Prevent this from interfering with workspaces [workspace] diff --git a/parachain/pallets/ethereum-beacon-client/src/impls.rs b/parachain/pallets/ethereum-beacon-client/src/impls.rs index fc98a5b2a3..571c0f9f7c 100644 --- a/parachain/pallets/ethereum-beacon-client/src/impls.rs +++ b/parachain/pallets/ethereum-beacon-client/src/impls.rs @@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: 2023 Snowfork use super::*; -use frame_support::dispatch::DispatchError; use snowbridge_ethereum::{Log, Receipt}; +use sp_runtime::DispatchError; impl Verifier for Pallet { /// Verify a message by verifying the existence of the corresponding diff --git a/parachain/pallets/ethereum-beacon-client/src/lib.rs b/parachain/pallets/ethereum-beacon-client/src/lib.rs index 12f4bb1526..6203895dd0 100644 --- a/parachain/pallets/ethereum-beacon-client/src/lib.rs +++ b/parachain/pallets/ethereum-beacon-client/src/lib.rs @@ -19,7 +19,7 @@ mod tests; mod benchmarking; use frame_support::{ - dispatch::DispatchResult, log, pallet_prelude::OptionQuery, traits::Get, transactional, + dispatch::DispatchResult, pallet_prelude::OptionQuery, traits::Get, transactional, }; use frame_system::ensure_signed; use primitives::{ diff --git a/parachain/pallets/ethereum-beacon-client/src/mock.rs b/parachain/pallets/ethereum-beacon-client/src/mock.rs index fd7f9f741b..78e71833be 100644 --- a/parachain/pallets/ethereum-beacon-client/src/mock.rs +++ b/parachain/pallets/ethereum-beacon-client/src/mock.rs @@ -5,10 +5,7 @@ use frame_support::parameter_types; use pallet_timestamp; use primitives::{Fork, ForkVersions}; use sp_core::H256; -use sp_runtime::{ - testing::Header, - traits::{BlakeTwo256, IdentityLookup}, -}; +use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; #[cfg(not(feature = "beacon-spec-mainnet"))] pub mod minimal { @@ -18,17 +15,13 @@ pub mod minimal { use hex_literal::hex; use primitives::CompactExecutionHeader; use snowbridge_core::inbound::{Message, Proof}; + use sp_runtime::BuildStorage; use std::{fs::File, path::PathBuf}; - type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { + pub enum Test { System: frame_system::{Pallet, Call, Storage, Event}, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, EthereumBeaconClient: ethereum_beacon_client::{Pallet, Call, Storage, Event}, @@ -48,13 +41,10 @@ pub mod minimal { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = u64; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -65,6 +55,8 @@ pub mod minimal { type SystemWeightInfo = (); type SS58Prefix = SS58Prefix; type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; + type Block = Block; } impl pallet_timestamp::Config for Test { @@ -105,9 +97,9 @@ pub mod minimal { // Build genesis storage according to the mock runtime. pub fn new_tester() -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let t = frame_system::GenesisConfig::::default().build_storage().unwrap(); let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| Timestamp::set_timestamp(30_000)); + let _ = ext.execute_with(|| Timestamp::set(RuntimeOrigin::signed(1), 30_000)); ext } @@ -185,15 +177,11 @@ pub mod minimal { pub mod mainnet { use super::*; - type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; + use sp_runtime::BuildStorage; frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { + pub enum Test { System: frame_system::{Pallet, Call, Storage, Event}, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, EthereumBeaconClient: ethereum_beacon_client::{Pallet, Call, Storage, Event}, @@ -213,13 +201,10 @@ pub mod mainnet { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = u64; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -230,6 +215,8 @@ pub mod mainnet { type SystemWeightInfo = (); type SS58Prefix = SS58Prefix; type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; + type Block = Block; } impl pallet_timestamp::Config for Test { @@ -270,9 +257,9 @@ pub mod mainnet { // Build genesis storage according to the mock runtime. pub fn new_tester() -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let t = frame_system::GenesisConfig::::default().build_storage().unwrap(); let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| Timestamp::set_timestamp(30_000)); + let _ = ext.execute_with(|| Timestamp::set(RuntimeOrigin::signed(1), 30_000)); ext } } diff --git a/parachain/pallets/inbound-queue/Cargo.toml b/parachain/pallets/inbound-queue/Cargo.toml index d6d527f810..fa24fdbda6 100644 --- a/parachain/pallets/inbound-queue/Cargo.toml +++ b/parachain/pallets/inbound-queue/Cargo.toml @@ -10,23 +10,23 @@ repository = "https://github.com/Snowfork/snowbridge" targets = [ "x86_64-unknown-linux-gnu" ] [dependencies] -serde = { version = "1.0.164", optional = true } -codec = { version = "3.1.5", package = "parity-scale-codec", default-features = false, features = [ "derive" ] } -scale-info = { version = "2.7.0", default-features = false, features = [ "derive" ] } +serde = { version = "1.0.188", optional = true } +codec = { version = "3.6.1", package = "parity-scale-codec", default-features = false, features = [ "derive" ] } +scale-info = { version = "2.9.0", default-features = false, features = [ "derive" ] } hex-literal = { version = "0.4.1", optional = true } rlp = { version = "0.5", default-features = false, optional = true } -frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } +frame-benchmarking = { path = "../../../polkadot-sdk/substrate/frame/benchmarking", default-features = false, optional = true } +frame-support = { path = "../../../polkadot-sdk/substrate/frame/support", default-features = false } +frame-system = { path = "../../../polkadot-sdk/substrate/frame/system", default-features = false } +pallet-balances = { path = "../../../polkadot-sdk/substrate/frame/balances", default-features = false } +sp-core = { path = "../../../polkadot-sdk/substrate/primitives/core", default-features = false } +sp-std = { path = "../../../polkadot-sdk/substrate/primitives/std", default-features = false } +sp-io = { path = "../../../polkadot-sdk/substrate/primitives/io", default-features = false } +sp-runtime = { path = "../../../polkadot-sdk/substrate/primitives/runtime", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot.git", branch = "master", default-features = false } -bp-runtime = { git = "https://github.com/Snowfork/cumulus.git", branch = "snowbridge", default-features = false } +xcm = { package = "staging-xcm", path = "../../../polkadot-sdk/polkadot/xcm", default-features = false } +bp-runtime = { path = "../../../polkadot-sdk/bridges/primitives/runtime", default-features = false } snowbridge-core = { path = "../../primitives/core", default-features = false } snowbridge-ethereum = { path = "../../primitives/ethereum", default-features = false } @@ -36,8 +36,8 @@ ethabi = { git = "https://github.com/Snowfork/ethabi-decode.git", package = "eth snowbridge-beacon-primitives = { path = "../../primitives/beacon", default-features = false, optional = true } [dev-dependencies] -frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "master" } -sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "master" } +frame-benchmarking = { path = "../../../polkadot-sdk/substrate/frame/benchmarking" } +sp-keyring = { path = "../../../polkadot-sdk/substrate/primitives/keyring" } snowbridge-beacon-primitives = { path = "../../primitives/beacon" } snowbridge-ethereum-beacon-client = { path = "../../pallets/ethereum-beacon-client" } diff --git a/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs b/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs index ebce56ae10..5ba621f834 100644 --- a/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs +++ b/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs @@ -1,7 +1,7 @@ -use super::*; use hex_literal::hex; use snowbridge_beacon_primitives::CompactExecutionHeader; use snowbridge_core::inbound::{Message, Proof}; +use sp_std::vec; pub struct InboundQueueTest { pub execution_header: CompactExecutionHeader, diff --git a/parachain/pallets/inbound-queue/src/benchmarking/mod.rs b/parachain/pallets/inbound-queue/src/benchmarking/mod.rs index 50de637290..00dbc27cdf 100644 --- a/parachain/pallets/inbound-queue/src/benchmarking/mod.rs +++ b/parachain/pallets/inbound-queue/src/benchmarking/mod.rs @@ -7,6 +7,7 @@ use super::*; use crate::Pallet as InboundQueue; use frame_benchmarking::v2::*; use frame_system::RawOrigin; +use sp_std::vec; #[benchmarks] mod benchmarks { diff --git a/parachain/pallets/inbound-queue/src/lib.rs b/parachain/pallets/inbound-queue/src/lib.rs index 6502a5cdd3..30de25ccbd 100644 --- a/parachain/pallets/inbound-queue/src/lib.rs +++ b/parachain/pallets/inbound-queue/src/lib.rs @@ -27,7 +27,9 @@ use scale_info::TypeInfo; use sp_core::H160; use sp_runtime::traits::AccountIdConversion; use sp_std::convert::TryFrom; -use xcm::v3::{send_xcm, Junction::*, Junctions::*, MultiLocation, SendError as XcmpSendError, XcmHash}; +use xcm::v3::{ + send_xcm, Junction::*, Junctions::*, MultiLocation, SendError as XcmpSendError, XcmHash, +}; use envelope::Envelope; use snowbridge_core::{ @@ -143,8 +145,10 @@ pub mod pallet { XcmpSendError::NotApplicable => Error::::Send(SendError::NotApplicable), XcmpSendError::Unroutable => Error::::Send(SendError::NotRoutable), XcmpSendError::Transport(_) => Error::::Send(SendError::Transport), - XcmpSendError::DestinationUnsupported => Error::::Send(SendError::DestinationUnsupported), - XcmpSendError::ExceedsMaxMessageSize => Error::::Send(SendError::ExceedsMaxMessageSize), + XcmpSendError::DestinationUnsupported => + Error::::Send(SendError::DestinationUnsupported), + XcmpSendError::ExceedsMaxMessageSize => + Error::::Send(SendError::ExceedsMaxMessageSize), XcmpSendError::MissingArgument => Error::::Send(SendError::MissingArgument), XcmpSendError::Fees => Error::::Send(SendError::Fees), } @@ -222,12 +226,11 @@ pub mod pallet { let dest = MultiLocation { parents: 1, interior: X1(Parachain(envelope.dest.into())) }; let (xcm_hash, _) = send_xcm::(dest, xcm).map_err(Error::::from)?; - Self::deposit_event( - Event::MessageReceived { - dest: envelope.dest, - nonce: envelope.nonce, - xcm_hash, - }); + Self::deposit_event(Event::MessageReceived { + dest: envelope.dest, + nonce: envelope.nonce, + xcm_hash, + }); Ok(()) } diff --git a/parachain/pallets/inbound-queue/src/test.rs b/parachain/pallets/inbound-queue/src/test.rs index 5786073775..1a8e877ccd 100644 --- a/parachain/pallets/inbound-queue/src/test.rs +++ b/parachain/pallets/inbound-queue/src/test.rs @@ -3,37 +3,31 @@ use super::*; use frame_support::{ - assert_noop, assert_ok, - dispatch::DispatchError, - parameter_types, + assert_noop, assert_ok, parameter_types, traits::{ConstU64, Everything}, }; use sp_core::{H160, H256}; use sp_keyring::AccountKeyring as Keyring; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Verify}, - ArithmeticError, MultiSignature, + ArithmeticError, DispatchError, MultiSignature, }; use sp_std::convert::From; use snowbridge_beacon_primitives::{Fork, ForkVersions}; use snowbridge_core::inbound::{Message, Proof}; use snowbridge_ethereum::Log; +use sp_runtime::BuildStorage; use hex_literal::hex; -use xcm::v3::{SendXcm, MultiAssets, prelude::*}; +use xcm::v3::{prelude::*, MultiAssets, SendXcm}; use crate::{self as inbound_queue, envelope::Envelope, Error, Event as InboundQueueEvent}; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { System: frame_system::{Pallet, Call, Storage, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, @@ -55,13 +49,10 @@ impl frame_system::Config for Test { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type DbWeight = (); @@ -74,6 +65,8 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; + type Block = Block; } impl pallet_balances::Config for Test { @@ -151,19 +144,19 @@ impl SendXcm for MockXcmSender { type Ticket = (); fn validate( - dest: &mut Option, - _: &mut Option>, - ) -> xcm::v3::SendResult { - match dest { - Some(MultiLocation { parents: _, interior }) => { - if let X1(Parachain(1001)) = interior { - return Err(XcmpSendError::NotApplicable); - } - Ok(((), MultiAssets::default())) + dest: &mut Option, + _: &mut Option>, + ) -> xcm::v3::SendResult { + match dest { + Some(MultiLocation { parents: _, interior }) => { + if let X1(Parachain(1001)) = interior { + return Err(XcmpSendError::NotApplicable) } - _ => Ok(((), MultiAssets::default())) - } + Ok(((), MultiAssets::default())) + }, + _ => Ok(((), MultiAssets::default())), } + } fn deliver(_: Self::Ticket) -> core::result::Result { Ok(H256::zero().into()) @@ -197,7 +190,7 @@ fn expect_events(e: Vec) { } pub fn new_tester() -> sp_io::TestExternalities { - let storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); let mut ext: sp_io::TestExternalities = storage.into(); ext.execute_with(|| System::set_block_number(1)); ext @@ -267,7 +260,7 @@ fn test_submit_happy_path() { expect_events(vec![InboundQueueEvent::MessageReceived { dest: dest_para, nonce: 1, - xcm_hash: H256::zero().into() + xcm_hash: H256::zero().into(), } .into()]); }); diff --git a/parachain/pallets/outbound-queue/Cargo.toml b/parachain/pallets/outbound-queue/Cargo.toml index 9670f9489c..d421400a12 100644 --- a/parachain/pallets/outbound-queue/Cargo.toml +++ b/parachain/pallets/outbound-queue/Cargo.toml @@ -10,31 +10,31 @@ repository = "https://github.com/Snowfork/snowbridge" targets = [ "x86_64-unknown-linux-gnu" ] [dependencies] -serde = { version = "1.0.164", optional = true } -codec = { version = "3.1.5", package = "parity-scale-codec", default-features = false, features = [ "derive" ] } -scale-info = { version = "2.7.0", default-features = false, features = [ "derive" ] } +serde = { version = "1.0.188", optional = true } +codec = { version = "3.6.1", package = "parity-scale-codec", default-features = false, features = [ "derive" ] } +scale-info = { version = "2.9.0", default-features = false, features = [ "derive" ] } hex-literal = { version = "0.4.1", optional = true } rlp = { version = "0.5", default-features = false, optional = true } -frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } +frame-benchmarking = { path = "../../../polkadot-sdk/substrate/frame/benchmarking", default-features = false, optional = true} +frame-support = { path = "../../../polkadot-sdk/substrate/frame/support", default-features = false } +frame-system = { path = "../../../polkadot-sdk/substrate/frame/system", default-features = false } +sp-core = { path = "../../../polkadot-sdk/substrate/primitives/core", default-features = false } +sp-std = { path = "../../../polkadot-sdk/substrate/primitives/std", default-features = false } +sp-runtime = { path = "../../../polkadot-sdk/substrate/primitives/runtime", default-features = false } +sp-io = { path = "../../../polkadot-sdk/substrate/primitives/io", default-features = false } snowbridge-core = { path = "../../primitives/core", default-features = false } snowbridge-outbound-queue-merkle-tree = { path = "merkle-tree", default-features = false } ethabi = { git = "https://github.com/Snowfork/ethabi-decode.git", package = "ethabi-decode", branch = "master", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot.git", branch = "master", default-features = false } -bp-runtime = { git = "https://github.com/Snowfork/cumulus.git", branch = "snowbridge", default-features = false } +xcm = { package = "staging-xcm", path = "../../../polkadot-sdk/polkadot/xcm", default-features = false } +bp-runtime = { path = "../../../polkadot-sdk/bridges/primitives/runtime", default-features = false } [dev-dependencies] -frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "master" } -pallet-message-queue = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "master" } +frame-benchmarking = { path = "../../../polkadot-sdk/substrate/frame/benchmarking" } +pallet-message-queue = { path = "../../../polkadot-sdk/substrate/frame/message-queue", default-features = false } +sp-keyring = { path = "../../../polkadot-sdk/substrate/primitives/keyring" } hex-literal = { version = "0.4.1" } rlp = { version = "0.5" } diff --git a/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml b/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml index 7f8627dadb..b791c096f8 100644 --- a/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml +++ b/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml @@ -13,8 +13,8 @@ targets = [ "x86_64-unknown-linux-gnu" ] codec = { version = "3.1.5", package = "parity-scale-codec", default-features = false, features = [ "derive" ] } scale-info = { version = "2.7.0", default-features = false, features = [ "derive" ] } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } +sp-core = { path = "../../../../polkadot-sdk/substrate/primitives/core", default-features = false } +sp-runtime = { path = "../../../../polkadot-sdk/substrate/primitives/runtime", default-features = false } [dev-dependencies] hex-literal = { version = "0.4.1" } diff --git a/parachain/pallets/outbound-queue/runtime-api/Cargo.toml b/parachain/pallets/outbound-queue/runtime-api/Cargo.toml index b3e9aadba4..6152a4c1fb 100644 --- a/parachain/pallets/outbound-queue/runtime-api/Cargo.toml +++ b/parachain/pallets/outbound-queue/runtime-api/Cargo.toml @@ -10,9 +10,9 @@ targets = [ "x86_64-unknown-linux-gnu" ] [dependencies] codec = { version = "3.1.5", package = "parity-scale-codec", features = [ "derive" ], default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false} -sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false} -sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false} +sp-core = { path = "../../../../polkadot-sdk/substrate/primitives/core", default-features = false } +sp-std = { path = "../../../../polkadot-sdk/substrate/primitives/std", default-features = false } +sp-api = { path = "../../../../polkadot-sdk/substrate/primitives/api", default-features = false} snowbridge-outbound-queue-merkle-tree = { path = "../merkle-tree", default-features = false} diff --git a/parachain/pallets/outbound-queue/src/lib.rs b/parachain/pallets/outbound-queue/src/lib.rs index f162ffc520..847b11cdb2 100644 --- a/parachain/pallets/outbound-queue/src/lib.rs +++ b/parachain/pallets/outbound-queue/src/lib.rs @@ -368,7 +368,7 @@ pub mod pallet { ); let weight = T::WeightInfo::do_process_message(); - if !meter.check_accrue(weight) { + if meter.try_consume(weight).is_err() { return Err(ProcessMessageError::Overweight(weight)) } diff --git a/parachain/pallets/outbound-queue/src/test.rs b/parachain/pallets/outbound-queue/src/test.rs index 6a268fa421..eb9268b242 100644 --- a/parachain/pallets/outbound-queue/src/test.rs +++ b/parachain/pallets/outbound-queue/src/test.rs @@ -10,20 +10,15 @@ use frame_support::{ use sp_core::{H160, H256}; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Keccak256, Verify}, - BoundedVec, MultiSignature, + BoundedVec, BuildStorage, MultiSignature, }; use sp_std::convert::From; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { System: frame_system::{Pallet, Call, Storage, Event}, MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event}, @@ -44,13 +39,10 @@ impl frame_system::Config for Test { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type DbWeight = (); @@ -63,6 +55,8 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; + type Block = Block; } parameter_types! { @@ -80,6 +74,7 @@ impl pallet_message_queue::Config for Test { type HeapSize = HeapSize; type MaxStale = MaxStale; type ServiceWeight = ServiceWeight; + type QueuePausedQuery = (); } parameter_types! { @@ -97,7 +92,7 @@ impl crate::Config for Test { } pub fn new_tester() -> sp_io::TestExternalities { - let storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); let mut ext: sp_io::TestExternalities = storage.into(); ext.execute_with(|| System::set_block_number(1)); ext @@ -194,7 +189,7 @@ fn process_message_yields_on_max_messages_per_block() { let message = (0..100).map(|_| 1u8).collect::>(); let message: BoundedVec> = message.try_into().unwrap(); - let mut meter = WeightMeter::max_limit(); + let mut meter = WeightMeter::new(); assert_noop!( OutboundQueue::process_message( @@ -215,7 +210,7 @@ fn process_message_fails_on_overweight_message() { let message = (0..100).map(|_| 1u8).collect::>(); let message: BoundedVec> = message.try_into().unwrap(); - let mut meter = WeightMeter::from_limit(Weight::from_parts(1, 1)); + let mut meter = WeightMeter::with_limit(Weight::from_parts(1, 1)); assert_noop!( OutboundQueue::process_message( diff --git a/parachain/primitives/beacon/Cargo.toml b/parachain/primitives/beacon/Cargo.toml index 829641856a..c28f332e97 100644 --- a/parachain/primitives/beacon/Cargo.toml +++ b/parachain/primitives/beacon/Cargo.toml @@ -5,18 +5,18 @@ authors = ["Snowfork "] edition = "2021" [dependencies] -serde = { version = "1.0.164", optional = true, features = ["derive"] } +serde = { version = "1.0.188", optional = true, features = ["derive"] } hex = { version = "0.4", default-features = false } -codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false } -scale-info = { version = "2.7.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } rlp = { version = "0.5", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } +frame-support = { path = "../../../polkadot-sdk/substrate/frame/support", default-features = false } +frame-system = { path = "../../../polkadot-sdk/substrate/frame/system", default-features = false } +sp-runtime = { path = "../../../polkadot-sdk/substrate/primitives/runtime", default-features = false } +sp-core = { path = "../../../polkadot-sdk/substrate/primitives/core", default-features = false } +sp-std = { path = "../../../polkadot-sdk/substrate/primitives/std", default-features = false } +sp-io = { path = "../../../polkadot-sdk/substrate/primitives/io", default-features = false } ssz_rs = { version="0.9.0", default-features = false } ssz_rs_derive = { version="0.9.0", default-features = false } diff --git a/parachain/primitives/core/Cargo.toml b/parachain/primitives/core/Cargo.toml index 466655f14f..33d5aaa9ce 100644 --- a/parachain/primitives/core/Cargo.toml +++ b/parachain/primitives/core/Cargo.toml @@ -5,19 +5,19 @@ authors = [ "Snowfork " ] edition = "2021" [dependencies] -serde = { version = "1.0.164", optional = true, features = [ "derive" ] } -codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false } -scale-info = { version = "2.7.0", default-features = false, features = [ "derive" ] } +serde = { version = "1.0.188", optional = true, features = [ "derive" ] } +codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = [ "derive" ] } snowbridge-ethereum = { path = "../ethereum", default-features = false } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot.git", branch = "master", default-features = false } +polkadot-primitives = { path = "../../../polkadot-sdk/polkadot/primitives", default-features = false } +xcm = { package = "staging-xcm", path = "../../../polkadot-sdk/polkadot/xcm", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } +frame-support = { path = "../../../polkadot-sdk/substrate/frame/support", default-features = false } +frame-system = { path = "../../../polkadot-sdk/substrate/frame/system", default-features = false } +sp-runtime = { path = "../../../polkadot-sdk/substrate/primitives/runtime", default-features = false } +sp-std = { path = "../../../polkadot-sdk/substrate/primitives/std", default-features = false } +sp-core = { path = "../../../polkadot-sdk/substrate/primitives/core", default-features = false } snowbridge-beacon-primitives = { path = "../../primitives/beacon", default-features = false } ethabi = { git = "https://github.com/Snowfork/ethabi-decode.git", package = "ethabi-decode", branch = "master", default-features = false } @@ -34,7 +34,7 @@ std = [ "scale-info/std", "frame-support/std", "frame-system/std", - "polkadot-parachain/std", + "polkadot-primitives/std", "sp-std/std", "sp-core/std", "sp-runtime/std", diff --git a/parachain/primitives/core/src/inbound.rs b/parachain/primitives/core/src/inbound.rs index b28df72ed7..5e7b10c25b 100644 --- a/parachain/primitives/core/src/inbound.rs +++ b/parachain/primitives/core/src/inbound.rs @@ -3,9 +3,10 @@ //! Types for representing inbound messages use codec::{Decode, Encode}; -use frame_support::{dispatch::DispatchError, scale_info::TypeInfo, RuntimeDebug}; +use scale_info::TypeInfo; use snowbridge_ethereum::Log; use sp_core::H256; +use sp_runtime::{DispatchError, RuntimeDebug}; use sp_std::vec::Vec; /// A trait for verifying inbound messages from Ethereum. diff --git a/parachain/primitives/core/src/lib.rs b/parachain/primitives/core/src/lib.rs index 01539e6d3e..a5190e9410 100644 --- a/parachain/primitives/core/src/lib.rs +++ b/parachain/primitives/core/src/lib.rs @@ -12,7 +12,7 @@ pub mod inbound; pub mod outbound; pub mod ringbuffer; -pub use polkadot_parachain::primitives::Id as ParaId; +pub use polkadot_primitives::Id as ParaId; pub use ringbuffer::{RingBufferMap, RingBufferMapImpl}; use sp_core::H256; diff --git a/parachain/primitives/core/src/outbound.rs b/parachain/primitives/core/src/outbound.rs index b3bd7946f5..c13a408057 100644 --- a/parachain/primitives/core/src/outbound.rs +++ b/parachain/primitives/core/src/outbound.rs @@ -1,5 +1,5 @@ use codec::{Decode, Encode}; -pub use polkadot_parachain::primitives::Id as ParaId; +pub use polkadot_primitives::Id as ParaId; use scale_info::TypeInfo; use sp_core::{RuntimeDebug, H160, H256, U256}; use sp_std::{borrow::ToOwned, vec, vec::Vec}; diff --git a/parachain/primitives/ethereum/Cargo.toml b/parachain/primitives/ethereum/Cargo.toml index b0bcfffdc3..0f3bf3b528 100644 --- a/parachain/primitives/ethereum/Cargo.toml +++ b/parachain/primitives/ethereum/Cargo.toml @@ -5,10 +5,10 @@ authors = [ "Snowfork " ] edition = "2021" [dependencies] -serde = { version = "1.0.164", optional = true } +serde = { version = "1.0.188", optional = true } serde-big-array = { version = "0.3.2", optional = true, features = [ "const-generics" ] } -codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = [ "derive" ] } -scale-info = { version = "2.7.0", default-features = false, features = [ "derive" ] } +codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = [ "derive" ] } +scale-info = { version = "2.9.0", default-features = false, features = [ "derive" ] } ethbloom = { version = "0.13.0", default-features = false } ethereum-types = { version = "0.14.1", default-features = false, features = [ "codec", "rlp", "serialize" ] } hex = { package = "rustc-hex", version = "2.1.0", default-features = false } @@ -17,17 +17,17 @@ parity-bytes = { version = "0.1.2", default-features = false } rlp = { version = "0.5", default-features = false } #getrandom = { version = "0.2.1", features = [ "js" ] } -sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } +sp-io = { path = "../../../polkadot-sdk/substrate/primitives/io", default-features = false } +sp-std = { path = "../../../polkadot-sdk/substrate/primitives/std", default-features = false } +sp-core = { path = "../../../polkadot-sdk/substrate/primitives/core", default-features = false } +sp-runtime = { path = "../../../polkadot-sdk/substrate/primitives/runtime", default-features = false } ethabi = { git = "https://github.com/snowfork/ethabi-decode.git", package = "ethabi-decode", branch="master", default-features = false } [dev-dependencies] wasm-bindgen-test = "0.3.19" rand = "0.8.5" -serde = { version = "1.0.164", features = [ "derive" ] } +serde = { version = "1.0.188", features = [ "derive" ] } serde_json = "1.0.96" [features] diff --git a/parachain/primitives/router/Cargo.toml b/parachain/primitives/router/Cargo.toml index 2fe1bbf22e..3a93e709bf 100644 --- a/parachain/primitives/router/Cargo.toml +++ b/parachain/primitives/router/Cargo.toml @@ -5,20 +5,21 @@ authors = [ "Snowfork " ] edition = "2021" [dependencies] -serde = { version = "1.0.164", optional = true, features = [ "derive" ] } -codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false } -scale-info = { version = "2.7.0", default-features = false, features = [ "derive" ] } - -frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "master", default-features = false } - -xcm = { git = "https://github.com/paritytech/polkadot.git", branch = "master", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot.git", branch = "master", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot.git", branch = "master", default-features = false } +serde = { version = "1.0.188", optional = true, features = [ "derive" ] } +codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = [ "derive" ] } +log = { version = "0.4.20", default-features = false } + +frame-support = { path = "../../../polkadot-sdk/substrate/frame/support", default-features = false } +frame-system = { path = "../../../polkadot-sdk/substrate/frame/system", default-features = false } +sp-core = { path = "../../../polkadot-sdk/substrate/primitives/core", default-features = false } +sp-io = { path = "../../../polkadot-sdk/substrate/primitives/io", default-features = false } +sp-runtime = { path = "../../../polkadot-sdk/substrate/primitives/runtime", default-features = false } +sp-std = { path = "../../../polkadot-sdk/substrate/primitives/std", default-features = false } + +xcm = { package = "staging-xcm", path = "../../../polkadot-sdk/polkadot/xcm", default-features = false } +xcm-builder = { package = "staging-xcm-builder", path = "../../../polkadot-sdk/polkadot/xcm/xcm-builder", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = "../../../polkadot-sdk/polkadot/xcm/xcm-executor", default-features = false } snowbridge-core = { path = "../../primitives/core", default-features = false } diff --git a/parachain/primitives/router/src/inbound/mod.rs b/parachain/primitives/router/src/inbound/mod.rs index ce7c7344ee..786e96ae6d 100644 --- a/parachain/primitives/router/src/inbound/mod.rs +++ b/parachain/primitives/router/src/inbound/mod.rs @@ -103,7 +103,8 @@ impl Command { Parent, GlobalConsensus(network), origin_location, - ).into(), + ) + .into(), }, ] .into(), diff --git a/parachain/primitives/router/src/outbound/mod.rs b/parachain/primitives/router/src/outbound/mod.rs index df771a4385..5935dbd210 100644 --- a/parachain/primitives/router/src/outbound/mod.rs +++ b/parachain/primitives/router/src/outbound/mod.rs @@ -5,7 +5,8 @@ use core::slice::Iter; use codec::{Decode, Encode}; -use frame_support::{ensure, log, traits::Get}; +use frame_support::{ensure, traits::Get}; +use log; use snowbridge_core::outbound::{ AgentExecuteCommand, Command, Message, OutboundQueue as OutboundQueueTrait, }; diff --git a/polkadot-sdk b/polkadot-sdk new file mode 160000 index 0000000000..8eb7cef34b --- /dev/null +++ b/polkadot-sdk @@ -0,0 +1 @@ +Subproject commit 8eb7cef34bf59b333af095bff822413958058b5e diff --git a/relayer/cmd/generate_beacon_data.go b/relayer/cmd/generate_beacon_data.go index 483fe733cd..1b864eeae7 100644 --- a/relayer/cmd/generate_beacon_data.go +++ b/relayer/cmd/generate_beacon_data.go @@ -188,7 +188,7 @@ func generateBeaconData(cmd *cobra.Command, _ []string) error { }).Info("created initial sync file") // generate FinalizedUpdate for next epoch - log.Info("waiting for a new finalized_update in next epoch and in current sync period,several seconds required...") + log.Info("waiting for a new finalized_update in next epoch and in current sync period. This may take a while...") elapseEpochs := uint64(1) waitIntervalForNextEpoch := elapseEpochs * specSettings.SlotsInEpoch time.Sleep(time.Duration(waitIntervalForNextEpoch) * SlotTimeDuration) @@ -215,13 +215,20 @@ func generateBeaconData(cmd *cobra.Command, _ []string) error { }).Info("created finalized header update file") // generate SyncCommitteeUpdate same as InitialUpdate for filling NextSyncCommittee - syncCommitteeUpdateScale, err := s.GetSyncCommitteePeriodUpdate(initialSyncPeriod) - if err != nil { - return fmt.Errorf("get sync committee update: %w", err) + syncCommitteeUpdate := beaconjson.Update{} + for { + syncCommitteeUpdateScale, err := s.GetSyncCommitteePeriodUpdate(initialSyncPeriod) + if err != syncer.ErrBeaconStateAvailableYet { + syncCommitteeUpdate := syncCommitteeUpdateScale.Payload.ToJSON() + writeJSONToFile(syncCommitteeUpdate, fmt.Sprintf("sync-committee-update.%s.json", activeSpec.ToString())) + log.Info("created sync committee update file") + + break + } + + fmt.Println("beacon state no available yet, retrying in 15 seconds...") + time.Sleep(15 * time.Second) } - syncCommitteeUpdate := syncCommitteeUpdateScale.Payload.ToJSON() - writeJSONToFile(syncCommitteeUpdate, fmt.Sprintf("sync-committee-update.%s.json", activeSpec.ToString())) - log.Info("created sync committee update file") // generate executionUpdate blockUpdateSlot := uint64(finalizedUpdateScale.Payload.FinalizedHeader.Slot - 2) diff --git a/smoketest/Cargo.lock b/smoketest/Cargo.lock index 9f8449a233..aded0e4e8e 100644 --- a/smoketest/Cargo.lock +++ b/smoketest/Cargo.lock @@ -103,12 +103,189 @@ version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cde0f2aa063a2a5c28d39b47761aa102bda7c13c84fc118a61b87c7b2f785c" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-scale" +version = "0.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49b08346a3e38e2be792ef53ee168623c9244d968ff00cd70fb9932f6fe36393" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "parity-scale-codec", +] + +[[package]] +name = "ark-secret-scalar" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=f4fe253#f4fe2534ccc6d916cd10d9c16891e673728ec8b4" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "ark-transcript", + "digest 0.10.7", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-transcript" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=f4fe253#f4fe2534ccc6d916cd10d9c16891e673728ec8b4" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "digest 0.10.7", + "rand_core 0.6.4", + "sha3", +] + [[package]] name = "array-bytes" version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" +[[package]] +name = "array-bytes" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" + [[package]] name = "array-init" version = "0.0.4" @@ -153,7 +330,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.37", ] [[package]] @@ -200,6 +377,27 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "bandersnatch_vrfs" +version = "0.0.1" +source = "git+https://github.com/w3f/ring-vrf?rev=f4fe253#f4fe2534ccc6d916cd10d9c16891e673728ec8b4" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff", + "ark-serialize", + "ark-std", + "dleq_vrf", + "fflonk", + "merlin 3.0.0", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "ring 0.1.0", + "sha2 0.10.7", + "zeroize", +] + [[package]] name = "base16ct" version = "0.2.0" @@ -288,7 +486,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -343,9 +541,9 @@ dependencies = [ [[package]] name = "bounded-collections" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a071c348a5ef6da1d3a87166b408170b46002382b1dda83992b5c2208cefb370" +checksum = "eb5b05133427c07c4776906f673ccf36c21b102c9829c641a5b56bd151d44fd6" dependencies = [ "log", "parity-scale-codec", @@ -362,6 +560,15 @@ dependencies = [ "sha2 0.9.9", ] +[[package]] +name = "bs58" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "tinyvec", +] + [[package]] name = "bumpalo" version = "3.12.0" @@ -478,15 +685,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b30a84aab436fcb256a2ab3c80663d8aec686e6bae12827bb05fef3e1e439c9f" dependencies = [ "bincode", - "bs58", + "bs58 0.4.0", "coins-core", - "digest 0.10.6", + "digest 0.10.7", "getrandom 0.2.8", "hmac 0.12.1", "k256", "lazy_static", "serde", - "sha2 0.10.6", + "sha2 0.10.7", "thiserror", ] @@ -503,7 +710,7 @@ dependencies = [ "once_cell", "pbkdf2 0.12.1", "rand 0.8.5", - "sha2 0.10.6", + "sha2 0.10.7", "thiserror", ] @@ -515,18 +722,33 @@ checksum = "9b949a1c63fb7eb591eb7ba438746326aedf0ae843e51ec92ba6bec5bb382c4f" dependencies = [ "base64 0.21.0", "bech32", - "bs58", - "digest 0.10.6", + "bs58 0.4.0", + "digest 0.10.7", "generic-array 0.14.7", "hex", "ripemd", "serde", "serde_derive", - "sha2 0.10.6", + "sha2 0.10.7", "sha3", "thiserror", ] +[[package]] +name = "common" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof?rev=8657210#86572101f4210647984ab4efedba6b3fcc890895" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "fflonk", + "merlin 3.0.0", + "rand_chacha 0.3.1", +] + [[package]] name = "const-oid" version = "0.9.2" @@ -584,9 +806,9 @@ dependencies = [ [[package]] name = "cranelift-entity" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f42ea692c7b450ad18b8c9889661505d51c09ec4380cf1c2d278dbb2da22cae1" +checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" dependencies = [ "serde", ] @@ -707,7 +929,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.16", + "syn 2.0.37", ] [[package]] @@ -724,7 +946,7 @@ checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.37", ] [[package]] @@ -820,15 +1042,32 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", "crypto-common", "subtle", ] +[[package]] +name = "dleq_vrf" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=f4fe253#f4fe2534ccc6d916cd10d9c16891e673728ec8b4" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-scale", + "ark-secret-scalar", + "ark-serialize", + "ark-std", + "ark-transcript", + "arrayvec 0.7.2", + "rand_core 0.6.4", + "zeroize", +] + [[package]] name = "downcast-rs" version = "1.2.0" @@ -929,7 +1168,7 @@ checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ "base16ct", "crypto-bigint", - "digest 0.10.6", + "digest 0.10.7", "ff", "generic-array 0.14.7", "group", @@ -1014,7 +1253,7 @@ checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" dependencies = [ "aes", "ctr", - "digest 0.10.6", + "digest 0.10.7", "hex", "hmac 0.12.1", "pbkdf2 0.11.0", @@ -1022,7 +1261,7 @@ dependencies = [ "scrypt", "serde", "serde_json", - "sha2 0.10.6", + "sha2 0.10.7", "sha3", "thiserror", "uuid", @@ -1136,7 +1375,7 @@ dependencies = [ "regex", "serde", "serde_json", - "syn 2.0.16", + "syn 2.0.37", "toml", "walkdir", ] @@ -1153,7 +1392,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.16", + "syn 2.0.37", ] [[package]] @@ -1178,7 +1417,7 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.16", + "syn 2.0.37", "tempfile", "thiserror", "tiny-keccak", @@ -1274,7 +1513,7 @@ dependencies = [ "ethers-core", "hex", "rand 0.8.5", - "sha2 0.10.6", + "sha2 0.10.7", "thiserror", "tracing", ] @@ -1326,6 +1565,19 @@ dependencies = [ "subtle", ] +[[package]] +name = "fflonk" +version = "0.1.0" +source = "git+https://github.com/w3f/fflonk#26a5045b24e169cffc1f9328ca83d71061145c40" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "merlin 3.0.0", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -1438,7 +1690,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.37", ] [[package]] @@ -1549,6 +1801,11 @@ name = "gimli" version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" +dependencies = [ + "fallible-iterator", + "indexmap", + "stable_deref_trait", +] [[package]] name = "gloo-timers" @@ -1627,6 +1884,9 @@ name = "hashbrown" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", +] [[package]] name = "hashers" @@ -1696,7 +1956,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -1923,6 +2183,15 @@ version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.6" @@ -2037,7 +2306,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", - "sha2 0.10.6", + "sha2 0.10.7", "signature 2.0.0", ] @@ -2204,6 +2473,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + [[package]] name = "memory-db" version = "0.31.0" @@ -2232,6 +2510,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + [[package]] name = "mime" version = "0.3.17" @@ -2351,7 +2641,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.37", ] [[package]] @@ -2372,6 +2662,9 @@ version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" dependencies = [ + "crc32fast", + "hashbrown 0.13.2", + "indexmap", "memchr", ] @@ -2426,9 +2719,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "parity-scale-codec" -version = "3.4.0" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "637935964ff85a605d114591d4d2c13c5d1ba2806dae97cea6bf180238a749ac" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" dependencies = [ "arrayvec 0.7.2", "bitvec 1.0.1", @@ -2441,9 +2734,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.1.4" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" +checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2476,7 +2769,7 @@ dependencies = [ "cfg-if", "libc", "redox_syscall 0.2.16", - "smallvec 1.10.0", + "smallvec 1.11.0", "windows-sys 0.45.0", ] @@ -2501,7 +2794,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -2510,7 +2803,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0ca0b5a68607598bf3bad68f32227a8164f6254833f84eafaac409cd6746c31" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", "hmac 0.12.1", ] @@ -2547,7 +2840,7 @@ checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.37", ] [[package]] @@ -2585,7 +2878,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9825a04601d60621feed79c4e6b56d65db77cdca55cef43b46b0de1096d1c282" dependencies = [ "proc-macro2", - "syn 2.0.16", + "syn 2.0.37", ] [[package]] @@ -2638,9 +2931,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -2656,9 +2949,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.26" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -2781,7 +3074,7 @@ checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.37", ] [[package]] @@ -2872,6 +3165,22 @@ dependencies = [ "subtle", ] +[[package]] +name = "ring" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof?rev=8657210#86572101f4210647984ab4efedba6b3fcc890895" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "blake2", + "common", + "fflonk", + "merlin 3.0.0", +] + [[package]] name = "ring" version = "0.16.20" @@ -2893,7 +3202,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -2980,7 +3289,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", - "ring", + "ring 0.16.20", "sct", "webpki", ] @@ -3132,7 +3441,7 @@ dependencies = [ "arrayvec 0.5.2", "curve25519-dalek 2.1.3", "getrandom 0.1.16", - "merlin", + "merlin 2.0.1", "rand 0.7.3", "rand_core 0.5.1", "sha2 0.8.2", @@ -3161,7 +3470,7 @@ dependencies = [ "hmac 0.12.1", "pbkdf2 0.11.0", "salsa20", - "sha2 0.10.6", + "sha2 0.10.7", ] [[package]] @@ -3170,7 +3479,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", + "ring 0.16.20", "untrusted", ] @@ -3261,9 +3570,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.159" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] @@ -3281,13 +3590,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.159" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.37", ] [[package]] @@ -3343,7 +3652,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -3373,13 +3682,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -3388,7 +3697,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", "keccak", ] @@ -3413,7 +3722,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fe458c98333f9c8152221191a77e2a44e8325d0193484af2e9421a53019e57d" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", "rand_core 0.6.4", ] @@ -3437,9 +3746,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "snowbridge-smoketest" @@ -3451,9 +3760,9 @@ dependencies = [ "hex-literal", "parity-scale-codec", "sp-core 16.0.0", + "staging-xcm", "subxt", "tokio", - "xcm", ] [[package]] @@ -3497,56 +3806,55 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7796939f2e3b68a3b9410ea17a2063b78038cd366f57fa772dd3be0798bd3412" dependencies = [ "integer-sqrt", "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-std 5.0.0", + "sp-std 6.0.0", "static_assertions", ] [[package]] name = "sp-arithmetic" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7796939f2e3b68a3b9410ea17a2063b78038cd366f57fa772dd3be0798bd3412" +version = "16.0.0" dependencies = [ "integer-sqrt", "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-std 6.0.0", + "sp-std 8.0.0", "static_assertions", ] [[package]] name = "sp-core" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c96dc3debbe5c22ebf18f99e6a53199efe748e6e584a1902adb88cbad66ae7c" dependencies = [ - "array-bytes", + "array-bytes 4.2.0", + "base58", "bitflags", "blake2", "bounded-collections", - "bs58", "dyn-clonable", "ed25519-zebra", "futures", - "hash-db 0.16.0", + "hash-db 0.15.2", "hash256-std-hasher", "impl-serde", "lazy_static", "libsecp256k1", "log", - "merlin", + "merlin 2.0.1", "parity-scale-codec", "parking_lot", - "paste", "primitive-types", "rand 0.8.5", "regex", @@ -3555,12 +3863,12 @@ dependencies = [ "secp256k1", "secrecy", "serde", - "sp-core-hashing 5.0.0", - "sp-debug-derive 5.0.0", - "sp-externalities 0.13.0", - "sp-runtime-interface 7.0.0", - "sp-std 5.0.0", - "sp-storage 7.0.0", + "sp-core-hashing 6.0.0", + "sp-debug-derive 6.0.0", + "sp-externalities 0.17.0", + "sp-runtime-interface 13.0.0", + "sp-std 6.0.0", + "sp-storage 11.0.0", "ss58-registry", "substrate-bip39", "thiserror", @@ -3570,27 +3878,27 @@ dependencies = [ [[package]] name = "sp-core" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c96dc3debbe5c22ebf18f99e6a53199efe748e6e584a1902adb88cbad66ae7c" +version = "21.0.0" dependencies = [ - "array-bytes", - "base58", + "array-bytes 6.1.0", + "bandersnatch_vrfs", "bitflags", "blake2", "bounded-collections", + "bs58 0.5.0", "dyn-clonable", "ed25519-zebra", "futures", - "hash-db 0.15.2", + "hash-db 0.16.0", "hash256-std-hasher", "impl-serde", "lazy_static", "libsecp256k1", "log", - "merlin", + "merlin 2.0.1", "parity-scale-codec", "parking_lot", + "paste", "primitive-types", "rand 0.8.5", "regex", @@ -3599,33 +3907,20 @@ dependencies = [ "secp256k1", "secrecy", "serde", - "sp-core-hashing 6.0.0", - "sp-debug-derive 6.0.0", - "sp-externalities 0.17.0", - "sp-runtime-interface 13.0.0", - "sp-std 6.0.0", - "sp-storage 11.0.0", + "sp-core-hashing 9.0.0", + "sp-debug-derive 8.0.0", + "sp-externalities 0.19.0", + "sp-runtime-interface 17.0.0", + "sp-std 8.0.0", + "sp-storage 13.0.0", "ss58-registry", "substrate-bip39", "thiserror", "tiny-bip39", + "tracing", "zeroize", ] -[[package]] -name = "sp-core-hashing" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" -dependencies = [ - "blake2b_simd", - "byteorder", - "digest 0.10.6", - "sha2 0.10.6", - "sha3", - "sp-std 5.0.0", - "twox-hash", -] - [[package]] name = "sp-core-hashing" version = "6.0.0" @@ -3634,21 +3929,23 @@ checksum = "cbc2d1947252b7a4e403b0a260f596920443742791765ec111daa2bbf98eff25" dependencies = [ "blake2", "byteorder", - "digest 0.10.6", - "sha2 0.10.6", + "digest 0.10.7", + "sha2 0.10.7", "sha3", "sp-std 6.0.0", "twox-hash", ] [[package]] -name = "sp-debug-derive" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +name = "sp-core-hashing" +version = "9.0.0" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.16", + "blake2b_simd", + "byteorder", + "digest 0.10.7", + "sha2 0.10.7", + "sha3", + "twox-hash", ] [[package]] @@ -3663,14 +3960,12 @@ dependencies = [ ] [[package]] -name = "sp-externalities" -version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +name = "sp-debug-derive" +version = "8.0.0" dependencies = [ - "environmental", - "parity-scale-codec", - "sp-std 5.0.0", - "sp-storage 7.0.0", + "proc-macro2", + "quote", + "syn 2.0.37", ] [[package]] @@ -3685,6 +3980,16 @@ dependencies = [ "sp-storage 11.0.0", ] +[[package]] +name = "sp-externalities" +version = "0.19.0" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std 8.0.0", + "sp-storage 13.0.0", +] + [[package]] name = "sp-io" version = "17.0.0" @@ -3719,7 +4024,7 @@ checksum = "480dbd54b281c638209fbcfce69902b82a0a1af0e22219d46825eadced3136b6" dependencies = [ "async-trait", "futures", - "merlin", + "merlin 2.0.1", "parity-scale-codec", "parking_lot", "schnorrkel", @@ -3764,64 +4069,62 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb7707246cee4967a8cc71e3ef0e82f562e8b1020606447a6a12b99c7c1b443" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", - "sp-externalities 0.13.0", - "sp-runtime-interface-proc-macro 6.0.0", - "sp-std 5.0.0", - "sp-storage 7.0.0", - "sp-tracing 6.0.0", - "sp-wasm-interface 7.0.0", + "sp-externalities 0.17.0", + "sp-runtime-interface-proc-macro 9.0.0", + "sp-std 6.0.0", + "sp-storage 11.0.0", + "sp-tracing 8.0.0", + "sp-wasm-interface 10.0.0", "static_assertions", ] [[package]] name = "sp-runtime-interface" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb7707246cee4967a8cc71e3ef0e82f562e8b1020606447a6a12b99c7c1b443" +version = "17.0.0" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", - "sp-externalities 0.17.0", - "sp-runtime-interface-proc-macro 9.0.0", - "sp-std 6.0.0", - "sp-storage 11.0.0", - "sp-tracing 8.0.0", - "sp-wasm-interface 10.0.0", + "sp-externalities 0.19.0", + "sp-runtime-interface-proc-macro 11.0.0", + "sp-std 8.0.0", + "sp-storage 13.0.0", + "sp-tracing 10.0.0", + "sp-wasm-interface 14.0.0", "static_assertions", ] [[package]] name = "sp-runtime-interface-proc-macro" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2773c90e5765847c5e8b4a24b553d38a9ca52ded47c142cfcfb7948f42827af9" dependencies = [ "Inflector", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 1.0.109", ] [[package]] name = "sp-runtime-interface-proc-macro" -version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2773c90e5765847c5e8b4a24b553d38a9ca52ded47c142cfcfb7948f42827af9" +version = "11.0.0" dependencies = [ "Inflector", "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.37", ] [[package]] @@ -3835,7 +4138,7 @@ dependencies = [ "parity-scale-codec", "parking_lot", "rand 0.8.5", - "smallvec 1.10.0", + "smallvec 1.11.0", "sp-core 16.0.0", "sp-externalities 0.17.0", "sp-panic-handler", @@ -3845,51 +4148,50 @@ dependencies = [ "tracing", ] -[[package]] -name = "sp-std" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" - [[package]] name = "sp-std" version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af0ee286f98455272f64ac5bb1384ff21ac029fbb669afbaf48477faff12760e" +[[package]] +name = "sp-std" +version = "8.0.0" + [[package]] name = "sp-storage" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c20cb0c562d1a159ecb2c7ca786828c81e432c535474967d2df3a484977cea4" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 5.0.0", - "sp-std 5.0.0", + "sp-debug-derive 6.0.0", + "sp-std 6.0.0", ] [[package]] name = "sp-storage" -version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c20cb0c562d1a159ecb2c7ca786828c81e432c535474967d2df3a484977cea4" +version = "13.0.0" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 6.0.0", - "sp-std 6.0.0", + "sp-debug-derive 8.0.0", + "sp-std 8.0.0", ] [[package]] name = "sp-tracing" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e46bd547da89a9cda69b4ce4c91a5b7e1f86915190d83cd407b715d0c6bac042" dependencies = [ "parity-scale-codec", - "sp-std 5.0.0", + "sp-std 6.0.0", "tracing", "tracing-core", "tracing-subscriber", @@ -3897,12 +4199,10 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e46bd547da89a9cda69b4ce4c91a5b7e1f86915190d83cd407b715d0c6bac042" +version = "10.0.0" dependencies = [ "parity-scale-codec", - "sp-std 6.0.0", + "sp-std 8.0.0", "tracing", "tracing-core", "tracing-subscriber", @@ -3932,20 +4232,6 @@ dependencies = [ "trie-root", ] -[[package]] -name = "sp-wasm-interface" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" -dependencies = [ - "anyhow", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sp-std 5.0.0", - "wasmi", - "wasmtime 6.0.2", -] - [[package]] name = "sp-wasm-interface" version = "10.0.0" @@ -3962,18 +4248,15 @@ dependencies = [ ] [[package]] -name = "sp-weights" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +name = "sp-wasm-interface" +version = "14.0.0" dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", "parity-scale-codec", - "scale-info", - "serde", - "smallvec 1.10.0", - "sp-arithmetic 6.0.0", - "sp-core 7.0.0", - "sp-debug-derive 5.0.0", - "sp-std 5.0.0", + "sp-std 8.0.0", + "wasmtime 8.0.1", ] [[package]] @@ -3985,13 +4268,27 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "smallvec 1.10.0", + "smallvec 1.11.0", "sp-arithmetic 12.0.0", "sp-core 16.0.0", "sp-debug-derive 6.0.0", "sp-std 6.0.0", ] +[[package]] +name = "sp-weights" +version = "20.0.0" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "smallvec 1.11.0", + "sp-arithmetic 16.0.0", + "sp-core 21.0.0", + "sp-debug-derive 8.0.0", + "sp-std 8.0.0", +] + [[package]] name = "spin" version = "0.5.2" @@ -4029,6 +4326,22 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "staging-xcm" +version = "1.0.0" +dependencies = [ + "bounded-collections", + "derivative", + "environmental", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-weights 20.0.0", + "xcm-procedural", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -4060,7 +4373,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.16", + "syn 2.0.37", ] [[package]] @@ -4169,9 +4482,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.16" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -4214,22 +4527,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.37", ] [[package]] @@ -4254,7 +4567,7 @@ dependencies = [ "pbkdf2 0.11.0", "rand 0.8.5", "rustc-hash", - "sha2 0.10.6", + "sha2 0.10.7", "thiserror", "unicode-normalization", "wasm-bindgen", @@ -4310,7 +4623,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.37", ] [[package]] @@ -4469,7 +4782,7 @@ dependencies = [ "serde", "serde_json", "sharded-slab", - "smallvec 1.10.0", + "smallvec 1.11.0", "thread_local", "tracing", "tracing-core", @@ -4487,7 +4800,7 @@ dependencies = [ "hashbrown 0.12.3", "log", "rustc-hex", - "smallvec 1.10.0", + "smallvec 1.11.0", ] [[package]] @@ -4531,8 +4844,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "digest 0.10.6", - "rand 0.7.3", + "digest 0.10.7", + "rand 0.8.5", "static_assertions", ] @@ -4775,9 +5088,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.100.0" +version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" +checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" dependencies = [ "indexmap", "url", @@ -4810,9 +5123,9 @@ dependencies = [ [[package]] name = "wasmtime" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a222f5fa1e14b2cefc286f1b68494d7a965f4bf57ec04c59bb62673d639af6" +checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" dependencies = [ "anyhow", "bincode", @@ -4820,17 +5133,17 @@ dependencies = [ "indexmap", "libc", "log", - "object 0.29.0", + "object 0.30.3", "once_cell", "paste", "psm", "serde", "target-lexicon", - "wasmparser 0.100.0", - "wasmtime-environ 6.0.2", - "wasmtime-jit 6.0.2", - "wasmtime-runtime 6.0.2", - "windows-sys 0.42.0", + "wasmparser 0.102.0", + "wasmtime-environ 8.0.1", + "wasmtime-jit 8.0.1", + "wasmtime-runtime 8.0.1", + "windows-sys 0.45.0", ] [[package]] @@ -4844,9 +5157,9 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4407a7246e7d2f3d8fb1cf0c72fda8dbafdb6dd34d555ae8bea0e5ae031089cc" +checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" dependencies = [ "cfg-if", ] @@ -4872,21 +5185,21 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b8b50962eae38ee319f7b24900b7cf371f03eebdc17400c1dc8575fc10c9a7" +checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" dependencies = [ "anyhow", - "cranelift-entity 0.93.2", - "gimli 0.26.2", + "cranelift-entity 0.95.1", + "gimli 0.27.2", "indexmap", "log", - "object 0.29.0", + "object 0.30.3", "serde", "target-lexicon", "thiserror", - "wasmparser 0.100.0", - "wasmtime-types 6.0.2", + "wasmparser 0.102.0", + "wasmtime-types 8.0.1", ] [[package]] @@ -4914,25 +5227,25 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffaed4f9a234ba5225d8e64eac7b4a5d13b994aeb37353cde2cbeb3febda9eaa" +checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" dependencies = [ - "addr2line 0.17.0", + "addr2line 0.19.0", "anyhow", "bincode", "cfg-if", "cpp_demangle", - "gimli 0.26.2", + "gimli 0.27.2", "log", - "object 0.29.0", + "object 0.30.3", "rustc-demangle", "serde", "target-lexicon", - "wasmtime-environ 6.0.2", - "wasmtime-jit-icache-coherence 6.0.2", - "wasmtime-runtime 6.0.2", - "windows-sys 0.42.0", + "wasmtime-environ 8.0.1", + "wasmtime-jit-icache-coherence 8.0.1", + "wasmtime-runtime 8.0.1", + "windows-sys 0.45.0", ] [[package]] @@ -4946,9 +5259,9 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed41cbcbf74ce3ff6f1d07d1b707888166dc408d1a880f651268f4f7c9194b2" +checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" dependencies = [ "once_cell", ] @@ -4966,13 +5279,13 @@ dependencies = [ [[package]] name = "wasmtime-jit-icache-coherence" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a28ae1e648461bfdbb79db3efdaee1bca5b940872e4175390f465593a2e54c" +checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" dependencies = [ "cfg-if", "libc", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -4989,7 +5302,7 @@ dependencies = [ "log", "mach", "memfd", - "memoffset", + "memoffset 0.6.5", "paste", "rand 0.8.5", "rustix 0.36.11", @@ -5001,9 +5314,9 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e704b126e4252788ccfc3526d4d4511d4b23c521bf123e447ac726c14545217b" +checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" dependencies = [ "anyhow", "cc", @@ -5013,14 +5326,14 @@ dependencies = [ "log", "mach", "memfd", - "memoffset", + "memoffset 0.8.0", "paste", "rand 0.8.5", "rustix 0.36.11", - "wasmtime-asm-macros 6.0.2", - "wasmtime-environ 6.0.2", - "wasmtime-jit-debug 6.0.2", - "windows-sys 0.42.0", + "wasmtime-asm-macros 8.0.1", + "wasmtime-environ 8.0.1", + "wasmtime-jit-debug 8.0.1", + "windows-sys 0.45.0", ] [[package]] @@ -5037,14 +5350,14 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e5572c5727c1ee7e8f28717aaa8400e4d22dcbd714ea5457d85b5005206568" +checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" dependencies = [ - "cranelift-entity 0.93.2", + "cranelift-entity 0.95.1", "serde", "thiserror", - "wasmparser 0.100.0", + "wasmparser 0.102.0", ] [[package]] @@ -5063,7 +5376,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" dependencies = [ - "ring", + "ring 0.16.20", "untrusted", ] @@ -5309,31 +5622,14 @@ dependencies = [ "tap", ] -[[package]] -name = "xcm" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" -dependencies = [ - "bounded-collections", - "derivative", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-weights 4.0.0", - "xcm-procedural", -] - [[package]] name = "xcm-procedural" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +version = "1.0.0" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.37", ] [[package]] @@ -5359,5 +5655,5 @@ checksum = "25588073e5216b50bca71d61cb8595cdb9745e87032a58c199730def2862c934" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.37", ] diff --git a/smoketest/Cargo.toml b/smoketest/Cargo.toml index 79502e5174..e54380eda5 100644 --- a/smoketest/Cargo.toml +++ b/smoketest/Cargo.toml @@ -16,4 +16,4 @@ ethers = { git = "https://github.com/gakonst/ethers-rs", default-features = fals sp-core = "16.0.0" [dev-dependencies] -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +xcm = { path = "../polkadot-sdk/polkadot/xcm", package="staging-xcm" } diff --git a/smoketest/src/constants.rs b/smoketest/src/constants.rs index a021eca908..d22d08e89f 100644 --- a/smoketest/src/constants.rs +++ b/smoketest/src/constants.rs @@ -4,6 +4,7 @@ pub const ETHEREUM_API: &str = "ws://localhost:8546"; pub const ETHEREUM_HTTP_API: &str = "http://localhost:8545"; pub const BRIDGE_HUB_WS_URL: &str = "ws://127.0.0.1:11144"; pub const BRIDGE_HUB_PARA_ID: u32 = 1013; +pub const ASSET_HUB_WS_URL: &str = "ws://127.0.0.1:12144"; pub const TEMPLATE_NODE_WS_URL: &str = "ws://127.0.0.1:13144"; @@ -17,7 +18,11 @@ pub const ETHEREUM_ADDRESS: [u8; 20] = hex!("90A987B944Cb1dCcE5564e5FDeCD7a54D3d // GatewayProxy in local setup pub const GATEWAY_PROXY_CONTRACT: [u8; 20] = hex!("EDa338E4dC46038493b885327842fD3E301CaB39"); +pub const WETH_CONTRACT: [u8; 20] = hex!("87d1f7fdfEe7f651FaBc8bFCB6E086C278b77A7d"); // Agent for sibling parachain 1001 pub const SIBLING_AGENT_ID: [u8; 32] = hex!("2075b9f5bc236462eb1473c9a6236c3588e33ed19ead53aa3d9c62ed941cb793"); +// Agent for asset hub parachain 1000 +pub const ASSET_HUB_AGENT_ID: [u8; 32] = + hex!("72456f48efed08af20e5b317abf8648ac66e86bb90a411d9b0b713f7364b75b4"); diff --git a/smoketest/src/helper.rs b/smoketest/src/helper.rs index d66f9a2e71..3c3d7824ac 100644 --- a/smoketest/src/helper.rs +++ b/smoketest/src/helper.rs @@ -1,7 +1,7 @@ use crate::constants::*; use crate::contracts::i_gateway; use crate::parachains::bridgehub::{self}; -use crate::parachains::template::api::runtime_types::xcm as templateXcm; +use crate::parachains::template::api::runtime_types::staging_xcm as templateXcm; use crate::parachains::template::{self}; use ethers::prelude::{ Address, EthEvent, LocalWallet, Middleware, Provider, Signer, SignerMiddleware, @@ -16,7 +16,7 @@ use std::time::Duration; use subxt::blocks::ExtrinsicEvents; use subxt::events::StaticEvent; use subxt::tx::{PairSigner, TxPayload}; -use subxt::{Config, OnlineClient, PolkadotConfig}; +use subxt::{Config, OnlineClient, PolkadotConfig, SubstrateConfig}; use templateXcm::{ v3::{junction::Junction, junctions::Junctions, multilocation::MultiLocation}, VersionedMultiLocation, VersionedXcm, @@ -36,6 +36,20 @@ impl Config for TemplateConfig { type ExtrinsicParams = ::ExtrinsicParams; } +/// Custom config that works with Statemint +pub enum AssetHubConfig {} + +impl Config for AssetHubConfig { + type Index = ::Index; + type Hash = ::Hash; + type AccountId = ::AccountId; + type Address = ::Address; + type Signature = ::Signature; + type Hasher = ::Hasher; + type Header = ::Header; + type ExtrinsicParams = ::ExtrinsicParams; +} + pub struct TestClients { pub bridge_hub_client: Box>, pub template_client: Box>, diff --git a/smoketest/src/xcm.rs b/smoketest/src/xcm.rs index 357e853b6e..17fe367739 100644 --- a/smoketest/src/xcm.rs +++ b/smoketest/src/xcm.rs @@ -1,6 +1,6 @@ use crate::constants::*; use crate::parachains::template::{ - api::runtime_types as templateTypes, api::runtime_types::xcm as templateXcm, + api::runtime_types as templateTypes, api::runtime_types::staging_xcm as templateXcm, }; use templateTypes::sp_weights::weight_v2::Weight; use templateXcm::{ diff --git a/smoketest/tests/register_token.rs b/smoketest/tests/register_token.rs index b1d15a9c64..a4b9020583 100644 --- a/smoketest/tests/register_token.rs +++ b/smoketest/tests/register_token.rs @@ -13,7 +13,7 @@ use snowbridge_smoketest::{ contracts::{i_gateway, weth9}, parachains::assethub::api::{ foreign_assets::events::Created, - runtime_types::xcm::v3::{ + runtime_types::staging_xcm::v3::{ junction::{ Junction::{AccountKey20, GlobalConsensus}, NetworkId, diff --git a/smoketest/tests/send_token.rs b/smoketest/tests/send_token.rs index d6e3adb0f7..70170c64b9 100644 --- a/smoketest/tests/send_token.rs +++ b/smoketest/tests/send_token.rs @@ -11,7 +11,7 @@ use snowbridge_smoketest::{ contracts::{i_gateway, weth9}, parachains::assethub::api::{ foreign_assets::events::Issued, - runtime_types::xcm::v3::{ + runtime_types::staging_xcm::v3::{ junction::{ Junction::{AccountKey20, GlobalConsensus}, NetworkId, diff --git a/smoketest/tests/transfer_token.rs b/smoketest/tests/transfer_token.rs new file mode 100644 index 0000000000..bd26609203 --- /dev/null +++ b/smoketest/tests/transfer_token.rs @@ -0,0 +1,125 @@ +use ethers::{ + providers::{Provider, Ws}, + types::Address, +}; +use std::{sync::Arc, time::Duration}; +use ethers::prelude::Middleware; +use snowbridge_smoketest::contracts::{i_gateway::IGateway, weth9::WETH9}; +use subxt::{ + tx::{PairSigner}, + OnlineClient, +}; +use snowbridge_smoketest::constants::{ASSET_HUB_WS_URL, ETHEREUM_API, GATEWAY_PROXY_CONTRACT, WETH_CONTRACT, ASSET_HUB_AGENT_ID}; +use sp_core::{sr25519::Pair, Pair as PairT}; +use snowbridge_smoketest::{ + contracts::weth9::{TransferFilter}, + parachains::{ + assethub::api::runtime_types::staging_xcm::{ + v3::{ + junction::{Junction, NetworkId}, + junctions::Junctions, + multiasset::{AssetId, Fungibility, MultiAsset, MultiAssets}, + multilocation::MultiLocation + }, + VersionedMultiAssets, VersionedMultiLocation, + }, + assethub::{self}, + }, +}; +use hex_literal::hex; +use assethub::api::polkadot_xcm::calls::TransactionApi; +use futures::StreamExt; +use snowbridge_smoketest::helper::AssetHubConfig; + +const DESTINATION_ADDRESS: [u8; 20] = hex!("44a57ee2f2FCcb85FDa2B0B18EBD0D8D2333700e"); + +#[tokio::test] +async fn transfer_token() { + let ethereum_provider = Provider::::connect(ETHEREUM_API) + .await + .unwrap() + .interval(Duration::from_millis(10u64)); + + + let ethereum_client = Arc::new(ethereum_provider); + + let weth_addr: Address = WETH_CONTRACT.into(); + let weth = WETH9::new(weth_addr, ethereum_client.clone()); + + let gateway = IGateway::new(GATEWAY_PROXY_CONTRACT, ethereum_client.clone()); + let agent_src = gateway.agent_of(ASSET_HUB_AGENT_ID) + .await + .expect("could not get agent address"); + + let assethub: OnlineClient = + OnlineClient::from_url(ASSET_HUB_WS_URL).await.unwrap(); + + let keypair: Pair = Pair::from_string("//Ferdie", None).expect("cannot create keypair"); + + let signer: PairSigner = PairSigner::new(keypair); + + let amount: u128 = 1_000_000_000; + let assets = VersionedMultiAssets::V3(MultiAssets(vec![MultiAsset { + id: AssetId::Concrete(MultiLocation { + parents: 2, + interior: Junctions::X3( + Junction::GlobalConsensus(NetworkId::Ethereum { chain_id: 15 }), + Junction::AccountKey20 { network: None, key: GATEWAY_PROXY_CONTRACT.into() }, + Junction::AccountKey20 { network: None, key: WETH_CONTRACT.into() }, + ), + }), + fun: Fungibility::Fungible(amount), + }])); + + let destination = VersionedMultiLocation::V3(MultiLocation { + parents: 2, + interior: Junctions::X2( + Junction::GlobalConsensus(NetworkId::Ethereum { chain_id: 15 }), + Junction::AccountKey20 { network: None, key: DESTINATION_ADDRESS.into() }, + ), + }); + + let beneficiary = VersionedMultiLocation::V3(MultiLocation { + parents: 2, + interior: Junctions::X2( + Junction::GlobalConsensus(NetworkId::Ethereum { chain_id: 15 }), + Junction::AccountKey20 { network: None, key: DESTINATION_ADDRESS.into() }, + ), + }); + + let bridge_transfer_call = TransactionApi.reserve_transfer_assets(destination, beneficiary, assets, 0); + + let result = assethub + .tx() + .sign_and_submit_then_watch_default(&bridge_transfer_call, &signer) + .await + .expect("send through call.") + .wait_for_finalized_success() + .await + .expect("call success"); + + println!("bridge_transfer call issued at assethub block hash {:?}", result.block_hash()); + + let wait_for_blocks = 50; + let mut stream = ethereum_client.subscribe_blocks().await.unwrap().take(wait_for_blocks); + + let mut transfer_event_found = false; + while let Some(block) = stream.next().await { + println!("Polling ethereum block {:?} for transfer event", block.number.unwrap()); + if let Ok(transfers) = + weth.event::().at_block_hash(block.hash.unwrap()).query().await + { + for transfer in transfers { + println!("Transfer event found at ethereum block {:?}", block.number.unwrap()); + assert_eq!(transfer.src, agent_src.into()); + assert_eq!(transfer.dst, DESTINATION_ADDRESS.into()); + assert_eq!(transfer.wad, amount.into()); + transfer_event_found = true; + } + } + if transfer_event_found { + break; + } + } + assert!(transfer_event_found); +} diff --git a/smoketest/tests/upgrade_gateway.rs b/smoketest/tests/upgrade_gateway.rs index ede38cf7f6..7bbad32a89 100644 --- a/smoketest/tests/upgrade_gateway.rs +++ b/smoketest/tests/upgrade_gateway.rs @@ -19,7 +19,7 @@ use snowbridge_smoketest::{ pallet_xcm::pallet::Call, rococo_runtime::RuntimeCall, sp_weights::weight_v2::Weight, - xcm::{ + staging_xcm::{ double_encoded::DoubleEncoded, v2::OriginKind, v3::{ diff --git a/web/packages/test-helpers/package.json b/web/packages/test-helpers/package.json index 944ed9635c..86c28c7a5f 100644 --- a/web/packages/test-helpers/package.json +++ b/web/packages/test-helpers/package.json @@ -30,6 +30,7 @@ "@ethersproject/abi": "^5.0.0", "@polkadot/api": "^10.9.1", "@polkadot/types": "^10.9.1", + "@polkadot/types-codec": "^10.9.1", "@typechain/ethers-v5": "^10.1.1", "@types/keccak": "^3.0.1", "@types/lodash": "^4.14.186", diff --git a/web/packages/test-helpers/src/generateBeefyCheckpoint.ts b/web/packages/test-helpers/src/generateBeefyCheckpoint.ts index 8a0e108784..9ef873dfb2 100755 --- a/web/packages/test-helpers/src/generateBeefyCheckpoint.ts +++ b/web/packages/test-helpers/src/generateBeefyCheckpoint.ts @@ -4,11 +4,19 @@ import createKeccakHash from "keccak" import { publicKeyConvert } from "secp256k1" import type { ValidatorSetId, - BeefyNextAuthoritySet, BeefyId, } from "@polkadot/types/interfaces/beefy/types" import fs from "fs" import path from "path" +import {u32, u64} from "@polkadot/types-codec"; +import {H256} from "@polkadot/types/interfaces"; +import {Codec} from "@polkadot/types-codec/types"; + +interface NextAuthoritySet extends Codec{ + id: u64; + len: u32; + keysetCommitment: H256; +} async function generateBeefyCheckpoint() { const endpoint = process.env.RELAYCHAIN_ENDPOINT || "ws://127.0.0.1:9944" @@ -51,7 +59,7 @@ async function generateBeefyCheckpoint() { const tree = createMerkleTree(addrs) - const nextAuthorities = await api.query.mmrLeaf.beefyNextAuthorities() + const nextAuthorities = await api.query.mmrLeaf.beefyNextAuthorities() const beefyCheckpoint = { startBlock: beefyStartBlock, @@ -62,7 +70,7 @@ async function generateBeefyCheckpoint() { }, next: { id: nextAuthorities.id.toNumber(), - root: nextAuthorities.root.toHex(), + root: nextAuthorities.keysetCommitment.toHex(), length: nextAuthorities.len.toNumber(), }, } diff --git a/web/packages/test-helpers/yarn-error.log b/web/packages/test-helpers/yarn-error.log new file mode 100644 index 0000000000..c7a3c72198 --- /dev/null +++ b/web/packages/test-helpers/yarn-error.log @@ -0,0 +1,89 @@ +Arguments: + /opt/homebrew/Cellar/node/18.4.0/bin/node /Users/claravanstaden/.node/corepack/yarn/1.22.15/bin/yarn.js add @polkadot/types-augment + +PATH: + /Users/claravanstaden/Library/pnpm:/Users/claravanstaden/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/claravanstaden/.nvm/versions/node/v14.19.0/bin:/Users/claravanstaden/.cargo/bin:/usr/local/go/bin:/bin:/Users/claravanstaden/go/bin:/Users/claravanstaden/.yarn/bin:/Users/claravanstaden/.foundry/bin + +Yarn version: + 1.22.15 + +Node version: + 18.4.0 + +Platform: + darwin arm64 + +Trace: + Error: https://registry.yarnpkg.com/@snowbridge%2fcontract-types: Not found + at params.callback [as _callback] (/Users/claravanstaden/.node/corepack/yarn/1.22.15/lib/cli.js:66140:18) + at self.callback (/Users/claravanstaden/.node/corepack/yarn/1.22.15/lib/cli.js:140885:22) + at Request.emit (node:events:537:28) + at Request. (/Users/claravanstaden/.node/corepack/yarn/1.22.15/lib/cli.js:141857:10) + at Request.emit (node:events:537:28) + at IncomingMessage. (/Users/claravanstaden/.node/corepack/yarn/1.22.15/lib/cli.js:141779:12) + at Object.onceWrapper (node:events:651:28) + at IncomingMessage.emit (node:events:549:35) + at endReadableNT (node:internal/streams/readable:1359:12) + at process.processTicksAndRejections (node:internal/process/task_queues:82:21) + +npm manifest: + { + "name": "@snowbridge/test-helpers", + "version": "1.0.0", + "description": "Snowbridge test helpers", + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "https://github.com/Snowfork/snowbridge.git", + "directory": "web/packages/test-helpers" + }, + "scripts": { + "build": "tsc", + "lint": "eslint src/*", + "generateBeefyCheckpoint": "npx ts-node src/generateBeefyCheckpoint.ts", + "generateContracts": "npx ts-node src/generateContractInfo.ts", + "generateBeefyValidatorSet": "npx ts-node src/generateBeefyTestFixture.ts GenerateInitialSet", + "generateBeefyFinalProof": "npx ts-node src/generateBeefyTestFixture.ts GenerateProofs" + }, + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.42.0", + "@typescript-eslint/parser": "^5.42.0", + "eslint": "^8.26.0", + "eslint-config-prettier": "^8.5.0", + "ts-node": "^10.9.1", + "typescript": "^5.1.6", + "tsconfig-paths": "^4.2.0" + }, + "dependencies": { + "bitfield": "^4.1.0", + "@ethersproject/abi": "^5.0.0", + "@polkadot/api": "^10.9.1", + "@polkadot/types": "^10.9.1", + "@polkadot/types-augment": "^10.9.1", + "@typechain/ethers-v5": "^10.1.1", + "@types/keccak": "^3.0.1", + "@types/lodash": "^4.14.186", + "@types/node": "^18.13.0", + "@types/secp256k1": "^4.0.3", + "@types/seedrandom": "^3.0.2", + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/providers": "^5.4.7", + "@ethersproject/units": "^5.4.7", + "ethers": "^5.7.2", + "ethereumjs-abi": "^0.6.8", + "ethereumjs-util": "^7.0.10", + "keccak": "^3.0.2", + "lodash": "^4.17.21", + "merkletreejs": "^0.2.18", + "rlp": "^2.2.6", + "secp256k1": "^4.0.2", + "seedrandom": "^3.0.5", + "@snowbridge/contract-types": "workspace:*" + } + } + +yarn manifest: + No manifest + +Lockfile: + No lockfile diff --git a/web/packages/test/.envrc-example b/web/packages/test/.envrc-example index 4d47bd7e43..6b39746f05 100644 --- a/web/packages/test/.envrc-example +++ b/web/packages/test/.envrc-example @@ -3,9 +3,6 @@ source_up_if_exists # Overrides for E2E stack ## Substrate config -# export POLKADOT_VER= # Relaychain version, default value: v0.9.30 -# export POLKADOT_BIN= # Relaychain binary, default value: $POLKADOT_DIR/target/release/polkadot -# export CUMULUS_BIN= # Relaychain binary, default value: $CUMULUS_DIR/target/release/polkadot-parachain # export BEEFY_START_BLOCK= # Start block to configure beefy client, default value: 1 # export RELAYCHAIN_ENDPOINT= # Relaychain endpoint, default value: ws://localhost:9944 # export PARACHAIN_RUNTIME= # Runtime type of parachain should be one of snowbase|snowblink|snowbridge diff --git a/web/packages/test/config/launch-config.toml b/web/packages/test/config/launch-config.toml index d080ee4156..baa5b61c5a 100644 --- a/web/packages/test/config/launch-config.toml +++ b/web/packages/test/config/launch-config.toml @@ -9,7 +9,6 @@ chain = "rococo-local" default_command = "{{output_bin_dir}}/polkadot" default_args = [ "-lbeefy=trace,mmr=trace,parachain=debug,xcm=debug,xcm::weight=trace,xcm::filter_asset_location=trace,xcm::send_xcm=trace,xcm::barriers=trace,xcm::barrier=trace,xcm::execute_xcm=trace,xcm::contains=trace,xcm::process_instruction=trace,xcm::currency_adapter=trace,xcm::origin_conversion=trace,xcm::fungibles_adapter=trace,xcm::process=trace,xcm::execute=trace,xcm::should_execute=trace", - "--beefy", "--enable-offchain-indexing=true", "--pruning", "archive", ] @@ -71,7 +70,6 @@ cumulus_based = true ws_port = 12144 args = ["--force-authoring", "-lparachain=debug,xcm=trace,runtime::bridge-assets-transfer=trace,runtime::assets=trace,runtime::bridge-transfer=trace"] - ## Template node [[parachains]] id = 1001 @@ -87,31 +85,3 @@ cumulus_based = true ws_port = 13144 args = ["--force-authoring", "-lparachain=debug,xcm=trace,runtime::bridge-assets-transfer=trace,runtime::assets=trace,runtime::bridge-transfer=trace"] - -# Statemine -> BridgeHub -[[hrmp_channels]] -max_capacity = 8 -max_message_size = 512 -recipient = 1013 -sender = 1000 - -# BridgeHub -> Statemine -[[hrmp_channels]] -max_capacity = 8 -max_message_size = 512 -recipient = 1000 -sender = 1013 - -# TemplateNode -> BridgeHub -[[hrmp_channels]] -max_capacity = 8 -max_message_size = 512 -recipient = 1013 -sender = 1001 - -# BridgeHub -> TemplateNode -[[hrmp_channels]] -max_capacity = 8 -max_message_size = 512 -recipient = 1001 -sender = 1013 diff --git a/web/packages/test/scripts/build-binary.sh b/web/packages/test/scripts/build-binary.sh index 1d8fbb27a3..64431caf79 100755 --- a/web/packages/test/scripts/build-binary.sh +++ b/web/packages/test/scripts/build-binary.sh @@ -3,54 +3,35 @@ set -eu source scripts/set-env.sh -build_cumulus() { - if [ ! -f "$cumulus_bin" ]; then - echo "Building cumulus binary as $cumulus_bin" - rebuild_cumulus +build_cumulus_from_source() { + pushd $root_dir/polkadot-sdk/cumulus + + local features='' + if [[ "$active_spec" != "minimal" ]]; then + features=--features beacon-spec-mainnet fi - mkdir -p $output_bin_dir && cp "$cumulus_bin" "$output_bin_dir"/polkadot-parachain -} -rebuild_cumulus() { - pushd $root_dir/parachain - mkdir -p $cumulus_dir - cargo install \ - --git https://github.com/Snowfork/cumulus \ - --branch "$cumulus_version" polkadot-parachain-bin \ - --locked \ - --root $cumulus_dir #add version path to root to avoid recompiling when switch between versions - popd -} + echo "Building polkadot-parachain binary" + cargo build --release --workspace --locked --bin polkadot-parachain $features + cp ../target/release/polkadot-parachain $output_bin_dir/polkadot-parachain -build_cumulus_from_source() { - pushd $root_dir/cumulus - if [[ "$active_spec" == "minimal" ]]; then - cargo build --release --bin polkadot-parachain - else - cargo build --features beacon-spec-mainnet --release --bin polkadot-parachain - fi - cp target/release/polkadot-parachain $output_bin_dir/polkadot-parachain - cargo build --release --locked --bin parachain-template-node - cp target/release/parachain-template-node $output_bin_dir/parachain-template-node + echo "Building parachain template node" + cargo build --release --workspace --locked --bin parachain-template-node + cp ../target/release/parachain-template-node $output_bin_dir/parachain-template-node popd } -build_relaychain() { - if [ ! -f "$relaychain_bin" ]; then - echo "Building polkadot binary as $relaychain_bin" - rebuild_relaychain - fi - mkdir -p $output_bin_dir && cp "$relaychain_bin" "$output_bin_dir"/polkadot -} +build_relaychain_from_source() { + echo "Building polkadot binary" + pushd $root_dir/polkadot-sdk + + cargo build --release --locked --bin polkadot --bin polkadot-execute-worker --bin polkadot-prepare-worker + mkdir -p $output_bin_dir + + cp target/release/polkadot $output_bin_dir/polkadot + cp target/release/polkadot-execute-worker $output_bin_dir/polkadot-execute-worker + cp target/release/polkadot-prepare-worker $output_bin_dir/polkadot-prepare-worker -rebuild_relaychain() { - pushd $root_dir/parachain - mkdir -p $relaychain_dir - cargo install \ - --git https://github.com/paritytech/polkadot \ - --tag "$relaychain_version" polkadot \ - --locked \ - --root $relaychain_dir #add version path to root to avoid recompiling when switch between versions popd } @@ -71,7 +52,7 @@ install_binary() { echo "Building and installing binaries." mkdir -p $output_bin_dir build_cumulus_from_source - build_relaychain + build_relaychain_from_source build_contracts build_relayer } diff --git a/web/packages/test/scripts/configure-bridgehub.sh b/web/packages/test/scripts/configure-bridgehub.sh index e062003846..fc71166491 100755 --- a/web/packages/test/scripts/configure-bridgehub.sh +++ b/web/packages/test/scripts/configure-bridgehub.sh @@ -28,16 +28,56 @@ fund_accounts() { echo "Funding substrate accounts" transfer_balance $relaychain_ws_url "//Charlie" 1013 1000000000000000 $assethub_sovereign_account + transfer_balance $relaychain_ws_url "//Charlie" 1013 1000000000000000 $assethub_other_sovereign_account transfer_balance $relaychain_ws_url "//Charlie" 1013 1000000000000000 $beacon_relayer_pub_key transfer_balance $relaychain_ws_url "//Charlie" 1013 1000000000000000 $execution_relayer_pub_key transfer_balance $relaychain_ws_url "//Charlie" 1000 1000000000000000 $gateway_contract_sovereign_account } +open_hrmp_channels() +{ + echo "Opening HRMP channels" + open_hrmp_channel "${relaychain_ws_url}" "${relaychain_sudo_seed}" 1000 1013 8 512 # Statemine -> BridgeHub + open_hrmp_channel "${relaychain_ws_url}" "${relaychain_sudo_seed}" 1013 1000 8 512 # BridgeHub -> Statemine + open_hrmp_channel "${relaychain_ws_url}" "${relaychain_sudo_seed}" 1001 1013 8 512 # TemplateNode -> BridgeHub + open_hrmp_channel "${relaychain_ws_url}" "${relaychain_sudo_seed}" 1013 1001 8 512 # BridgeHub -> TemplateNode +} + +open_hrmp_channel() +{ + local relay_url=$1 + local relay_chain_seed=$2 + local sender_para_id=$3 + local recipient_para_id=$4 + local max_capacity=$5 + local max_message_size=$6 + echo " calling open_hrmp_channels:" + echo " relay_url: ${relay_url}" + echo " relay_chain_seed: ${relay_chain_seed}" + echo " sender_para_id: ${sender_para_id}" + echo " recipient_para_id: ${recipient_para_id}" + echo " max_capacity: ${max_capacity}" + echo " max_message_size: ${max_message_size}" + echo " params:" + echo "--------------------------------------------------" + + npx polkadot-js-api \ + --ws "${relay_url?}" \ + --seed "${relay_chain_seed?}" \ + --sudo \ + tx.hrmp.forceOpenHrmpChannel \ + ${sender_para_id} \ + ${recipient_para_id} \ + ${max_capacity} \ + ${max_message_size} +} + configure_bridgehub() { fund_accounts wait_beacon_chain_ready config_beacon_checkpoint + open_hrmp_channels } if [ -z "${from_start_services:-}" ]; then diff --git a/web/packages/test/scripts/deploy-polkadot.sh b/web/packages/test/scripts/deploy-polkadot.sh index d589fb65bd..7090decf80 100755 --- a/web/packages/test/scripts/deploy-polkadot.sh +++ b/web/packages/test/scripts/deploy-polkadot.sh @@ -2,15 +2,14 @@ set -eu source scripts/set-env.sh -source scripts/build-binary.sh zombienet_launch() { npx zombienet spawn config/launch-config.toml --provider=native --dir="$zombienet_data_dir" 2>&1 & - scripts/wait-for-it.sh -t 120 127.0.0.1:12144 + scripts/wait-for-it.sh -t 120 127.0.0.1:13144 } deploy_polkadot() { - check_tool && build_relaychain && build_cumulus_from_source && rm -rf $zombienet_data_dir && zombienet_launch + check_tool && rm -rf $zombienet_data_dir && zombienet_launch } if [ -z "${from_start_services:-}" ]; then diff --git a/web/packages/test/scripts/set-env.sh b/web/packages/test/scripts/set-env.sh index 4207c0384d..2043dc0f28 100755 --- a/web/packages/test/scripts/set-env.sh +++ b/web/packages/test/scripts/set-env.sh @@ -1,15 +1,6 @@ root_dir="$(realpath ../../..)" -bridge_hub_runtime="${PARACHAIN_RUNTIME:-bridge-hub-rococo-local}" -relaychain_version="${POLKADOT_VER:-v0.9.43}" -relaychain_dir="$root_dir/parachain/.cargo/$relaychain_version" -relaychain_bin="${POLKADOT_BIN:-$relaychain_dir/bin/polkadot}" -cumulus_version="${CUMULUS_VER:-snowbridge}" -cumulus_dir="$root_dir/parachain/.cargo/$cumulus_version" -cumulus_bin="${CUMULUS_BIN:-$cumulus_dir/bin/polkadot-parachain}" web_dir="$root_dir/web" lodestar_version="${LODESTAR_VER:-1.8.0}" -geth_version="${GETH_VER:-v1.12.0}" -geth_dir="$root_dir/../go-ethereum/$geth_version" export contract_dir="$root_dir/contracts" test_helpers_dir="$web_dir/packages/test-helpers" relay_dir="$root_dir/relayer" @@ -59,8 +50,10 @@ skip_relayer="${SKIP_RELAYER:-false}" ## Important accounts -# Account for assethub (1000 5Ec4AhPZk8STuex8Wsi9TwDtJQxKqzPJRCH7348Xtcs9vZLJ in testnet) +# Account for assethub (1000 child parachain 5Ec4AhPZk8STuex8Wsi9TwDtJQxKqzPJRCH7348Xtcs9vZLJ in testnet) assethub_sovereign_account="${ASSETHUB_SOVEREIGN_ACCOUNT:-0x70617261e8030000000000000000000000000000000000000000000000000000}" +# Account for assethub (1000 sibling parachain 5Eg2fntNprdN3FgH4sfEaaZhYtddZQSQUqvYJ1f2mLtinVhV in testnet) +assethub_other_sovereign_account="${ASSETHUB_SOVEREIGN_ACCOUNT:-0x7369626ce8030000000000000000000000000000000000000000000000000000}" # Beacon relay account (//BeaconRelay 5GWFwdZb6JyU46e6ZiLxjGxogAHe8SenX76btfq8vGNAaq8c in testnet) beacon_relayer_pub_key="${BEACON_RELAYER_PUB_KEY:-0xc46e141b5083721ad5f5056ba1cded69dce4a65f027ed3362357605b1687986a}" # Execution relay account (//ExecutionRelay 5CFNWKMFPsw5Cs2Teo6Pvg7rWyjKiFfqPZs8U4MZXzMYFwXL in testnet) diff --git a/web/packages/test/scripts/xcm-helper.sh b/web/packages/test/scripts/xcm-helper.sh index ae45f448b5..3fde6af697 100644 --- a/web/packages/test/scripts/xcm-helper.sh +++ b/web/packages/test/scripts/xcm-helper.sh @@ -76,7 +76,7 @@ transfer_balance() { local dest=$(jq --null-input \ --arg para_id "$para_id" \ '{ "v3": { "parents": 0, "interior": { "x1": { "parachain": $para_id } } } }') - local benificiary=$(jq --null-input \ + local beneficiary=$(jq --null-input \ --arg target_account "$target_account" \ '{ "v3": { "parents": 0, "interior": { "x1": { "accountid32": { "id": $target_account } } } } }') local assets=$(jq --null-input \ @@ -104,7 +104,7 @@ transfer_balance() { echo " calling transfer_balance:" echo " target_account: ${target_account}" echo " dest: ${dest}" - echo " benificiary: ${benificiary}" + echo " beneficiary: ${beneficiary}" echo " assets: ${assets}" echo " asset_fee_item: ${asset_fee_item}" echo "--------------------------------------------------" @@ -114,7 +114,7 @@ transfer_balance() { --seed "${seed?}" \ tx.xcmPallet.teleportAssets \ "${dest}" \ - "${benificiary}" \ + "${beneficiary}" \ "${assets}" \ "${asset_fee_item}" } diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 949db19a28..d7496f5a61 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -211,6 +211,9 @@ importers: '@polkadot/types': specifier: ^10.9.1 version: 10.9.1 + '@polkadot/types-codec': + specifier: ^10.9.1 + version: 10.9.1 '@snowbridge/contract-types': specifier: workspace:* version: link:../contract-types