From a2e1634aeccb5cad13464de8038c1db60ccb54cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=B3nal=20Murray?= Date: Wed, 20 Dec 2023 16:30:10 +0000 Subject: [PATCH 01/15] Fix clippy lints behind feature gates and add new CI step all features (#2569) Many clippy lints usually enforced by `-Dcomplexity` and `-Dcorrectness` are not caught by CI as they are gated by `features`, like `runtime-benchmarks`, while the clippy CI job runs with only the default features for all targets. This PR also adds a CI step to run clippy with `--all-features` to ensure the code quality is maintained behind feature gates from now on. To improve local development, clippy lints are downgraded to warnings, but they still will result in an error at CI due to the `-Dwarnings` rustflag. --------- Co-authored-by: Liam Aharon --- modules/relayers/src/benchmarking.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/relayers/src/benchmarking.rs b/modules/relayers/src/benchmarking.rs index 2d74ab38f9d..00c3814a4c3 100644 --- a/modules/relayers/src/benchmarking.rs +++ b/modules/relayers/src/benchmarking.rs @@ -104,7 +104,7 @@ benchmarks! { // create slash destination account let lane = LaneId([0, 0, 0, 0]); let slash_destination = RewardsAccountParams::new(lane, *b"test", RewardsAccountOwner::ThisChain); - T::prepare_rewards_account(slash_destination.clone(), Zero::zero()); + T::prepare_rewards_account(slash_destination, Zero::zero()); }: { crate::Pallet::::slash_and_deregister(&relayer, slash_destination) } @@ -121,7 +121,7 @@ benchmarks! { let account_params = RewardsAccountParams::new(lane, *b"test", RewardsAccountOwner::ThisChain); }: { - crate::Pallet::::register_relayer_reward(account_params.clone(), &relayer, One::one()); + crate::Pallet::::register_relayer_reward(account_params, &relayer, One::one()); } verify { assert_eq!(RelayerRewards::::get(relayer, &account_params), Some(One::one())); From fdcbf7964604189198cbbca1f94ce5af705e22b3 Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Thu, 21 Dec 2023 10:37:24 +0300 Subject: [PATCH 02/15] Cleanup bridges tests: with-grandpa-chain case (#2763) related to https://github.com/paritytech/parity-bridges-common/issues/2739 Co-authored-by: Branislav Kontur --- primitives/runtime/src/chain.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/primitives/runtime/src/chain.rs b/primitives/runtime/src/chain.rs index 7ca956e2670..9ba21a1cddf 100644 --- a/primitives/runtime/src/chain.rs +++ b/primitives/runtime/src/chain.rs @@ -203,7 +203,7 @@ pub trait Chain: Send + Sync + 'static { } /// A trait that provides the type of the underlying chain. -pub trait UnderlyingChainProvider { +pub trait UnderlyingChainProvider: Send + Sync + 'static { /// Underlying chain type. type Chain: Chain; } From dd4656b94585017610119fe77f09fa720dfb132f Mon Sep 17 00:00:00 2001 From: Clara van Staden Date: Thu, 21 Dec 2023 18:06:36 +0200 Subject: [PATCH 03/15] Adds Snowbridge to Rococo runtime (#2522) # Description Adds Snowbridge to the Rococo bridge hub runtime. Includes config changes required in Rococo asset hub. --------- Co-authored-by: Alistair Singh Co-authored-by: ron Co-authored-by: Vincent Geddes Co-authored-by: claravanstaden --- snowbridge/LICENSE | 201 +++ snowbridge/README.md | 127 ++ snowbridge/parachain/LICENSE | 201 +++ snowbridge/parachain/README.md | 155 +++ .../pallets/ethereum-beacon-client/Cargo.toml | 95 ++ .../ethereum-beacon-client/benchmark.md | 88 ++ .../src/benchmarking/fixtures.rs | 1215 +++++++++++++++++ .../src/benchmarking/mod.rs | 156 +++ .../src/benchmarking/util.rs | 44 + .../src/config/mainnet.rs | 10 + .../src/config/minimal.rs | 10 + .../ethereum-beacon-client/src/config/mod.rs | 56 + .../ethereum-beacon-client/src/functions.rs | 31 + .../ethereum-beacon-client/src/impls.rs | 93 ++ .../pallets/ethereum-beacon-client/src/lib.rs | 841 ++++++++++++ .../ethereum-beacon-client/src/mock.rs | 275 ++++ .../ethereum-beacon-client/src/tests.rs | 1032 ++++++++++++++ .../ethereum-beacon-client/src/types.rs | 38 + .../ethereum-beacon-client/src/weights.rs | 68 + .../execution-header-update.minimal.json | 43 + .../finalized-header-update.minimal.json | 38 + .../fixtures/initial-checkpoint.minimal.json | 62 + .../next-finalized-header-update.minimal.json | 38 + .../next-sync-committee-update.minimal.json | 83 ++ .../sync-committee-update.minimal.json | 83 ++ .../pallets/inbound-queue/Cargo.toml | 93 ++ .../src/benchmarking/fixtures.rs | 40 + .../inbound-queue/src/benchmarking/mod.rs | 55 + .../pallets/inbound-queue/src/envelope.rs | 50 + .../pallets/inbound-queue/src/lib.rs | 342 +++++ .../pallets/inbound-queue/src/mock.rs | 311 +++++ .../pallets/inbound-queue/src/test.rs | 211 +++ .../pallets/inbound-queue/src/weights.rs | 31 + .../pallets/outbound-queue/Cargo.toml | 78 ++ .../outbound-queue/merkle-tree/Cargo.toml | 33 + .../outbound-queue/merkle-tree/src/lib.rs | 464 +++++++ .../outbound-queue/runtime-api/Cargo.toml | 34 + .../outbound-queue/runtime-api/src/lib.rs | 20 + .../pallets/outbound-queue/src/api.rs | 30 + .../outbound-queue/src/benchmarking.rs | 85 ++ .../pallets/outbound-queue/src/lib.rs | 413 ++++++ .../pallets/outbound-queue/src/mock.rs | 189 +++ .../src/process_message_impl.rs | 23 + .../outbound-queue/src/send_message_impl.rs | 98 ++ .../pallets/outbound-queue/src/test.rs | 268 ++++ .../pallets/outbound-queue/src/types.rs | 99 ++ .../pallets/outbound-queue/src/weights.rs | 81 ++ .../parachain/pallets/system/Cargo.toml | 83 ++ snowbridge/parachain/pallets/system/README.md | 1 + .../pallets/system/runtime-api/Cargo.toml | 32 + .../pallets/system/runtime-api/src/lib.rs | 13 + .../parachain/pallets/system/src/api.rs | 16 + .../pallets/system/src/benchmarking.rs | 167 +++ .../parachain/pallets/system/src/lib.rs | 681 +++++++++ .../parachain/pallets/system/src/migration.rs | 74 + .../parachain/pallets/system/src/mock.rs | 270 ++++ .../parachain/pallets/system/src/tests.rs | 664 +++++++++ .../parachain/pallets/system/src/weights.rs | 249 ++++ .../parachain/primitives/beacon/Cargo.toml | 52 + .../parachain/primitives/beacon/src/bits.rs | 19 + .../parachain/primitives/beacon/src/bls.rs | 87 ++ .../parachain/primitives/beacon/src/config.rs | 10 + .../parachain/primitives/beacon/src/lib.rs | 31 + .../primitives/beacon/src/merkle_proof.rs | 58 + .../primitives/beacon/src/receipt.rs | 96 ++ .../primitives/beacon/src/serde_utils.rs | 130 ++ .../parachain/primitives/beacon/src/ssz.rs | 194 +++ .../parachain/primitives/beacon/src/types.rs | 512 +++++++ .../primitives/beacon/src/updates.rs | 110 ++ .../parachain/primitives/core/Cargo.toml | 60 + .../parachain/primitives/core/src/inbound.rs | 74 + .../parachain/primitives/core/src/lib.rs | 174 +++ .../primitives/core/src/operating_mode.rs | 25 + .../parachain/primitives/core/src/outbound.rs | 413 ++++++ .../parachain/primitives/core/src/pricing.rs | 67 + .../primitives/core/src/ringbuffer.rs | 76 ++ .../parachain/primitives/core/src/tests.rs | 13 + .../core/tests/fixtures/packet.scale | Bin 0 -> 386 bytes .../parachain/primitives/core/tests/mod.rs | 14 + .../primitives/ethereum/.cargo/config.toml | 2 + .../parachain/primitives/ethereum/Cargo.toml | 51 + .../primitives/ethereum/src/header.rs | 414 ++++++ .../parachain/primitives/ethereum/src/lib.rs | 36 + .../parachain/primitives/ethereum/src/log.rs | 75 + .../parachain/primitives/ethereum/src/mpt.rs | 142 ++ .../primitives/ethereum/src/receipt.rs | 139 ++ .../parachain/primitives/router/Cargo.toml | 61 + .../primitives/router/src/inbound/mod.rs | 320 +++++ .../primitives/router/src/inbound/tests.rs | 41 + .../parachain/primitives/router/src/lib.rs | 6 + .../primitives/router/src/outbound/mod.rs | 282 ++++ .../primitives/router/src/outbound/tests.rs | 1063 ++++++++++++++ .../runtime/rococo-common/Cargo.toml | 26 + .../runtime/rococo-common/src/lib.rs | 16 + .../runtime/runtime-common/Cargo.toml | 41 + .../runtime/runtime-common/src/lib.rs | 129 ++ snowbridge/parachain/runtime/tests/Cargo.toml | 244 ++++ snowbridge/parachain/runtime/tests/src/lib.rs | 94 ++ .../parachain/runtime/tests/src/test_cases.rs | 293 ++++ snowbridge/parachain/scripts/benchmark.sh | 15 + snowbridge/parachain/scripts/hexliteral.sh | 5 + snowbridge/parachain/scripts/init.sh | 12 + .../parachain/scripts/make-build-config.sh | 5 + .../parachain/scripts/verify-pallets-build.sh | 113 ++ 104 files changed, 16221 insertions(+) create mode 100644 snowbridge/LICENSE create mode 100644 snowbridge/README.md create mode 100644 snowbridge/parachain/LICENSE create mode 100644 snowbridge/parachain/README.md create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/benchmark.md create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures.rs create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/mod.rs create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/util.rs create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mainnet.rs create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/src/config/minimal.rs create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mod.rs create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/src/functions.rs create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/src/impls.rs create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/src/lib.rs create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/src/tests.rs create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/src/types.rs create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/src/weights.rs create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/execution-header-update.minimal.json create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/finalized-header-update.minimal.json create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/initial-checkpoint.minimal.json create mode 100755 snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-finalized-header-update.minimal.json create mode 100755 snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-sync-committee-update.minimal.json create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/sync-committee-update.minimal.json create mode 100644 snowbridge/parachain/pallets/inbound-queue/Cargo.toml create mode 100644 snowbridge/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs create mode 100644 snowbridge/parachain/pallets/inbound-queue/src/benchmarking/mod.rs create mode 100644 snowbridge/parachain/pallets/inbound-queue/src/envelope.rs create mode 100644 snowbridge/parachain/pallets/inbound-queue/src/lib.rs create mode 100644 snowbridge/parachain/pallets/inbound-queue/src/mock.rs create mode 100644 snowbridge/parachain/pallets/inbound-queue/src/test.rs create mode 100644 snowbridge/parachain/pallets/inbound-queue/src/weights.rs create mode 100644 snowbridge/parachain/pallets/outbound-queue/Cargo.toml create mode 100644 snowbridge/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml create mode 100644 snowbridge/parachain/pallets/outbound-queue/merkle-tree/src/lib.rs create mode 100644 snowbridge/parachain/pallets/outbound-queue/runtime-api/Cargo.toml create mode 100644 snowbridge/parachain/pallets/outbound-queue/runtime-api/src/lib.rs create mode 100644 snowbridge/parachain/pallets/outbound-queue/src/api.rs create mode 100644 snowbridge/parachain/pallets/outbound-queue/src/benchmarking.rs create mode 100644 snowbridge/parachain/pallets/outbound-queue/src/lib.rs create mode 100644 snowbridge/parachain/pallets/outbound-queue/src/mock.rs create mode 100644 snowbridge/parachain/pallets/outbound-queue/src/process_message_impl.rs create mode 100644 snowbridge/parachain/pallets/outbound-queue/src/send_message_impl.rs create mode 100644 snowbridge/parachain/pallets/outbound-queue/src/test.rs create mode 100644 snowbridge/parachain/pallets/outbound-queue/src/types.rs create mode 100644 snowbridge/parachain/pallets/outbound-queue/src/weights.rs create mode 100644 snowbridge/parachain/pallets/system/Cargo.toml create mode 100644 snowbridge/parachain/pallets/system/README.md create mode 100644 snowbridge/parachain/pallets/system/runtime-api/Cargo.toml create mode 100644 snowbridge/parachain/pallets/system/runtime-api/src/lib.rs create mode 100644 snowbridge/parachain/pallets/system/src/api.rs create mode 100644 snowbridge/parachain/pallets/system/src/benchmarking.rs create mode 100644 snowbridge/parachain/pallets/system/src/lib.rs create mode 100644 snowbridge/parachain/pallets/system/src/migration.rs create mode 100644 snowbridge/parachain/pallets/system/src/mock.rs create mode 100644 snowbridge/parachain/pallets/system/src/tests.rs create mode 100644 snowbridge/parachain/pallets/system/src/weights.rs create mode 100644 snowbridge/parachain/primitives/beacon/Cargo.toml create mode 100644 snowbridge/parachain/primitives/beacon/src/bits.rs create mode 100644 snowbridge/parachain/primitives/beacon/src/bls.rs create mode 100644 snowbridge/parachain/primitives/beacon/src/config.rs create mode 100644 snowbridge/parachain/primitives/beacon/src/lib.rs create mode 100644 snowbridge/parachain/primitives/beacon/src/merkle_proof.rs create mode 100644 snowbridge/parachain/primitives/beacon/src/receipt.rs create mode 100644 snowbridge/parachain/primitives/beacon/src/serde_utils.rs create mode 100644 snowbridge/parachain/primitives/beacon/src/ssz.rs create mode 100644 snowbridge/parachain/primitives/beacon/src/types.rs create mode 100644 snowbridge/parachain/primitives/beacon/src/updates.rs create mode 100644 snowbridge/parachain/primitives/core/Cargo.toml create mode 100644 snowbridge/parachain/primitives/core/src/inbound.rs create mode 100644 snowbridge/parachain/primitives/core/src/lib.rs create mode 100644 snowbridge/parachain/primitives/core/src/operating_mode.rs create mode 100644 snowbridge/parachain/primitives/core/src/outbound.rs create mode 100644 snowbridge/parachain/primitives/core/src/pricing.rs create mode 100644 snowbridge/parachain/primitives/core/src/ringbuffer.rs create mode 100644 snowbridge/parachain/primitives/core/src/tests.rs create mode 100644 snowbridge/parachain/primitives/core/tests/fixtures/packet.scale create mode 100644 snowbridge/parachain/primitives/core/tests/mod.rs create mode 100644 snowbridge/parachain/primitives/ethereum/.cargo/config.toml create mode 100644 snowbridge/parachain/primitives/ethereum/Cargo.toml create mode 100644 snowbridge/parachain/primitives/ethereum/src/header.rs create mode 100644 snowbridge/parachain/primitives/ethereum/src/lib.rs create mode 100644 snowbridge/parachain/primitives/ethereum/src/log.rs create mode 100644 snowbridge/parachain/primitives/ethereum/src/mpt.rs create mode 100644 snowbridge/parachain/primitives/ethereum/src/receipt.rs create mode 100644 snowbridge/parachain/primitives/router/Cargo.toml create mode 100644 snowbridge/parachain/primitives/router/src/inbound/mod.rs create mode 100644 snowbridge/parachain/primitives/router/src/inbound/tests.rs create mode 100644 snowbridge/parachain/primitives/router/src/lib.rs create mode 100644 snowbridge/parachain/primitives/router/src/outbound/mod.rs create mode 100644 snowbridge/parachain/primitives/router/src/outbound/tests.rs create mode 100644 snowbridge/parachain/runtime/rococo-common/Cargo.toml create mode 100644 snowbridge/parachain/runtime/rococo-common/src/lib.rs create mode 100644 snowbridge/parachain/runtime/runtime-common/Cargo.toml create mode 100644 snowbridge/parachain/runtime/runtime-common/src/lib.rs create mode 100644 snowbridge/parachain/runtime/tests/Cargo.toml create mode 100644 snowbridge/parachain/runtime/tests/src/lib.rs create mode 100644 snowbridge/parachain/runtime/tests/src/test_cases.rs create mode 100755 snowbridge/parachain/scripts/benchmark.sh create mode 100755 snowbridge/parachain/scripts/hexliteral.sh create mode 100755 snowbridge/parachain/scripts/init.sh create mode 100755 snowbridge/parachain/scripts/make-build-config.sh create mode 100755 snowbridge/parachain/scripts/verify-pallets-build.sh diff --git a/snowbridge/LICENSE b/snowbridge/LICENSE new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/snowbridge/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/snowbridge/README.md b/snowbridge/README.md new file mode 100644 index 00000000000..a38910da316 --- /dev/null +++ b/snowbridge/README.md @@ -0,0 +1,127 @@ +# Snowbridge · +[![codecov](https://codecov.io/gh/Snowfork/snowbridge/branch/main/graph/badge.svg?token=9hvgSws4rN)] +(https://codecov.io/gh/Snowfork/snowbridge) +![GitHub](https://img.shields.io/github/license/Snowfork/snowbridge) + +Snowbridge is a trustless bridge between Polkadot and Ethereum. For documentation, visit https://docs.snowbridge.network. + +## Components + +### Parachain + +Polkadot parachain and our pallets. See [parachain/README.md](https://github.com/Snowfork/snowbridge/blob/main/parachain/README.md). + +### Contracts + +Ethereum contracts and unit tests. See [contracts/README.md](https://github.com/Snowfork/snowbridge/blob/main/contracts/README.md) + +### Relayer + +Off-chain relayer services for relaying messages between Polkadot and Ethereum. See +[relayer/README.md](https://github.com/Snowfork/snowbridge/blob/main/relayer/README.md) + +### Local Testnet + +Scripts to provision a local testnet, running the above services to bridge between local deployments of Polkadot and +Ethereum. See [web/packages/test/README.md](https://github.com/Snowfork/snowbridge/blob/main/web/packages/test/README.md). + +### Smoke Tests + +Integration tests for our local testnet. See [smoketest/README.md](https://github.com/Snowfork/snowbridge/blob/main/smoketest/README.md). + +## Development + +We use the Nix package manager to provide a reproducible and maintainable developer environment. + +After [installing nix](https://nixos.org/download.html) Nix, enable [flakes](https://nixos.wiki/wiki/Flakes): + +```sh +mkdir -p ~/.config/nix +echo 'experimental-features = nix-command flakes' >> ~/.config/nix/nix.conf +``` + +Then activate a developer shell in the root of our repo, where +[`flake.nix`](https://github.com/Snowfork/snowbridge/blob/main/flake.nix) is located: + +```sh +nix develop +``` + +Also make sure to run this initialization script once: +```sh +scripts/init.sh +``` + +### Support for code editors + +To ensure your code editor (such as VS Code) can execute tools in the nix shell, startup your editor within the +interactive shell. + +Example for VS Code: + +```sh +nix develop +code . +``` + +### Custom shells + +The developer shell is bash by default. To preserve your existing shell: + +```sh +nix develop --command $SHELL +``` + +### Automatic developer shells + +To automatically enter the developer shell whenever you open the project, install +[`direnv`](https://direnv.net/docs/installation.html) and use the template `.envrc`: + +```sh +cp .envrc.example .envrc +direnv allow +``` + +### Upgrading the Rust toolchain + +Sometimes we would like to upgrade rust toolchain. First update `parachain/rust-toolchain.toml` as required and then +update `flake.lock` running +```sh +nix flake lock --update-input rust-overlay +``` + +## Troubleshooting + +Check the contents of all `.envrc` files. + +Remove untracked files: +```sh +git clean -idx +``` + +Ensure that the current Rust toolchain is the one selected in `scripts/init.sh`. + +Ensure submodules are up-to-date: +```sh +git submodule update +``` + +Check untracked files & directories: +```sh +git clean -ndx | awk '{print $3}' +``` +After removing `node_modules` directories (eg. with `git clean above`), clear the pnpm cache: +```sh +pnpm store prune +``` + +Check Nix config in `~/.config/nix/nix.conf`. + +Run a pure developer shell (note that this removes access to your local tools): +```sh +nix develop -i --pure-eval +``` + +## Security + +The security policy and procedures can be found in SECURITY.md. diff --git a/snowbridge/parachain/LICENSE b/snowbridge/parachain/LICENSE new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/snowbridge/parachain/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/snowbridge/parachain/README.md b/snowbridge/parachain/README.md new file mode 100644 index 00000000000..ddcbedab0c6 --- /dev/null +++ b/snowbridge/parachain/README.md @@ -0,0 +1,155 @@ +# Parachain modules + +## Configuration + +Note: This section is not necessary for local development, as there are scripts to auto-configure the parachain in the +[test directory](https://github.com/Snowfork/snowbridge/blob/main/web/packages/test). + +For a fully operational chain, further configuration of the initial chain spec is required. The specific configuration will +depend heavily on your environment, so this guide will remain high-level. + +After completing a release build of the parachain, build an initial spec for the snowbase runtime: + +```bash +target/release/snowbridge build-spec --chain snowbase --disable-default-bootnode > spec.json +``` + +Now edit the spec and configure the following: +1. Recently finalized ethereum header and difficulty for the ethereum light client +2. Contract addresses for the Ether, Erc20, and Dot apps. +3. Authorized principal for the basic channel + +For an example configuration, consult the [setup script](https://github.com/Snowfork/snowbridge/blob/main/web/packages/test/scripts/start-services.sh) +for our local development stack. Specifically the `start_polkadot_launch` bash function. + +## Tests + +To run the parachain tests locally, use `cargo test --workspace`. For the full suite of tests, use +`cargo test --workspace --features runtime-benchmarks`. + +Optionally exclude the top-level and runtime crates: + +```bash +cargo test --workspace \ + --features runtime-benchmarks \ + --exclude snowbridge \ + --exclude snowbridge-runtime \ + --exclude snowblink-runtime \ + --exclude snowbase-runtime +``` + +### Updating test data for inbound channel unit tests + +To regenerate the test data, use a test with multiple `submit` calls in `ethereum/test/test_basic_outbound_channel.js`, eg. +"should increment nonces correctly". + +Add the following preamble: + +```javascript +const rlp = require("rlp"); +const contract = BasicOutboundChannel; +const signature = 'Message(address,address,uint64,uint64,bytes)'; +``` + +For each encoded log you want to create, find a transaction object `tx` returned from a `submit` call and run this: + +```javascript +const rawLog = tx.receipt.rawLogs[0]; +const encodedLog = rlp.encode([rawLog.address, rawLog.topics, rawLog.data]).toString("hex"); +console.log(`encodedLog: ${encodedLog}`); +const iface = new ethers.utils.Interface(contract.abi); +const decodedEventLog = iface.decodeEventLog( + signature, + rawLog.data, + rawLog.topics, +); +console.log(`decoded rawLog.data: ${JSON.stringify(decodedEventLog)}`); +``` + +Place the `encodedLog` string in the `message.data` field in the test data. Use the `decoded rawLog.data` field to +update the comments with the decoded log data. + +## Generating pallet weights from benchmarks + +Build the parachain with the runtime benchmark flags for the chosen runtime: + +```bash +runtime=snowbase +cargo build \ + --release \ + --no-default-features \ + --features "$runtime-native,rococo-native,runtime-benchmarks,$runtime-runtime-benchmarks" \ + --bin snowbridge +``` + +List available pallets and their benchmarks: + +```bash +./target/release/snowbridge benchmark pallet --chain $runtime --list +``` + +Run a benchmark for a pallet, generating weights: + +```bash +target/release/snowbridge benchmark pallet \ + --chain=$runtime \ + --execution=wasm \ + --wasm-execution=compiled \ + --pallet=basic_channel_inbound \ + --extra \ + --extrinsic=* \ + --repeat=20 \ + --steps=50 \ + --output=pallets/basic-channel/src/inbound/weights.rs \ + --template=templates/module-weight-template.hbs +``` + +## Generating beacon test fixtures and benchmarking data + +### Minimal Spec + +To generate `minimal` test data and benchmarking data, make sure to start the local E2E setup to spin up a local beacon +node instance to connect to: + +```bash +cd web/packages/test +./scripts/start-services.sh +``` + +Wait for output `Testnet has been initialized`. + +In a separate terminal, from the `snowbridge` directory, run: + +```bash +mage -d relayer build && relayer/build/snowbridge-relay generate-beacon-data --spec "minimal" && cd parachain && +cargo +nightly fmt -- --config-path rustfmt.toml && cd - +``` + +### Mainnet Spec + +We only use the mainnet spec for generating fixtures for pallet weight benchmarks. + +To generate the data we can connect to the Lodestar Goerli public node. The script already connects to the Lodestar node, +so no need to start up additional services. In the event of the Lodestar node not being available, you can start up your +own stack with these commands: + +```bash +cd web/packages/test +./scripts/start-goerli.sh +``` + +From the `snowbridge` directory, run: + +```bash +mage -d relayer build && relayer/build/snowbridge-relay generate-beacon-data --spec "mainnet" && cd parachain && +cargo +nightly fmt -- --config-path rustfmt.toml && cd - +``` + +### Benchmarking tests + +To run the benchmark tests + +```bash +cd parachain/pallets/ethereum-beacon-client +cargo test --release --features runtime-benchmarks +``` diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml b/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml new file mode 100644 index 00000000000..5c4acda13d8 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml @@ -0,0 +1,95 @@ +[package] +name = "snowbridge-ethereum-beacon-client" +description = "Snowbridge Beacon Client Pallet" +version = "0.0.1" +edition = "2021" +authors = ["Snowfork "] +repository = "https://github.com/Snowfork/snowbridge" +license = "Apache-2.0" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +serde = { version = "1.0.188", optional = true } +serde_json = { version = "1.0.96", 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"] } +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.2", default-features = false } +hex-literal = { version = "0.4.1", optional = true } +log = { version = "0.4.20", default-features = false } + +frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking", default-features = false, optional = true } +frame-support = { path = "../../../../../substrate/frame/support", default-features = false } +frame-system = { path = "../../../../../substrate/frame/system", default-features = false } +sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } +sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } +sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } +sp-io = { path = "../../../../../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", default-features = false } +bp-runtime = { path = "../../../../../bridges/primitives/runtime", default-features = false } +pallet-timestamp = { path = "../../../../../substrate/frame/timestamp", default-features = false, optional = true } + +[dev-dependencies] +rand = "0.8.5" +sp-keyring = { path = "../../../../../substrate/primitives/keyring" } +serde_json = "1.0.96" +hex-literal = "0.4.1" +pallet-timestamp = { path = "../../../../../substrate/frame/timestamp" } +sp-io = { path = "../../../../../substrate/primitives/io" } +serde = "1.0.188" + +[features] +default = ["std"] +fuzzing = [ + "hex-literal", + "pallet-timestamp", + "serde", + "serde_json", + "sp-io", +] +std = [ + "bp-runtime/std", + "byte-slice-cast/std", + "codec/std", + "frame-support/std", + "frame-system/std", + "log/std", + "pallet-timestamp/std", + "primitives/std", + "rlp/std", + "scale-info/std", + "serde", + "snowbridge-core/std", + "snowbridge-ethereum/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", + "ssz_rs/std", + 'frame-benchmarking/std', +] +runtime-benchmarks = [ + "beacon-spec-mainnet", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "hex-literal", + "pallet-timestamp?/runtime-benchmarks", + "snowbridge-core/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", +] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-timestamp?/try-runtime", + "sp-runtime/try-runtime", +] +beacon-spec-mainnet = [] diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/benchmark.md b/snowbridge/parachain/pallets/ethereum-beacon-client/benchmark.md new file mode 100644 index 00000000000..de976e12149 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/benchmark.md @@ -0,0 +1,88 @@ +# Motivation +Demonstrate that +[FastAggregateVerify](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04#section-3.3.4) is the most +expensive call in ethereum beacon light client, though in [#13031](https://github.com/paritytech/substrate/pull/13031) +Parity team has wrapped some low level host functions for `bls-12381` but adding a high level host function specific +for it is super helpful. + +# Benchmark +We add several benchmarks +[here](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/benchmarking/mod.rs#L98-L124) +as following to demonstrate +[bls_fast_aggregate_verify](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/lib.rs#L764) +is the main bottleneck. Test data +[here](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/benchmarking/data_mainnet.rs#L553-L1120) +is real from goerli network which contains 512 public keys from sync committee. + +## sync_committee_period_update +Base line benchmark for extrinsic [sync_committee_period_update](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/lib.rs#L233) + +## bls_fast_aggregate_verify +Subfunction of extrinsic `sync_committee_period_update` which does what +[FastAggregateVerify](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04#section-3.3.4) requires. + +## bls_aggregate_pubkey +Subfunction of `bls_fast_aggregate_verify` which decompress and instantiate G1 pubkeys only. + +## bls_verify_message +Subfunction of `bls_fast_aggregate_verify` which verify the prepared signature only. + + +# Result + +## hardware spec +Run benchmark in a EC2 instance +``` +cargo run --release --bin polkadot-parachain --features runtime-benchmarks -- benchmark machine --base-path /mnt/scratch/benchmark + ++----------+----------------+-------------+-------------+-------------------+ +| Category | Function | Score | Minimum | Result | ++===========================================================================+ +| CPU | BLAKE2-256 | 1.08 GiBs | 1.00 GiBs | ✅ Pass (107.5 %) | +|----------+----------------+-------------+-------------+-------------------| +| CPU | SR25519-Verify | 568.87 KiBs | 666.00 KiBs | ❌ Fail ( 85.4 %) | +|----------+----------------+-------------+-------------+-------------------| +| Memory | Copy | 13.67 GiBs | 14.32 GiBs | ✅ Pass ( 95.4 %) | +|----------+----------------+-------------+-------------+-------------------| +| Disk | Seq Write | 334.35 MiBs | 450.00 MiBs | ❌ Fail ( 74.3 %) | +|----------+----------------+-------------+-------------+-------------------| +| Disk | Rnd Write | 143.59 MiBs | 200.00 MiBs | ❌ Fail ( 71.8 %) | ++----------+----------------+-------------+-------------+-------------------+ +``` + +## benchmark + +``` +cargo run --release --bin polkadot-parachain \ +--features runtime-benchmarks \ +-- \ +benchmark pallet \ +--base-path /mnt/scratch/benchmark \ +--chain=bridge-hub-rococo-dev \ +--pallet=snowbridge_ethereum_beacon_client \ +--extrinsic="*" \ +--execution=wasm --wasm-execution=compiled \ +--steps 50 --repeat 20 \ +--output ./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_ethereum_beacon_client.rs +``` + +### [Weights](https://github.com/Snowfork/cumulus/blob/ron/benchmark-beacon-bridge/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_ethereum_beacon_client.rs) + +|extrinsic | minimum execution time benchmarked(us) | +| --------------------------------------- |----------------------------------------| +|sync_committee_period_update | 123_126 | +|bls_fast_aggregate_verify| 121_083 | +|bls_aggregate_pubkey | 90_306 | +|bls_verify_message | 28_000 | + +- [bls_fast_aggregate_verify](#bls_fast_aggregate_verify) consumes 98% execution time of [sync_committee_period_update](#sync_committee_period_update) + +- [bls_aggregate_pubkey](#bls_aggregate_pubkey) consumes 75% execution time of [bls_fast_aggregate_verify](#bls_fast_aggregate_verify) + +- [bls_verify_message](#bls_verify_message) consumes 23% execution time of [bls_fast_aggregate_verify](#bls_fast_aggregate_verify) + +# Conclusion + +A high level host function specific for +[bls_fast_aggregate_verify](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/lib.rs#L764) +is super helpful. diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures.rs new file mode 100644 index 00000000000..b50be81360a --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures.rs @@ -0,0 +1,1215 @@ +// Generated, do not edit! +// See README.md for instructions to generate +use crate::{CheckpointUpdate, ExecutionHeaderUpdate, Update}; +use hex_literal::hex; +use primitives::{ + updates::AncestryProof, BeaconHeader, ExecutionPayloadHeader, NextSyncCommitteeUpdate, + SyncAggregate, SyncCommittee, +}; +use sp_core::U256; +use sp_std::{boxed::Box, vec}; + +pub fn make_checkpoint() -> Box { + Box::new(CheckpointUpdate { + header: BeaconHeader { + slot: 5809344, + proposer_index: 101696, + parent_root: hex!("ea7ce4ad810829cf37a2235b1126c82aecfc5955a1647ec83640cf3f7db91bd2").into(), + state_root: hex!("56f6363d3604e61a907c774edf0bddf6477a8d410f026414bc420f751de1f092").into(), + body_root: hex!("8c799aeef815cbc4499e0b46723623105afb177a5c522ecda3415ad9fb259e6c").into(), + }, + current_sync_committee: SyncCommittee { + pubkeys: [ + hex!("adf5a4907639db7bdcbecbc295b57d8950b0abe34ab17798686643427023c4f3983550d1496f81a27e52b070e4f4e6ee").into(), + hex!("91b036b30405531cacebf5d4f7e939b44438bb9942123ee55b44453e32febfbf2c846e0e4fb08190b01a000d072dcaa7").into(), + hex!("a86e70f00161ec6c4b780b4fc631c8dbae979f1e6c9ed037dd0745833ed6e3e18831478eb4753861f339293c0508f4d4").into(), + hex!("84196b1f39fba1fb7570074e7dd2768ed5c28db7f91a6374e413c8fc82f97738af771f90496526088bfa1ee2c01ee299").into(), + hex!("b9a230fc12d85281cbfcc7f5e6b13ab17b3dcbf0adf256d031c01acb30734d061683d40fd62175da73a621440bb04367").into(), + hex!("80b8be5a3d6f39aa7362c5feee9f89b75d1e5c2b485ea9a776c60fd60dba611e9bf5ca8b2528f42651b3dad212acfe77").into(), + hex!("ac8fcfc40028d04bdbea87b4b335781e35e10f881bfeb07b94c538eb37a43b18b1a04aad3dbe80bbff6e128017251f2e").into(), + hex!("b0b2136cc729b7de8868c02de6247ff2a68694296c78f088ce967219f08cfb7be9e1830e2630b10ca650c715d85d89f3").into(), + hex!("a70627c99777970eb9bf3268bac06bdc41c2ead41b1b76d30e7fd2aefe83319461d03aaf7ab93150343be9fbd2e48e7d").into(), + hex!("9599aae109d31ddc9028c428a148ea9ebffdb5ab6a684895dbd3772c1baf947c8a255e4c7ebaedae2a9e046219d80d76").into(), + hex!("8652e099adb88b2a25ab64fb01314e24cf26dbc4ae110d7fd73d74a0e0a4fea2ce2ce87cb1ddb7c0b9fb50cc6afa2153").into(), + hex!("83ba74c6e31073865eaed3c38a8e885ee715f03cfd6e36929655b6aa790d8f676c4ac4ae27f963e311d00923357eb087").into(), + hex!("86b05425d880027fbde9be3ea526283c5b958ccb31eff997d9d7b5e3b70e2d011ed95f891248082e870d55704a471deb").into(), + hex!("a4eeb958121bc5be5b1a68b73faa83b19272ef2f2cb627431be08e9844ef9d4548b4208670754d0954e5b012e3933859").into(), + hex!("87b0119e4c54aa2b4f8260f9ace7722788578bc6d822361d011e751caf13be5ca94b7d5842df5c16e52bfb4d658a405a").into(), + hex!("b696ec7f5dc82655cf027f5827fff3ce39195c1ee4ea9fba1808880cdea16d6086fb583edfbf66608e4f33211ddf9f27").into(), + hex!("a69bafcb3af59786acf009cc31e245009156a7e4fd2af98cdf2b7e63c39aff2baba08a338cdac93e94f6132b2cfe7a7c").into(), + hex!("8aa0aebb24b8c62168b255b6041474e8abf0d589a7467bc4712d910a9c2d470432d251e336a80dded27c0e9eea43aebd").into(), + hex!("a08d6976d3579411080957dfa2ca9487b1c4d8dbcdf640c1fea0a46f2c0228c2ddadf0553781c3e0dc5c7503b1bf29a0").into(), + hex!("a4abccfcfce6754e4d6c5c8bbad6668a55dc555ba99189936385e4dafa0435b323b813ce69f76e24299b5842c244139a").into(), + hex!("b89e4fd2dfb46c2af6df73f7185693ac535b67ab31f2805b1c24f400e0068cb32aff164b53668512f5895883189f7c02").into(), + hex!("b7c221a5884d10048bf9dd8611fb5231ce444fb756e59dd60d18a2332e889c014b27d739ed6012ff86056c04f36a87f1").into(), + hex!("a82875d66a4da52d6eac9dcd9ba9c728332253ad4b83acf1601a34efdd0c398eaad4acd1a948203d1bbd4a17d01a7b56").into(), + hex!("8c0a8ec162b3d48ee6a0f39620432cd67a1eb33a6d6f7bf1aada4f24c7498cf2e2b2476898f14c875f5efcf439aa0bce").into(), + hex!("a4b5d6451ae5baba3984bfbd5eef59543bf7c923662ea182cec6bb29aded9afd4c89e618ff756b5290506e0bf5a7e690").into(), + hex!("80664b43e3bd2f6e8eeb81a46cdca4f571499f3f0c77eb007ceb33c5b3dc18348a68cedc19d9967117f21a6c1ea29060").into(), + hex!("9174e46939c6915c757e793c9a02e46ed49d869216b720d0924b9697d94098182cad2cc6d4caf4cf140445377f1b4c80").into(), + hex!("b6e25cc134e089d306c648228d84aeee9516c8a276a2d37b54b458314b8f8980d49614550e821aac31000a5e7d518fca").into(), + hex!("ab1ab623a70f1e33cdbee356530a6f8fd9d00b2f9d8f94c0854816e5dd2bb8b258b5fb7a89ebc0725d8ebb74395847b6").into(), + hex!("8e75ea6f0678abfe1a7a9201c9fde992451327d61290fd803b3a1cdf2f7537fd7c23e0e06af5bb886a28928d0baba1c5").into(), + hex!("b41f4d4421de7b94eb9bc61602d08d77dc3f5f5d025e04f44c1426f14e8f707031b9e1d3a6e92c200f54166b2040f0a0").into(), + hex!("a8fa0c61435b851f9bda4da8dae0d544984ba5c0fef338eb6896b9c08306c3e2aec0a6c2028da319f210387320df4f73").into(), + hex!("a884af449df4cbd39e161de10f9d1f645eedfae0d259ddd84347733836fded047ca079916d365ef3d93fb354c8c795a6").into(), + hex!("936970bdeffc92f32915d141ccd8334df7966a3cafecb6d33fab9f477c389179f612cd6e368b615a98112d71756756aa").into(), + hex!("88dfe631c1e16ec3634e06a83a857ce9c909cb5b05d40490e6d02e553dd3bf213f0e178d31b4d913a4796b7226ab3ba2").into(), + hex!("a0c8357b4fb9c4431bc88e6336c2218590a7cb351ef4405a80aa6d352912f0b3110f3a09eef337bfe98da6b0841c6214").into(), + hex!("a7def54e08e2cea7def767d1108bc5c24d64e2dbdea9d07f0c8c63e60eec2db4e095b4a84bf6a4822103560b0497d1e7").into(), + hex!("80991c4f933985d9662d2e047187f244dcbb79606410aeb66ab250b2fdb9bd9daa392339e9b16d0d07648e847b02f942").into(), + hex!("b63fe559e2b4580238a0b0ce52ab8258838c2b64c1922c56b64cd65be2f88c140cb4e6ce96932e92f1ae06b20ee9e613").into(), + hex!("926ece3480c5c1f24f03d8289dcac7d3b202fcda277dd4453294dffc2953d91c842653a9e272b76fe2cebe1de3aba63d").into(), + hex!("930d29990821d26a748018bb6998488d5de811c8ed506c213c0ba346c8011e2d7c2235aa427a320129c1d016948eabf1").into(), + hex!("ae4e3fcd6c99a8f320dd4d160704db6baaae9aaa885f5d792212ea03cf06a459eb4a2730da9161ddd72a5e6544744e81").into(), + hex!("a01ae9d4f0008efdc5203abfdd0807ee7cc58c49cc5946d0b991ea2e069a224f0d99ea714b4d5cc464deb57372790660").into(), + hex!("ab17902ab255c575a133ed47fbafd62f898748ef6fc33455a2adcb2d4ea72c31255a9cd0c545d2ad8007a5a694f13371").into(), + hex!("86e2384e0469ab8ea9c5628d619d10336b3c0f334969dbc3335dfd72ed9899639fccfb5d1d9d6667a0dba20651584100").into(), + hex!("88ededd6ef3502be7c3c1b018cd814d4a8f98a7cf9521fe9cce6faaa6056315e22828397435b57d15e996fd15d7d700a").into(), + hex!("affa898a30a0dd2ccbe8d46c5a69dc1a8696b311094ac00e8ef6d398f6f132edb2d823004bc7895ac53bc09b6fb1059c").into(), + hex!("ac9f5bc3e2045a1eb356d88f2a62781fdb5775349c9bbdd9417b7bb7a9132a1cd42bf4986fcdc706eabbce45ab9f1cc9").into(), + hex!("986e3813ade7b9533ccfdcd76ea17490bc3dc62c8a596c8d07b246c28d7dea465c4dadda05111d2793d72d317c7c2833").into(), + hex!("ad4fbc51581cd520bcd0b88379ec0482c94b2ac344ce48a5facc1cf3e026edb088ce5cba5113f2c31f630a1fb37c5214").into(), + hex!("b499bfe19a22900c46bc0af1925887bfdd62455a3b85144e44b9a0a3756548c72b4f5c61f21c15f5e70b627d9f53a9c4").into(), + hex!("a5f40fcbe99b494c6acdd65ec3516d5a4a784ffc501e686764bf655c1f2f4bf784bac6b85e961d6a5ae513555a638323").into(), + hex!("a44c695e5490bca1cdc6b69fa80d6540239e42ae1765bff39285d1798696574c409e27c288b3b57196cf7c1753366969").into(), + hex!("a1ec5d9b8e55803477fbdc454d9c5cc605ead24147e5b04a03f80558a14f1e08bd6557f3fd11dab06a2816d32138cd43").into(), + hex!("98957c2e0a82210e2329b60dac05dd8b219ca00b18206227b725d011bb2f8b0dc1a79149a7d49a9a5505301b1b3847c5").into(), + hex!("ac8df8b1b596039c24c185108c89ef4da384e92c957c84bdefdab923e4be7c0e9480d837e1ff2e6269828b86b0b9f6c2").into(), + hex!("9358e3a48d4938b189059c3696169d31339851a1f4205dfe4de423ad4b96e7015c0dccb8bcebb64c1c357b65d5da6914").into(), + hex!("af1ab721df52d8b106449aaed05761b637c38f4c5513062afa55a09b94c8b088fe98cf430be4633b4f2f818da545b37e").into(), + hex!("8b8c063568a13f6522fc66285ab116a06d5e226a72f5a00fb321dd9b7d0bdb53a6b46ac17a1c9faf468c19b128c84488").into(), + hex!("b537f79bf008cd16711390c188c52d8dcf23cc41990c82005de2b0ff1fa09de85d3c34328ad9124e108ec252ec667f70").into(), + hex!("b9e8cf06d584197093d4b4b1e1f745786bb1f9772c0a771b321ae2dccac167ea79632138d60d8ed6dbbba2accd0a3c11").into(), + hex!("a674106b2c965c708b98a9f28a3f511f5dd8dfe7b2b9ca64a29152c7fd8de428316638d5091412e22e50406c372d9950").into(), + hex!("900a4953af5a28ca5b6f789a0dab9a03e3e5b9a0e866465d371b871fc59ecba31b524b0fc414eb7467d4384ca1e4ab5c").into(), + hex!("8b12a6114f8e0947995d72fee19e9204a4b552a85743d5320c1942bd2294d52a2d6d346f5e930ed788fc929069733297").into(), + hex!("a118f4b631a0bfc00df74a94930d69075b83be0bfec2affdf5e1ca4762d40592132108a7d2088891e7fe078c84ea9d9c").into(), + hex!("b074d18f84787d245018a2dabe2f0a51bf2f3786a802317122982a598f7f953339468e0392665c3f3a6b8fb17cd8f72c").into(), + hex!("8e6230b8186009b765ae6b176eb7dbcf503139472c0c2c5574e3d608a49932f0b852e744d2e215c58512ed2b4e8178da").into(), + hex!("98cd13f8400ecc9db458cb81840ed6467795f54f25680931881808909cc661230716fcf8b3fc2b18f4c12d30c32d9e20").into(), + hex!("b861f89275776bd640bc7d0d347df31e784292fa14ec468a6b0e8d64a9b077b6bdae1bdbc56385bf8f5676ba62002606").into(), + hex!("80ac9088ce82fd7a90c91b24e5e91636ed76844303a3b1105bc284b4e9a860acca3207d1804200a55eeb3ef45ba97558").into(), + hex!("940bc07a53373f075128b6c12f59120bc7368289d5a960c55d52abb68e8444f6f830b07850d31a9ed137f5357b38406c").into(), + hex!("b8c5919657811270976eb45b9f3f09be798fbcf6b34ce7443fb36207816b6a84d2b945a6e6522480c2feed12ca980df9").into(), + hex!("8294e6ce7d7d3b77bf48252eb97cca47a5b9dff1b8c97f8b7af8034b938864f38bad932bfe44a9bf4df81e394aee7ef2").into(), + hex!("8d9075a2c42c1cf51e082ab1a57a66670f0e81af2a651aacac5aaaf3876711aabbc0c96e44d883e6ad8a91a81be22940").into(), + hex!("882aea71e4512d5c41b5fd6509ede0fa35a49fff9648d277b531364613342711b2c7520a5f8d58ff31b7fc9407f968fc").into(), + hex!("8a34a824cbac06cd99fc68f36ae09c6adf2d472fcbd378cda61b838c29ca9750a7f7d63d9b61d1f30deda1ce048ffd42").into(), + hex!("a4f027b5466de4fd633cba98d2c8c78db10f91c8bee76c32ca5a80c5e87ffaf19df84e675f31bb6c14ee733ac3d4a33b").into(), + hex!("b990db2d743b389132d4d8281701b348bfc52f707e6553f309e4f59706871142e6b8e3d081057a5c43243911148318bc").into(), + hex!("a4500c88a58971460c33a404a65260a9e21c4a345601d1686ecc352ab088b2bd93d30930383901fd2d042dd037286761").into(), + hex!("a4de9078286cde237b4ff2da52a0fc1b8fe7b931ac35b3033dca0b87b5c86e58bec951a66a7308fc951ebb70fd0d0bfd").into(), + hex!("a9adb6dbff69b115be1cb37d5ee3a95d8c9f466f059128b6ab197d4119f6c0f87d1cf4d14d4beb2a43f7913700c1d909").into(), + hex!("a8a33f167e473eb2ace3bedc1cac2281bc9f522a0fdf6a9eb365859b9116067e07b7c380e8ea4dd33a4fbe23e2412be5").into(), + hex!("88c3785f853a192c50c38040ed52c413084dd069729cb14d806223f8a51aef40c21648d1e03bbbca031ce811e1b708ce").into(), + hex!("a7db446f88ef0d018675c0e7be0e9655d098529ce4b4c92ad809ed9f588c3f6c6dd98267ae0efb1659dc16a29e1feac0").into(), + hex!("916fb4b864ef46a2f8f570364cdf02c93d8432d8155e7ad1a15777d7f5d5fab94797257d0943aed5f16033528a4290b9").into(), + hex!("b9b7ae2ec02b0694d7828a69bbd1fd6e9070cc217319dc4e8fc854e48f5ce6e133fb0d5492e2f87e7cb8d3d557f17037").into(), + hex!("8cc36ade2b8039ffd41459272091d9cc4c46a49a187e18e9e3b283136831724313ee6eb5954c34acf9ecf7d79c30dcfe").into(), + hex!("b89a28db91eb06f191731a927445ca64cb685a206f4d77f335f510eab3a4973eb1d199525aa12df17f97cb4e079bc35a").into(), + hex!("87fb2881b92d5d9a2555080afe033512fd93306bd25f4a841d034c0fd9685ae09ecd29d27523e8f18664cdf2127ae6bc").into(), + hex!("aaf63cd83256de5b8558bdfd7f5fa44b3b3cd767983484ee482241286f82c6f51c1de99e2c03c8c99e6d4a27b7379cc1").into(), + hex!("89b52eb17e1c2868a3da6727e6f122046739c99cbb6aa7e30f65d7e649d09540b7ba77ea3efad77be597e48f7abe7643").into(), + hex!("88d097674b763a770872f17266f38200a4034347756c5ece6f11fb841e82447a75f6f3279ba8ab54e668b2072c6596ef").into(), + hex!("8de58933f07ac60ae919adb4be0becfb5e6f7330708a39cbc4c988c79033f0ffb365ae2a6308c234c218f0e45ec1ce6b").into(), + hex!("a4ec080db7716a0eae593b0ca91a16273abf534b8d153232e4b7d613c9fd21081bc8442d6e57a6e8e026c66c93bf0289").into(), + hex!("b680857b566466d1fb92d78a09b75d93753c275249dd05a17702e48560e4df5c7f9ca68370847250fd001433972c8b0e").into(), + hex!("84ec67623fc58128f4504b071b53e3c0fc60ed07318febc8d450035567691e2e58468b6799e5f3d93536100bb4b5f3f0").into(), + hex!("b22ce364b11e164d3df52050d59085c29c398556617277349637290b193727e3942064693ba1d7bda313905908a071d5").into(), + hex!("876198b5734f1ab5f7ec0231110e9cbe59d116ccc410678d5e0108fae42bab5dcc7cd15df200bc71f471ecbeb0e80d68").into(), + hex!("b081fc87056c34a8a78cc34f308502c5b6509adb0b344e83227b997aade90d6f0f1b8e5302601ca3217ecf9dcfa24ddb").into(), + hex!("8fe71e517db52831a0c4adb83fc6524817b9a358fc6bf58c03c91d4125482921936391e54c767ad2f13071e0e5ea266d").into(), + hex!("91212d83807ca11b030e5ab72ec85a8d13d468c714fc97c20b5d0569c382ee270d2ca486c88354994ee54f02dacbea50").into(), + hex!("b022bf24d2ea893125f3a89186f444aa5f301333f0667eb5862586a5eea8233c90202064eaf9363f7b367a6dda15d45b").into(), + hex!("b1f45fa596a32d3fe267c830eb042432eec6b79efcd5c84ea835d7108bd4290fb64749ebdf7e7e51e6138fedb3cd2eb8").into(), + hex!("8567d2366c584d975bea34d4f9e2ce62a62765125326c5e56b5cda08fd2f2e7f769db47eb514d2d9324b645879c82a66").into(), + hex!("b4816fa77c76e1f75e6fa903a4c0c031ac7a5f5ccb5f553b4eed83bb34067480804c0f6f308f8d0fd723dbe2198b0608").into(), + hex!("a9ceeea8878d799fbb6d52dc4112ae712429b9213f72b284698d68ea6827432f34e51daae1727b5402916a836567f611").into(), + hex!("984c8ca226df18ec574e0fabd6dc9ab3a2e1b319c4b6ab5b19872239833dcf447ee5d720305b2385d65facd297704809").into(), + hex!("b02fc16b3530532a2373776e2512421d6d2e42f3fd3c3e71393706d74ef9324571c8c1ba7b9caf65dedfff2bad946d71").into(), + hex!("849faa2060a75d08850b54e06376f252d9cb4add3e740225ee37d23e29f80cb9f98188a7eaf6a381af4b4bcc9874b792").into(), + hex!("b5331ab6646a8be3bc37c5fec56a597b914683402828dd4098b189f245c638e063c933a542c0122f063f98a9468687b7").into(), + hex!("868d8214f26e14e71ae0bd514275ae9442760af72269790228e733005293019984d3d463c2bb82936193dfae8c267fa3").into(), + hex!("a88c6c4af4b9d285997c9b5cca7e22ab9b8e5873ff36455bab6a6dd4518e966079524f8c35391811f16eca421f588694").into(), + hex!("a6f508524a938fb49a7da70251fc8300192882a3fe784f0bc51027ef2193d90c75d0d0720f2f5be634d81f38f3d85b8b").into(), + hex!("80a923acf2aa0349b4852f47edec37cd47bd74447f2f91c110ed092d015887a6625d5f1fd1f5d00c994edbff1435956c").into(), + hex!("84ed9f1ee0db4c9ae55492fd07fdd44851a6d0209da5b521435229b1b45d57c3b835af627122756ad0e63e915c15909c").into(), + hex!("b4c4c1e6fdc418bd29cbe8082fd774f678dc28a51896a51349c888ec98124b7a522baf70b820ae0729696624f3695af0").into(), + hex!("a8cdde029503aa3e23776a67952b2bc954fc0dc06f07a78bc94e6408edf381bdadc29efe4e5340a9b7efe99a3f3b3687").into(), + hex!("ab02a92f5ee21035e6e3e40a026d8d5680f98afdbf82dc037dfa30a87a1c101387a0085da8474989b24196ff494aa618").into(), + hex!("986c88a5d0bc6ff4127e34e0a5fefc1290936ec88d1765e776e199601f9660a8425c1fc6defff07fb81576461d0ed7bc").into(), + hex!("abe2259e880aa8b587ac9a31f794895bb18ff1bbed378a70fa09388e5a6a7343c072401c856bdd92fc2f60ca11056aea").into(), + hex!("8c04c98815c0c1f281c8783ff8098b0d806039a39fb2f4642a08f821c02506bc7c80ba7a1f4b225ecda9971ee3a22121").into(), + hex!("87b7bb0cce6244aa1a540941f0ff5ae4126fd4c62bd98d34993380a35e1c9a9f43b561506e5eafc1ddb8aef131403590").into(), + hex!("93cdf5f956e8b40ca0e31cf559937b997897c137a411930ca28075899abb6c08dd6aad5b2bfd5c09f07613a6854b3be5").into(), + hex!("83ebb284e03b4414694522caedabb391062ba9ec373e94427feff071644df91635ef498dcd9351ae259c5b15d6edbb38").into(), + hex!("80747223ba06d6465e26a354b79c42ec0624d33cdf015da7bcfb31f7009d92aaf6321f4a921f6b38e0a394a412edcefa").into(), + hex!("967b4b10a341abc5c01ffd413103c6468e3efa32c8ddc7e8622fd3ab2a765a420e0be3c81e1da05679becc5bd03e59f6").into(), + hex!("8a01b90d551f26c265b9987c67b641d15bd3b8e5af5c25472037645da05d9d54c0e59bab32578eeb3c1c5889f4fd9aa1").into(), + hex!("b6b38e40e3fbb31b257ecc18dcfff2fd850a41c2cfa5a642b0c383cc1a86b2b9adbcb22130665f544f1d9fdf87e92dd2").into(), + hex!("b490529e0da56e7e4d4cb2f79b704576c8b6569e9960dafef059dac0144b29ec337f4beb515465a57414d8965268a3dd").into(), + hex!("8a3b14616bb721543bfe007f1a042e76ef068a6e4f8964d68dbb7a733ea92dfe4e51f4008aabaa01a8a3566b00d083ae").into(), + hex!("8b82dbd0d0592d45d6309c795beb42274b74d844cfc393b34cb6992e3b25ea8f62f777124584eedf482949bb999ca5c3").into(), + hex!("918226266d7f02b2081edba64ca4b70339b7a63ef9194cd77a214620bc25618495cb4335c0c3621c75f821e685af3f1e").into(), + hex!("a61f56310689b9f383b45e8c8c647bd7150fc6dc3be96afb464b0c67c6f8c73ac9941bc8a5b0e2093255c204646c94af").into(), + hex!("abe204f55b8dd101bbd554561c1a7b50c01b31c967f6cea18dc898a10021eadca3c314f6b7afcc2251682717540d2100").into(), + hex!("a0cc3fbc4a05e3b5f93f4df85b92c1bed221f21700d8faaf84e99954cf6994d0052c8ba8ab894503b5515bdd1460ac5b").into(), + hex!("a5e5e175726b31163e13447e360f835ca64c3883901fb1fdc275b487106b39fdf43b83ee8f3985dc85157b94aaf8c389").into(), + hex!("b34106e71862b290f7bb47e5492417b07b541fdba23ed474f29d666cfb50bb5a3ea137ab717a41ff769af53ab385a3d6").into(), + hex!("aab726a0317c365aa15ef9527e5101b1a90cdd60888b733cdbd61dffac3374f995206abd154d099b2dfa03dbe666d503").into(), + hex!("b3fe9956454604b2aa1d51480ae96182ad1a8af64e80adbba1034619090c23d0d7ddb4163f400399d5946babada2f5a1").into(), + hex!("831a0d4008865576d9d0200dbe80eeafa7e6e6d442a46ebf949f39e32ad311995535a261795a7e27f2b23a6d506b7a33").into(), + hex!("8d7fe284c9ea1a2dce6ac70e3f225994f65ba9791520fecf5359b80f7c32c1e45e75b8b787ccf24b83c79301e046bb4d").into(), + hex!("b00df7ea640dcdaec66317924090f49380edc5c669ef1249ec8a24a3436b4bb41be0edd4cb0d04bc6ffd540ac8efad18").into(), + hex!("aa55d72470c024627edff24f9a19ae958d6b382bab6a24581183f762d736ac10f189ec3f34a7a41516f81696352f16c8").into(), + hex!("99e172cdb14a23161b5e8aa80121d98e69506ae0ab956912eb2ed959b73ee901852f263cb65798554ec0ee35089b4c03").into(), + hex!("84ce8ec6a7debf3cb2e53afff7d1f68bf75b7b209938192c7675286b17489d7996ecd9514c5233af0a17390b9982d805").into(), + hex!("943cddf3f5a6dc04f425aaca25be44438aabc7a661476761de596fcef5746f9d83c361da3fe1f21227ee5b9bf9a3ac76").into(), + hex!("aa81e66cb01e77c5db882792e9d896c83aa418b12c3b5201e1937ba5b74bf5fda974c82f6f40e3ca48bae72ed93437db").into(), + hex!("83bee12657fb462a5988ee26e2d0ef8b11e5fcec108724f6135e95913d7f4ec338031b697b24fd7a650cbeb088b26733").into(), + hex!("ac0070705c447e635b8df509de9ae03ea9b0314fc58b3befe14c316cb7b70ceaed081aad115a2126ecaef630c6bbab0f").into(), + hex!("a1c9c3b6f28c14ba91cf063153c50253d82440b81dd8ef938e181ef4116ede0b0ec62844e1d7e8b387668ddb8644852c").into(), + hex!("b41811ee8e385836fd709081a9a65a33ae1571bf943937615e97d49aeec3289624882915a5f5b6ee98601e752bac1212").into(), + hex!("a59cfa6d60f5c3b62197d3058a9b42c66bb841ee5d67ae34ad452dc70974de0a56a770c4ee5905c0d214c3d81a5269fd").into(), + hex!("ac47ff714d42056df3962cb4494019c977fb6200cdeabfa3ba85ec7d7d70c7d3ff4aa05e26aeae6ec6a3afa460244ea7").into(), + hex!("83c0ff348f1d018485c18417037016ec592c249830fa649b27754dfa70b94a549a42eada20ab1c4de2a5a513d742186c").into(), + hex!("ac5ddeddc94d18cbbad0e1889a2b64e91b3f927d3eb666ba018807f1e4e1451a43498ebacf12fd370b62c5386e36fedc").into(), + hex!("91606f0315fadbc42b1b27ff35b5601196a7a8beec3d5c76643e38ef28f0aef0aba9123bac7ceff0b297ca53727edbd5").into(), + hex!("af9cd077736f17c89ab4fd21fa2cee63b16f67277e9c5d54663f6d5a7abc3141f3045558899da70419b1e92ce88eba86").into(), + hex!("ab0757213aa3fcdc326925e0dadc2206f43c53f7abaf34a077f1cb29427261b4bd9981dbd1e33fedbd77fe00bbdaf8bd").into(), + hex!("8c97d256f9d4e0f309522f3899c5f74fd7e8c4dab6adf4886e7b058b323e294229fafce28871fd39e5c43f28c670b8a0").into(), + hex!("86eb85ad6fb7a3d5cd9aa5b22fd648fe9db688fe663c835abec75a6bfb67af0df0421d24203083aeb8ccda06dfb230c9").into(), + hex!("afa2dd3712eb94c9097135a69573c1f373ee0d7916f4ccec5a62445726aa4c1548bca45038e1a44ab7c8b7e3ea22dd6a").into(), + hex!("91e82407c442937af665ff8952d8b7ce3d68ebf807166aaf0fd710b76c65b39283e511b3314297ab0f2a9c8a2d76ffbe").into(), + hex!("a52cdd05f6e254c6da7a00c9210e33a49658f035b78bc7f15b527fce20c3893d3f7dc27a616eb3e107da060df251b082").into(), + hex!("81e6ddbaad6a18404832d2923697ea8df8dc3b39e53390269f197b976b5edbad074639e1e7bb25ae87b00681973fa021").into(), + hex!("a776979b38184661cc36ae9bf99b98cfb64babe37b16ed7e16e33e2187af71d9f62af4fab2bf0671baf3172727741d79").into(), + hex!("9395a004323f4ae604518224292a1fdb359fe9d4ec2a2262f13fb33d90a9dc50040d03fa6315a5ab2db043e7e16fb971").into(), + hex!("81bfad9e94c00fc810c4e63042fed6dc54c7c48637064376d5a4df8c8d6be3c2eed335640bf45bb8df99327a7e070d06").into(), + hex!("b6b38236ea973f91eff175206c4328cb97335bc8e498d9c9a2040468885f7d8464a8a1168929cdcc4c59513885e1589c").into(), + hex!("aa14a7baeb7b6d0048bdb8c772de512001174f764b37396c6481bff5aad30abd6143e4654a3d80406f8d08948ff8145f").into(), + hex!("a7297d6c09873e481c04f2e9e9a07567d78da504d2929c8b9d8ecae1c4d919611e061caa632776a8716b20e031cfd203").into(), + hex!("a0942935f58ef26a111d77b1c4598207eb6e3414c106b286f1c4dd344b3e70d3a46595ebb657e43f0e71dfff3b532382").into(), + hex!("95dca5de041e96f8c64f945817ab1ad62414b3002073b18331e288878c7a889774468d3c24f04e0714958ebd79ebe71c").into(), + hex!("b64f58f4eea309ea03c60f6ee66107fbe45c5ba81b8ea397a515435a179ee86bd098cb9acab4f374d29c8a388152fc6b").into(), + hex!("a70fe2ce7cfbdc22183a1a81c779c6071199768ad9b39ad0727ced4fcea5fc79e9833279ce93e1ef16cfc6dc0ef4f15a").into(), + hex!("8169d05ef0406b661022af53dde8ccd7315b3e35065c568673bfe5e59828480312a8ad418ad431beee12e7882d11142e").into(), + hex!("8148070a20eba3b61bd168e00ae8262d698263a8f22ee01ed6d46d154a08708a85533f54935bf92ee6ab0c04569eb3ac").into(), + hex!("b5e4f8b8a011c9cde6a9338d7c751ce2828fcf41b40e140ecf543150a5b4859f87836461d0ea2ed7cd0e6bfb8febdfc7").into(), + hex!("aab7b0022a1791339fbf567e771c43e9a2a46fcfed394b7216b556aacdebc259e5fc599eca66b12c23467b2443fa9c76").into(), + hex!("a843e5929fa14bbdb5f370d28547a7b585443f4d2fdf8e7237fcbb93a5220d62c8033665996f36288127a2bb4822f357").into(), + hex!("92a5abe1a8d508193c88827f93156e84199b14731a68b0b434663e5b9ce8e6e3005ccefb3ad8330c56fc0898eb9334d2").into(), + hex!("948c5a4bce25157f5f779fcdd89bfb4747a6178d464d15148742920aa2ab7fc63d6989b586152e1e79eced93f8686206").into(), + hex!("8702f3fccf470a294946970f8ecfed499f5ab3df799601f872d7be3d9227ff78a764550fd1a97ab25b7be96d366c82e5").into(), + hex!("85c5f99e913f1cb67a30807386b5292c841b51e959a13912fef2e0f4ba84ab3b1c483dd5fd33e80774de19695b622888").into(), + hex!("8a903e39b9b46dcaaca4fc968b298430b982ed3916f8ad533ceef5131dd507f1188fbe856c80bedc7bf34799743fa86c").into(), + hex!("a91ecd938c2a399b97576c43c5d1621fe748732090e360fa1e3ddd145438f9569d39a7be9d032b435a5d14ca4c905d15").into(), + hex!("aba9def4db5bbf2ba185c134f7734feeef976573e20d76aee476bfaa2af389ba5576a1476aae2d42d5470a46ca3f58ba").into(), + hex!("91d3529480d066817c0111bbd92714a40472ed6c877df358de98f0258f79fb8ccd54a4fa8bab3b9cc15bfabeb620c196").into(), + hex!("8cbce4e674d90185c47225c587dac654428427cef8a563cb89aee6fdc2ae6f12a8b11be46c779ed9afe38ea97d7d71ec").into(), + hex!("ac684cedfa58b2adbb6a13a94aa8398ef4a14970f5a43a344986cab68fff7fd48f7bcdc0506026eb0a2867efe86f283b").into(), + hex!("a21a2f8df2b811550d6e115c095d4d6781a84ba25b7f4017adb318776ba7452f48ed8b83a6a94aa68d83f2226a4c0549").into(), + hex!("a0d96e01d937144627c695aa4256f1d1a16c708894ce854f5ac656585e6852a43c39080909e7029b6611ef519d9983b2").into(), + hex!("a2f32ffa61e370d087058cd3ffc534da6a917f75ed5de568938885cf5220d474c930ba9bfdce91e031aab3b3167ad362").into(), + hex!("aa6a7c0162520c6706ab0f6188b718c1909a4aa12e71afc1c2d40e51fe44f667db0e7f1f0cdd81594447e267720f2dae").into(), + hex!("b4f16474ec3f37765e8750729f3245167b82472ec454329c9183a5d5ec939041d85b83523d11f2b895e2d15586f81422").into(), + hex!("917af7d2995b6466baaea2b3eaee5f76508d0c117d0452bca6a07ecb87c0cf595161abd5bd31a904e05684e55475a4ce").into(), + hex!("93dc25ff6a8ed93fa40d198a97955d40a5f29e50fc6fa6dbad34582478d3d1bbac0ec5789f11a92a738e533939c281ba").into(), + hex!("a41c824ff14ff5ee486a6130dc6cb01043e59f71e234390d464c95ac49ceda8b5400079ed4edecbb59be2083d8f06da7").into(), + hex!("850da042d678ac0aa31dfe0eca861ce17cc306188f260195fd10f940c67d42c9431cb68a64d27232e989c9c23a6e3d1a").into(), + hex!("a3e223f30d9782fa1fae634497c64fc58bc8289e48a67c8517621918e2b921cba1e90b2b01f838ea36071ed89bf64ed3").into(), + hex!("809001b01c33bf49a97ab6fbdf708fb224879c71679a2b335cfbb3cb4aba3201a32113de289878606c9feca057d9faea").into(), + hex!("a10ee1706f4c49a9cb2fee4ec6a0dbdc883fe40d4e1cd7a0388f49edf1f5f23a38e6075fa5fb54fd8e77ac3742266a6c").into(), + hex!("8c96e17529d7051f09f93faca150f5313e4d7f32235a4af6d12270780d6c14418749489a2674c728095a56585e0ed924").into(), + hex!("a9a7bf56eb25c9bda003a70128117adca9c33c6bb24bb4c381ac405e014d9c75aed0d704d801b9feacdf81c3b7f0040f").into(), + hex!("ad53d11d31bb9ea53bd23d673fb26211ee39ff4442e9efa1259bddae866e97bf07b0f9ca44e166b3b85d19b5865b1612").into(), + hex!("95e86d1427c8abd87e7f966c2ff9468d0bc3f76175bda677acea5113b5bd0d7631972c4172220e3a72e0dad1496bc14a").into(), + hex!("b8894228542dfbbc6eb65c9adf6549eb4ade838701356e7d672c095b1f997be5bbf3ff19474ee99e81320efeb04cd529").into(), + hex!("88bc36d6d90424e86374499e330ce5afeb63164fe81fcb4d56c5c997e07093a37df33437389879895c8b2cccac28ed0e").into(), + hex!("8ec1d43488aebb9544ae0a12ac7311bf873bee05caafca5176e26d681b881ef6b5e3ae5d9853b33577cc21d3acfa1e82").into(), + hex!("aec567db9a542eacf68cf4b7b9682ffe0b385dfd192296f8d8cd9e1db9d7da0b4a4a0d0ec2419825177413faad458cfa").into(), + hex!("ae242e9e2c7ff2c0898f92e7e9742ee5e19376ab97195c4eea0487490068199d0fd7ea08b832c43e208336b5c77d1947").into(), + hex!("93447c215479b68442636384d29fd5b4815cff904668e909c67fdcef1cf5d594219371f62edf189d6e54f04872705947").into(), + hex!("87f993a564e69e132c6cc4874fefd83bb5032b98bda5eaa8fe9e1713baaf08486aea21eac3231028715e846e33a3fa23").into(), + hex!("a9c4eade07d3d51bf733d8357005e08a5f86cb44c3dc6b66dccbdbb67cb5727bb456d6092418275f34b59063b3fd64eb").into(), + hex!("8939e3cc9c1dd203d8079aa4ac0d40d2e1b85bd876616bc6b589b0bd187701fcc36c52d79ec7f14b5e54fff459c99028").into(), + hex!("978122dfec6fabe4f737a3c9326f2f721cc212455001ca7e09b65b70ec1ada1ae26d451632f31f648cbc65a3337250c2").into(), + hex!("8d1eeed7fb1902deaf7d6dec7c86807c4aa8ea1d7130d6caf01d65e36f6a30e3442a97ad6918e67d2e17fff4ebe7a97c").into(), + hex!("a16203ba484b5b02a1b210d487a54c3da41b3815c307a30fdbcda0c3f5f2205e16bc7232e1b8d57d5f58718ed4941ec1").into(), + hex!("89b4e7bdd90323c53aa502a9839f57133ab0cbae1cb133fd0beb54f4d7785988eab89eb0bcdf61bf62a29b341befb883").into(), + hex!("b75550a71a4144a4f23ee27d86c10c44e8e57c118ff4f9a2685762a98a3770a6c2d1fd9229f9792dd4e784e8b2eb675c").into(), + hex!("9171ea1599ae47b04ffc307dfe5e49da0f48835cda926355606ddff47b18ce3c224828ddb942e63dd8153c273105125a").into(), + hex!("8e0e78d069f4d51b9b0c370100a9d10e395b8f88d009e33ed7fc4959bf140176cc316843c76d2a741a3471d56ced5db4").into(), + hex!("aad6b97330e76b22781e78ebb2fb2e92148d74546cddc7348e7a7f0563b986a7553907c8946258cc343a15a8918f7491").into(), + hex!("a9e8e436356d44c945d8248d249e20f5c50bd147de94418d4f04e1f67be2319e4d2a7291981378a1e457874dc91a9948").into(), + hex!("800b092bbe1f56e78d766c510dfe42f0d6670335f5931b3f821c77689fc11a502d7c82d2d887ab21caf312f8e5a037f7").into(), + hex!("aa8b05f90da0056b7659c26171df70c748d7a8fb52bfda42b7d129df386de331c1fef9d5ad1b19f0452cafbb813c3ec6").into(), + hex!("a6bb8153637b097a905342895ec1c927faa92ef8d59af86e43864ffeb6b8caa3f5b025079ccfa83214332aa4f6b71a9d").into(), + hex!("8244cab3e6f39492c8fda490a363dcbd8af265dd3a158c2af0e66182b48fc2b49f473b402bbf0951b42da5bb669504e8").into(), + hex!("8696508e20c144ef2cd954fe420c60f8432529b97a865a52de5292215c448984dd591170d88c286d7bf5a1cf8b94ae53").into(), + hex!("abb5b057c6b91d51df313b4690b15a218dfac6a30a05041c5cf451f515062eb02c54ee6cf6ff2df7640d15ddc7a95dc9").into(), + hex!("ada583911773366a4ca0b5d407520a590e4f3c6628c6d050f2641655d1654809b886807c1efeee9e9ca187b79b7676c8").into(), + hex!("9730edb86b7161715296bd5267bba55d3bd956dc9f4c640df92cc8aaeed8ab2dc1ff74988ec2122f6c3ea57b6e30dd91").into(), + hex!("8da42bb48c6f17c0e96b5edb71ed5e937c9aa65af142234e3ce61403df7f6ef05a4309e92469eaf68d83afc5bd800373").into(), + hex!("b3cb17866a99dfd048c4ad6024823841eb6602c7e4728340f1167b8af3c810926f0eb3e1a0f51ed6fba4a80743660db0").into(), + hex!("af121178dfa05ac08a2acd56f895f444e56968b703ec6b6cfae1e836d78afe6f51021d4a415aed89913df49bffe27ec6").into(), + hex!("958d5dad1aabe840881f29617dcd2f759f220974515507b0a63b3487b4cbfec69be7d22f4f7f45d693101177ab205303").into(), + hex!("ae6160e53c2c9ce5495bd0f0476703684d854048f2a8bdfeb6cd1e93fda36e44d879531f213feb1dce706d35f9fbb04d").into(), + hex!("8dca41a5808d3c75f41919cbe65a226355df9ebc7c1a2d2263d654bc66d1f5786ffba84a1670a7369258bc92d6bd68e6").into(), + hex!("81585a607df11d0a5dd778adfa1eca440a49e37b21677fe88709142243f5ffb2205e703366de53fbdbe3d7ded093e834").into(), + hex!("a80b1f358d284d3d8b18ef9f101d4f0d84c2ff99342e7150a55bb2f54ee231e333ffa930487a86e97f460696348e897b").into(), + hex!("a4a1f79af8ca4a5c5b44b05828449002c92c313c8bdc33465c099ce8f74c3d575ffcf0ac1ec5d29e80ff96b07f08636d").into(), + hex!("8797e455d44ad2721ce7de2fb8125af1bc4c0757d9c2fae25394e44b8952dc5fa597e0cf5d2b1c2ce996e380597a1db6").into(), + hex!("acd840fe9ed7f38ceb48d65c9f9f02fba4df0fd871efb58b35547c9b526e6e2416195d2c131a04408df7298db50a76aa").into(), + hex!("a9ae67c2d2bfe04d64bd4def66509c108f9ce85394da48d97407535c1aec05df39e3f7c66203f72bc65fa72c18bfa77d").into(), + hex!("abb785c66a7aa06200bec1960c572d61a9cf2c283404601259ba720a506b3831391e998346ee73392a3f7f12915b6f6b").into(), + hex!("8a453eb657c2a85bf93193d47ec26102c4d3adb666a7e1f05f1991782319bbfe104cea57ae1f4379cd115ff711be67fc").into(), + hex!("96c7151e34ed488a06946059722dd9d1b5a2ad2fec96b545ed662a3d0fc23bce6973d93dd2932128d95b0686f9208fc5").into(), + hex!("b5f39ed29d3f85e56e21ec2bce47b04ba16d72a9fad492815b485a93065f2a83dd46f92d74274f815c84792278a67cf0").into(), + hex!("ac9449a216a875c2f288e34443a94a521f8e9de28f70b729f393a483359ffd3ef8537b8a798b8c9a259ca390f9fa9751").into(), + hex!("b15584e841de0e25a301bc3378e89baee55989d9610c513b79748e7c51c484f7bb1d9adb33f3b63d52d36918514aed2a").into(), + hex!("b4dcbabb43cf694b024d36734baf824830304257d959f6300ce17f892a23000e036c4d3d59d7d1198bf4f6ad5ff07e57").into(), + hex!("b8a1f0a8ae246442517606f34ca4029deb727cab005c9952ee9858dd99497ba8a0e3311bd43aeee35275db74c7bbc52d").into(), + hex!("b1c443db1b5a00a87a399880ccbff4481f5742423c47d38b175527e84b32fd66110791c117fdb70782d75c476683f9fd").into(), + hex!("8e018c4b2b4cf1f1a417d00b13fc51ccebcd09a502bb14795b8274585d2e30d71c2c7a9b9f56a717f0676e685e65e907").into(), + hex!("871ea4444c7080995472fc8bc08f9091f9f706e9cfc49eeea5357867badd837649f059163835a7ad7263cf03fd13b198").into(), + hex!("88b67b5819119372e0fd7f97ba1eef877cc32d4be465001c35096adfa18e1811bec1620849a608de8420126fee9c37e5").into(), + hex!("9060dc7f55fdfc237799a2814a6bfe2d2f539ab76c38a9b1206890323bb4eb7b1ce011ea4fa552b412bbf6c67a95f025").into(), + hex!("8bd156a3a54bffe373fea65ecb2ffb12c96f04e07eee582200a0ade24d543bd6523ae5eb8a710c1de1912b2b4712fa0e").into(), + hex!("a8c3fb552f1a8c6cc2714b97d0cb8b2b6028bc3aa4571a7e3e33f46eb4c150771556c7884d575ce8fb7b62a5770ed2aa").into(), + hex!("a808f5a34beb7d62d23405a64d27ee5d7bf83cd880caf7bd4a615b84f22e1dbf11eab129d9cc9ad90d4e1dcd68613f0a").into(), + hex!("ae56febedf59fe99e79e87d7fe7aea5989493833a52f2e6012fd3400c69a6dde951fba50e0c280779d530d74452d63f3").into(), + hex!("8ed5f6de4a3ba85c6c857068bad6432e96c6054ea38ef07391b914c052c2262856d19403a590e8df63c6dec99da35b68").into(), + hex!("89c01fd1f37d826b9ef3b73e2b1aa5f4b4f86a263b2822cff0153fd2b945bbcf16eb3868ce66910073bf86b222becfc1").into(), + hex!("97b3ef6e0bfd3c399ec959d22d29fa9a79fe8746eec49e1675afbf7a955d02db2e89190ebf43118b65a7dc2db0c4d72d").into(), + hex!("a95700745f0ecbb1e794f4db9788af60df4772b5ffc8f5f693f213ce6230810df31716382dccd5a832ced7f34945d144").into(), + hex!("87d0a6a8cdc36fbd788bf744a443b632369fa0cd983d2b60e20856533ed6451d8476b9b3cff39ed0f75de94ad5c7aa48").into(), + hex!("a14c6f6463aadc8d1d2985b601bae8e74de54954ee7e3aa918837064a98efa5ab736628446582ccd13bd458ec2d50b1b").into(), + hex!("8b68ec274484c910f1a73a8cf8a8a149ff2942ac9de6e73641619fdd9e778e9c0fe6198745f049fa9fed9e56287da0b6").into(), + hex!("b77e981a03493852e7ebd6efecaa647c69ce6d46b2190bb2d08f0eede4addda776fda92e9d943ba57331bc985cc8e112").into(), + hex!("9870ea49ed03991dc1a4f47fc978618d549b4f0ddea01d91e7c409db775c91cb2a58c0c0c57eb73e7b6d3418f850b0e6").into(), + hex!("a518fea50400ae263ab9cea0180079d0d353bdb7cd440cb4d2156b9628e487b704630d931bcab742e0f3d7230821ae91").into(), + hex!("861ba1b761d0ce92972f28b7a65cbf6026bdf7427774fe78ff1f45c67f9083fe94fd2c42f47082b6fba722abb648c61c").into(), + hex!("83d257a40e8418407c80851e2f14d0bc47c3b9ce9e2de53b5c6cd99f31dd25dc200fa90c822060d47c4225d61560706e").into(), + hex!("881f7f674959e4176731ecaf6e2c9b490e70c07abceef15707dba8c9aa3cfa2293a96bc9d5455f769642c9717a4fe949").into(), + hex!("835116735f8e21064c497fb0dcfc929004ae5eea1f3e6863ad0b227c820d36255230090812da0800e03af9fde4354a13").into(), + hex!("98d9c12ede55af8067af5b62b89002c66e3b6556ee201ecbaf585fe5026f997fda75105068d62fe5d2403c6c64c314d8").into(), + hex!("ab359e8e0ef4cbaa9830e2aab892db7cd7ddaaea54cf455c2ca24f10ca337f989641ea33fdb1772ed90a988083405cb6").into(), + hex!("ae9ded9c9fc4e812dcab3d8a1c74ea264eab2df0715c7107ec1ec336c0bb5f3761ac9580ca18109278be5cff837f754e").into(), + hex!("b373013674404122f39dd6fc29abef1b2634e2bf650b42c15d5a2f7d762eed98166be26372e8dc6bddeaff84cc2aaf4b").into(), + hex!("b34adf4c3acadd7e11a9d61f7df20cb2520cdbf2d16c217f39e3afbdf2180abe59d37115910b77a504b81a6000b982c4").into(), + hex!("8161d446296d39d0c27a3db1bcbf0619e0c49739c655af49f49ea8403374afa4f98aaf530413848b7d4b53eabc16864a").into(), + hex!("8256cd8e3c9354ffbb59818f0b24db969a7765d64c2fcedf591ce65f619237d6eabd110293bff42b388c9965ff6d51a5").into(), + hex!("a1c562787d2ba1cb64dba278080fccb1c6538ccb00b94db34b62ed1cd863792f8acc4df78d181badc38dd9bda544e395").into(), + hex!("94ad66b4066f53ff299dc4bde2bdc23a891959903174e8ec08dd79f163c6f4661b3eb3458a786bd8f3fa153c806e793a").into(), + hex!("ad1a50bcfaa5641422c6f10d31316035eaf061ad1fc0a36c8835e078d3fa6efbe6dde4bdb28158d9b7aa74fd9241523d").into(), + hex!("a5952780f78fd6afd9c31226a23d307be72aefe0bd99c32a139c3909b1ff1769e2441dd2c03f33cf98df25c76178e492").into(), + hex!("954100f83b800dfb89721ac06728c3d5e8a8edb7e1b56513a63c2b49dd44b9930edd897fecd262984301cb6df23a338d").into(), + hex!("85de42b8de3cc88181a50e9aae696d92e66cabcc7b86425f846dfac138d26eda7cbc420cfd10f5d2681b63bcf411afcc").into(), + hex!("abeda3b142d621f94f829ed4174d042461e95d978be206fd31f8661263bb7a87c648aeff8bf640ec173a77ab0970a93c").into(), + hex!("af99434f06a13d9c5ee7195ce58beea07940949b686b4ce06727bbbdfa1621c608c891227e2f026bcb58c60a6e925533").into(), + hex!("96e97ce1ed97b8afbbf282bfbdbdb4f863a6931cc781e9d7938617310ded35dcf043c2320507e91e94f470f0cbb98621").into(), + hex!("8693fe1860981505e4540b79ee7a7ef33b26535cde6e9aa019bd1e0d26f359a2d26f0341b7c1634eff1f5859ed3a8625").into(), + hex!("a94e940bc2d8f826c23bcce8fc4e49e29c5f918180f566a67395d33cd573e6dfb149490de1ae75068feaedfe6cce0e40").into(), + hex!("9697d6be370d808a49563e062c2b3a0b347281e00839dc3dc0ed888c623f346a42094fbe2489d0487049f2fe47887cb5").into(), + hex!("b06d4cc8e83acc4121bd278784061f6fd391b3ac378fc6ef46ca2158207f5c0d33a51d3dcc4a499aa48e5b27539c4a16").into(), + hex!("972aa57628ce57381aef9710ebb7cb7a8db28b1b64d7db8be38936479f39772c60d766b0c5dcb79676e9330d0406761e").into(), + hex!("ad2164467404544aabb70605a56e9b0f7887491a1691302b2bedf271b50cb6f1bea1b9637214aa3624f5d8f854359607").into(), + hex!("a9da2595107e9db07c56a59d2af529b036c50033ff43c282e2da551bed8faa96eca744881e600b6406569675643046cf").into(), + hex!("8680660eb867978df2474b25e225fd7536b88e9e73f0188c0dbe835677de701fd402916d8e3d17fe652c7ac6d2fa0330").into(), + hex!("b721e239f50bbc7af5578b75c8befa439474bc4e6ea8d35d1006ed54c6d81c718fa675901df591a69b4cc30899974362").into(), + hex!("a8af30765f1b00ad51a32d856a2b2f97831843878a1668a43e66b65b8d0bd4a2e2826fef5ca5bf140050dd81eaa6174d").into(), + hex!("82baad156e89d7b3da9ded4516603ec9aec36e3a0a9bdd0ded604e4fcc0ba10179f9517fc8372d3743cce5e676c8cd17").into(), + hex!("b3392745016dfafca36a7af4be273c5fb4170b71938d6b93691d7a3bc8791bda537ef001d19ffcf7b393a89c898b8b14").into(), + hex!("92f83c901eccb742618313ee2f5ca571406bbfb1d077ebffb92d52ca962403d34a24f9d333c3a155bb9a72a0fc2eda34").into(), + hex!("9792598e2f303896010e35bf670dc2f3799cbe6f0c66379030b0ea01b44ebf24b9257841ab80d2d6a401fc56bb722e68").into(), + hex!("ad1a3c9c5d699ebe4f1b2727dc94b290c84f44c9ffb38d5498b14fcfc5914f4ef4d1d57853e036ca11e42396808556cb").into(), + hex!("90729c7ec4250613062a4ffbcba5829743ba7fd03a4e3407c2ae00b4513c21f3ebd68d10759ac4dfda5544e77b2ac306").into(), + hex!("840add692580be7aea866045826baa4a07804f8e3f56593a2af6fe317046d7d0fae181632f4009ae0d64dfacd4600c4a").into(), + hex!("b1be58941fe077aa8721b020f34d3ad94d1d5083244c276b7f3e6f4c918517f8c5c8d5c1376178bf27cb35ed76699e6f").into(), + hex!("97ba3e3be55d17113fb63abdc808d89fe205d75fc1ac808ebb78ea1b7570f7a014fae099cbc4b2a4b2ec884977405f80").into(), + hex!("a2c57bf9373db5382465ce924bf7dc4e62f406c187a39ab456a7387ed9231ce059d197f8701af9ce2d6cc772367ecfde").into(), + hex!("a62ba8b81b9f8d40fad7fa1d7e8e49ee547f170889b5d6a2be9e2ad2ab0b265b4197fbbfd3b17803a6e727d41cba83a1").into(), + hex!("a94559a51d438b194fea96975a4571a118105479fbb7a37abc7d676fc8b8d2ca30c66b25b7727dcd297384773ddca074").into(), + hex!("957f9be0f15d8eecf621eb0978267c3fc85607f31c501179d9c83864ed9a9e5d526aae278af3767632bf56a20eca62d1").into(), + hex!("b89928c19d1101486d4299c493db5bb72f56f8bc24b71bb54eedf84284452250427b179dddd7fcfc0f521fbba09d0c5e").into(), + hex!("97dda9cbf61015b296307e510295be258045a1de9de52117f0aa28de48e27ffd24ff711f9187936293babe89da226fa1").into(), + hex!("a66b4064c5b1ee95a35a93209c89206b352e0666abd1b5c95eed3c382210334fedad7d531b9939cdb2fc649c4369236c").into(), + hex!("89d85e413030dc45194b2676a1f2a76801920535ccd909277af1ac87fd9b0d16d94d8c62a421c9d95e7a053cc4c3e0bb").into(), + hex!("b8f0350e1ff988bf23846f2d64e40b35a370d1c5d1f9dca4021508205611f788fe5485e966ff2bb6fe8acc1540a2e751").into(), + hex!("aef9ed7229aaadb1ac4344e5b4d0eaf9b89b20d50d8ae8dae24294ec3c0f2f68dee3186dce35d46020d8d1b2626a29e3").into(), + hex!("b9362f34ead1b0cef1fa9b35b76b644a323ff71c48f375c27e22c6878cdf778b1a3125445cc8cffb6c8b9a3ed046c3d5").into(), + hex!("b69c578e2223f3727b7b5e99f3926eb7424869b356541feecda54a0882e4a009b182c358052d788c2a7e776768ce2b7f").into(), + hex!("a9ab536cca003598d88f76cd0d666b1738802c7452201f5d99ba4fd82b6d7da3c9ad8c4707445d6cb4b2c43de7ba06b8").into(), + hex!("a02648e465634db73fd49bbcdb23cb6feed9688eaf4c5678799734d49f2d4cec9cdddf598114896de961ebdc07436884").into(), + hex!("8253283df9690e171af958f2a3cc37e0b2cd67768f2362bd604ba5c5db8d3500c0d7d6cdee982165eaece63bd016f2c5").into(), + hex!("a06d8256d22ef3891a751716449f97d374e27bedbb9dbd0f1c9528307787e4d9ab9450002bead2922c31fd4ccab9abc9").into(), + hex!("a3bcf7d7c1f1c5a2bdde1e0f4cd3cc6dfa061156534aacd6318d8192c27218b6e34e734a118a282b0d5fdf639e704c21").into(), + hex!("b5577e876cb3de8196b485ae828362419c2f7f8ca9c8f38b1254059873fbe53b57110be543c864bbcf8b485f63925169").into(), + hex!("8410e1b1ab99cf1868fa4494dc75129f42a5e633448e64321cb379175cf6eb704ad6863e3a6475f9cd3cd3f1fcd4b49e").into(), + hex!("b6b21b346d709d4897da4c535556d599486878f5c574bca2823ff9d382fea2f45e8d03aa0fc5a5d623098f1b67c77a60").into(), + hex!("92951386b734171accd57b66afad7ddd0ffdebbd9da835e273b11f96639aefa6259a1387fe3947f9f7eacdcfcbb54b65").into(), + hex!("837cca28b3bb00034d619a3b667b06b66d7cd351ee2c161014b4c33692c705e0fca1352c1e5a7fe8ee00515f4b9c9658").into(), + hex!("95589319552ee815c1e1b053cc4452f9ba600142c37bd700feb3c27468c769e45e6307d7c0a3f366440cdb4d3b997d1c").into(), + hex!("87ed23d8d5fd6aa0922565367ab405e666996e7b918795da299c204cb6d1e51a9c6ff1760dc3fde555b0900e677a9b9a").into(), + hex!("88564f50eb215320ad93b979c617cafcda9122ea02f113029702df1f39116e00b35e0beb0c70bb7d7f2d9b4bf68a1419").into(), + hex!("adce6ad54e5d24a2da5a04751151034245184bd7e61998ddfed673fddbe4e3d069b580e833b3bd4509c30a2e6a81f528").into(), + hex!("80800ca4fa6d0f3ea555ac7d37e54e7776f640f76fe89cd7f172c74723cdb3324da01314c6f66c4fc404c393aa8c7841").into(), + hex!("a16f473cbc9070881b9dd63be9f99670ca571822a67520cba885b2636137731b440561f83e199713ecdd51d4dd542997").into(), + hex!("a08c0625cbaaaba847a63ab4a96206bbcc7bfeb659505d0b6b0e58d22f00aadec41f8cd62ceb116258b78063f26796ea").into(), + hex!("a358200c83ff15fe3fef7a1610bfacdf86d55452258e7f4701082f993c8bd5d234b4d86f96d444e96c01367503663886").into(), + hex!("97278525e5e590ab6cc4fa4a1bac4ed7164a65887b29e658bdb2146008b02907488565dcea09e761f6922118d9933ed3").into(), + hex!("b4e76e4cf2c711a7f3be5b404f076b9d2272e15ea7c61fa4b7a14c5608c352a92fe6674a25dc493a6bc9e864ff4b4a85").into(), + hex!("a4612d268cffd31d092892268e6b4f9f564f0036bfee4f200d270a61a8e5e239996d288d28d6f281d8446a88da56cb55").into(), + hex!("81a70c88fd7d99165b41ee12883ae529458758650fd13001c86f8fc6ce5f8f9b69ce3a133e310619692faa1580dd5d67").into(), + hex!("a87124cbaafc8ee5418639ff27795003a43ac18d07a60fb8a1c155c5fece0f8b25525166ba697e07a5f2d47af6cf0bec").into(), + hex!("90807f573a322aac9d1cd546100e49cb8c771f3d32c89da1890c1c819d90b1dc668c2374249a093c0863d5988c358d4d").into(), + hex!("90cb26b40d10f193da22975b0507f04de6cd9d002e33226852cb40d948d1814009a39332c75f1067e8192b0c9230ce63").into(), + hex!("aefbe25ad8bef226d434b970bda8a47bce8269ad69cf91e02e04208a74055ea79a3a7dbc988981b79bcb9298af467e62").into(), + hex!("b4932ab425f4abad270b32b6f66066cd01fd6f18cf8c84dde99d21c9c2676d58be4f9ea5ebbc454c9d9f921c0333cff5").into(), + hex!("ad19368c70cd241b1a90e5b46f34c44351d298e2fc9ee5906596b20f5aa9e592e878afe8924aea112be60c07648fef8c").into(), + hex!("8b2d2953b4603b73bfb1edda8313cf07f6d9d16b0272d90bc46816677b602b4a7e6fcb36c4f69335918f1ba4ec95dec3").into(), + hex!("ac64d362f730c790ee3f9311990d9ffa3b99d4952ea74f63d141360d2edb7fd0b70d94e5865504af3caa94b63e34ff4f").into(), + hex!("b71ad17d1cdf6be4b7f0bf7d3fca689d5a69a7426dbedfc137bb162142d26e079f49c99797316e2a577225d881e31a04").into(), + hex!("8dd692a01ecd819981ea31f39a5950bac2af0deafb35323358736bc59f8fc69f58c865ed9cfe239ee34d6f80bceb562b").into(), + hex!("b2ae1f2d871d48b6157aa9d74c24e3fa3f09d6c40f421de9c545de5ecdc44d44d6c4a7caff315694d8173974b92c6119").into(), + hex!("8c934a58d5d2c06221c10c14f08f17265e918c6f7f158f6989acca4b1bdf3db58952e5500f930af02ac3e6e44133669e").into(), + hex!("9466e7c328d12ad5439ac01c994825a94665091aa00e212a75c4ffd39f4473a62c160d63e568b534dd7d5577ad266544").into(), + hex!("8e35a84ca6f167c75f98728000b5df8d9c5611080d2dda8c49f8d4afd2196da349cda481fdad8a0e7dad1cebf4b82446").into(), + hex!("8ec436a9690744a1c6a31fa796bfc8f054ea5efb1c8d6a70e9094dbdc32bc199a7c1b29216d706616029525883a9e342").into(), + hex!("87cadc50459a643648f5995ff7ac751c24454040f788e218c4894854ac658fc64c2ea0a8cae4973056ea11f7bb0e5a26").into(), + hex!("aa5a2d8278dffefc43d598186f1119bf1a6d2343143f4874aee24d3869fd4b58401e8bb220f2a228416c89c1f5344af4").into(), + hex!("a36f48c232cba1daae013418421fac6278bca09ee3816eb46cc4059254f1e7672dcecd6eebc9bc0896e96cfa0d8b485b").into(), + hex!("937f8e28abdb3859575cff574517975b96ad41dddd4efb23af86429b01ecbfea553be6cce336d170116752118368e05b").into(), + hex!("aaeb4e5c7f67ee23b1976b2e86f2897ced033e79012532599d130cdbe29d8cd551d9451794741d2ede8564af9070f07c").into(), + hex!("884d9608b7556dbddd0ed13bbe04a5bd9f2bda0bd090d47550f7362bd769a3b3dfa890191c64e44378792d97ee4df5f3").into(), + hex!("a8276ce24aabe42cab32ba7d77c2ef2ca84b3a3e3d750f8d0385f9027f0e009365c78196638dadde186bf44b780fff53").into(), + hex!("9148c5c797b4a6438360072c463008df8b17978335f36d4972b4f826861e8a175265a9eb00c56f47d3892783dcbd080d").into(), + hex!("a7e5100f51c611f010b2601d340ad7aa65bab89c8aeecb181e76185f3a739892f8b172e5cd2c108d5aed8f5cc91cb6e7").into(), + hex!("87c46e67d6643c07e0e318dcb22032753c624e646e4871be4098005100b306f3cfb25b6d81c718e83b42b92841c577d3").into(), + hex!("8bf429c735133cb05edd9b8943b5d4040e83191553452e69b3a1fd06edf2a9eefe8e280cdda811795e1da33e41e58345").into(), + hex!("800ce4d6c257a365e5d8e1bcde67a38c04ff723e38b0926af8b9fc352545317beb40621497aaac8d0e5da291c0208630").into(), + hex!("a5c795afa0ce78cbc11de13c8f58d0bd9ca5b8665d5d8d28513a0d8666f9336b0dc3295557801ba253983fc99f45ce3c").into(), + hex!("99e3e4a8e16ed2ea44aae56b537ca9b159d57e987b0511b6d34767744b04700ff287d431dcc6c67d7cba5748b3580899").into(), + hex!("ac88e78183973e9730ff0c88dd62eb23e2794067ac2574a1c8deed85a4aa6229ee620668dd16084c8f168b2555f04cb9").into(), + hex!("a9c4fa68984527577c6da60dfff110163f35ab7393b852c053d73485155fa1536d9701f660a08b160bf49a647ce3cf92").into(), + hex!("902c3138ff660230158ff69c33911cbe958d29178a54cbd13480addd948b19b0b97f6b235df2beeadb7f7e1803b8cbad").into(), + hex!("a6169eabbed09e08a0d290f9075c62ca4b14e1f7adc53545abae49858b3d5d7fd6cf8d8ba2ee1bf13f36f79ee4092935").into(), + hex!("85a0d7387b1db5635f17899bbadddc0fe6b11976385e12ea4272a8f61d81004406604c8f04f10ce928fb6b547d3bc654").into(), + hex!("a39e5f2112944a7ee31fdccaca927e4f4bbefed1274a134e8a038307820c1d14a6260e25ca5a3af0589f8faa8f516c5c").into(), + hex!("b5c86d0482a417bc94b42f8478de06918b36c5f45d0695275da2a3e773088268cc127ac1380f912307b6455dd0b16d07").into(), + hex!("b8b5e32afc4cf0fb92251b422ef9b757130455150c49ce51f6d6d95d895dafa25649363660608bbe7507d787db9d643c").into(), + hex!("b11f3856f691d84d49fdbeb4f33c45c37dd401a2bb71bbf946f3ddc53a57ce5c4da583f76cf4467d43034a61e1dc88fe").into(), + hex!("a56d1de276b2d0a4482e17cd358455aa19a47bd25c7fc97af8457ebc37781358cbf8a7eec9427881550a8db1bbf51771").into(), + hex!("9508c85488f15d2772522dd1e991f41da1f3af7e3527e098d5408ea96f11f4150415ac68ba0a3031e95528664b261de3").into(), + hex!("a28e129c656bc44d0b6892103b7d7c0d15ef1f1ce583e90e2c644c3016ab348ae26a662652c953a3c447272e52b007a5").into(), + hex!("a68dcb67d0cb585cf22f753602c46c7ccffff246b106db9c56248ecc5e94a036009bde23864879af62a4ede81d040c56").into(), + hex!("b9725383c63b2a522f4d976ad6be14a35b9e80145e058baa622238500f1a2ffd6869cde87fdb984654b2e57615bde3ee").into(), + hex!("90248e4cf47ec8b00ee874ac98227759a3f7ce4819e44176dd9b1acaa6270d144d3d707a35e0cbdd7ae23b15537a20e2").into(), + hex!("81327abb95401fc2fe0b1c2d27d7d9972811a63e12be0173fe8311678ff1fb097d73fa32cb85f13935e1a4b7fc59113a").into(), + hex!("a31bd2dfc9ddfa9ac748968b532a41a26007b23cda258fdacb3b0abb751cd7ce2eccecab2d5e3781fedfe0d8da027481").into(), + hex!("809b28c11c1abbf53f2dc005d30403937d9826960b24f4de857a9470067add08d49345586d7e58bb1107d232b3b47bbf").into(), + hex!("b0597958b75e64fe5c6e56ef803284b3b7420fd537e5625c75af3aef814a87a5ff01951261c2c7b27e374466658711d8").into(), + hex!("ad8fdb91216db4fa779774324162fd5bd7ff9a999030c42d9f90248bc328221aae315ef8617c9ba623091adaa0556074").into(), + hex!("8668991c8bffca4cbfc06f3429961c595d85803a262105907361758d677920796be70d2cf820f0b1caaef708d924e676").into(), + hex!("ab22ff4c2ec9e683d2d1ecf57f7af9b3aab1cd289e22b1b66f37dc3779e83e35211f7d4919dc3ef0babf876d491e0bff").into(), + hex!("b8696c811af5d3360951d7bcc9ba4e82e17a125501e91ff74b915de28a8cc217c6fb05d90985fea7ee431e519e494d9e").into(), + hex!("845c0bc4769c428fb30e63c8e4631f22e69f934b0e6089431ddda2c232172a4980cdb6f650563992667a0790f1a3870d").into(), + hex!("b4113cfe79b6b198b517ab5d14900a7189ba78b7ef85d04551e18fe1ce6a69564377fb86a0e11627cb794d1f416fbeb1").into(), + hex!("aa6848837b26df24b04198b0b09b77d7b59d26dd3b20f7843352f2436c046e9975af2985e64fbd6267d897e728a9e721").into(), + hex!("861456839cb76a9490dbe055559e3dfe3bcdc41646aa656d8aaabeb4c0e39a1b370a4f0107b78f900614e3fa09b46bb5").into(), + hex!("ad6a8ca9a21b7874f8b115024a7f079f5a1dac3b165267b33a59d1c8de2065bce4552369c930e9a949d0b07110a71452").into(), + hex!("aa83179de1682892257c57774844b040299789430a262c8b44dcbd81f8062deaa731ff4bebab1a815d3148ec719f4cb0").into(), + hex!("895549691861582abd102fc19a4ed269b335010aeef45ae9ae6b0d9c6d26f26c31371086ddeda626e76f7f07dc622fc6").into(), + hex!("a94e590989e81d269b5246f22a9c97b604af58352c70100f8a20454fecf36d19e601dc1201342841ab231dcefc461f2a").into(), + hex!("82541b5b7a392456d1936373396012b086c370e6dde41f6d4409d35373d1586d3c7119f6f0d1e38bce9cae67c97fcdd8").into(), + hex!("8b89fecfe83adce613e75a52e785ffc90847c09ed779ebef4d29048bbac04b58e27311461c25d4e68cc0e6778228b037").into(), + hex!("b3eeb09bc9ace8a62b71747711bbfa308b746c86ca87297cf2a8e768765a86ed1add2e1acd2925cf05537dffd4dbec50").into(), + hex!("a5364dc8221a37d73250f8498d9b6e163babfcb01e1fdef8ae570538e128b562a0ed8b353235159c3781ada8506ada33").into(), + hex!("ad0d54f0f67d0231ca0ab54ae881386b055c169fd7415c12e511e5ddc5d4b1beba0e1a157211996c7ab61f6e94cacd64").into(), + hex!("b4b978f7f9b084c089923e73a593a24d5aa22600c879eb03645a19ffe8b36cb8ae040378a378ebcb4a5b73331a2064e5").into(), + hex!("b3d79038de0c62c667ab4213524679934b33de22111626c258bf8fd8e16134425549dc7e3dee15239c32bcf122f5bbcc").into(), + hex!("af7a243eb665d9b2c37033363b252c42bc2c202c266ee125b5676b6f9f94ee5d46d3e2ca217f107719051de511625dfd").into(), + hex!("9726a0d607674fbde3fa5c346806c4083e092921c303ec86bf5a16e4b760d031a24585ab407b9b1b0692d12276912961").into(), + hex!("85a8eb7ff82937e2ccddf2f049af9d871c653de4d71ab36b198bbc7bfef2e32eb3f22462dd01affbce13813332193262").into(), + hex!("a8889fa7291017a3363a5e14cee8cb24c273be4aeb74c4b0e1e375f70060dbc9ba296b291e154eaa56703b8e3f7e85a3").into(), + hex!("a789cbc52c5468bf404fc1b19651ef6a805d96ab8a8991407e149a68d10d1f67d1d4b380c08f8be1faea8d1b32bb8c1a").into(), + hex!("9535392a86b73ac66ff8ac1ee0549d266a9e25e1db542b077d136d26710282529f34c43dd94ee77aa97c647e0e05356a").into(), + hex!("a1ae9d5fd0ca16021e0a33fa116eb5b94991aae02efc6f116e073def47253fe2d1f2438275f09f204cec0610ad523ff3").into(), + hex!("b5c6c5b37943e99bed4e63c9215bea95fc365a576a9f8f0b9da8d5ceb5f9da881a273f5692b0913a3bb922772923c07e").into(), + hex!("b3b0144fb027e0c7f1a0c4c703cc5e1c09422be38de4e10010c28bfac358a6c834df6794e5007ecc4c8d866ffb9a8725").into(), + hex!("aaea409068fd2cb94a7c6fe031ed47c7c5b366a33905d12a107799aea57a052b9bfbb1c4f88b1b3775d5bef7d6204b73").into(), + hex!("a10cea5af8405d807b66ad492a1aab8618324ec3d9d01181ce29512e38f03bfaf556251dc490b3d1e80576bbecb27dbb").into(), + hex!("b700d4046b0be98b3cdfb8a2eeee52df68bcc1c5550d1c17205664b0d896028bddaf5dd38482645e76f643ad9d2ea9ae").into(), + hex!("ac9163d5f57a2d1def901e74c1b07f4d14b1e9a5c362d3b082c45389ae8add929a1dfb0baf14f64790f86cddbdcaa32d").into(), + hex!("8e3b79b19d49d77844e3401c01984af7211268bdf6609919c9867a83cbbea21870ff108143795a85fbdb2c15a2d127f1").into(), + hex!("b9db73eeeafbeee4edc52c1fcac7de6d8acd22a8d3d1c4cf760a81dfb6cc91ee454385044301fb2253588f23f3a24079").into(), + hex!("b268631698668059d8eb44d50d532c9d8c49953ea2029d6a2d0eaf69713afc85c42d989cdd3bc0a479ad77cbad24fc0a").into(), + hex!("95f74950a24d82ba9a9df5d839d17d7ff830a5dff38663630efad5abe9c58724802d5bef891ca2b3b81923b55a94c6f4").into(), + hex!("969297c612c35347019f5bc80d2887a3c95c8ffbb011f5cefac63a1f51e48dc84d961aed56afc353791589a45c871cfe").into(), + hex!("98743e9521e5fb6a643c086a00423fea51b8ad2e55bbeadf791ede16eae64f9fa45c41101c6cbe4a8e96c692fc57c030").into(), + hex!("9374001ac3a8673e337b078da1b72090bf2450a5f53f6a600f4cd43ea4b5fe86a73d14bd0103b110f23e417dcb4c2e47").into(), + hex!("a91bd42a87f28a6fed7fac68b5306e5382a93fde2bc9aa5c48b747ab774f9c557343cafb46dcd4e93df5aa95ed832410").into(), + hex!("8fcdec0a825737ee2c61401014287079e729a8b8e49337e99b34c25dd9da570a1fefc532a0cf6ce1bec80be2d9ff46e8").into(), + hex!("8197cd84016cb41e4287d29b3a0fe8d221868e5993aef8c15c1578e038f9c43e93bc26dfc67fbef919322178223d0b9e").into(), + hex!("a4607e2b6ff802a4e497c53b206972d35520c78f14f7d4d78514333e90b2a8852603bf223f1c9eee3793008f87cd8fc3").into(), + hex!("a72b6185e451b3be2c140fb3f48225927e7c052805682e3de9b2c826997419084bf1e2034aef0c5d364b0004b3b7807c").into(), + hex!("aa99a2cd46884d2ecae4257c1db8fe1ef6b0cc1a0c25dcefb53540ae91ea7bc8955b8acfc6d96ef47fc3a5733f2f28e0").into(), + hex!("878ea42dbda59fb6f839f0b65eec295f2d543541f4fd576a60d104b94b49b1a1ac6e9a15ed3274e6305de3f35ce1e3a1").into(), + hex!("ab2f77f6036200b4ffd3192b8d06dfdae4eaed4e1105b27e64ae2e120c909095e59f4dbbc44e818afdffc7f9ea1f42be").into(), + hex!("a37e3fd9b1337734cdaf34111762403db11b1aa0324937a17e053242a9099b3db0d396b485ca996f91117c64623915bd").into(), + hex!("97c65c28a6a81690d4d6ff17d5cd3be0e15ab9cafe66e6f7b8da66ead8beec561c3abbc79af52a8986d576363f14cd27").into(), + hex!("ae138b3020373ca238d5dd780862fa28a2c3e05903366cdc0fd7a142db3d18eda63b8d049abed37f1fcb25f6cdedbd67").into(), + hex!("a800bf90b4e7aa7b5b00fbe6b5f45067e0d7ef2b1ed9a626211e07b66b12ddaf90ed05d369f8da13ecfd8cb499f192a1").into(), + hex!("96565fc4ef721f754b6f53db97d32ef5e5c3cc0f55928eba3eb341f4962b815381178763ef05c21c1247124d592b4449").into(), + hex!("b4896f9e2f88c990fab764a4e006f3f39ba6bdd0e1c75fc8dab2973544e052ce63f8c61a6ab213c85f6799d988a6fd61").into(), + hex!("87aa22b60a13edcede78e629d54714436a8d7d1e6e232d4df6047213b4a91e61e5feb38216e0ebb209f1dd8d7e4f5f9d").into(), + hex!("ac4d5e8bb39a2564f3bff053e2058f261209cf14e65f7dc540070d40dad7ec4f5fa81efe6274aeab8691b85a774307c5").into(), + hex!("8b13673c306988222f09ad896a75a6232ef3bfd2f6c37c2d751668466d45511542fe982ca5720c6518891830674e2cfd").into(), + hex!("afeaafa07eaf14f248d2a34e4f86064c5bccd92d3a6c0ace1ae827dd59111e9b3cf2722a270234eb5aa633c12e140354").into(), + hex!("aa31119422a52a7a5ba90f4e0b5676434b4f05289ea3143e8a2162e32b1e19b582a586da796ad9876d0991274f3363a8").into(), + hex!("82c78ac9f2018540eea744c003a76cd7bc8984103e941c680a4a833a7c81defdd28165256890d534aaca2991dfd856b7").into(), + hex!("b4a99846af0ffe14d0f820a574d42571e0186cd078840ebdf0684c806c08eac1d6afb2f7f9f9dbfee19c2ea12af5307a").into(), + hex!("93cd10366714618a7e8d4edf3c93a9bd30a280f765cb93071a279eb5bc4fe8dcff8d91a1efe8fe697d1cb5e760a07fd0").into(), + hex!("b17dd2a8817471efd91b60ee31bb5f7c2848bb40251dafc0e2250cdeec3202cbfc7a8af6d7f5c3300a53a73bb4a11b54").into(), + hex!("b396d11ed53f287ecab591707ec5ecd0c5d34a67854783dbf263fe2614c707a2226231fd8dbd6bb1ca0760f06f2fe7d9").into(), + hex!("9982a0fbdde6ad91f35e64de34183e4e7f7df6cf422912f3dde0cd16394f0f172dc32c4f68f2a09647fed32894471fb6").into(), + hex!("ac5889086fbfd2f2570191b5d92659fd17283509477f442dae81a8491b8641a5f63e275659e6592ebd0e62a8c7a9bdb2").into(), + hex!("8fd6151866cc75461b69b4685ac4efb5a21c10d5b3291617bee4ff300d90fa2290319967faa2b7189c090d3b60994fbf").into(), + hex!("adb4459e4e6410606a74742d6e48f7b84f30ecc8e849b6af9b4b617236dedf1707ec388a97523f18ec7e047743fa7151").into(), + hex!("a9fd9329ea3b6fb77dc577e2c891eb66c61a575ab75a66dcd897f1127e8bd9ad8d3eb9059c7f6a8b08199913b83e5ba7").into(), + hex!("b94cfafbd3ef7673023ea37996084acb3109ffbccd210184aaf8ce8d29bf36390bdbbf2870b0970e66831d28e90b248b").into(), + hex!("922404dd76801113ba23df87ba689e5cb609c94930370576d0d16e99a489de0fb079fb273159b8b07fc58bfe4f787c70").into(), + hex!("8c6005451c02b18458c3f069a521aafb44fab40f4260a60da6b9bb5f920e91990a868aafa4b6b071a899d3bc51fac72e").into(), + hex!("b0cf68badbb39413649b3171281ebfbabbcda1123549a4c6c09dbd4dc0427b51d555056c79f38840c52cf920dfa2c8d5").into(), + hex!("a08a09c8dac1f7bbbff2b7ea96899b64fed53e971569171224e675399467daea6870e48fddcf47179d3c7eab4cfde3ad").into(), + hex!("881c89cfce577898ad367abc2cf5989c647bf8904be5e061e632256b3750b0aedaf4d30c17f994358aecd069b62cff09").into(), + hex!("81674253d6664d414f667b10f6e8edc32af0a67b2b99d3e4657991f8a8b1dbf260447871c1c680d92f99abdf3da2d035").into(), + hex!("92e34adb15141ea58b2b481f9dd69e2584f512531bab13779fe99e18d48b6ab039bb28d9f444d517298e11464ebde4da").into(), + hex!("81ee1554da84a0a487e52c57528b69cd79f1b6530418354095ab976207e368379ae2fe0a4a340d209f13ac9783cd6d5f").into(), + hex!("839c0316ca07242ab52b76f55049f2da3e83f021591b0bba295677d80d4b407f88b0d207f3ecbe7eb85f19eba5d152c2").into(), + hex!("88b0ad748a61db5eb96016d9bf16bb05ffc4cf5ef56569397e9395f454fc1f731b48dcd8b3368163c36a3fb41577286f").into(), + hex!("b94fac438903b1e6cd11135b8fd35b91b61a0354addf8ead5cae4fc853ebb5be68bfb9901d8b4d3bdf58224675b6d675").into(), + hex!("a015eb1a7e1b814625b13c1b1bca7f738e80be5972f3a3a27cd9b21b033f16e4b5934bab69e38a6edb8d03e84e8725ef").into(), + hex!("83ef4eb739353f7679b27d3679551b2a0eb1bd4d372def5c0e8e5922a9ce7138dae4b62d5c147e6439a551d3ebb1e1cd").into(), + hex!("95907a3b288f3d4199434590340293881b94322e82f7fe9c186da3fdad7881b9a92cdcc5fc29d4124b1d05886bc9ec2c").into(), + hex!("868078f74e35b72a894d72f93d45333e423b1aec6d7e3cd7550254ed6a156957d4c5919489a84986f6134be8334bdf4e").into(), + hex!("8f089ffa10d8ff27470b8f6fcff49a69bd06ef3f88faee54a6bc8ea0dca6bb799199bdcd9a9e7686c43302cbadb584a0").into(), + hex!("980f4614de867eed7571cb3100f9566542b90d2b4110806dbad64249944cf3e4e484d03543107fdff0e91634d5193530").into(), + hex!("abab8578ecc6096bf063da248b376bd9e76a8b9364000a98c85813ada835017ffe693f908aa789cf09ca3020f3bbb9b8").into(), + hex!("a2beaf5eb12232e44bd251aaef3e007989794ad1df7a5f41ce1e6d862ff0607db47cacd4b04d684dc22d3640f6b8aa16").into(), + hex!("8f57e3d8d68264b5a07c9fc2399db0dfdd079abac46e1023373c22377612d3b005053e0df490d2435110c9fc2791b8ec").into(), + hex!("af7d2c45de945cb09adeaa1898fe0b026b5a5c5de2ac21f3b2c298d82fe4ae253d859c47f71def164a77b542905bfc73").into(), + hex!("93b026c1b083d82b3bd52d0004985f374acc81f754f7dd4e563a9ca5b20780f7872925a03e48d2154c526723b6d3fa88").into(), + hex!("b8a11c00250f9e148086818aad4dda9d69480b378ef5ca9e2fe85dfbb709d2a919067d9abd2eafdb5202cd334081b5a2").into(), + hex!("a7026b1a57d9d64f2526bc42c771cacf43a718725c2d0dd889b1af12481e3112bb5357e6434b3e83754b067bd5d533f8").into(), + hex!("84771640879d9628fea0ae1106a45bb8a383ca0a9a110093355395968b4d5af9e4a34201024a187d3a31b78a839af6ea").into(), + hex!("b99e5eda7144057e439ae752c2d879345ebba19e83c35785743d6fc1646069b0258ebb1ef62fdd43493498ed08a8de15").into(), + hex!("b2a17e5253f695a61697469df96f3182a62faf0b5d10c150f833543e7b3f5979506a068ddaebf310fe86efaf3adf13e5").into(), + hex!("8ce51f0a8ffbcfdddead1a94f45a42ec4f9e8770c0ca33b58207b8db06f3004c05e88f5b31896e1b7d3c79ff571426b7").into(), + hex!("a775ae2c3c59968d0add4c446c5f20e92f92eebb704016ea45a47c5496945b7d0935b4d8ea315990e6f58ec33d00aa9c").into(), + hex!("93bac2d2038c87f111c8000e721e4637b04ff8c3b7b1e8a9f02cae40e465a1b2928aa226af73ed643a4c21f3fec436f2").into(), + hex!("ae050b3f4784f2c12c902fd1881f6bb940806c0a9d7cceeeafd194dcd49cfa48acb10a09c55ea47b508d5d16702800db").into(), + hex!("a8c6680208271473433781cafde59a4aca2496d58c85f48ebaf447a0c175e784c4a1351d94b5d1a64c78bcf8c84f8f2e").into(), + hex!("8f9f71c20844682e17bfc30d745ee2848bd8782b05572ea64f9b9bdb2c24b3d1953bae317d79e267982c42f3f3aa60f9").into(), + hex!("abc4ec57e1625bcf3c10754a07a2047d359e503b05e2524175b48d5844756ea21f626a65a08f4f7b32cfb0646cc68fc8").into(), + hex!("abaccbb39d4fc4c252997503604764731889f5bd66382c90477df2f2d413f86892f7efdbee0e3a908b3cd69321d3db78").into(), + hex!("906a87855cc2b3765774d3e8c7daa62630fa7ba761ee2a0bfc5594380dc1d9b62740d1190fb882ffaf17c0d869356261").into(), + hex!("afd0ed291ba237f8b626698e3c54b8a84341628a524b897e53aad5231aa01977990c55215a677e9adf4319a98e81bef2").into(), + hex!("89512dacd42d13f5618f1979d9afd93c06247de2e1e9ab6625b5bc9efe24439189a564ea220c4ce2795f059064f5f5d5").into(), + hex!("90238fe2ab6b623ecc990ef8d2849d26229db5f3c8587cf06501e459c7742d81653c7dee45da82f5946e041f129a8df3").into(), + hex!("a420b197f4863782fbd676bdf1808ff1c6f49a506d525952c575c10a32cf63afef22f977d4b7d6258334c498f36e7f95").into(), + hex!("b7d8fe926876d1d01529eb6e30a78db47b6693af3171b2014bd18180066609cca9036e35953ebad7355362fa671d903d").into(), + hex!("a4b7dc0ae7e7d8c8eb65081427f5d41a122bcad56456dbcf4a4e83e188af1e3d80dc7f450766b8e87ed8b28ca6c5c479").into(), + hex!("8d3e1060196b4e8e827052c2ed782aa554540f21690b67d39db46fcf088d10f67f2b6e0d98689e7497e8029bc8f355bc").into(), + hex!("861657c4e2a48891939b49706791a03f63d092643cb491adfefb3cfa7d86ecacccaf86e4a1382444e466a61e29a12bf4").into(), + hex!("92f1c5b122943341854ab7d5c4603e083019344e2252da5664c676ffdd564345d7e28e2a5692dcaadc4371a95ea2a142").into(), + hex!("86100ccc2ee10dedee28a3ffa0bbaccc1ecb19d36a99e6deef1f2373c1c1c3dcb8b8fbec5809304d883c5d60f617d875").into(), + hex!("97c06ca658fe3ec45a6573bde07b3a95d80cff213c9f4eb8933c8dbaf147262291a5ebd55b0e58a4686c4971cdc45671").into(), + hex!("b13e9055709868f723014736b1fde59c05899bbf2aa6d4591d724c35c15ebe6d215e37fcb1e7b8585abab0b2ba309c00").into(), + hex!("8ce0532b968d8d770eb611131978a253e7940ceb627b7364b3a4dd517f26c31bee51c134a5b1297362f6f9b6d714ef33").into(), + hex!("92edce89bea01fdb25da5d0f903de2fee626681cec3db418a9161286a2e95bbb90ef2ccd8dad434b51776f85d982700a").into(), + hex!("aefc7dea295547984ab42a64f2f59ba2ae8220712778a71530623351a44372ddd1018cd8d4951934ae0fa39653ad6aae").into(), + hex!("ab297f28266bd5ed104c1b55088f114592e80aa098a0865e5543e12c6392b0f94b5cd4e0b6f375d1a0d0809d80c1fca0").into(), + ], + aggregate_pubkey: hex!("81a5778df2e724c98b4ef79ff33b9c5fa3ea265de81d49de5c4ab3be2165d32fe15c59c982f758c3b9c522ca5e659fce").into(), + }, + current_sync_committee_branch: vec![ + hex!("1da42c54eb912009030c084b700d2e0031c0a0e5759b0cc593601b99764a725c").into(), + hex!("0c960bd59f4a61104153da676eb38ebae603e9cbb55b0f6677cc1df0d535d60e").into(), + hex!("1682c67e0936255e351f8be6ccbdf048db06a80749aa900bd4265af1c366bd52").into(), + hex!("d95bb6af7d6be07e5d7d27337ab9b54d5bf725ac37671b9483434d22d724bb92").into(), + hex!("3abb1af4e9c3acb052119a42c2d4222d99e8b5b958c520a03526a8177b921cf5").into(), + ], + validators_root: hex!("043db0d9a83813551ee2f33450d23797757d430911a9320530ad8a0eabc43efb").into(), + block_roots_root: hex!("ed6ca045637c1c7dd54fbef547b8b1aa3f5b9fa8f0bfa5df26142a0c4237e617").into(), + block_roots_branch: vec![ + hex!("620abd1a8757614facfd9d2fa43795281bccd4055bc9b12e5cb3742a16a9f9cb").into(), + hex!("14c793be544d5fe1993a1b25d39f4b69e832e914c3d470745276a25d982df4f5").into(), + hex!("46aea5f0a7d66cffbd55e676b915be97cbf3dc6281146cdf4952047214ff74bd").into(), + hex!("0ccefa47e43d03e26def9fa07bacd91a5a2a20c6c5dec2ea090f71f91ac99282").into(), + hex!("f03f3d7a52241ab959560beb9b748a8ab93e2b7221c8070561a12a5fba8d4434").into(), + ], + }) +} + +pub fn make_sync_committee_update() -> Box { + Box::new(Update { + attested_header: BeaconHeader { + slot: 5808573, + proposer_index: 430716, + parent_root: hex!("0be3932fbc9ebdf3220e2195d87653f283d9f999946e53f6a9f6172b6f532779").into(), + state_root: hex!("cdfacee5c92a351843fdc4591ccf16c4f040d0276add8421f08dbd5c71035a1f").into(), + body_root: hex!("3d248ca71ec98250b8dcdeab1207806406f1434c11874655af56925da6bd88da").into(), + }, + sync_aggregate: SyncAggregate{ + sync_committee_bits: hex!("ffabbff6fcdefbebaefffff9e37dfffebff57f7bffe3efbdfef1f7f987751dd176f3b3ff7bfa3fedff5fdf7f7afff7ff777bef5f9f7fe75f97fffe7dfdfffbdf"), + sync_committee_signature: hex!("b405701a0227b7c40805504a66069fb5ef99cdd84f1e295c9b4a4eccbe4d93718740efa9f8eca62f563dbc73021c00e914a69b00a9ebaa906e78f26c1cb8088af916096801c787f18f493b1479fd43f1f5b28d15af827a1e580713fa82bfa1d7").into(), + }, + signature_slot: 5808575, + next_sync_committee_update: Some(NextSyncCommitteeUpdate { + next_sync_committee: SyncCommittee { + pubkeys: [ + hex!("8e9fbd36b3cbaaefc176cf46336592e2b59a51e3035d095da9e1df9d2fb5aac5e47ad05d27784ca675442abb875a6559").into(), + hex!("b4c6164c5ea19f3da5a76a2435db598bb012ea34cc8fb6d749f1588463e5c39d29cb3d45ceae0543372246549b17deaa").into(), + hex!("a89c780da1a713e86b149d63312aa840e865dd926565f0ee9d9627d363eadadf5a4bd5f79d8039f2e2927ed7fa60209f").into(), + hex!("aeff2bd9faa0201abd7dd681ff97888c0ae71d84e71590f424facb2e37b5759f07d338dcbb695ad6ffd08d903c0f92ec").into(), + hex!("b89cfb61a59cdcb61e9f3ed76cb5cf13c907bdf6b2622e16d140743c5021d45cb6d91ee94331130b876efd984575948e").into(), + hex!("a2c889cc5195532bcb5c83d035cd6881b889ffb9d0536843d3fb6f7b1c093a927162add5ab6ca5f06e7c3ec4ca4522e5").into(), + hex!("b5966a6d047ef679a9613114149530facbfc7b4bee6ab23a60853f45de034435b624ad0126ac6c7d6a12b1be93177e0d").into(), + hex!("99249360fc064fc2778b37b107d834eecd5eae29e8f10a45d946f11fe358db065242482935224226e83f518fa6916962").into(), + hex!("8c3548aa879d974c5542e59ea43bb34db91f92c7d21eca5e3e4fb9d01364c21e8e2341eeaba1d22da67f1f455644afe6").into(), + hex!("828b95590a46cdc4756fc1a7b7d7c4031637494938521b74a3740a970ff532b88ffcb5333197088f6700925dcab5c42a").into(), + hex!("ae2e6ae80c16831c02170dd273ff6808e4379a8baf00e707d497eec6cb50b5a1f132eddf053f243765a54695ca35c443").into(), + hex!("a7bfac686f7b307d794fb1740a05cb1a6ef14b06150e64353a0b6544e7b0c5e3a7c8985d257c5bd74e411c0cc8424479").into(), + hex!("b3671a59e2d425ef0ed109932402ff7dfeec72cee39c1840cade48a13f3ff36bd0f9b3931d0651fddd214a2dcaf7bf89").into(), + hex!("b56c962ab20fae058c256e37ba4091d7a9e5d3c602e3eaa2d90df65fd5a11ab68f245a5a6e53262335c6dd4f3e0e51f6").into(), + hex!("a8be83de4b06ebd8c14bce332a1175a4c651fdddd4a58ec85bf4c68cbce83a50dfff8c26070d104556883af678693076").into(), + hex!("b4b33b7013c6af21797478b14b1dc81fb7c5661fa2471d8cb4eeaa62a62f795aa9be2cfb65ff6b957cb7f89487a587af").into(), + hex!("991a42351791da02bf6c1a9ca8248901657d6f2a95225e4827ac3171b5247cd31f9465c9ab1c2b78e268c82b61db1f36").into(), + hex!("88a38e70998cbed82ae7f9c192e06df8abdd35278efb25a1112246d46a3d3f0bddee41f5c492949f15e651ed7fdd6a15").into(), + hex!("87dcb7f13c6af7f7d102c643db0406ac7fb06fbe1fc647f436ea839e75561b27beabdd6133da332383bf22ed4f83fb9f").into(), + hex!("a441e2c51448b6b2ddb38dab213d9ae3d1fe70e91e1feb0f98590b5fb6f3c18ec0adccc221fc44ba027511c52e5fa626").into(), + hex!("ae5f4dc4266016943cbe1db6538619c430639a1179d246cb820adf8edcbe55e9f79471134d06365b0d459b280aa2282c").into(), + hex!("8165bbc59ef3b15f29379a7ef90d8b3610590c662207ea7c49267f36b5b62af3d48008d182ec3384ca7c1063bd25b284").into(), + hex!("8cdc4e6a238afc55406920620fa90f696403afc1797562b424c26e679096950e7f42b8d8327ab0d7573608056364fa4c").into(), + hex!("a1f4c958f7bd1182cd4ef88561eb534c9ea3563d149a276fc256645be0b2e86a3d642ac17261696ada39a04a866973fc").into(), + hex!("b19e5ca1ef1d4fbac5633cd29e9510116bafb3229749e0e4444caf9819fabf9c4c805b5966c02446c1eb0029b3c1293a").into(), + hex!("a4682af7e19328a145a1a5c43ad3e14648b90f664c6139eabe1a13da9b763ef23947dc3ea2054af7d0b7018f7498df51").into(), + hex!("999ae1a8f2e0cad6a0378e7e0a67c8a6ef4a824043b34e67074d05ceee93cb7b49d3c3acc961f1aab69b45f89d12180f").into(), + hex!("94a9f1686e91ec733799b569e3b0313db64f3a219b48482e2a56c21016e800d4373c2f8b876a923e0753a464e5fe4684").into(), + hex!("b4936942d807ad09cbaead9f56ca124617fd1fda2ff5cd94fffbbdf5ff2b295867acd1e41599928ae455d597ea45cfb0").into(), + hex!("a74166db86410c9722e657cdd0f4d1da86a4f83168e2bd9ac71850bbfd9471e1ed88a6476b75ae5ddb42afc62a9ac121").into(), + hex!("a97909c10241e046dc707ff9d822c385dd68be297d6b54c84fbdc18f5a1dbb3350e93496698d6304ad1d6bfd34b4a041").into(), + hex!("b6d9b775129b048a6c577656ac2de15135c2bf1a3c7c8140ce20a990274e42d7b602ebe932855c1d03373797ea0bec63").into(), + hex!("b59f975937cfc8eb510c1da0a7fff1960c46b9235550cd6decb514805439f08b8f18d88ae0373bbf50b028a08612d552").into(), + hex!("8af01facbaefb24cc4c11e13c64445600b1d716be66908964ef79e12c0eded04e1d23295444818f024e55df2aa911034").into(), + hex!("b79607bbe31f159b208a0d1b2f95cc5373631908292126b8b75fc44b22a8bcc9550de7b51ada33e5596d0f17d5f4e48a").into(), + hex!("a1a474a66940bbf6e601b6c6e63103de2d5eb76d7ad3d39dbd74149658a14e31143a9723327a73bf72eaa75dea42c3c8").into(), + hex!("ada18b62cf80098f36921cb0c2f85200fa362721c4673546f8554e2f5fc8639f2ffb2cac68e888af7ead8c660b0db13a").into(), + hex!("9198582e8aebc174dd168c6cf20836a21cbb6baeffacf9f933850d8e0fe0619ac1ebb99fa6fe902c75927531c108ee5f").into(), + hex!("b8a44b23d29cc5ae1f00d5384fd06f31b73ef1a7ffe334b59db668c924aef2cdf60c3070a44a12b52a14ba185198035f").into(), + hex!("a688064e0b3fb3baca87d711b29419a02c06e6a1dd764af31574dd84fe870c8ef614d4c2d42fc9508711dc05fe373776").into(), + hex!("b86c167a1c6738bfef1feb7eef8f553898f69a933876acf675596fc2e39f0a8c83ac37df69dffb669fcba4e3f1caab92").into(), + hex!("a32d52f3e9acea45dfe9ce6c577dea8200e68d6ca39eab5d6fd24c508d2028f533b8b04f1a4fca7965315ee5dc5e2809").into(), + hex!("8ec96bf235d5e9bf36382d79b4bd1be8a8e2b23a9f7f9e02ab6d708e96a1c12fa81eb236f02b0180a0cb9f3c1bc28cc4").into(), + hex!("a0261a76664fe2fcebe1501e18eac7bce32b947db7bccb7b746757ba51cabbc8bb385600a99b248887edeb84f82a6f49").into(), + hex!("a44313f945a1d462376e03fafe6d7a9659dd81046460f45ff8914732ed268b2430ff632aa0d368828c2076144bdc8595").into(), + hex!("a55fbee79559e1fa7b85718306185e3769a92052cceb600283d0236accc6ba2343799c1856609faeb7c685dd504384e5").into(), + hex!("8a3d4ea2eea81742fcbde7a1bea5ffda55c58b5e4618ace17773057932b7216b96ad4a117d9054de18f71b3345a0076d").into(), + hex!("aeaa0984232b1fd5607a1a67051d42df3ffe71363639e5130de243cea84c87554e6597f3f07952b7d40d19b6e18957ad").into(), + hex!("986c868f8f25db957f44a39bc209f1ff8e98e9bff52236b2473b8ba977d0b7e90d146ec86a518a581c5de796290d505d").into(), + hex!("b1cb0755c54e0619c8306636e926930605f15901c01e36822131dde1538b063d0dc485a97534ef1e12f2f0febd1092c5").into(), + hex!("93cf415d4d7ea309b85bfba7ebefc0d1ea91b8e93fa351262d9eb34b728c7a516ef0904cb2b3549db2b3b3f788b147af").into(), + hex!("97359ca81e9fa330f4c0a3b4de96ff45391c2f83247d1f73a6884bd123d34edc66a4d3f29718f5543350204488ee51f3").into(), + hex!("8348c9b229787630ce26a41e7c016adeef5dd3ec1f124081baf9db4ebc1a3f3a37b40d94183ea9eedf9a458a2e65fb41").into(), + hex!("a4c6b13c7dd27497917bc9a4c4a91b953b88c819e147087b125c93657ad082971152d384e8c512f48cfe07a69f54fd95").into(), + hex!("88008b395718646492ab944a9139b95251214c42e90720c703b19b99afc971824bb87c2a4d40202cfbb62bd2ee30c15c").into(), + hex!("946969ae721cdb08dab293a638387dca6045e230cd7c7b7237c75e123355db9b8e444089633d0977dbb6e42a729ab4ea").into(), + hex!("83435817ddeeb242c37d31877a55194f208f4cab406b10a4a0605a54a19745f3517a880dcab8a5a4422c0e19e2ea8a2f").into(), + hex!("94fd0a0f870a6ed2e6a4f53f5dff5b5adc1a6943203da6a34c73694702733c991e146f8c7108ff35d563fb67f55a106b").into(), + hex!("89bc609d5223c73afbca46a8c3cc271990a8bac5191f1ef6a2c88d7984adff00d67bcfcdb3958c259e17d5cba62beb28").into(), + hex!("b39077093900919b51e68f647d11e0f78359be69c405fde5735ce6839f739081437b899f33c6c9e6c86d4bcfed059186").into(), + hex!("a0a6f9f588e336c14b91a9c0c56085830611df85ce6e99d759c72a4dbae500b47dbe736287f6b2d65b448a2a0e6ca237").into(), + hex!("8222a17ad961ad325b819bd0625e079a471e597adb89f2170cb490c40f6b8b1a08b2e23a1abec02011452d589b183702").into(), + hex!("8b77ca7fa195450ab3399f88341a9d323e8b9b7b9b2ca30985d97ebb287e1f9b7e0279f22ab3a2dad682d7906f6c8d59").into(), + hex!("b6b8389382d3336bc5ffdc752bc699a6bb0057dda7879901c7633787a2b412fb7852fc896ce95cd09a9b98c76bef1b1b").into(), + hex!("970a20613047ad84b61ede90efc41a91ef7259a5fa79ba23964ea907fba1fd88d2710b69fe5bcb0d75ed9fb68d02e557").into(), + hex!("8843dcb71117b6044b1c7eccb5010d0a2f93775a98909bf23c1773ac9eb1c0f43aba26dad08ea7823da593c38a30598a").into(), + hex!("b5b147bf651ef9696ed3ebcfc3ce226b2748a4c4e7cbfbf12b3ff5f1f0b2ee1372477e1d7d8aef8d9ce3ec602a63d01d").into(), + hex!("95433edd328aa9223f521daf6d78ab272fb83150bac78ef6639cbc032de8834049d4992af0828946eca69f359987584d").into(), + hex!("b2f4d2154ac750245e966f62b92022a136ed0313964ddf534ff3e9b4456cf58bfe429ac83b718bb38db5a4fbafab23ab").into(), + hex!("b6b1f2a3a99496dab156c6159b8c98990501894b5b0cf200c792bc462263cb0aaac570f5a785aecf367a0531ac2a87e2").into(), + hex!("9985e3ae265653082f068b8ac4c09d10b2543f920a19911cddf18ac53a7f921da86f11836f51f2adfb26c7bf4ad51efe").into(), + hex!("90c31f4985c7481e5939766dd080f6ee01ac7a4fedb9954b9d1fa8fa1cb0e6e7185a1e31d8503542f1d409ed2f550e88").into(), + hex!("830736923cdcbf7de3ae650768482845ed9b45c4dc9928d66481c76ead9b27427a96989389c8583a153851ab957d67a9").into(), + hex!("82312631f5b301fd3ecd8b0a6e83b130b6e997a5a1e6255e883c590efa00b0ac3bee45c15308efe824aa665c8d7a365b").into(), + hex!("b8ed7b3c092f7bb05aca8cc4c2041161426908e8db349cdd2064e95044f9e7649cd569039e0ef0a94e006094113d0e22").into(), + hex!("b1d6e5344b74a67699cda807ad4883369a77d79335cb8eded6e0ad9b64c8661b7ddb47ce4308ff69f947fc173f496ac0").into(), + hex!("922f0a2f84e476e6fc00c196eb913ebfaa6b205fa8ce8c8453330a58956872eb2e4ec0087b398eb51819ea2d0aae6b21").into(), + hex!("8c729483a3d2ea34337d9c6260944da7e2ea8646de66d39617924681189c79672b0ccdb63525cb4635e3cce1d8f72f13").into(), + hex!("a00af936fe87caf17f5b365f59d019f8438a62b8f174510d863da59097986011a9e76319d4125ceb64f1d83defd822c4").into(), + hex!("96d33c3832bf0af5900a20c067bd45dbf3f0ecdc086eb065afea6c44f117eaf9ae8841848578d2915452e61bad014803").into(), + hex!("8a16c15a161a1e898bf06a23f62a9ec042c5b9e875cbd54d62e11be181647cf09e6a0bc65fd62017ae150525c16ee746").into(), + hex!("b4a0443c452085bb77b5790be42005178dec8f9085e2f1b963d55de6978cb608b7ebb42e4a84f24350c768c2e78d22c4").into(), + hex!("9168aa07b4e29c67723f4b87a025fbe6876f13c69505520b4dd6b387f16530a886bfae5e5304539564debabc059589fc").into(), + hex!("9504db9c5ece4ac0b703ccf751503665746bd580f11106df3c8a903ae7a5c9b0520dd16c89671967e2aa12775af4f67a").into(), + hex!("a776127d4e2e46c7dee8559ac56b266e7eaaa26eb8db0a7f4df0c66fa1564a349f414c9091d1e4c3e7ba96938916c769").into(), + hex!("a85785ed5832dfa8c9a5dd9d20523591f04536712c19a38c2c1496ce9c8787cf37964d739f83d9979db5574ed524d557").into(), + hex!("a4ba9a3312c2c253394891714719d2cb369eea993353b07f9a6efe3ecbd245f08d69f3e1302d6ee312e743c05ae85cf0").into(), + hex!("8329604134885c08173b14b7c68b74ceceb3694a0a3f7997f566ba94bb3fb2ad3f78ab3d02c496858bfc95655f072e7f").into(), + hex!("8e3f5485c98cc317653375ceb44636054a3202045bea6e9f6faac128e115de7a658a49a6432858db7b4b14fccbb93f7c").into(), + hex!("a706c82514d19152bc4097f8602f792a4917f5cb409c42dd42a5e4f2ebd1bec8318019934ed6d19cb43123293bf4ec98").into(), + hex!("ae14d5f32cb99bf3eb0d844157f12b836963be0d6f91b776f973a66701924c1ad9c3496540db4292580e6be871486486").into(), + hex!("a45ee325452d4bb2c60ef5be60b7d601158ca1cfeef0734727562b94ef8f72190005567e2007e8940f8cc538838f1147").into(), + hex!("b8f1fcdabf33ba011c86487a082b19fb146de932a469b19518cda2ac046c319059382cb8ab3715f8025573ab53c5cdd6").into(), + hex!("a613f3dd6c8361893be08f816c640cdea4d57d3207704774eeea8818edf102cba7ff7b06c4c5d0fcf0873b09f72d1ef4").into(), + hex!("aaeab877b1d16a4db6e47a8a864e073c4742e0a84e46ae8dea1a0eed0d2cc9f23adce9e0c8d88464ec0c059df99a9583").into(), + hex!("8fed26ca2cc519a44ae38398d856c3f75d1ea6cd02dd36dab004188f3ef2167cd67d279580f37176dd70c1a0ab08d72c").into(), + hex!("ae18905c02f96e110f40d3bd99ab26bf28e0af939c6945966fd5e3ff440e54bcee56d667a0a21d8326f88e5c22e42506").into(), + hex!("97d803614adb6571f4ea11833d0d9ca8221e7fc99a960c637d4990a72727ed2713da874bf156dbaa70bd4c2f668681fa").into(), + hex!("aa86c3bf79ebf46e1cee54f517b7bdced4c7a96d3ab27405e7d68dba92ee6fc7fc91a107f3cca85096f0d2581cb4039e").into(), + hex!("b75cdcde1702b5bd6be180dc8ea26e5534da77b1c7bf711c8447a565a63d073474f0270d78dcec78ecf5baaea1f75d1b").into(), + hex!("a36e810e50d283e8ef625cf684c1fd333a0373e5b0a9d81ba40cabb76299af93c536285c5d7239e86ec56905245ed2b8").into(), + hex!("a16b6b41e5c31901f3c0fc2a7dd8c084fb508947314c4bf4b6fb338d95ff2cf49fdc5de1d6b9acddb1b096b835df6ad0").into(), + hex!("8b580da99256b1d0d7a90dc46a98ce5132fb3928d416f2df5ed1769544692482ec8f2ad5f57871041d8c78d00c949a0f").into(), + hex!("945dc91cffe575f06b4b01fdcd580da57403469a21db6ffaa77ae06d31b8a2aa9957e26db1bf89554611f51f10c8f73e").into(), + hex!("8c55c4000195fd1155ea608f586a327cccd1221036ffd29eb9903f8f28009083203f18480b35cf82e0390a5ffef4bfb9").into(), + hex!("87cec982094c85f6c1e402b74b52f7c0495ab4a2d3f2309734aa0bd2bfdbc88b8bdd9556664015c7d9fe2f138dd7c807").into(), + hex!("8fc576e4f9057d82e2fd2270a787c596bce5fedbdb9f6d612c2caeb1a778450d8c1f6e86dd011a45f3fe7f201e520438").into(), + hex!("a43eb1acf0de695d478a661a71128ce9c58923e3adfb62728a2e9f185c9f46877db645398546a300b75f2c849f5ab14c").into(), + hex!("b57be020fd23d3fcd6057997099fdd648dae32cb750e8d058b62a5e902ee5ca27771d762020cba2985884ffcfded3500").into(), + hex!("ad3ad1089c8232280e9fa2f6c314ae57758cfbc3a0663ad9517e35b74b19e49345e03d1d33d0d7b69d736501ec5b3f4e").into(), + hex!("aed7faac2e65c10b52d7b3009eef010a624c7f57a5c76c55afd310345707bc8959ad619101b9c1ee4bde44152697c537").into(), + hex!("a6b177c7f945cde42c5389f7258689aefe1b6ee0b243f9901c6e60ef1bebbea9bc297689cda0c93aac9b28c7d70d0022").into(), + hex!("b079f925c29da333461adc949ff4daf19d0500f516d95e3a4c3dc2e2f5ce26ba0f08b2473c03b6974146b239532deade").into(), + hex!("8c573c73d603c8ed73ac3eedacd8ffef4c18425699e30d46be2dbbeb3590380b0fb713daf3ff3cf7544da502dcf35cfe").into(), + hex!("a39331c8acd40377f020611ac9f3a758832e0a644a5cca318c01e654696fc607e299b744c0cc2ecee2bca755c9aa3581").into(), + hex!("8e71e261664d5a6094ee912fa7e3e866ebb5c4c610062fb5fd733359d0e5a5d806a3370155ec3b04e83cf7a2d7c4a0d0").into(), + hex!("ab048af1200dfb67b4fb6bc8bbcd8344547e57942f7397c06988c9c42cce53784a0282fc13bc878635a3317b8f306a81").into(), + hex!("b32fc2da89d3a3541a61338e6b0c5a7f477a23bbb9a7c63b1087f36c49b6d9a42d4720708af496d82c56e1e6836f5cb4").into(), + hex!("97d0e8f961033e4aaf96a75f585d16eca691dd05f4a5477e8d3a0fd97d02555d67b29d314b5d150dc0de3b72810338fa").into(), + hex!("8223bb67c99eda58237a765c8fb426871a1a9e02e6e91d956b16e57b8dbc30c0edeb76abb30ecb2f4139a19922a4c62a").into(), + hex!("8d9ec5c0575500e433a4bc66d196d404b8619ea38b0dcaa036e1c1453eb23c6949509243531ce59318c22db6e33ee1ef").into(), + hex!("933ac0e3e6acc7a238fb5495835a591db77c39e27f4034dfaea20bce7c072ff6bb6f59a9823a07a76a431905afa2dbbc").into(), + hex!("99f3cab4e8005fdb6bb44900a4f166ef0c2c48dad85c0a127c4d854bca4ad32a2954a586734ee0e57f3317e5b81923cc").into(), + hex!("8f01dc4011ea394a9f7a73b7f246bb00472632fe715314525f1db2cc6158b22dad22d1371e7d0b2d5e72cc408f07cb25").into(), + hex!("96e702adba7420e819338f6f8740946289bca6f24a5f14a5bdc727d1cd66bb7d2a573cdec8ef1333ca39685c33f6e7b0").into(), + hex!("890ab24865a2652a8fb96ced381530192d072cad275c19539cd74e03c001321216a0999ba83c8f3a162bed003dcbaae1").into(), + hex!("96e2f1ed5f78c0b018cb388447bb85b33da331a5a306ce4e216d1070beb7c3900f979ef128e85180c56958c0d729ecdc").into(), + hex!("8ef642d5a1fa4b32fd69f7f57886d1d9447ddd9a8425a03f15633cd688e41054d5243ad6f352a5a3fea2be2f3cb7bede").into(), + hex!("84a3177be656623fe280f91e2acddba52c068cf8a37bd79b9b4186ef199bad65f52cf3e47b581f1964c9987f088fabd2").into(), + hex!("8b913725eb48feaaed46b2e3ddc0cc414aeb433dfa584155e2eaf29020f6f1fa0e801b85bee4bd28831b5cc66944f411").into(), + hex!("88d802c75d422a713c19a600cfc9cd843ca41e35722e21a0614c3195ea84752337ee30991d860fa75a57ce3f614e0a50").into(), + hex!("b43cf4b09d02b20073903bf152f569a43864095622a472656d8a96efebfe3a20dca86871268ffc528a194bd951662d71").into(), + hex!("ac1c65ef79ad0e56184bcdf0680dde5547bd01b95d7e9c3c71671c71683709cdf7fb988440c3bfcb847c26f198b94f81").into(), + hex!("abebe453b3f2430a9287d0d5fc043f7ee434b33feac6b7dab58d5deed7568e0730d59f94b1883e3d43f3c2934d3f40c8").into(), + hex!("84e0acddddd0c202eaabfca7cbf88774ae374e841899942a2353064f132c6205ee378277b2703744a8bea9bc16449537").into(), + hex!("a69865f8a3f66ff4e548ce29a212041bcacdc85410b8467f0515842062b3204fb1b7616e45fb5f46a5619808fb390dbb").into(), + hex!("a55b426b402e9b27fadf87b27cabe5375c6941b22597dea75586eb9dcb699d925db77250b1d755512aefbd4eab0a2e4d").into(), + hex!("8047da13f072c9e848d33a0f397ecf3e783e7dd507ded7a4de25327fe89c183c8dd1da3d419b48f53d93537bc2c1a8e3").into(), + hex!("94a9345e464b9b28798c608115438f1eaaa60a56abad028729dddea3c856f7f871031b4f100626f8bb7a06d88f7cc6c8").into(), + hex!("aac8cc93a4bf5b383080738021fc56cf732988622fe0d493540545b19a6a54cdfe9f8cd2d2dcbd572bdde0d1f8cbb101").into(), + hex!("80f24fae3c8d202e8072092342f8b046dc9edfa1234c86e9f06cdd7fd2a1dc0f81ad69886a8c219f53a94b9a75cf6b78").into(), + hex!("88ac9c1d5c036f14566203d8e18421cdd21b2305cbd20f9857e4edd09e002ba0bb5c89b039cba417b353c6f2f63c50de").into(), + hex!("a45c8ac231d0ddca06f1bf03eeed331e9b524ecafa74642e4c4591cead603d4228cbb0701af58770100964fc880ff85f").into(), + hex!("88767dcda5fc82e5ee515639992868790ad56d2a4fdf1bd1ba1c5be51b381c149fc9db23b93488b54adc89fd4c48dcf9").into(), + hex!("b23e34136c22ac73157c7c5cc8a9491b0b5bc968c95a9c104b402cad9de598e323ada4cc527555157cbecadf48faf87e").into(), + hex!("99910638bfe8b9974a1bb7efed279de750deb046bc21a9655da4ea81a1aa807f2b76aa2a64d773b1b23af283ba3878f0").into(), + hex!("a05869387ea3b4c8f7403d85ec788499a993482538e0e2078d016f00d67571d1342187ae088c788dea518bdf295da88d").into(), + hex!("a7dd1735f178d53908e29db85ba6166640da8c8bc6f717e0da9bf74c547bb98a512266cf737937201cbf6d14bd9420ca").into(), + hex!("87f5b096a1263b51df28417fb423604879b18c4d0a8a48630f70e0f95226bd51a252d8be362df801680344330857fb5c").into(), + hex!("b1a5a549e27b8256c388465be3017dd123a7d257fdb49b2bb409c6430b6056cb8125bf88b5f196bc9e02567a6728c7e8").into(), + hex!("b70862d190351d6bec9c618057e407b43864a0dcf860b31ab6617f75e1ea02de49ff338a45af53783cbf10400c878a32").into(), + hex!("b27a654ece8541b9bf9c6ae0047969ebb69c4687a43030b1c412991dfaf349e2d3caeb6b7ae3d72ff0e2d758a04510fc").into(), + hex!("81368aaa4489c992a6ef3b55df26ece993958df2e40f04a95ca514fda56c2fb98f11d61faedd31860b89e89eab965f0d").into(), + hex!("94e14e03de977732b7c7faa60ec8180e77233a43d513a37c443be4fa0bac64308d6a1929de075b5d51efaa9bbd6855f7").into(), + hex!("b2e26d7b979f93e8dd55eea5a0f4985bb254128963a939ca07fbc33bf83ad7796e9426660b2f35088d7aa5fa0cda2ec2").into(), + hex!("850aee846e93c5204c1906a2782da71c0ff9e2d1962a778dac77561846e6f9290ab10daf72f189df0a57c1548bd4e6cb").into(), + hex!("aabcd7f870c299cabe4dad1857b3b6cc3b9fde2b525e9d8ec0fc1f497cd199108971173e61cdd5937c45758cbf7b9403").into(), + hex!("ac069d7ff2633fc73bb0b7607d9c27305a4e15c189c8da396d6685798c12ef179bb44cffeeb7435667fb03a799eee5cc").into(), + hex!("99e3eb82b955b2411d1b81d946e5ef6b9c6957ae0e368f4a9c279a0541c3a46e289fbff526a1f9db4aa21b92d13bc9e9").into(), + hex!("b5bc3dd1e05a66a1d775ae0ad159df19c7188f2c73a8553525855ab34617c7f080e217732003e09b29a5b36b12ba564e").into(), + hex!("aa631a69aa4a9c14de2c49fde83453633d17bb258a2b7ada723bc8e71ef22c617ebdf8ba64c72675440b35d419d0f836").into(), + hex!("8f42bb48587cafbb3936adc495e82981d7fd81d8c0233a4e4d44f9df72f8439a9a0228d6cf9d156ea608caffab8d9eaa").into(), + hex!("94e079215b8d187d546f33d5384673215ee65c70d3bd0778f67c11665af5fb025b4302518a0db6266996c136ee90d4e8").into(), + hex!("b3dcb504b50dc58ee7f2e2f78ca884d5fc081b570d1177b884c92bd34272ececf2a9319cb1cfb9df011d4db3ad266e42").into(), + hex!("a5e5b55940e379e6c0fe7c6ac9ab86f3836f261942e3933087f1e1deecd280af9afd95d1bfb384976d5947d5069531e9").into(), + hex!("b1a36c3a0a79836817a2890ac53c6768ed3965bf5d1663e2df69b1bba60910e84dcd4f917991812b305367786edfa288").into(), + hex!("a8d07cbfbbf31d113b80d3a1f82ec7c29c4d78007efb66b5592255acebbd8e1b0c8b927a866c79211d5d4994648153ca").into(), + hex!("acad1228fd1ffbc118ada45a27f33ea02a09455d0c295510da693d741ca3b5725af41b99967ea6d429f604736a4fac81").into(), + hex!("b201ad414928e315aa00dc60b89c7a15464d5e97c30b551a462d02c35e327d2ef3244a98a402f9e055a2f9af6e970733").into(), + hex!("861689f35fb72780dc0be92c140dec07857290495baf3137bd2e83ace2f268f205ffc58edfb0e09f323ea5f14d0ce10d").into(), + hex!("89138730c80c30dea01abfebbed79bbe6016b4924193d9c2e8bfaeef30616bcd92f0eb24d5345bfb005bcfea989fd8d3").into(), + hex!("b78092afc3f16397d2eaeb5bdd7fc6c01ef516a71102124febc0cb443f4446c18037ae75c7c1d0c8177454b092922ace").into(), + hex!("a739cb664cdefe7a2f38333fff13bacaca129d718a043fae1a1b7c4251a77319b44589429dcb9ad113f24e11d3b75024").into(), + hex!("879996d4bed3d3235c0f73ac8f3f612eecb6aef6756896920e0229f5deb1d91feff95734e6b4143ba89badb5cc1f0cf2").into(), + hex!("a213d854a0496d74526b3c37a48d6f610452b44202424a419acf206df1cf76f7357ff5c0899e45adb565535bb09c29c1").into(), + hex!("8afa04d66a3e8a2759ff088395cd98597883b3ca6d8811703f5fc74b822ce4e56e1dddeea2c099fb3e0f6648f990f1e9").into(), + hex!("8a2e7ca192972af2b77660b07aa612811fff94c951532e3fb6829e8031355363f4aeed0f9e02b845f00cc9ad4b744c4c").into(), + hex!("8f0757fa7ab1eabf429802c3811caad65833e763029c3aaaa43ce921abeb277d7dfd06e0e58d36e494871ab9bb090668").into(), + hex!("91c0c0b0564fd95db51c73637fad622e6769206bfa03e41474a4e68369d10de7da5d1bd2b5d226f0564cc1ee8c3e9074").into(), + hex!("82b35466d835a6f13080628ce407cfe495cbeee26a5168de9e595a122ae3757f2eb0a64a71ff1ef6ef26c8cc97ec1f52").into(), + hex!("80d11c7a711fd2dbfedc76fe018fca09295d5a3146df92496ba01063e5e098198cd9c52d3802e6cd033f64b3c651b67e").into(), + hex!("8607de2cda6838c70f262dadb21409649900c27a5bf3505ce2166ef6f616f4b7119aa3e3f3c62c1a508662d7d68e8f0e").into(), + hex!("a1c14cbb653115b6225f53e3e6ef8e25f87cf47315b25dea5e658493121ca22733d3fd2781920dfa3a04271d58970749").into(), + hex!("aa876cfb3d572bc1f84a5579dfe8df82a9177b441492382e8ef6528e28e46ce59fce9a82d42c1c2000b28cff06596d18").into(), + hex!("8742ee128452ee98f21360f903c0a57e600d622d4ac793f32d6732f5fc315f757bac89b0f39a4ddcf4b8668cd02f3e78").into(), + hex!("a2e04418db55c0d9163a1bc242e6d43230a943ead121bf8a5f50c109e4ecf0fd99e5b126a4fe2ae9b0a248e613b54f7e").into(), + hex!("841b7c0ab57c2cfb1a180a9b0a2875a7675624f0e5c779f01f3f92a1ea547cd1164485f54bc433d71c7b054a6fdfff15").into(), + hex!("9855f3506dabfea5a133ad49557c3c9e1c7b6965215cd940bce4bfa90e98d9c62999feb29da0af8768b99f5f82c64489").into(), + hex!("a65939fb29f1d913e36be1f877c8b9a3549ec17313c4354b1834cf7ca9ae220af26a72cdfdbc59567bcd7e4152d90930").into(), + hex!("b64edc36e0bcd48cb350350fce955609ae51f5bd197cb7d42b04a2ec7f8dbf236b2a3b23a6e0778d57796433f0e6e9df").into(), + hex!("9379a72a722c1a5c8399acf72ebadb7ab1c5a2e18137cd3850b211dfef907850399b6151ae7bdb590a6eb04387ce0c31").into(), + hex!("b621023f0d3c731f49a48378c3709a0c051fa1e3f8788d27169a76dc35d46cd6095b32d7e91794c35f4af8d75f950411").into(), + hex!("a82421a53687a444a065ff1e11c439cb7342a3edf496f2ccc04f56fc6630bcd79ccce1437479a6e7d6dce918d3d45181").into(), + hex!("857fb59242e6687e940fc114df3c06af5a89d85c762140b1e4b0f8cbcae9d604f435377d7a2d153a65e0dec099e3e8f3").into(), + hex!("95e6a571cbd7c7a58c1c599cb4c837c9f31757a6ee4ed6740e9d55c350baa847ce6d081023b43b397a3798c6843baf13").into(), + hex!("adc1e1f8523fc6e3d683dc0ca15ebdbf471de635f25fa7be6fde9907bd3fad130baafd7d21b43fa04738d4c19448d788").into(), + hex!("85f8ff5b661f9e529421f7e5f831db1919ba3170a59673546db695c3af8a82cb1ca352e07e6c801ef9fe6f501d5896ad").into(), + hex!("937b374871e35266c2815e4d0ad72dc2b6c756e840ec36fdb90a71ecdd4afe13f6064ef36b9d1590a39a7be2156fd728").into(), + hex!("ad4aa9b451187905652222dedfe6135111ce4eeebcca74ecc74f3464a07831754eb0072abfb96adc23d0c5c33a1d9f16").into(), + hex!("815bc7c9c7c84396bd0de5c71b78f2be5fddbbca3f600f341a21533ae6dcfef8bb94f4340ec2a90f40ab091efe4cc6e7").into(), + hex!("90bef1fc273005610cd79161686b25d88ed2ff2abe18f16a4054fa05dbcbaa339825616c117f55ab26d12bdf2e414f70").into(), + hex!("b96e51c2d2bd0fd78c4d3b9873d217eb76642c329a9ef293010fcadb45ef2f9ee3a9c34b0365e344d33c464c08a0f51c").into(), + hex!("94c4048c3fe7dfe736458ee16566027290f93b1f052c3cfaf28f5c33c32af6b9cc960d86181d54361dcc10aca9f81a58").into(), + hex!("aeaad402961126722aa5033c6bc7735d4cddf35ededaa08073ab1a8412e5d1d06e95c58c7a95409edf1566ae904d795d").into(), + hex!("93d019b814d00d5eb6e7545e6480da089fa48ba34f0a961c704db12e34a144818c306cdc4f31320e542c75eb0f1ca96a").into(), + hex!("a3c21f7864512c38a58f02c0c83993ce6294329b074b801404e4f941d21e4e7e5eaeccd41da8ac423c967b7230b2a505").into(), + hex!("80c26a2aff26da9d8d739496b5a63da6d8d35544c71b7b05b41ce4cbda89e6d32e85fb1e38a215aa01dc64cb43e089e0").into(), + hex!("8c5e66d7668ab7e0de06ebab4a4ffd13f24e4458610e64a972a1e1f15356f6e745cf36b8cde658d03817f2749616fe84").into(), + hex!("a1260c9a6727d6d4a4c147e0c7ba91c5e2a47b5a08a07a3ba0eaf9b50360b6919495b4aca5f85e8fb2e4ef1c307286c2").into(), + hex!("9150fbf49242afc6ab7f865d4a92e7013eabab432b341710232e0fd971eb2b214a3da5b82617a8b7defacbe060538ea6").into(), + hex!("ab44ddafebcba5a0fc1002f3bedf595f3245ae07c9184d640154968e4993d85087efa8a173a670d07eba1c00d3ed1c5f").into(), + hex!("91580bd78343a09b62e31bdef63dfa9e0c874d7b39eb8a4300388ab053f262e118f790392f73d4fcf7714b521690d94a").into(), + hex!("ad4b8eb477ff8e573a911a1a4c1ba027088828cde7907e193ccc4b853aea74c66d19ea99c3779f6ce4d505ad83f2174e").into(), + hex!("a5791ba6dd8534607100f405b2f104c987336d5c47a544ed571d0babc6dd88a634296773faacfc3fdc13a5f7ab0f0cc6").into(), + hex!("ada0d1c948bd8f66442cb4b9cdc3a5368ab6c585cd8be766b468864a8fbd60535e454943731d4121ca134743d05221d8").into(), + hex!("a83556f376d8cc4a26b53223b11426da96bdad5351c2fd451ea053346b334eafef9773e3486928b9d407d3e13d5dcdd0").into(), + hex!("83be01b65302a31c5ba09c8329f683904943cc8017cc8975272d7d284b6a15a3313e27887e4de9110f64445581747ec9").into(), + hex!("8acd831b27588a99743c5d4f61e6f0610faa530d6259f187aeade29f1c9d5956f1c01a5faed8be8924fe1e8d9de03571").into(), + hex!("b17e88d1fc760f3d6633f5b48411b7237e276e2fca621d3db4619da62993bdeb3c12cfe7d130a92e4d3a14693d1b87eb").into(), + hex!("b769850bf9b77a1958d5eb932f99807cb695eedafd476d99131e3d7340cb845a33cb2cc7b640a0f3b14901b506802ff8").into(), + hex!("89e7eb7cc852326b6e18cf5c720c4e44c474d254de9e912d22510aa4cc1952b5e5c40b46a4907be375b89bd57d9f1152").into(), + hex!("af7ec9a4b836709701fb497f69dbcd0d94bf986fb6894f48c67014bc8b0ca947da71722d87de0371923f5bf2ec82ec64").into(), + hex!("8d3ff45719a7fc5254e91c710d956a16b8e8435fc4c8f68d1a47672335246bba9627d7058510d25417b7eed5ece5c110").into(), + hex!("a99a7b987f7050c230ab1adfa50a30b4f3782cd31467ff9c2a749182a1974a36a6a375ed5b0909d1e627b32ce0245ef5").into(), + hex!("a0bea35f339b54d82e345204fd4b75d41af3bd08d33b223211e496ef7fcdd8e327dc5a9ecb6fcb7de134b3eaa43d30f5").into(), + hex!("9419df6b2bd022fb6c79566f932c37828ca7a5a1a9efb64f470d7ec06e0d6b0b0147cba88814581a0773c80cf3d21033").into(), + hex!("948b0cd553cafa57de03279b83fa4f28cdbd0ec4e2219e25fad53c9d3d28c619ede568ad6e095a155d117caadfa87551").into(), + hex!("b21383b264f67c8c66011a79e20a4d739d1f8fc258562e6351eb1e1c5b83e42090f1525886ff4b65875868ae17a8faa1").into(), + hex!("aca93939c30eeac8fc83c82ff6ba3549ff38121115a60b7fc94b7d64e1f36f65e932bd8f3bbf2bcba986c9309861fcfa").into(), + hex!("a728507043b7e86c0bf19cbd81a45e1ac98d2edcea4c7faa3381df13f6352232b711b03829e3eddb7770213866dde7ff").into(), + hex!("ae0bafa42eece82975171e94b14e7063a09bbcd44cea6b7da4b820cd5d984be4c00a2e9e5137b0d34603e1ac914f889b").into(), + hex!("b63cf4b55c4a62c50c356cc2721ae5a89244ba9aef2c9f5c93762837fb14197479435f593947c8943ac77e6a2ade0208").into(), + hex!("acb5cdbe2cc7c44ad3980f9ba74b0a97f36add3fbb4e9b513c62157c14812aa73fac68be8c30170c39d1aee626f5a1b8").into(), + hex!("b14ddfe1c42321feb8ffd76ac041814f3d690fc16ff47b23ffcc247e8722d50ae001b6df4e1af6cd7c67c8799c8a1907").into(), + hex!("abe60d6024a9d6874df7e59b4bbd7e1e55da22adba1d16320fbfa2b68e8db995997ce6f81f8809e96c40f548ba005787").into(), + hex!("a23307e2ee6d96561452294a9265cf0eb1d6f86b30c7ec48066cbbe889eb7f0d64819225293496db709a1fd60dde7e5f").into(), + hex!("8bbd00e149a9fd5eaca24581821c3dca114e008c3e92a36db536944f6b5e5e983628f155c2319cba9a8a2a26d3885add").into(), + hex!("954fcbe0655b82bfc15679237d98c3759a49ffd0eb7f5da1827711814b92e0a4be2c0b7a96fc16ee3e31099c993ce6ef").into(), + hex!("a9bb0a14061ab4de136605e94899a41c3585ed190b2a97f529e911f02ff389652049616b408aaaea81d38f08a8f6c533").into(), + hex!("b58fa12cd0b69ac2e5c50b543bb15abcc3a0c96cc9cebfff34c4f7dc83bb5ece69d881348860385456eb6198ecc640ad").into(), + hex!("b73597c5ffd3a812e8a553bd3ad2216282fe7c1203120624b86cacb8a7421ea6807e29fac3383cfd61d632db8e3af5d8").into(), + hex!("ad153b873be0eaa71ad3b0191067874e085164f8428b89c7d2e01af0802169a9afa1775ca0f9491350db9e6c7c6581e9").into(), + hex!("8a7fcbfc564fd1af76df52ac5802a7342aff25d745307d2b9cf29c4470273686d9877b4588754af0e1bbbbe0310c3fdb").into(), + hex!("84553c8b77c7e5c81bfb1413cfcda7f8fd95c78c011c19189784be6a5e7352248b3b30cf5c80d9262de6c35ae6d4f1a5").into(), + hex!("8866da76cc8ca6522c3d41c950ea7fd67d448e1d567ecfd0cb916912d597b754807f7489f5e3bea7b4110cc8088ded24").into(), + hex!("84adaf9a79d5c3bc8dc7e669ccc5d4964254d0fc32bc535e54c5e4a4f45aa3c409c11eadd4fb21f4c831329087adef06").into(), + hex!("a77ce1ee4f8feed6ffa0c5cb8fb7fe0f95a03117e746b56b5e8178d27a1582804e84a86aac1cbab53aadffd9f84c0bd4").into(), + hex!("863321bf40995482cff032854ad5017bd885baaa6ec4ef47ab6bc713640b1e258eb40797ba049fe677937e3ff7a2ba2b").into(), + hex!("a46fb6fad471bb923cc38748253f887b53153ccad475240bf7244c1f9f568ade931b0522911348d64460021639bd831a").into(), + hex!("86604e383195be9c40ab728db426af87698d0e34157edaecc357544037d66d40e558cbfef7b005f8db3c9faf541f2c6d").into(), + hex!("abb7d323687c1d0ecfe89d411d9a81d05d009b84e652af437cee40e89bd2657641cbacf28120fe93deb0a1d3b410fbd4").into(), + hex!("a8d2488d99e04b79057739e6e0522b38a0f68a21bc190696c38d96f0e58a9395e3b9011e54d2cf7e8fd0b380e753f2ea").into(), + hex!("a36fd6a64f64f40ece0babcca8926dfc005cb1d90e4adcaa9c01ff3bff8d73cc0f95bdcb4f09d7e3b5d761ad5c3c065a").into(), + hex!("9699c0c5b1695416470c302f3097e93b94004f42369be26afdf04aad49bed67851d50f14c44efc0a90e311ecb27b3387").into(), + hex!("929e6ba1338579c1cbe76f1b075c0fd9725adfa97ab8b821aeee75133a874426414fbfb5cde7f7f8b74fbd8b27bbf7db").into(), + hex!("ae874a087a61c3ba4bdc2a582cdeace6d321f81683636440943dd860c783344d4133196197a108f6f473bb1e75c597ae").into(), + hex!("95bb2da076a9fc25e96affc7e4adf71496dd5802d7443cb5a77e3d52ef544aaf939c0884169df547000b3afc55cc208d").into(), + hex!("b0b63d1993f601c8aa96448183ff560f291903e649192e2e34e796bb66a31f9d0edd0f03ba4f1d299fcfb1e931abbf39").into(), + hex!("84cc92f8897d0bc0efee72d62ec3a8c07b7c72e00913860623982bba412307c2c42069ed90dd996bc56ffd0573b607f4").into(), + hex!("8ae9804b99addebafd3672785d4402a583c97821087589b7a129961b6131fb18c2fa60d606cef4f636b6cbe46b5d6415").into(), + hex!("8f4c85506e99d383b103217077c70571ad8b9046d039174df6d9f1902f8b85143754969bcec37519a1340c79046f1c32").into(), + hex!("81a5a0214a381d72657e1142a781fa8db0d849e1e012babe4c912a1edebc5dbfc265bc7fbfdf8b6ccbefb55eb0fcbf86").into(), + hex!("82c0e11c9016d95501a97e551b8b926fa317f02fb6764cdf0981796e6e23cbf13e48d46bacc875681900fe8c1741cd27").into(), + hex!("a00912f7bf9abb33f1624dbeb5a960ed32addb4d6bbf9770b6d82d514eabdc339f751e41c8f4461e560141b53f086f8c").into(), + hex!("8d905bcf245556e52587f92957459a41b9974b5d8b8d2baf2d8a98edcac2a77fc8b1eb70024e1e28d5c7a190d9f2a77c").into(), + hex!("b8e19d883289d97b0174cebb92d12a8c6ab16e4a8f0db9d7b67ccb9bdf97f070352e6b24c2decd89e7894099445d8b96").into(), + hex!("89cee93ceec6e742aff71ff60085f04e9550ef5568012b4ef0aceec9928c677f9711ea553499db812bf80eb5df021396").into(), + hex!("89d58564c0215295070329974e51e528ee4d9cb197b089755a86451098bc2f347be8be5b0cc06240315f75222ba2e9a7").into(), + hex!("a312cf33dd49ba6488ee13200193f06a5801407a15fc79956f977586a27a4b2d4cebf0da22f6c1100ce2a0d08730a383").into(), + hex!("acb541c487eb8fb4034ca6208f542c5adec863f1346dfd50fcc0ba1c6866e43f0071c8cbdd62ce6a2498e16e80855fff").into(), + hex!("98022eb774377f49b90f41439cc6703fa152d1d38c0e0c78eed49cbc54670369cb2b7acbbc37dac6617e57e527e41b83").into(), + hex!("8f00d44e73473d7b96a686d1d3b0848095d0514b70128c22ccc4141219dc3f5d2ddc3345cc506ce0e747ba358289bcc6").into(), + hex!("911e37896367a3e8603eaf995480bbb62229a3758a608c4822410e46de45a1048ee6f67c2039aba9fc95281ba5476623").into(), + hex!("80a349a605d2968fbe362e40672b33eface969c975ef75a8fe82ee7ace1d0b5034b7af8667650e813876a8a7484414c8").into(), + hex!("8b00779d873c6976d8b01afc94734fcf943c1819ab1c46e512e0c43469cd08b93158caea1cde84d13a48f27407048748").into(), + hex!("99030a66c4afac7e3753abb669cdf576cf96e21b1d698135148ba133e2d8fe97b4875d770e6246597461958224f653c7").into(), + hex!("8766f592d757c09f617090eb8f226016073a992990e16fd64a705c0c3104b202d36de18ccadcdb3dac5d68afc2495b4c").into(), + hex!("961cce69a7a39c20500c96332d2ce4cdeb3d844082edd527fd1694cf499b30bd33f06da66047d3849b49f4c2ccc8bcf3").into(), + hex!("8bd5dee639c3ef32712931295cc5bd0a8820192aafd35d1f1f9a24130bf208b7cc3f2ae99d6fce02dcac4c8225564d5f").into(), + hex!("a89ba310a62330e7396ae361da7a74a596e4a8be02496c8f4b3c860ac5c3cacdfcf4790d00b2ffa75fa900db2bdb15fe").into(), + hex!("89bebf6f59151404989f282a567c378f2f5a04d85225e23e22e0963da27673f3c7e8990dfb526a1133a988811cd03f45").into(), + hex!("81e9ec6ed189c12ca8d4fe32e21c60834d7938f739545c7dd76303ce347b69beba9eb14ab780c00cfe3804c5756417ba").into(), + hex!("8bbbd7b584948e34852a26d18b9dbb46f2974fb68bc8317ba5a168094a74bbe2304e1dc438777ccf92117831f7986c84").into(), + hex!("8ffbf94991bddefde2bf0ccb115b00d7b19a6a448f093816b9db0c65a43a27519a52ac7b88e6e37a7f33d384d42b05e7").into(), + hex!("b62267be83a54451ace1b8e2b54994990d2e1d619e040c2075cf1906c25089dcbc08ed8c2f2f8f62953b822f163324fd").into(), + hex!("af6d55c342e0e7f0bc3ec547ebb4688a884b59410aca90ad6d8730b4fd3543952fe2476e2db871618d12901fbbd2b91b").into(), + hex!("9027b69f6e5d550acb459f8b4b9e3f05cf291c104594cd244b224eeb8cac419800ebfd5255d87e0dde31bba662e20134").into(), + hex!("8bd160918bfd8049878826f443fa416fe32bd018262b1b4802e015ffb0049197c34d730c5ecba951a93986cca1e23825").into(), + hex!("b82f2bf2bea66697c4b5ed6d340ba74bbe0dce84b2d23904270f3500507318ccca0dbc967a69c4379bd12766708dcbd8").into(), + hex!("b4d00a38be54fe5ba5984af648c9092b133f21b22e56ea106442421c03c26d282b81d31ef8d22ebf92c0c26f86d27512").into(), + hex!("857d95d8aab25f91e7cbe0ea70a3159723566192c1d6dc0e68c2b19565a865a0daeceb4b1c733f75b0dc9cbfe246d870").into(), + hex!("b222a1f3f2d05912987902a861796f43cde8124f7dc398170beb76b6434e7095a8e2d5de54b2692490cb0c325cef8956").into(), + hex!("b016f69dc65c3e72e77d43334863db2c364f3697c552d4bc0730f45cc32fab5f60a5dc0f9f2f6df409fe3e2ba3f2f3a2").into(), + hex!("931b966d70e048570c463bfe7ce7decaea3ad80d0540ca079ddb10958398ea27df85de2fb2b7c238d0763d6293d34b4c").into(), + hex!("aaa3cacaf65a90a6a8e8fcbb98b673160e5f410b28b08a8733444cd71de9e807e00b146ae35fff05160a786eba6793c7").into(), + hex!("8effa24ae2c3cc12aef32e737faf7985c03e2ccd984cdf740f31aac7a93ac295be7fafa3a4d47812d9e0fa5bc2b3472c").into(), + hex!("ae8f1044330885e22c376ba50926ca10177799628b1c3f6b731113126ace5faa7756ca80fda0c535ddc77d051632266e").into(), + hex!("8a6613706dce5417736438d9bc779e29646a0b12fb1c5b5e118aeffbe72d37ce71ef78d3da4f2cc8c1f3bb47f8721cd8").into(), + hex!("8a435b4d265a01f7de575ee8893105de8be608a370c2f1870b7b097bf3635abbdfaf164ac1c704a6c9b31d7baf48028a").into(), + hex!("ab842c0851dc81e247a42806ff83a2e23b86147d884cfc828cbd1f3abc7fee929657bb49a2910975be746f97d0bb7c7b").into(), + hex!("81966af3ed4bba12f6895bcc1e2d4af8a0b313f45446f4f2e966494460f77015d2c9e65eaf396653f8f55e50413e7986").into(), + hex!("b61357419b1d65649e79ccef51d68d1e7c746d77c7f32692b6ff315d9dacefdee2a527816ac3118e5c80e00212725c87").into(), + hex!("b3a0c1e36006ab666e4d4e98c78df5630abcc76e86b3c13c342efbb64c2f669d12a98e797429871c12a7171f7a751422").into(), + hex!("93601527015bc30178505d37cea121f19145e366be178e42c9ea7380ae34053c45938a3b4d8ef852ff8701764bf74a52").into(), + hex!("998a446e7b4dbd7a7a2055f437859dd3ddb44c52d3dad9250f085d797c821ed91a17dd13d00f532c5f0f2321c5b3eb9e").into(), + hex!("af35c5f4bb11a87ee3f626007cacfee4ca892851459cb9cb2e127e92c9c274f9082c905165758976f9c7bbaeb984acf6").into(), + hex!("a0df73b065667fa0f6a4894aba39b3e4aac620fb1a8a3be96c94423231917c3a7d75f04383b40cd802909d9cf018b0d1").into(), + hex!("85c9c5a5302b706af5af436c07d1a1a952ee1cf4a0cccf002f514473fcf85d05bc4c23b5da2d6d0b5d0aa503f7e41a65").into(), + hex!("abd1ffa853de61d8b26e6eb6c7eba5636967c155233a6d73fdddd361379ec51a74c242715b6ad0033a6343157aee7ebb").into(), + hex!("ae45b130af61f3e76012da75b19d46a786e0c21ca7c6b5bde193b2203d6d8b7b8afad25a198e8c920c69954d3d6bdc14").into(), + hex!("93729120899ef573f6f276a1ba861a400a35efff7a2074400bb6b5df818e3fc1f353cd5a8e4ce122a2bbd8f5b30126dc").into(), + hex!("b34615b2cf8912c51c02264008e0cd78b79c87b87d56db810d899490bc438d446f734ca958c7c291aff68e3211ec8c5c").into(), + hex!("a1ca372d158fd7eee15091582c6c1b9ac9854959677ee25e5786a94cf8c1d15b64f0019aef20331d9675e1f1ce41fd6c").into(), + hex!("a4bd66cf90f38233b579b8698f5655f077bdb1d626e1d36ceebc67cf7ab8ee8e129cbdc307895bf0fb6e34a4aeeffc68").into(), + hex!("ae06f6db3a3ea3a21193f6c6231db42d18fa3aa06a8295741bab35589dcb1d51256838dca01356d580e8c423c45ddbe9").into(), + hex!("b70b5f0cf21cb98c70996a9eb6e4b3562732505299149bbebef821477ff406dba3979a2526b9969213b9ba75e35de3f8").into(), + hex!("95cf5980f21a58f4604ffb99c8651752f724faacaa216f8c7cbe400774deda53f26aaa15fc6415e936f52ce13cec6ecb").into(), + hex!("933c0e5bbb358f5f83cf9e60c67ea8fdcc0b7a203fe5b07131e3bd69295c507880a1e542ab2a6a8d182866f7c6b14a8e").into(), + hex!("a8baa60ce583afcf85e4756dbb0a4871b330ee70f7872c3e36ac4d43f2587fbbdfa2a13162ceb7efdf897bb96fd2d97f").into(), + hex!("a127b3828c422ff51a067d482fb67074d45fd0a86bea5066c7f6dfa83f4b82b4584646518e898ff725cf5de055c6b236").into(), + hex!("871ef5a7f50e5ae528eb16bc30ceb64b97d111896d34fb4a65c93c8d0498eb7032033eb663f7b169a8af4b96e7acbe21").into(), + hex!("80d0bb10037029f0d8f8c9b9b46f0d0ff32b2198af44a4f84c8c0ace60f2b39f8f8d284308769c6075e9425d6229905b").into(), + hex!("b882ecbb78c758c951fe53b434af25b594e602dd783787f09ed077b79f7dd7851fed769a1593f5a5b938ea2171987d3c").into(), + hex!("ad41cb47b16077f73cbbc157527a17c936efa78a59d1f36e3c0dad67cd19fdc60cb772556018029611aa46643084f024").into(), + hex!("82ad3ad7a706ec19b39b0c8cf75d061ea3a1966dab04643f5b9d711e6651b45f0cd22ce5048cb51e4e118b305bdf231b").into(), + hex!("8286a4970b8db361abd04e5d197849dd335b7074f9c3fb91dfd19b7f43d2a3ae9e114b0cb6342463986d32d262c34d79").into(), + hex!("a844f14ffc4c99989a6c666dcdcc135c2fda96914220b1c565215d5c2c3102f5413b7edf9b25882a02a19aa78c2bc545").into(), + hex!("8e758f3b03fab7f5d0993e78674efe3f9cc211e268c12d23911fc01ae7a4c8f879a393e3fcde0c05c10106a59b59ab72").into(), + hex!("a973caa021aca6f0470460b84df9324ed894a441435a53c4f0c48fed4359242ee71fb3a0e4cf438839ed838f37e5c02e").into(), + hex!("ae17c713f10747282798487f02d25d2d8e7459ed436d90a895617afb9299ee81994ed68ef87ecdc0660b7565c323f0e8").into(), + hex!("978e68aa5f44daf9cfb9220147ff509ffde89d121d08d982a0fabae9f07cb3145c2312ad200f2f0dc051820fc54d07c0").into(), + hex!("844e58a9e35ce1005fd5785f56fdc9b3f7e8e073f48fa40da19a5e9e84aca00b8743c5407920cb554e926873092015c8").into(), + hex!("b296da231b6ca9d5535432c81f7d0c20a71cbd32d357740d1543e1e3910ea5d32b005938f9273af96e401637180f4606").into(), + hex!("8aee25d881e7ba99fa6aa2fc65ebd44aa498d31ecffc595ac8cab010f6cfdaca308f56e616ae51d7e2c2e15864eda0bc").into(), + hex!("a04298e32052d7f91096285c73d67cfb3f3f5463abb3d7caf3108d8d77aedf9896c359986ae598bf9602dc90e6eb3178").into(), + hex!("8c336e463dd98ecccefc55fa366ac70a2fcaf60acba2f2171490642a6f616a1c6b72601bfc3533a5f49ba02dd1e39fa1").into(), + hex!("b00b383ef5d68f0939c0538c7564614401283c6923dab4db4c72a05a88e05bb576ac374eda61c024345227bf45161e05").into(), + hex!("9273a1a6c9cbbc8d5a46498b7658f6125e955cbf19f0461d1372ea9de200688e4f7376b23b132b41cfd672fb42ec48b1").into(), + hex!("a7f04c0377207a6bb5d96e2e6cb9f7696d5dba2acc3dcd6021ecdb3d121a558999b2b3d92497f72f28f39a551b2fbfcb").into(), + hex!("8d530cf98af85dbd0bb7b1f2fdc24d499b19a941ef431bc7f37ca9328a4f6ceb0660eb87edbb1a5d868d3141fe6c51f5").into(), + hex!("ae88acd7fddf35c72c3ad1c507f8dc185546d8acdd92d70f00991f50afd67809167ad3171c7e45976456fca033f0a95b").into(), + hex!("8df71ffbc265a4bf475ac7ebdd5eba137f4c3b585075ea8957757661b3f11e7a92888094e85c8863ed53d91df45e37a7").into(), + hex!("917737cb24287f30c899dd88853ee3b9be54ea707ef38f1545ef9e436865be1399fd2de4d2c04e3fa5b4a3205f4305ac").into(), + hex!("837e57594b1b71fd9f25f27967b721df500e3d7c72f22e90f4315e10fabbef027ec1db0dd9863b817071fe3c9413a5af").into(), + hex!("94b9c2155509b2189883d2237cd37c9ed19c3a22203e9e2b045184aed072e406e93eb7b5c3fbfb85eeca4c5e630e4ed7").into(), + hex!("b022c75923080450ffe5ecb8e01972785628ec2027b6bf3dc2b09c92ba8ba55222965767c21a240705ed5af6e9d92695").into(), + hex!("b993e15339e28a472b3c98bec723ddeb7728822571ef1fb1c2a1607a4023f37d663b615c7855426170d9ad8f6a971617").into(), + hex!("b34db4df6a97056021b088c53cfa7cedc8e585f907a67d1ee8412a50d84e5e3d347011fb99d5d71b111c88f5efd44610").into(), + hex!("b582bbdd7e0d2ccabe94e6d193d1b8dcad1932d1e96ae8e1a295cc05b381646f682f1f66cb90ddcfcd7735b335ea0242").into(), + hex!("b289c068f7c988a69173d347361047211c302abfafbac1d87259388b5197274f5ee90d56228093a42eec32039e490868").into(), + hex!("88e84114e8e536051ef5197ad181f96ce13fcd5627f18964bf4bb2f461c6638033ba363800326e494e43aeee94c62125").into(), + hex!("80d16c3e8717274533ff3b764984479b3bc709f11ef5129644dfcbb5d8bdedc7a8cb2e539a4524bb0fd4d977ffd25fb0").into(), + hex!("9405d059e30017152eca6d6d86366a7a5570501d78c3869d638a2b8a0bdc8c5bce9f0b46764e78680e2fd41697af9d52").into(), + hex!("ae23483a1d25f8b9a5adea9527560cce5552994b3964ffde2fdda0ce7b6156e1d76e698d7314b0820976776baee37b63").into(), + hex!("8d8395fa4ff7ad0ae3be3d3c446cab058890cf7a07d0a2825e22396cc938cf2d7a986745be5e3c1758c5ca0dc29c0ea3").into(), + hex!("8c5899cfb437a72d99085d8abf54eeb345d7da59ef93978b0cd9207853dc491451939f4b1a7bf317c87504ce949713b2").into(), + hex!("816ca0740bce43365bb20e41c3d0c88cad587e4c743b2c0cac9dc966aa8de220da347d65392a9b750a2001499027e3c5").into(), + hex!("b3d23c55cec1d18bedd276d1454f93ad28c72d921dd6600d8102710770f52b79ee8cf445f6781c2ca095c9a25d41489f").into(), + hex!("95d541d6196c1221dfa5ff213dc3e658649a3cd4afc8e738631fc7b6914bf0dca74f41cf382fab364dcb0d2d6ed489ae").into(), + hex!("a1ab2fd361b973027f6ee6a9f8f2c081cb5d7199d69e36c280c7f9c3e99b1cfc994ad7f68ac0cd78c61bb419251fa14e").into(), + hex!("ad36ebc0cf82369457b665dfb2f8444fd2add0b49658cef2c800ab0297bade2c0249bb124f3d321536933128c1149c92").into(), + hex!("8f917e000d7688a0f508777b8db7c0ace39677c4458d7e50d8c9dc59d32faba4abdedfce3af26cf3d04c020e526ab597").into(), + hex!("aa994238e432c51896efdfa240f75fe40f1b1a7b624ff0aba66a35f827b9bf1197de3cdc0bbd9d0147304061ced0325f").into(), + hex!("943da065ec673dd41351270747e40c1f5a8dbd7ba259c501349ed754ffb91c56747a78c392cb4b78a796d748044798d7").into(), + hex!("b0c45ed1457710daa48edf2e61ba59988a8257ddf902318c6bb00be7a4ad8235b46180f7353d9f0c0f747a4cf219d1fc").into(), + hex!("81b56da0943d2940fc8041a51c74dd03f6dcd8a705ef2ec3b685395e313224861f29de31205d45e944e437179f19398d").into(), + hex!("aadd5eb1be98f3fc7e93925e46062353576ef2ee81421fe3f6850701728b8f74637d66cbcd344364565b0893d8bdcc9f").into(), + hex!("a5dd3dc1e172c899f4ed17fbdb842bea7d7f3f0d6b284af9749e25acbfbb2f9c1afb1848490bb22da9ddfeef30232323").into(), + hex!("84ba149e940db1663271eb16e920442bfeb035fc601a7389f85c78ce7bf27b13b5c1a5625d8b45dbbf199caf2d753bf9").into(), + hex!("b5634eb31a68f45a2aa17e8eae7752d8a58673fcc9efad34118b0f3db7415edfdc27166e6d809406da0bd26a0ae1371c").into(), + hex!("a2ad4aa94a40f1c159c7588ebdd77b80edbcfd95e867ec6991f711d39b4dc911cfb6da6075db23bc090218976e9ffa38").into(), + hex!("8de6002f3e789b014254b32161b5595257eb01ace67a8cd9657235e2d04f7ffce6ae0d059488bd9dc070c32b5b7b3fb3").into(), + hex!("a5f659b41f35fe6a9f43d1f72c803da876ee4aa5b879fbe5d5e93be38dcd5f10716122d83afd003b79b8120d83358884").into(), + hex!("a64e6b71dc6ab9eeb17d50e1d2516c5ae63680b50a6077fd870780aebffca70a8b7f8627e23731b79b3866813a20af0d").into(), + hex!("b0003260e70f86eeba286d3d9f6d73bf15f084e7240d9aeee38a1173ea5c47fd9a9637384204001873732e6a407edadf").into(), + hex!("8d4df6703cc9f1d0760c67ae6b20928ffeb6b13d67bc406b8a534ecb07d6ef415a106ed992b50267677f7d114f9d69c3").into(), + hex!("8cb982f382ac327918387c16c73de1ec5ff979923f1110b9660836ddc2f5f742aaf970700f7b27fb2fdacb126d341353").into(), + hex!("b6988aa5e4043e278c01c83a9774175b1188bc2d78b96817a7fb406f86aa4395b7eb666267e819a5a0615803f840171c").into(), + hex!("b69c70007de643e3fbaf7b557bcaaacb67288ef6ff616c9c89dee0cedd33a76396a90cb44207225568870c7c5601438c").into(), + hex!("971102768c0dba73925cfff2053b1cd8fa88f5c21aeba2cf3a78ac853818bb4a85cff714134879e5c7d7c7994cff20a7").into(), + hex!("b00b8d49b1f1fc0e792e257b0c3c33ab554fe231aaa6366f5aac11ff35051ae23cd2a5c6b9eecb3ad00e840c78d6a587").into(), + hex!("a34bf3b6d9659f1a89e40e3b35afe741a670a3a9305278a52d479535f4b5973b23b10ccdfa194cb2937f150beca3535f").into(), + hex!("a84c4fd757d86613a4bfe72cc9d7864c2c236b9463e365441360686e19f7f772ebb6c07a24c680462ffb1f3939c870d9").into(), + hex!("b3c34a2470e32395bd9c8789905166ba77b7b7d27cb504b8647dfb4fa6d65884afb2f120d83afd876b4a00cb104347a5").into(), + hex!("b9d18f57a669686eb8ec08555972e54505b7d487dfea7105afc76333138d5f934b9b5f9a3a7896481782fad5328bdbda").into(), + hex!("a23f65babfef6a2442833441200291028ebf56031d7154a4d7d0fa18acd4b7bd78dc34b85924c3073eb5be7733ac10f5").into(), + hex!("80948f3e12ffccd88605cd4d67abb83014c35d8d1a3254f6c546aa7197f810cdd06eb49b99f424187df218c8e8d7254e").into(), + hex!("b24ac23a86e23a16f4f04ed683ebaa51ccc6d2d038674e36d00a14fb71d46c433373a8a0bb75a0afd3c2f9605dd4867f").into(), + hex!("b002aef96f1702f4e3c92b00aa2976b57b77ed97a4d64619c6db676b286c6e633eca63fb232cec0d533a803660c20147").into(), + hex!("9867492f550c1f12276a201717bb4c420bffe904d55008655f929368b664e0293c1dabe9b5a5a71ad884a12686c1d9de").into(), + hex!("96b702733a7ef38b23e45999a04bacebe414a01bb41792cd9aff566fc23610d02e069c85c6fd4173846a40657a958e78").into(), + hex!("8e588db21f84245d034d7427055996f109133b9b3aa095472b879bd180052657da20a48513c1f625c339be90a64878e8").into(), + hex!("b6821bb1a130460ed1936d34cc189980d8fae8c5debc5149d47e90aad69ed3b143a3a00de5959e21ada73a06b3e8c9d1").into(), + hex!("a751ae06c6d699b5593f5928910e1ef3634dedd460ccd3f23d74f5f61a3950392aa66149ae366c048c6c7ece968c2d9c").into(), + hex!("86835cbe686b81fe7e096af5ac8c24f7cfffe2ce2b993626a606e42f6356c0d7c3d4ea19d110aa1a7b7f7ec5e68808f1").into(), + hex!("93719cea4911ce7e436f7b3ea77b9cfb83a1db903cb38f1de3b04d0a69a0f06bbc4f9acd3b313d46113009a917dd5996").into(), + hex!("b0d240c09c137a742d77edf11a7257030ef8b1a785b810de104fb24b22535cf0d62bc54f544b027d532f16b43a2df7e9").into(), + hex!("9376f46ab931f5c58b1be49c529ace24fade089af1af43b339721321a273169c5bb668250b2c2b0aa16aa522e6675bdd").into(), + hex!("82636e68d0d59d20dafd7486176b62ca2d5dd0275c8fff552fbb974565ef2406ff56cff5c43a5b9e383e0b09737de446").into(), + hex!("8f300fd7f29640aeb759d09735f9ac36d1035248c35ff38a165d2d931058268a055971b4fd4dd9d467960180cd255dba").into(), + hex!("a7d5f4e2b01dccd9cd7cbf566b5ab604efdaf9b682bb4ecae1b7801c2f93425350620e91ec807b0a110971c316e68cc1").into(), + hex!("8952700221cb45e3ab933ec20978d9c9c7b873784299b86d0c2d9998bb6b1d1efc1ee3bcd00c5148b2fd9473838ce067").into(), + hex!("b787e77d194e4dfb89968f4e289e97195c2674adba0a3e7d5582cefacdedf93a0e5f27d9d144aab68aaba878fd640414").into(), + hex!("8466c67bed3fbc30e46639de92c422f06bc80df658340a47299ad7798cae412c976fa6ae6bc0a32ce655b93b08cbeaf5").into(), + hex!("ab5d78cf76e16fcfc0491886fc1c95a492ccc67fd31060eb183b89bf59ed6e2d349324f9734c504e74c360272a22f369").into(), + hex!("a4f9f8539f9f89dc5a2c8296af591277c2d308275234729dee23e35e3d541919d1aa9a260780899615e2a895ad8fe703").into(), + hex!("94ed2cf23c5d28497b506515597ab71120f4ca42f7ebc5a4e87b798353eb70590923eaaf163bc550bf312bd6bb2c0b05").into(), + hex!("a78f064aa69402af33f1c9c1bcf04634384ad8528aaf8d28ce1d1a04804bdf93a8b49baddd6870eedf642e566d091af7").into(), + hex!("86796909d2dd3010e8d46c3d99a3c0efcbd4e986e581ef5be4c7810ed8b92268bbdac1dbf1b24d6805df6642f53f0b58").into(), + hex!("a6b555b50ec3b60e9768f407b84c5fd8a055150c17f78f2d5a3b0daa13f2c692e5041184bfc8919280c230c57adc9ddd").into(), + hex!("b4f9b0a0242ded4dc0a4903f16d270f21f2e15668b3abd45f79e1b465bf50074d232f905c6de6f2727a0a9ef039f7681").into(), + hex!("930b7dd8666a35358c6a0a42c600dbe8ad5d9682dfc641474fbd8fba90ddaac7d3ed5f5395f297dd571051ac2d603333").into(), + hex!("abba3bdcee368688a8e53d56627b915148fcab59717174fe8136c85bc24e8d15046da09b31c0c7c9a5bac1016bbfafb5").into(), + hex!("ac199e71110e15ebfb3e58b8ac14f1de8ebd3e0894f273f84783ef3fa4fd16ce6bfa5d41421e884e258fe8e2dce68075").into(), + hex!("a53eaed94fe550c07375ff5ed9706d69563bdba724a4022cf7c639737c97683f036400dcb87268184a9877eb116bd479").into(), + hex!("86e8269c1b368228438de5aa4065ab9d2888de7599b00d5382ebba8fb0600cf357de27e20edaa50127e213c7f6be1f6f").into(), + hex!("8f8d9b9b03b178d370a9e918dd54264f83c4ed20824be79427cbc973a9acf3d74637e5c35080192bb67e64390299c19a").into(), + hex!("a230cbc17aa669c2a9b02e736d20519d93a6fa1b6ed452e065fa78a0fb4b3a0f55fcbc5e719db6417353ef0798f70b43").into(), + hex!("b4e28c30e57cd33fdeb257cee66389365f4a1b9847f94e8b0552c65adff5719e51d50ec8bba36a71ec24641ce4fc6338").into(), + hex!("91799f066e16f9a07a419d3e425c959052f8ad1aee0e2f613d3b023829fb1946c81b16e8b733ed03ca924d03481bafcb").into(), + hex!("8ad935420f026b166233ad387c58857eafdd2fcd4efe55ce1bce9ffd668b8997555927fcec88b04de795129a10263d1e").into(), + hex!("a098f20bf1ae2510f1955c586c7115a29c64bd22a086a2f2a7ff5e08349bf24086504a1e5e1fa82b3aa73a097bcd948f").into(), + hex!("909a3d2e7bb5538bd89c446aa53f1f05a1ec17c88d793a310866cdda6e5d836d53fbb80afbf8baa8aa49db3836c912e8").into(), + hex!("89e64879667f34f1127cfacbd9a3337fa28c0227bac5c5ac907d6ad9c3a853472f4f7cf093e3b735968229398bc7c94b").into(), + hex!("b6ea32c4d640f9b7de841575a00003c1b25d0a845eb54b065129c271790bf602cc39761316c4e9dfc1644ae3ff4b05e1").into(), + hex!("80ef23a1cf6f50f96d5b4645bc79ed4c958f1394da9e5cda0cdaca3815ac8435a8d3a690ed19665b7cd1bef8bf7b0366").into(), + hex!("8b7346d1f30de7e50e3d3b32b441ba5681335d25ae6025623e1469466addc5515415a29ecfed987e07bd6a85ec1eabbc").into(), + hex!("99277ae52f7f2f193549739a704aa2f756c2ddff68b9848040ccacc675fa12d62c9fc1318daecba514089537a4e7b83a").into(), + hex!("94d392e29a3a1b8ce63c52288fdcd3f95f80bdd2a600626e2ce3517162e69b9c0eb36bae6786701ba12e23a33b8f90b4").into(), + hex!("8f270be40047911a4cd5997668bd6d62c90780882451c544ea4bdebe061a9e61bafa1d8bb8af62e0ce4fd73611a7f34d").into(), + hex!("a841f7229fd0490a853523edbd12a5dc6772bd607afd0516c582a813a10fd74d19f480d02b3e7b7b6256896620905976").into(), + hex!("aaf65a2e4e6a3d903ccb51a063d64688590a3ae54c7df3c5e8820d88533a6f10b81b130ab476c9f16c660a81f66dd3bf").into(), + hex!("b3683ebb70696339844ccac03925ec85c8dc06959608527a1744c23a67a805e71b5a91610fc6fbe0f667d054b4087e37").into(), + hex!("b042a5614245184e5a4620cd3a67c51811fcc0a0dff63ac06dc8030f01d8343ff0bd39ab3cdc3c09e4f3c1503ed35e62").into(), + hex!("8a343ff96dfae2c2e62558db3cc424b3c055e2cf84b53f63bf49c95d98ad0b372517df7afdb189007b7db725a3fbd567").into(), + hex!("a3a81a2b37160a371ceee3d07194a70e58041a3e6f75f47c4d8e2c619cae3f44b2de5703e3b80fbae9778e284927170a").into(), + hex!("b9554f94b7c611c2b3f63df5ac0f920d1eaff7b424bc8e857b94c354aa1d3c02a4348510099750e0af3e16dcd0f9a245").into(), + hex!("8678aae32f5bfb9dc249a39eb5d0638bd45d48d2b5b7be32b5e1c2be7b8d29d7198a15e2c24fa7813f060309f2493843").into(), + hex!("85f020a228f8952986c979028dbf2c2e8e59191970ea5e4cff6e6bb46251138d9edd90a211ccd53fd395db8addfb6d71").into(), + hex!("8b0801e8ea30467063d68caa5d3315809b3f21c7429f256fc2a10f7e173f0e1d1bbcf59e025b9e44238a53ef1b8318d9").into(), + hex!("a4d3fbad305853d8057c09bb10fdea9234ff90d51ad0c21342248895d77ead5a8c104c554e6008677e396b55d4efdea5").into(), + hex!("a7f12f870c5a3e2332f10cc2db7dc26ce58a94ff60ebc28f3ae06e820e6514d80c5133563225011213e53f51f748413e").into(), + hex!("a94ed25fba32b4302fff40e2c55e06b6fa4b9820635beb0b43df61010ab5cdaf944199bc73c4827214ae1f57bd75e70a").into(), + hex!("8607e973bc67d217ea67104eb538fcaabdcefcaa7da981ae0322916f7a74229b47f18820458823e7ef160f69f5363dbe").into(), + hex!("a83206fcc995ca57583c5952bef2027503308472bd712c536050217a391bf0fa9617d956ff6c913c2566cbc515cb291a").into(), + hex!("b9110bd697c294a0905503490d17d5536ac1782514bcbdd6f67e8fbb75c0922b39cb7f742d28cbf5356e4f1885b060c2").into(), + hex!("96e1d2b723a458f6b8cd4a8b2a83f33fc7931901cac1fe2169ffbf7c1ac8b4d8547165af3dc61c2b37ab88d3e81f940b").into(), + hex!("92cddef13af28962b7e281d5c0552ee5135b7a401944c9ab31d617b072cf00365e24dd87f86f6618b202d51c25f63fd6").into(), + hex!("a751e27a646ac1f3c828cb88585aeae6899d0940252973329b0589b05714bdc1cd271bf745d482f670f4ccbcd9a60d98").into(), + hex!("861fc00a2edf468353c6012a89ab7cddeaf964ee387e5eac48037eddc536df3d097c69a689f09bdad189384719d50e0e").into(), + hex!("a7dda298ac153aaa6a59785ed7b6900362b1220588a29b44764cc45834859bba0f5b9f8f17bba97fb49fa2c7ed4eb65f").into(), + hex!("a6b679d47e1ea1469e5dc14e1eba97ba2a0f2cec0a9a0983ca086f917298c93af45de60765aa2cb3759ed62c9eb5e4dc").into(), + hex!("b95b1f4472f8f69ee010d36db46c268c59cbd13864c63ce9e6a4755ad00c2db04c951e312b88060e8411018cf655e76a").into(), + hex!("935883b9eca730ef868329a67fe99ed5363b0384e7e6f97147d4c80a76d9b2d8ae6783e80d103149a8a3fbfd51f9f6be").into(), + hex!("ace980d1e3c76dcf78bbb87f3ca9bd0bba7897fcf9e24b27e00fa22855b1b4ac224137361ef6817c94fcc81fc3d3a3de").into(), + hex!("a614b6f113d74d4dd6dea66125b11195212031fd7d3da825b24739e5107cae653fb89c34527b399c43340064a9744a6e").into(), + hex!("83c27783856f9af7491ec9fd34be730600afa59484cae9d3981685cadb869dbd05555a07b93db7d0f361c9ae8e0bfe73").into(), + hex!("850f1389e21bec1c8785d17316a09af9355d32b75d02d9ad72791cfc5a411595a367ba9eb641c5b7acd6be1ee21579ea").into(), + hex!("b810405c7415c49bce0f7893aecde90da33b71684668877c5d6cdbe82161f9cd7eaa2d68597140e39fff8b9cd67424e5").into(), + hex!("a5923930d34526d70e083f4633de4766f04df901ca3adba4a462d03423b609d9813b78a2fcaa2d770a5abc27c260c39e").into(), + hex!("a6ec439bff50a4bef8d0cd47c52e92cf00846ca3fe97cf88e5b6d7800ea22d0ebcac49d9ecd123d4c156642f8bb4389f").into(), + hex!("97b7d3fbd11886976291a24e9e7d6f4974345e06024121eaf57097057c103b6f548d1f523416cd6b465e8109aa0be911").into(), + hex!("b45f04e0d4c17df2815a6fea2b04fd7cc2cbb8e6789084e224db3c1d00db1c6f1d325a63df25ee4a9a992553dab420b2").into(), + hex!("a91dc563b48b4cc210119ff55bec2957e8be50aa25928147d0434a9ea4088e98ba1f17c2050e713d2891a3c741ea6c6c").into(), + hex!("a12256c39f3b17c0540d2d3442b732b2485ae9da240a1ef47782549dc7e84f7a9c9240ff59a73fad228a3c01fe953169").into(), + hex!("aebc98b50533d844fe3149735750c10eab861e765aa7820e3d54fb66089ce15409206bb58d3aae5ef22a29ac5207c702").into(), + hex!("b023d0e4fc2eba4c60cedae9d2ffa79cdcd5c79279fa41baa94f536c17d746a6aa76e8fe203fb1678da126c4343eed8b").into(), + hex!("a673262367bde5d1775961c7d9aa26d9859c59600536130f9adc8f99f81f0106d2eab2c5ac3912476affcab3821fecdd").into(), + hex!("8008298954370c0c3026fd71fb48fc619caa394c9ea17273284a903b07de1d385336fad69c8ab6fe6692774d5fabcfc1").into(), + hex!("a98a824454bc0fba41a6543ba11ec6879c979e97c87e3f7f3a228ba995e33bcae9378740f925800b81d3627f2af36c51").into(), + hex!("a29c667540db41eb7ce06d74ad91c7ddeb3e1f019a028b8ed4ee705d8d079d6f7d36f1b64fd4b9b807f0dc1ab3d65d2d").into(), + hex!("86c32be8a7155f26696c1e541096ab43b3836315490a4bdad867b973ebfa8ac414e4074819b9639348a048bd6fc4bdee").into(), + hex!("a0de748319bb0c53c03f172c9aebc4f7538dfce6ffdd362d24ffdd111448277a8a705832e94f65c61aa635a5f40b6f0b").into(), + hex!("970de7621ef90cb3921f747ce1cf9d389f322cebc286c339395714a6d40167fe26e04e1fc3116d3b7bea1c99bfedf0fb").into(), + hex!("841ae6b0bdd22718fd917ca4a871d39cf6811b9a460b99422fb324235b2c51b460e48159d7e1bc1778de3513b7ab1f29").into(), + hex!("86764a78587892407b311892c4c4e70890bd757d3f72a832257f411646e9298eb4f042ec1c929cc6ffcf539dda90fe7e").into(), + hex!("b33008c5025d35243e91b6749e7d7934bd8334e5f58e88db907715435a28f02d018b09127fb0302d1ee68d7f97391040").into(), + hex!("b5ea29ebc8107525894d9872ac88b4c9662fd18d87316565a8b013529b478f17f6c1c0ddf6482db6ede54d27c0e80782").into(), + hex!("9576def9e5dd8673d3dec2090536672d44368b78b2c2f70dd9e36a9d0e5889cd9e2a47b77ebda94388ac75679257b829").into(), + hex!("823dd44b4635bf095786e47f836c4af02d4dea848bc1cd823876266341d56496e09bec8612413c302fb34c3383a55e0e").into(), + hex!("b6a32b13f8b1339b0591b9db343696aab77a0c2ff181d2069ff39581da8904499d619c26e6e44209b7791c3aa2fb7aa2").into(), + hex!("b9b3262a97049e236e29afc4a7c6d2e2253f437e013b90bd0882d35d46d7a67e1344b3dc822fcae27717a9887d842a81").into(), + hex!("8a94e08cda133175049eb2cddae936b16c477db54a749b8d3378233034f56fdea99520755ec8eb355b738af61138d9a2").into(), + hex!("a55933f63c4cce4d99d8df4fe6dc9d9a3054379ed2560bb2a9147f9e456925ab29f7b1f14321ab2501d67dd759f5ef36").into(), + hex!("8b5a713fb50a2aa0671f1405876b0a829a5c1f7c9915906bcad26de7e2011f8eb2e2b7a1cbf94c19685edf8b364f242d").into(), + hex!("97cd2419d4aaabe457b1efa6d2e557a0c4d8725e57e33018626fb31395ed78555b79cf90da49975360a497049004b20c").into(), + hex!("90d640d0c949a73543b476e0b634d442c0bbe0f4d3f1f4f99d19fd8d37d3b99c4bb3c5c08ee77c24f0af6dc7c29ce658").into(), + hex!("8f65263c9ac0026d9a536360c8b01b40243cc27a7896fada367372ba82ffcf2c758bba9f92c96fdd66956b25d7162903").into(), + hex!("ac50c7c4b3201f2c98e812e83452ded2e2dfbeb4c1910b873978c4b5b443b34dde042b13cb4943759cefe1a546bd8197").into(), + hex!("a07a157ebb964282729ab09205f5a2df132b5a0103233dca67dd55215b84e66423c576c6e0b055bf85c6a27025fe1aba").into(), + hex!("b89462ff76b35af9a1f23bbeb7f3b6e2f72f4d96aaa30fcce820573654895c76d813f27dea9251c96ea9e3f1726da99e").into(), + hex!("a81866a83434f91d464a93a50c4906224f3108777f731a1d363d16f769795be8ffd23c25f0e051d8c43a55b665c15bda").into(), + hex!("a974e15a6315d56d612f5e8d70171b01baba976ae1602265cdb74e1f5cf3a48c94e8b90bf1d343f3f56f8f9ece604ecb").into(), + hex!("97ad199e4ba05c97c5aa90cc6e63ed86f78fbea35b9f56f5107df643efe40647d1ac7e50cf6e1de8b4ede8e2225e090c").into(), + hex!("a67c3822c0e5902355fe053c3c41765146018dd90de0df89c6ae230826056e91cad2a28f06859b8ea899486ddbdbe6fa").into(), + hex!("a5dd8329edde8fdb8f82fb71637c7a4d1e13c51ab2b24cc98b80952575e821fe31c3e7de5a566f8a98e0243cebc6d1d5").into(), + hex!("b7070e8349dbd4359414c0d909de10a472c4a7fc4827804b3e1980b1cd8f468d21d4c6163c234c05f05534e423f6199b").into(), + hex!("a1acc31ccbb89ba6ba5be3ffc26ef83a28c3b0f76be71f87ef618f9f8171c8afdbc5f05c521c67171ea9fde1bad7a9dc").into(), + hex!("a86d620245d119b34f55c6145a65937e5ed5281803675e120d8c2de05eabc08f85eb8d8c877aebf535663518c4fe2f88").into(), + hex!("885317798c5b49430d50d5c5eb527540b0b704794d88d510b2511e9fea2de299d8f2cf2ae2e96196a9c0925ab1f30da1").into(), + hex!("8a5c37ad34f1867fc9fdd3303ffb86fb0d98ce27fd6739078949c070b44081349368302d7c910fd3d886165b5fbd3304").into(), + hex!("a1935e801664a3f51c22e616d25fbecb3f3be76b936e4d2dc28a4bbe79d002ddf01b94cdf9e18d07f2e2c4bccdfd76a9").into(), + hex!("b3d13a611ada38fb6c802e6f7e09d03703e9e7bf82424ded2774d6493dc0c7d8965e7839ff4d3f9fe00a1e8fb20bf13c").into(), + hex!("84f6edb320cf92e147ba3ba8b2470c57dd107b80ea8083219d3c91b77fba7b20b6774ae7ace26924c02c9a2247842bcc").into(), + hex!("86546f16627c3b875790b604aeb19c925f6d32db27c2ebf405df0324095fab1f8b748fd94b6c2b5a2dfeaf748a565b3f").into(), + hex!("b95563cebc351d8237e5f9b8ab984976e84ebf7e16c62102629cbda06c86b013c6a973d007d72a870883408b8343fd1f").into(), + hex!("8d5eff4d3238446be0f805b8f387fd57f298dfcadba88a0d87234bbede46d0ef833beb0f2ede7a51fa84a808393757b4").into(), + hex!("862179dd50e7a0fa7906248c0f3671d8d3b25504e30276da74a36edfebc8c92a04abc9dc3cba8c1b34005beb06cceca3").into(), + hex!("b12bf5775e3f9ae29da6b127ffe2892d5dec12f9c1bc21426c225220cb0d5fca5c6376afb5bf5f112f79c6563694007d").into(), + hex!("957cd40aa0864b86bc64420a184988be4489c0f0a3363f39571e71a7443ac6815a1b8ce4862c736be8441108dd78101b").into(), + hex!("8f31cdb655b66e1f8ad877639f71524aa78c09acc24aa493bd6f6be383c295f51a6e70f2573081cf87cd41ef55f5428d").into(), + hex!("a8f304c1f2faa78683d409dbb0c11e26583fdfe845f2557e378c56acc9baaa88cce25442733edcdd0da70f3e5557e53b").into(), + ], + aggregate_pubkey: hex!("870e9dfe2c909b7116a9a4180da4fb6ac4865f9304adc4c36dde6f82338c43352b58dfb494e6095bfade1dbf86e7f939").into(), + }, + next_sync_committee_branch: vec![ + hex!("d138fae7ec85d4d5ebd8d7375b3f39f4bf0d05439e6920a44bcc977e62ee0dfa").into(), + hex!("a6baa91932e6f9d9fec678e9fd75a140c8e74bd87f11d37093839826b95ceeec").into(), + hex!("926c0348ccc4c44119ca84e50911ac22078ab704b0784ebc593155da5c5adb53").into(), + hex!("c4a04575645ebf0cf5b3317a092e595adf49dd93669424c2a5efef700ed082a1").into(), + hex!("81a062566009887529ffc6350f713cd2aa30460c13173fe9ffcdbde71fd69f8b").into(), + ], + }), + finalized_header: BeaconHeader{ + slot: 5808479, + proposer_index: 218610, + parent_root: hex!("ac0c3b35e7e21d11d0563f98fb16bbfb0460aef2ee5fe39ea209aed66694601e").into(), + state_root: hex!("c66e3a4f1718ce82f35c898e8df8080c540aca493a535a2f6170a13b550faef3").into(), + body_root: hex!("207806f82ac8c5bdb6793dc61f31ce91dd06a7fe3a143d29b6579975c64d1d9c").into(), + }, + finality_branch: vec![ + hex!("0bc5020000000000000000000000000000000000000000000000000000000000").into(), + hex!("8c04962a994aadff4d3042da73e167e666323757db5b0234a497c7ddba058ded").into(), + hex!("95901d6dae3edaab0f29f2c6155edbc4eb3980b6816339a464fb51b91fafdb7a").into(), + hex!("926c0348ccc4c44119ca84e50911ac22078ab704b0784ebc593155da5c5adb53").into(), + hex!("c4a04575645ebf0cf5b3317a092e595adf49dd93669424c2a5efef700ed082a1").into(), + hex!("81a062566009887529ffc6350f713cd2aa30460c13173fe9ffcdbde71fd69f8b").into(), + ], + block_roots_root: hex!("93a5736680a9dfe23df1f8a6098c0671c583dae469847e25da3532b3649ae11b").into(), + block_roots_branch: vec![ + hex!("31a647639bd26edd8e3976b4475933d18d7d238210881f57570b7b4030133da0").into(), + hex!("0a3392c5febec2f099f93c5465c68f4f1630927d0326ad84c8d0b318364dcd82").into(), + hex!("986071ec073d43597d67a6595f7f6fc807ef1042c6821fda41ff80aa2717536f").into(), + hex!("732f545955de627e65c46201f053569dceab609948147690136bc64e060f38b4").into(), + hex!("2e7c74db495877af1e95da27113e89757ea475e8d672d319e655810ec64d4ba2").into(), + ], + }) +} + +pub fn make_finalized_header_update() -> Box { + Box::new(Update { + attested_header: BeaconHeader { + slot: 5809441, + proposer_index: 169069, + parent_root: hex!("a4d2fbf3ee62f32589738f386559a1e2358f4f54aff5f7eaea61144d3d9c00d1").into(), + state_root: hex!("4aad4183bc21fc96c90f8e043049f8c1d5ed205c6880c89cd99f2e080ef85138").into(), + body_root: hex!("406c96c6adad01df901df3625cbd622f1d541249b05c768ccc4db5643d973141").into(), + }, + sync_aggregate: SyncAggregate{ + sync_committee_bits: hex!("7fabbff6fcdefbebaefffff9e37dfffebff57f7bf3e3efbcfef1f7f987551dd176f3b3ff7bfa3fedff5fdf7f7afff5ff777bef5f9f7fe65f97fffe7dfdfffbdd"), + sync_committee_signature: hex!("84dc756c452ec9a3ba01cc98d03cf5471b871e9f3f77ddfe72ddf6d5d318ec3de9e5c1508e47ed362300cd45a144655a076d50073c24a67591b0454d2a4632bc01e97eab80f937a8288131a31ab76f400ba9c26a19df176c7e67b724f70407c3").into(), + }, + signature_slot: 5809445, + next_sync_committee_update: None, + finalized_header: BeaconHeader { + slot: 5809375, + proposer_index: 170923, + parent_root: hex!("87fed31787712fa6e802b9f296c1eb0b0ac5bc77f6945d4478c4d25bd7160d1a").into(), + state_root: hex!("246ac89e1854bada03be1da64081954e008238de219088609ddf45efc8000346").into(), + body_root: hex!("ffe0fdbdc2bf57bebdd084fce3820a13801095d236a2fb8f3a64c9d7cf94f8b9").into(), + }, + finality_branch: vec![ + hex!("27c5020000000000000000000000000000000000000000000000000000000000").into(), + hex!("8c04962a994aadff4d3042da73e167e666323757db5b0234a497c7ddba058ded").into(), + hex!("95901d6dae3edaab0f29f2c6155edbc4eb3980b6816339a464fb51b91fafdb7a").into(), + hex!("34e68ed57efdf18c5d2f455e77fa8b2a5be95bb827bdf7f7f6648103688d84b7").into(), + hex!("fc1d45f882aa66020a92c55da663ab9758581a020eb7336173fe84ef861bbdf9").into(), + hex!("7d1745c42ec44d4b2493a55dafdb770f6d38eb4a7ad68ae0264949cb7432e4a7").into(), + ], + block_roots_root: hex!("9e5aeee5467301f3a44d1ab664cebd198519423e73e2118ad046d9bae217f497").into(), + block_roots_branch: vec![ + hex!("ef671e41918c36e23a3673407050b420366022886dcce1b707622de97a695121").into(), + hex!("707cb79caeaf310c10ce1c177312e48b2331164c8327d2635203148c4d974f09").into(), + hex!("1fd802c27384482fdaacfa7406072f6f96ff5428f003af748068d1965cc36981").into(), + hex!("8a31cc13bddabda4f79d948e5e3d70806f638b61d89c87b40aa7131af43c18a8").into(), + hex!("70eb43218a3a6f619f1d0dc7f173fc9c3323fa7e3824ae6cd79af2f7d19634ad").into(), + ] + }) +} + +pub fn make_execution_header_update() -> Box { + Box::new(ExecutionHeaderUpdate { + header: BeaconHeader { + slot: 5809374, + proposer_index: 130336, + parent_root: hex!("2bb54c61560a80d1cfb0528e8ea207dfb9d55ab49238523e21609a9ee3b8a9b5").into(), + state_root: hex!("0116ea76f5c36373dfc8e039811eba86c8e8e16cfe9f0614376559b6585741a7").into(), + body_root: hex!("9a10b47e30bc11fc2ee1e21943a8382d727444f646f09664192236458b555ffe").into(), + }, + ancestry_proof: Some(AncestryProof { + header_branch: vec![ + hex!("eca009f3262f75b055e6c919e2c0a2c017f017e581a825a2618a2a76926a264e").into(), + hex!("a647371a5590630186dd47b9b8571f27e39a77b4aac1f763fabefe104bf94985").into(), + hex!("9a414690540e4c87ff5171b619b3ab6ff1115c21f247196989f5a0a9085b59a1").into(), + hex!("1bf7ae16fcde0833c6e97a83b72aef31a0b5ca055b87f86602b9b4aa193f557c").into(), + hex!("588d993d05b59bf3352f0f5ebb4cd3ec97ca3e41800da675996741e8fca374c0").into(), + hex!("fdfc6280944bb0a18c9cd0afa9f4a255719a4650233f19de478399276f198c92").into(), + hex!("1d96235b47c604f029b9ab7eb913b13b3c0c2df7f79e3301341b1ec38ea44e4c").into(), + hex!("3ee3af17ce8f5a4946d30b6bce7d6e7580b3981cd2af92246401e2326224f6d1").into(), + hex!("b53b5450e070adf02f4bb9d7c65dd131d07ae2218340eec95ac8aa5e5cdd82aa").into(), + hex!("4d7c09715a1f25574afa1dc3dd7bb44e4c1a723b9360c893b8510f675f85227a").into(), + hex!("38c159fc38dedc1e4f399a3f773ab4376fc40b126634b40d172d5daa6602cf94").into(), + hex!("9faac6fa44ed19fcf530f77b7090dd50dd17aeedabe763931ab7567276025a75").into(), + hex!("c6549c1b0f0027ac373164437e7010b955fbae1a0e78485408ec33ca906beb2d").into(), + ], + finalized_block_root: hex!("f6e721e4e65d9565091a557705285ec6db0a3a3072317317719ec8ad563859a3").into(), + }), + execution_header: ExecutionPayloadHeader { + parent_hash: hex!("6d51d7c94763813ffefa234097a51c6fd7009424d2991695f7bd6203157c86f9").into(), + fee_recipient: hex!("000095e79eac4d76aab57cb2c1f091d553b36ca0").into(), + state_root: hex!("fe9f753520a7b5c0263bbf4fdba728f69e9cf861ce1883aa13de5da30ff75d74").into(), + receipts_root: hex!("cf6ab47d8fc336155b18abfa2d965aae57d9d35a2fcf5cfc992b8dcd136958cb").into(), + logs_bloom: hex!("8427414fce71480d7e70cdbac68dd6f77608c05cf349c34c87ad3256e8dde9e3f9c52131945876c03b6e83ea5970536428283a180eb40efcc5fd834ce424f0dbf622dbba6cfda7945cc1f93a1b6e7ae448c598b4f45f7cfa933fe9808d835cb86e8a38261a031448e262f8e4f2dc4c3254c460e5faae4b518438c1330012154a1ba33ab7d85c8acaa9c47dc582fd003a771c9b09aa16c34d4f0c01fbb3f8c0a28e11d2eafb4e73b75a18e182eac7c021706832a9a785836d31f651efacf88a329334e5b3def3bf1871573dc3553f415f298a9457f7837a31302937a4178be1339cdbb83af329ae7e88d8ab6cba62f018be139896ecbc7ac11ef24b0b4ae343e9").into(), + prev_randao: hex!("5a76eff974d26bf74dc3003fac473ab4abc541be26bd61f124a1818a70ea0b3e").into(), + block_number: 9143323, + gas_limit: 30000000, + gas_used: 28165724, + timestamp: 1686220488, + extra_data: hex!("").into(), + base_fee_per_gas: U256::from(2267_u64), + block_hash: hex!("e4a67cdb1512f29ad9b331e7a37cf8e376222eafa58e72cee7771ad582cc0610").into(), + transactions_root: hex!("bd7eaeb676c14c37bbf0b6f3db2ce021a04a41dbf002f6c7df3bb61639ac7287").into(), + withdrawals_root: hex!("8647d3ecaaf62e1d087c5ab54a23f1d64f477b7ddd16fff458847181d89fc432").into(), + }, + execution_branch: vec![ + hex!("795608ac1294bcc663127b8428513ba4a5ffe952ff72f8322dca23628f13d716").into(), + hex!("336488033fe5f3ef4ccc12af07b9370b92e553e35ecb4a337a1b1c0e4afe1e0e").into(), + hex!("db56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71").into(), + hex!("2a8f5c65655edeb2800f248f2e14044fc651061d0c00c8e8b627cb21ba421fb4").into(), + ], + }) +} diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/mod.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/mod.rs new file mode 100644 index 00000000000..cba22fc86c9 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/mod.rs @@ -0,0 +1,156 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use super::*; + +mod fixtures; +mod util; + +use crate::Pallet as EthereumBeaconClient; +use frame_benchmarking::v2::*; +use frame_system::RawOrigin; + +use fixtures::{ + make_checkpoint, make_execution_header_update, make_finalized_header_update, + make_sync_committee_update, +}; + +use primitives::{ + fast_aggregate_verify, prepare_aggregate_pubkey, prepare_aggregate_signature, + verify_merkle_branch, +}; +use util::*; + +#[benchmarks] +mod benchmarks { + use super::*; + + #[benchmark] + fn force_checkpoint() -> Result<(), BenchmarkError> { + let checkpoint_update = make_checkpoint(); + let block_root: H256 = checkpoint_update.header.hash_tree_root().unwrap(); + + #[extrinsic_call] + _(RawOrigin::Root, Box::new(*checkpoint_update)); + + assert!(>::get() == block_root); + assert!(>::get(block_root).is_some()); + + Ok(()) + } + + #[benchmark] + fn submit() -> Result<(), BenchmarkError> { + let caller: T::AccountId = whitelisted_caller(); + let checkpoint_update = make_checkpoint(); + let finalized_header_update = make_finalized_header_update(); + let block_root: H256 = finalized_header_update.finalized_header.hash_tree_root().unwrap(); + EthereumBeaconClient::::process_checkpoint_update(&checkpoint_update)?; + + #[extrinsic_call] + submit(RawOrigin::Signed(caller.clone()), Box::new(*finalized_header_update)); + + assert!(>::get() == block_root); + assert!(>::get(block_root).is_some()); + + Ok(()) + } + + #[benchmark] + fn submit_with_sync_committee() -> Result<(), BenchmarkError> { + let caller: T::AccountId = whitelisted_caller(); + let checkpoint_update = make_checkpoint(); + let sync_committee_update = make_sync_committee_update(); + EthereumBeaconClient::::process_checkpoint_update(&checkpoint_update)?; + + #[extrinsic_call] + submit(RawOrigin::Signed(caller.clone()), Box::new(*sync_committee_update)); + + assert!(>::exists()); + + Ok(()) + } + + #[benchmark] + fn submit_execution_header() -> Result<(), BenchmarkError> { + let caller: T::AccountId = whitelisted_caller(); + let checkpoint_update = make_checkpoint(); + let finalized_header_update = make_finalized_header_update(); + let execution_header_update = make_execution_header_update(); + let execution_header_hash = execution_header_update.execution_header.block_hash; + EthereumBeaconClient::::process_checkpoint_update(&checkpoint_update)?; + EthereumBeaconClient::::process_update(&finalized_header_update)?; + + #[extrinsic_call] + _(RawOrigin::Signed(caller.clone()), Box::new(*execution_header_update)); + + assert!(>::contains_key(execution_header_hash)); + + Ok(()) + } + + #[benchmark(extra)] + fn bls_fast_aggregate_verify_pre_aggregated() -> Result<(), BenchmarkError> { + EthereumBeaconClient::::process_checkpoint_update(&make_checkpoint())?; + let update = make_sync_committee_update(); + let participant_pubkeys = participant_pubkeys::(&update)?; + let signing_root = signing_root::(&update)?; + let agg_sig = + prepare_aggregate_signature(&update.sync_aggregate.sync_committee_signature).unwrap(); + let agg_pub_key = prepare_aggregate_pubkey(&participant_pubkeys).unwrap(); + + #[block] + { + agg_sig.fast_aggregate_verify_pre_aggregated(signing_root.as_bytes(), &agg_pub_key); + } + + Ok(()) + } + + #[benchmark(extra)] + fn bls_fast_aggregate_verify() -> Result<(), BenchmarkError> { + EthereumBeaconClient::::process_checkpoint_update(&make_checkpoint())?; + let update = make_sync_committee_update(); + let current_sync_committee = >::get(); + let absent_pubkeys = absent_pubkeys::(&update)?; + let signing_root = signing_root::(&update)?; + + #[block] + { + fast_aggregate_verify( + ¤t_sync_committee.aggregate_pubkey, + &absent_pubkeys, + signing_root, + &update.sync_aggregate.sync_committee_signature, + ) + .unwrap(); + } + + Ok(()) + } + + #[benchmark(extra)] + fn verify_merkle_proof() -> Result<(), BenchmarkError> { + EthereumBeaconClient::::process_checkpoint_update(&make_checkpoint())?; + let update = make_sync_committee_update(); + let block_root: H256 = update.finalized_header.hash_tree_root().unwrap(); + + #[block] + { + verify_merkle_branch( + block_root, + &update.finality_branch, + config::FINALIZED_ROOT_SUBTREE_INDEX, + config::FINALIZED_ROOT_DEPTH, + update.attested_header.state_root, + ); + } + + Ok(()) + } + + impl_benchmark_test_suite!( + EthereumBeaconClient, + crate::mock::mainnet::new_tester(), + crate::mock::mainnet::Test + ); +} diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/util.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/util.rs new file mode 100644 index 00000000000..7e5ded6e1f0 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/util.rs @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use crate::{ + decompress_sync_committee_bits, Config, CurrentSyncCommittee, Pallet as EthereumBeaconClient, + Update, ValidatorsRoot, Vec, +}; +use primitives::PublicKeyPrepared; +use sp_core::H256; + +pub fn participant_pubkeys( + update: &Update, +) -> Result, &'static str> { + let sync_committee_bits = + decompress_sync_committee_bits(update.sync_aggregate.sync_committee_bits); + let current_sync_committee = >::get(); + let pubkeys = EthereumBeaconClient::::find_pubkeys( + &sync_committee_bits, + (*current_sync_committee.pubkeys).as_ref(), + true, + ); + Ok(pubkeys) +} + +pub fn absent_pubkeys(update: &Update) -> Result, &'static str> { + let sync_committee_bits = + decompress_sync_committee_bits(update.sync_aggregate.sync_committee_bits); + let current_sync_committee = >::get(); + let pubkeys = EthereumBeaconClient::::find_pubkeys( + &sync_committee_bits, + (*current_sync_committee.pubkeys).as_ref(), + false, + ); + Ok(pubkeys) +} + +pub fn signing_root(update: &Update) -> Result { + let validators_root = >::get(); + let signing_root = EthereumBeaconClient::::signing_root( + &update.attested_header, + validators_root, + update.signature_slot, + )?; + Ok(signing_root) +} diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mainnet.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mainnet.rs new file mode 100644 index 00000000000..3d22ad82cec --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mainnet.rs @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +pub const SLOTS_PER_EPOCH: usize = 32; +pub const SECONDS_PER_SLOT: usize = 12; +pub const EPOCHS_PER_SYNC_COMMITTEE_PERIOD: usize = 256; +pub const SYNC_COMMITTEE_SIZE: usize = 512; +pub const SYNC_COMMITTEE_BITS_SIZE: usize = SYNC_COMMITTEE_SIZE / 8; +pub const SLOTS_PER_HISTORICAL_ROOT: usize = 8192; +pub const IS_MINIMAL: bool = false; +pub const BLOCK_ROOT_AT_INDEX_DEPTH: usize = 13; diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/minimal.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/minimal.rs new file mode 100644 index 00000000000..affa86db976 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/minimal.rs @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +pub const SLOTS_PER_EPOCH: usize = 8; +pub const SECONDS_PER_SLOT: usize = 6; +pub const EPOCHS_PER_SYNC_COMMITTEE_PERIOD: usize = 8; +pub const SYNC_COMMITTEE_SIZE: usize = 32; +pub const SYNC_COMMITTEE_BITS_SIZE: usize = SYNC_COMMITTEE_SIZE / 8; +pub const SLOTS_PER_HISTORICAL_ROOT: usize = 64; +pub const IS_MINIMAL: bool = true; +pub const BLOCK_ROOT_AT_INDEX_DEPTH: usize = 6; diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mod.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mod.rs new file mode 100644 index 00000000000..6b959ebfec9 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mod.rs @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use primitives::merkle_proof::{generalized_index_length, subtree_index}; +use static_assertions::const_assert; + +pub mod mainnet; +pub mod minimal; + +#[cfg(not(feature = "beacon-spec-mainnet"))] +pub use minimal::*; + +#[cfg(feature = "beacon-spec-mainnet")] +pub use mainnet::*; + +// Generalized Indices + +// get_generalized_index(BeaconState, 'block_roots') +pub const BLOCK_ROOTS_INDEX: usize = 37; +pub const BLOCK_ROOTS_SUBTREE_INDEX: usize = subtree_index(BLOCK_ROOTS_INDEX); +pub const BLOCK_ROOTS_DEPTH: usize = generalized_index_length(BLOCK_ROOTS_INDEX); + +// get_generalized_index(BeaconState, 'finalized_checkpoint', 'root') +pub const FINALIZED_ROOT_INDEX: usize = 105; +pub const FINALIZED_ROOT_SUBTREE_INDEX: usize = subtree_index(FINALIZED_ROOT_INDEX); +pub const FINALIZED_ROOT_DEPTH: usize = generalized_index_length(FINALIZED_ROOT_INDEX); + +// get_generalized_index(BeaconState, 'current_sync_committee') +pub const CURRENT_SYNC_COMMITTEE_INDEX: usize = 54; +pub const CURRENT_SYNC_COMMITTEE_SUBTREE_INDEX: usize = subtree_index(CURRENT_SYNC_COMMITTEE_INDEX); +pub const CURRENT_SYNC_COMMITTEE_DEPTH: usize = + generalized_index_length(CURRENT_SYNC_COMMITTEE_INDEX); + +// get_generalized_index(BeaconState, 'next_sync_committee') +pub const NEXT_SYNC_COMMITTEE_INDEX: usize = 55; +pub const NEXT_SYNC_COMMITTEE_SUBTREE_INDEX: usize = subtree_index(NEXT_SYNC_COMMITTEE_INDEX); +pub const NEXT_SYNC_COMMITTEE_DEPTH: usize = generalized_index_length(NEXT_SYNC_COMMITTEE_INDEX); + +// get_generalized_index(BeaconBlockBody, 'execution_payload') +pub const EXECUTION_HEADER_INDEX: usize = 25; +pub const EXECUTION_HEADER_SUBTREE_INDEX: usize = subtree_index(EXECUTION_HEADER_INDEX); +pub const EXECUTION_HEADER_DEPTH: usize = generalized_index_length(EXECUTION_HEADER_INDEX); + +pub const MAX_EXTRA_DATA_BYTES: usize = 32; +pub const MAX_LOGS_BLOOM_SIZE: usize = 256; +pub const MAX_FEE_RECIPIENT_SIZE: usize = 20; + +pub const MAX_BRANCH_PROOF_SIZE: usize = 20; + +/// DomainType('0x07000000') +/// +pub const DOMAIN_SYNC_COMMITTEE: [u8; 4] = [7, 0, 0, 0]; + +pub const PUBKEY_SIZE: usize = 48; +pub const SIGNATURE_SIZE: usize = 96; + +const_assert!(SYNC_COMMITTEE_BITS_SIZE == SYNC_COMMITTEE_SIZE / 8); diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/functions.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/functions.rs new file mode 100644 index 00000000000..751e63c7f86 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/functions.rs @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use crate::config::{ + EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH, SYNC_COMMITTEE_BITS_SIZE, + SYNC_COMMITTEE_SIZE, +}; + +/// Decompress packed bitvector into byte vector according to SSZ deserialization rules. Each byte +/// in the decompressed vector is either 0 or 1. +pub fn decompress_sync_committee_bits( + input: [u8; SYNC_COMMITTEE_BITS_SIZE], +) -> [u8; SYNC_COMMITTEE_SIZE] { + primitives::decompress_sync_committee_bits::( + input, + ) +} + +/// Compute the sync committee period in which a slot is contained. +pub fn compute_period(slot: u64) -> u64 { + slot / SLOTS_PER_EPOCH as u64 / EPOCHS_PER_SYNC_COMMITTEE_PERIOD as u64 +} + +/// Compute epoch in which a slot is contained. +pub fn compute_epoch(slot: u64, slots_per_epoch: u64) -> u64 { + slot / slots_per_epoch +} + +/// Sums the bit vector of sync committee participation. +pub fn sync_committee_sum(sync_committee_bits: &[u8]) -> u32 { + sync_committee_bits.iter().fold(0, |acc: u32, x| acc + *x as u32) +} diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/impls.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/impls.rs new file mode 100644 index 00000000000..7e72b12631c --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/impls.rs @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use super::*; + +use snowbridge_core::inbound::{ + VerificationError::{self, *}, + *, +}; +use snowbridge_ethereum::Receipt; + +impl Verifier for Pallet { + /// Verify a message by verifying the existence of the corresponding + /// Ethereum log in a block. Returns the log if successful. The execution header containing + /// the log should be in the beacon client storage, meaning it has been verified and is an + /// ancestor of a finalized beacon block. + fn verify(event_log: &Log, proof: &Proof) -> Result<(), VerificationError> { + log::info!( + target: "ethereum-beacon-client", + "💫 Verifying message with block hash {}", + proof.block_hash, + ); + + let header = >::get(proof.block_hash).ok_or(HeaderNotFound)?; + + let receipt = match Self::verify_receipt_inclusion(header.receipts_root, proof) { + Ok(receipt) => receipt, + Err(err) => { + log::error!( + target: "ethereum-beacon-client", + "💫 Verification of receipt inclusion failed for block {}: {:?}", + proof.block_hash, + err + ); + return Err(err) + }, + }; + + log::trace!( + target: "ethereum-beacon-client", + "💫 Verified receipt inclusion for transaction at index {} in block {}", + proof.tx_index, proof.block_hash, + ); + + event_log.validate().map_err(|_| InvalidLog)?; + + // Convert snowbridge_core::inbound::Log to snowbridge_ethereum::Log. + let event_log = snowbridge_ethereum::Log { + address: event_log.address, + topics: event_log.topics.clone(), + data: event_log.data.clone(), + }; + + if !receipt.contains_log(&event_log) { + log::error!( + target: "ethereum-beacon-client", + "💫 Event log not found in receipt for transaction at index {} in block {}", + proof.tx_index, proof.block_hash, + ); + return Err(LogNotFound) + } + + log::info!( + target: "ethereum-beacon-client", + "💫 Receipt verification successful for {}", + proof.block_hash, + ); + + Ok(()) + } +} + +impl Pallet { + /// Verifies that the receipt encoded in `proof.data` is included in the block given by + /// `proof.block_hash`. + pub fn verify_receipt_inclusion( + receipts_root: H256, + proof: &Proof, + ) -> Result { + let result = verify_receipt_proof(receipts_root, &proof.data.1).ok_or(InvalidProof)?; + + match result { + Ok(receipt) => Ok(receipt), + Err(err) => { + log::trace!( + target: "ethereum-beacon-client", + "💫 Failed to decode transaction receipt: {}", + err + ); + Err(InvalidProof) + }, + } + } +} diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/lib.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/lib.rs new file mode 100644 index 00000000000..fdda200251a --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/lib.rs @@ -0,0 +1,841 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! Ethereum Beacon Client +//! +//! A light client that verifies consensus updates signed by the sync committee of the beacon chain. +//! +//! # Extrinsics +//! +//! ## Governance +//! +//! * [`Call::force_checkpoint`]: Set the initial trusted consensus checkpoint. +//! * [`Call::set_operating_mode`]: Set the operating mode of the pallet. Can be used to disable +//! processing of conensus updates. +//! +//! ## Consensus Updates +//! +//! * [`Call::submit`]: Submit a finalized beacon header with an optional sync committee update +//! * [`Call::submit_execution_header`]: Submit an execution header together with an ancestry proof +//! that can be verified against an already imported finalized beacon header. +#![cfg_attr(not(feature = "std"), no_std)] + +pub mod config; +pub mod functions; +pub mod impls; +pub mod types; +pub mod weights; + +#[cfg(any(test, feature = "fuzzing"))] +pub mod mock; + +#[cfg(all(test, not(feature = "beacon-spec-mainnet")))] +mod tests; + +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; + +use frame_support::{ + dispatch::DispatchResult, pallet_prelude::OptionQuery, traits::Get, transactional, +}; +use frame_system::ensure_signed; +use primitives::{ + fast_aggregate_verify, verify_merkle_branch, verify_receipt_proof, BeaconHeader, BlsError, + CompactBeaconState, CompactExecutionHeader, ExecutionHeaderState, ForkData, ForkVersion, + ForkVersions, PublicKeyPrepared, SigningData, +}; +use snowbridge_core::{BasicOperatingMode, RingBufferMap}; +use sp_core::H256; +use sp_std::prelude::*; +pub use weights::WeightInfo; + +use functions::{ + compute_epoch, compute_period, decompress_sync_committee_bits, sync_committee_sum, +}; +pub use types::ExecutionHeaderBuffer; +use types::{ + CheckpointUpdate, ExecutionHeaderUpdate, FinalizedBeaconStateBuffer, SyncCommitteePrepared, + Update, +}; + +pub use pallet::*; + +pub use config::SLOTS_PER_HISTORICAL_ROOT; + +pub const LOG_TARGET: &str = "ethereum-beacon-client"; + +#[frame_support::pallet] +pub mod pallet { + use super::*; + + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + + #[derive(scale_info::TypeInfo, codec::Encode, codec::Decode, codec::MaxEncodedLen)] + #[codec(mel_bound(T: Config))] + #[scale_info(skip_type_params(T))] + pub struct MaxFinalizedHeadersToKeep(PhantomData); + impl Get for MaxFinalizedHeadersToKeep { + fn get() -> u32 { + // Consider max latency allowed between LatestFinalizedState and LatestExecutionState is + // the total slots in one sync_committee_period so 1 should be fine we keep 2 periods + // here for redundancy. + const MAX_REDUNDANCY: u32 = 2; + config::EPOCHS_PER_SYNC_COMMITTEE_PERIOD as u32 * MAX_REDUNDANCY + } + } + + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::config] + pub trait Config: frame_system::Config { + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + #[pallet::constant] + type ForkVersions: Get; + /// Maximum number of execution headers to keep + #[pallet::constant] + type MaxExecutionHeadersToKeep: Get; + type WeightInfo: WeightInfo; + } + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + BeaconHeaderImported { + block_hash: H256, + slot: u64, + }, + ExecutionHeaderImported { + block_hash: H256, + block_number: u64, + }, + SyncCommitteeUpdated { + period: u64, + }, + /// Set OperatingMode + OperatingModeChanged { + mode: BasicOperatingMode, + }, + } + + #[pallet::error] + pub enum Error { + SkippedSyncCommitteePeriod, + /// Attested header is older than latest finalized header. + IrrelevantUpdate, + NotBootstrapped, + SyncCommitteeParticipantsNotSupermajority, + InvalidHeaderMerkleProof, + InvalidSyncCommitteeMerkleProof, + InvalidExecutionHeaderProof, + InvalidAncestryMerkleProof, + InvalidBlockRootsRootMerkleProof, + HeaderNotFinalized, + BlockBodyHashTreeRootFailed, + HeaderHashTreeRootFailed, + SyncCommitteeHashTreeRootFailed, + SigningRootHashTreeRootFailed, + ForkDataHashTreeRootFailed, + ExpectedFinalizedHeaderNotStored, + BLSPreparePublicKeysFailed, + BLSVerificationFailed(BlsError), + InvalidUpdateSlot, + /// The given update is not in the expected period, or the given next sync committee does + /// not match the next sync committee in storage. + InvalidSyncCommitteeUpdate, + ExecutionHeaderTooFarBehind, + ExecutionHeaderSkippedBlock, + Halted, + } + + /// Latest imported checkpoint root + #[pallet::storage] + #[pallet::getter(fn initial_checkpoint_root)] + pub(super) type InitialCheckpointRoot = StorageValue<_, H256, ValueQuery>; + + /// Latest imported finalized block root + #[pallet::storage] + #[pallet::getter(fn latest_finalized_block_root)] + pub(super) type LatestFinalizedBlockRoot = StorageValue<_, H256, ValueQuery>; + + /// Beacon state by finalized block root + #[pallet::storage] + #[pallet::getter(fn finalized_beacon_state)] + pub(super) type FinalizedBeaconState = + StorageMap<_, Identity, H256, CompactBeaconState, OptionQuery>; + + /// Finalized Headers: Current position in ring buffer + #[pallet::storage] + pub(crate) type FinalizedBeaconStateIndex = StorageValue<_, u32, ValueQuery>; + + /// Finalized Headers: Mapping of ring buffer index to a pruning candidate + #[pallet::storage] + pub(crate) type FinalizedBeaconStateMapping = + StorageMap<_, Identity, u32, H256, ValueQuery>; + + #[pallet::storage] + #[pallet::getter(fn validators_root)] + pub(super) type ValidatorsRoot = StorageValue<_, H256, ValueQuery>; + + /// Sync committee for current period + #[pallet::storage] + pub(super) type CurrentSyncCommittee = + StorageValue<_, SyncCommitteePrepared, ValueQuery>; + + /// Sync committee for next period + #[pallet::storage] + pub(super) type NextSyncCommittee = + StorageValue<_, SyncCommitteePrepared, ValueQuery>; + + /// Latest imported execution header + #[pallet::storage] + #[pallet::getter(fn latest_execution_state)] + pub(super) type LatestExecutionState = + StorageValue<_, ExecutionHeaderState, ValueQuery>; + + /// Execution Headers + #[pallet::storage] + pub type ExecutionHeaders = + StorageMap<_, Identity, H256, CompactExecutionHeader, OptionQuery>; + + /// Execution Headers: Current position in ring buffer + #[pallet::storage] + pub type ExecutionHeaderIndex = StorageValue<_, u32, ValueQuery>; + + /// Execution Headers: Mapping of ring buffer index to a pruning candidate + #[pallet::storage] + pub type ExecutionHeaderMapping = StorageMap<_, Identity, u32, H256, ValueQuery>; + + /// The current operating mode of the pallet. + #[pallet::storage] + #[pallet::getter(fn operating_mode)] + pub type OperatingMode = StorageValue<_, BasicOperatingMode, ValueQuery>; + + #[pallet::call] + impl Pallet { + #[pallet::call_index(0)] + #[pallet::weight(T::WeightInfo::force_checkpoint())] + #[transactional] + /// Used for pallet initialization and light client resetting. Needs to be called by + /// the root origin. + pub fn force_checkpoint( + origin: OriginFor, + update: Box, + ) -> DispatchResult { + ensure_root(origin)?; + Self::process_checkpoint_update(&update)?; + Ok(()) + } + + #[pallet::call_index(1)] + #[pallet::weight({ + match update.next_sync_committee_update { + None => T::WeightInfo::submit(), + Some(_) => T::WeightInfo::submit_with_sync_committee(), + } + })] + #[transactional] + /// Submits a new finalized beacon header update. The update may contain the next + /// sync committee. + pub fn submit(origin: OriginFor, update: Box) -> DispatchResult { + ensure_signed(origin)?; + ensure!(!Self::operating_mode().is_halted(), Error::::Halted); + Self::process_update(&update)?; + Ok(()) + } + + #[pallet::call_index(2)] + #[pallet::weight(T::WeightInfo::submit_execution_header())] + #[transactional] + /// Submits a new execution header update. The relevant related beacon header + /// is also included to prove the execution header, as well as ancestry proof data. + pub fn submit_execution_header( + origin: OriginFor, + update: Box, + ) -> DispatchResult { + ensure_signed(origin)?; + ensure!(!Self::operating_mode().is_halted(), Error::::Halted); + Self::process_execution_header_update(&update)?; + Ok(()) + } + + /// Halt or resume all pallet operations. May only be called by root. + #[pallet::call_index(3)] + #[pallet::weight((T::DbWeight::get().reads_writes(1, 1), DispatchClass::Operational))] + pub fn set_operating_mode( + origin: OriginFor, + mode: BasicOperatingMode, + ) -> DispatchResult { + ensure_root(origin)?; + OperatingMode::::set(mode); + Self::deposit_event(Event::OperatingModeChanged { mode }); + Ok(()) + } + } + + impl Pallet { + /// Forces a finalized beacon header checkpoint update. The current sync committee, + /// with a header attesting to the current sync committee, should be provided. + /// An `block_roots` proof should also be provided. This is used for ancestry proofs + /// for execution header updates. + pub(crate) fn process_checkpoint_update(update: &CheckpointUpdate) -> DispatchResult { + let sync_committee_root = update + .current_sync_committee + .hash_tree_root() + .map_err(|_| Error::::SyncCommitteeHashTreeRootFailed)?; + + // Verifies the sync committee in the Beacon state. + ensure!( + verify_merkle_branch( + sync_committee_root, + &update.current_sync_committee_branch, + config::CURRENT_SYNC_COMMITTEE_SUBTREE_INDEX, + config::CURRENT_SYNC_COMMITTEE_DEPTH, + update.header.state_root + ), + Error::::InvalidSyncCommitteeMerkleProof + ); + + let header_root: H256 = update + .header + .hash_tree_root() + .map_err(|_| Error::::HeaderHashTreeRootFailed)?; + + // This is used for ancestry proofs in ExecutionHeader updates. This verifies the + // BeaconState: the beacon state root is the tree root; the `block_roots` hash is the + // tree leaf. + ensure!( + verify_merkle_branch( + update.block_roots_root, + &update.block_roots_branch, + config::BLOCK_ROOTS_SUBTREE_INDEX, + config::BLOCK_ROOTS_DEPTH, + update.header.state_root + ), + Error::::InvalidBlockRootsRootMerkleProof + ); + + let sync_committee_prepared: SyncCommitteePrepared = (&update.current_sync_committee) + .try_into() + .map_err(|_| >::BLSPreparePublicKeysFailed)?; + >::set(sync_committee_prepared); + >::kill(); + InitialCheckpointRoot::::set(header_root); + >::kill(); + + Self::store_validators_root(update.validators_root); + Self::store_finalized_header(header_root, update.header, update.block_roots_root)?; + + Ok(()) + } + + pub(crate) fn process_update(update: &Update) -> DispatchResult { + Self::cross_check_execution_state()?; + Self::verify_update(update)?; + Self::apply_update(update)?; + Ok(()) + } + + /// Cross check to make sure that execution header import does not fall too far behind + /// finalised beacon header import. If that happens just return an error and pause + /// processing until execution header processing has caught up. + pub(crate) fn cross_check_execution_state() -> DispatchResult { + let latest_finalized_state = + FinalizedBeaconState::::get(LatestFinalizedBlockRoot::::get()) + .ok_or(Error::::NotBootstrapped)?; + let latest_execution_state = Self::latest_execution_state(); + // The execution header import should be at least within the slot range of a sync + // committee period. + let max_latency = config::EPOCHS_PER_SYNC_COMMITTEE_PERIOD * config::SLOTS_PER_EPOCH; + ensure!( + latest_execution_state.beacon_slot == 0 || + latest_finalized_state.slot < + latest_execution_state.beacon_slot + max_latency as u64, + Error::::ExecutionHeaderTooFarBehind + ); + Ok(()) + } + + /// References and strictly follows + /// Verifies that provided next sync committee is valid through a series of checks + /// (including checking that a sync committee period isn't skipped and that the header is + /// signed by the current sync committee. + fn verify_update(update: &Update) -> DispatchResult { + // Verify sync committee has sufficient participants. + let participation = + decompress_sync_committee_bits(update.sync_aggregate.sync_committee_bits); + Self::sync_committee_participation_is_supermajority(&participation)?; + + // Verify update does not skip a sync committee period. + ensure!( + update.signature_slot > update.attested_header.slot && + update.attested_header.slot >= update.finalized_header.slot, + Error::::InvalidUpdateSlot + ); + // Retrieve latest finalized state. + let latest_finalized_state = + FinalizedBeaconState::::get(LatestFinalizedBlockRoot::::get()) + .ok_or(Error::::NotBootstrapped)?; + let store_period = compute_period(latest_finalized_state.slot); + let signature_period = compute_period(update.signature_slot); + if >::exists() { + ensure!( + (store_period..=store_period + 1).contains(&signature_period), + Error::::SkippedSyncCommitteePeriod + ) + } else { + ensure!(signature_period == store_period, Error::::SkippedSyncCommitteePeriod) + } + + // Verify update is relevant. + let update_attested_period = compute_period(update.attested_header.slot); + let update_has_next_sync_committee = !>::exists() && + (update.next_sync_committee_update.is_some() && + update_attested_period == store_period); + ensure!( + update.attested_header.slot > latest_finalized_state.slot || + update_has_next_sync_committee, + Error::::IrrelevantUpdate + ); + + // Verify that the `finality_branch`, if present, confirms `finalized_header` to match + // the finalized checkpoint root saved in the state of `attested_header`. + let finalized_block_root: H256 = update + .finalized_header + .hash_tree_root() + .map_err(|_| Error::::HeaderHashTreeRootFailed)?; + ensure!( + verify_merkle_branch( + finalized_block_root, + &update.finality_branch, + config::FINALIZED_ROOT_SUBTREE_INDEX, + config::FINALIZED_ROOT_DEPTH, + update.attested_header.state_root + ), + Error::::InvalidHeaderMerkleProof + ); + + // Though following check does not belong to ALC spec we verify block_roots_root to + // match the finalized checkpoint root saved in the state of `finalized_header` so to + // cache it for later use in `verify_ancestry_proof`. + ensure!( + verify_merkle_branch( + update.block_roots_root, + &update.block_roots_branch, + config::BLOCK_ROOTS_SUBTREE_INDEX, + config::BLOCK_ROOTS_DEPTH, + update.finalized_header.state_root + ), + Error::::InvalidBlockRootsRootMerkleProof + ); + + // Verify that the `next_sync_committee`, if present, actually is the next sync + // committee saved in the state of the `attested_header`. + if let Some(next_sync_committee_update) = &update.next_sync_committee_update { + let sync_committee_root = next_sync_committee_update + .next_sync_committee + .hash_tree_root() + .map_err(|_| Error::::SyncCommitteeHashTreeRootFailed)?; + if update_attested_period == store_period && >::exists() { + let next_committee_root = >::get().root; + ensure!( + sync_committee_root == next_committee_root, + Error::::InvalidSyncCommitteeUpdate + ); + } + ensure!( + verify_merkle_branch( + sync_committee_root, + &next_sync_committee_update.next_sync_committee_branch, + config::NEXT_SYNC_COMMITTEE_SUBTREE_INDEX, + config::NEXT_SYNC_COMMITTEE_DEPTH, + update.attested_header.state_root + ), + Error::::InvalidSyncCommitteeMerkleProof + ); + } + + // Verify sync committee aggregate signature. + let sync_committee = if signature_period == store_period { + >::get() + } else { + >::get() + }; + let absent_pubkeys = + Self::find_pubkeys(&participation, (*sync_committee.pubkeys).as_ref(), false); + let signing_root = Self::signing_root( + &update.attested_header, + Self::validators_root(), + update.signature_slot, + )?; + // Improvement here per + // suggested start from the full set aggregate_pubkey then subtracting the absolute + // minority that did not participate. + fast_aggregate_verify( + &sync_committee.aggregate_pubkey, + &absent_pubkeys, + signing_root, + &update.sync_aggregate.sync_committee_signature, + ) + .map_err(|e| Error::::BLSVerificationFailed(e))?; + + Ok(()) + } + + /// Reference and strictly follows DispatchResult { + let latest_finalized_state = + FinalizedBeaconState::::get(LatestFinalizedBlockRoot::::get()) + .ok_or(Error::::NotBootstrapped)?; + if let Some(next_sync_committee_update) = &update.next_sync_committee_update { + let store_period = compute_period(latest_finalized_state.slot); + let update_finalized_period = compute_period(update.finalized_header.slot); + let sync_committee_prepared: SyncCommitteePrepared = (&next_sync_committee_update + .next_sync_committee) + .try_into() + .map_err(|_| >::BLSPreparePublicKeysFailed)?; + + if !>::exists() { + ensure!( + update_finalized_period == store_period, + >::InvalidSyncCommitteeUpdate + ); + >::set(sync_committee_prepared); + } else if update_finalized_period == store_period + 1 { + >::set(>::get()); + >::set(sync_committee_prepared); + } + log::info!( + target: LOG_TARGET, + "💫 SyncCommitteeUpdated at period {}.", + update_finalized_period + ); + Self::deposit_event(Event::SyncCommitteeUpdated { + period: update_finalized_period, + }); + }; + + if update.finalized_header.slot > latest_finalized_state.slot { + let finalized_block_root: H256 = update + .finalized_header + .hash_tree_root() + .map_err(|_| Error::::HeaderHashTreeRootFailed)?; + Self::store_finalized_header( + finalized_block_root, + update.finalized_header, + update.block_roots_root, + )?; + } + + Ok(()) + } + + /// Validates an execution header for import. The beacon header containing the execution + /// header is sent, plus the execution header, along with a proof that the execution header + /// is rooted in the beacon header body. + pub(crate) fn process_execution_header_update( + update: &ExecutionHeaderUpdate, + ) -> DispatchResult { + let latest_finalized_state = + FinalizedBeaconState::::get(LatestFinalizedBlockRoot::::get()) + .ok_or(Error::::NotBootstrapped)?; + // Checks that the header is an ancestor of a finalized header, using slot number. + ensure!( + update.header.slot <= latest_finalized_state.slot, + Error::::HeaderNotFinalized + ); + + // Checks that we don't skip execution headers, they need to be imported sequentially. + let latest_execution_state: ExecutionHeaderState = Self::latest_execution_state(); + ensure!( + latest_execution_state.block_number == 0 || + update.execution_header.block_number == + latest_execution_state.block_number + 1, + Error::::ExecutionHeaderSkippedBlock + ); + + // Gets the hash tree root of the execution header, in preparation for the execution + // header proof (used to check that the execution header is rooted in the beacon + // header body. + let execution_header_root: H256 = update + .execution_header + .hash_tree_root() + .map_err(|_| Error::::BlockBodyHashTreeRootFailed)?; + + ensure!( + verify_merkle_branch( + execution_header_root, + &update.execution_branch, + config::EXECUTION_HEADER_SUBTREE_INDEX, + config::EXECUTION_HEADER_DEPTH, + update.header.body_root + ), + Error::::InvalidExecutionHeaderProof + ); + + let block_root: H256 = update + .header + .hash_tree_root() + .map_err(|_| Error::::HeaderHashTreeRootFailed)?; + + match &update.ancestry_proof { + Some(proof) => { + Self::verify_ancestry_proof( + block_root, + update.header.slot, + &proof.header_branch, + proof.finalized_block_root, + )?; + }, + None => { + // If the ancestry proof is not provided, we expect this header to be a + // finalized header. We need to check that the header hash matches the finalized + // header root at the expected slot. + let state = >::get(block_root) + .ok_or(Error::::ExpectedFinalizedHeaderNotStored)?; + if update.header.slot != state.slot { + return Err(Error::::ExpectedFinalizedHeaderNotStored.into()) + } + }, + } + + Self::store_execution_header( + update.execution_header.block_hash, + update.execution_header.clone().into(), + update.header.slot, + block_root, + ); + + Ok(()) + } + + /// Verify that `block_root` is an ancestor of `finalized_block_root` Used to prove that + /// an execution header is an ancestor of a finalized header (i.e. the blocks are + /// on the same chain). + fn verify_ancestry_proof( + block_root: H256, + block_slot: u64, + block_root_proof: &[H256], + finalized_block_root: H256, + ) -> DispatchResult { + let state = >::get(finalized_block_root) + .ok_or(Error::::ExpectedFinalizedHeaderNotStored)?; + + ensure!(block_slot < state.slot, Error::::HeaderNotFinalized); + + let index_in_array = block_slot % (SLOTS_PER_HISTORICAL_ROOT as u64); + let leaf_index = (SLOTS_PER_HISTORICAL_ROOT as u64) + index_in_array; + + ensure!( + verify_merkle_branch( + block_root, + block_root_proof, + leaf_index as usize, + config::BLOCK_ROOT_AT_INDEX_DEPTH, + state.block_roots_root + ), + Error::::InvalidAncestryMerkleProof + ); + + Ok(()) + } + + /// Computes the signing root for a given beacon header and domain. The hash tree root + /// of the beacon header is computed, and then the combination of the beacon header hash + /// and the domain makes up the signing root. + pub(super) fn compute_signing_root( + beacon_header: &BeaconHeader, + domain: H256, + ) -> Result { + let beacon_header_root = beacon_header + .hash_tree_root() + .map_err(|_| Error::::HeaderHashTreeRootFailed)?; + + let hash_root = SigningData { object_root: beacon_header_root, domain } + .hash_tree_root() + .map_err(|_| Error::::SigningRootHashTreeRootFailed)?; + + Ok(hash_root) + } + + /// Stores a compacted (slot and block roots root (hash of the `block_roots` beacon state + /// field, used for ancestry proof)) beacon state in a ring buffer map, with the header root + /// as map key. + fn store_finalized_header( + header_root: H256, + header: BeaconHeader, + block_roots_root: H256, + ) -> DispatchResult { + let slot = header.slot; + + >::insert( + header_root, + CompactBeaconState { slot: header.slot, block_roots_root }, + ); + >::set(header_root); + + log::info!( + target: LOG_TARGET, + "💫 Updated latest finalized block root {} at slot {}.", + header_root, + slot + ); + + Self::deposit_event(Event::BeaconHeaderImported { block_hash: header_root, slot }); + + Ok(()) + } + + /// Stores the provided execution header in pallet storage. The header is stored + /// in a ring buffer map, with the block hash as map key. The last imported execution + /// header is also kept in storage, for the relayer to check import progress. + pub(crate) fn store_execution_header( + block_hash: H256, + header: CompactExecutionHeader, + beacon_slot: u64, + beacon_block_root: H256, + ) { + let block_number = header.block_number; + + >::insert(block_hash, header); + + log::trace!( + target: LOG_TARGET, + "💫 Updated latest execution block at {} to number {}.", + block_hash, + block_number + ); + + LatestExecutionState::::mutate(|s| { + s.beacon_block_root = beacon_block_root; + s.beacon_slot = beacon_slot; + s.block_hash = block_hash; + s.block_number = block_number; + }); + + Self::deposit_event(Event::ExecutionHeaderImported { block_hash, block_number }); + } + + /// Stores the validators root in storage. Validators root is the hash tree root of all the + /// validators at genesis and is used to used to identify the chain that we are on + /// (used in conjunction with the fork version). + /// + fn store_validators_root(validators_root: H256) { + >::set(validators_root); + } + + /// Returns the domain for the domain_type and fork_version. The domain is used to + /// distinguish between the different players in the chain (see DomainTypes + /// ) and to ensure we are + /// addressing the correct chain. + /// + pub(super) fn compute_domain( + domain_type: Vec, + fork_version: ForkVersion, + genesis_validators_root: H256, + ) -> Result { + let fork_data_root = + Self::compute_fork_data_root(fork_version, genesis_validators_root)?; + + let mut domain = [0u8; 32]; + domain[0..4].copy_from_slice(&(domain_type)); + domain[4..32].copy_from_slice(&(fork_data_root.0[..28])); + + Ok(domain.into()) + } + + /// Computes the fork data root. The fork data root is a merkleization of the current + /// fork version and the genesis validators root. + fn compute_fork_data_root( + current_version: ForkVersion, + genesis_validators_root: H256, + ) -> Result { + let hash_root = ForkData { + current_version, + genesis_validators_root: genesis_validators_root.into(), + } + .hash_tree_root() + .map_err(|_| Error::::ForkDataHashTreeRootFailed)?; + + Ok(hash_root) + } + + /// Checks that the sync committee bits (the votes of the sync committee members, + /// represented by bits 0 and 1) is more than a supermajority (2/3 of the votes are + /// positive). + pub(super) fn sync_committee_participation_is_supermajority( + sync_committee_bits: &[u8], + ) -> DispatchResult { + let sync_committee_sum = sync_committee_sum(sync_committee_bits); + ensure!( + ((sync_committee_sum * 3) as usize) >= sync_committee_bits.len() * 2, + Error::::SyncCommitteeParticipantsNotSupermajority + ); + + Ok(()) + } + + /// Returns the fork version based on the current epoch. The hard fork versions + /// are defined in pallet config. + pub(super) fn compute_fork_version(epoch: u64) -> ForkVersion { + Self::select_fork_version(&T::ForkVersions::get(), epoch) + } + + /// Returns the fork version based on the current epoch. + pub(super) fn select_fork_version(fork_versions: &ForkVersions, epoch: u64) -> ForkVersion { + if epoch >= fork_versions.capella.epoch { + return fork_versions.capella.version + } + if epoch >= fork_versions.bellatrix.epoch { + return fork_versions.bellatrix.version + } + if epoch >= fork_versions.altair.epoch { + return fork_versions.altair.version + } + + fork_versions.genesis.version + } + + /// Returns a vector of public keys that participated in the sync committee block signage. + /// Sync committee bits is an array of 0s and 1s, 0 meaning the corresponding sync committee + /// member did not participate in the vote, 1 meaning they participated. + /// This method can find the absent or participating members, based on the participant + /// parameter. participant = false will return absent participants, participant = true will + /// return participating members. + pub fn find_pubkeys( + sync_committee_bits: &[u8], + sync_committee_pubkeys: &[PublicKeyPrepared], + participant: bool, + ) -> Vec { + let mut pubkeys: Vec = Vec::new(); + for (bit, pubkey) in sync_committee_bits.iter().zip(sync_committee_pubkeys.iter()) { + if *bit == u8::from(participant) { + pubkeys.push(*pubkey); + } + } + pubkeys + } + + /// Calculates signing root for BeaconHeader. The signing root is used for the message + /// value in BLS signature verification. + pub fn signing_root( + header: &BeaconHeader, + validators_root: H256, + signature_slot: u64, + ) -> Result { + let fork_version = Self::compute_fork_version(compute_epoch( + signature_slot, + config::SLOTS_PER_EPOCH as u64, + )); + let domain_type = config::DOMAIN_SYNC_COMMITTEE.to_vec(); + // Domains are used for for seeds, for signatures, and for selecting aggregators. + let domain = Self::compute_domain(domain_type, fork_version, validators_root)?; + // Hash tree root of SigningData - object root + domain + let signing_root = Self::compute_signing_root(header, domain)?; + Ok(signing_root) + } + } +} diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs new file mode 100644 index 00000000000..4d1d14a1015 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs @@ -0,0 +1,275 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use crate as ethereum_beacon_client; +use frame_support::parameter_types; +use pallet_timestamp; +use primitives::{Fork, ForkVersions}; +use sp_core::H256; +use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; + +#[cfg(not(feature = "beacon-spec-mainnet"))] +pub mod minimal { + use super::*; + + use crate::config; + use hex_literal::hex; + use primitives::CompactExecutionHeader; + use snowbridge_core::inbound::{Log, Proof}; + use sp_runtime::BuildStorage; + use std::{fs::File, path::PathBuf}; + + type Block = frame_system::mocking::MockBlock; + + frame_support::construct_runtime!( + 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}, + } + ); + + parameter_types! { + pub const BlockHashCount: u64 = 250; + pub const SS58Prefix: u8 = 42; + } + + impl frame_system::Config for Test { + type BaseCallFilter = frame_support::traits::Everything; + type OnSetCode = (); + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = u64; + type Lookup = IdentityLookup; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = BlockHashCount; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = (); + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = SS58Prefix; + type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; + type Block = Block; + } + + impl pallet_timestamp::Config for Test { + type Moment = u64; + type OnTimestampSet = (); + type MinimumPeriod = (); + type WeightInfo = (); + } + + parameter_types! { + pub const ExecutionHeadersPruneThreshold: u32 = 10; + pub const ChainForkVersions: ForkVersions = ForkVersions{ + genesis: Fork { + version: [0, 0, 0, 1], // 0x00000001 + epoch: 0, + }, + altair: Fork { + version: [1, 0, 0, 1], // 0x01000001 + epoch: 0, + }, + bellatrix: Fork { + version: [2, 0, 0, 1], // 0x02000001 + epoch: 0, + }, + capella: Fork { + version: [3, 0, 0, 1], // 0x03000001 + epoch: 0, + }, + }; + } + + impl ethereum_beacon_client::Config for Test { + type RuntimeEvent = RuntimeEvent; + type ForkVersions = ChainForkVersions; + type MaxExecutionHeadersToKeep = ExecutionHeadersPruneThreshold; + type WeightInfo = (); + } + + // 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 mut ext = sp_io::TestExternalities::new(t); + let _ = ext.execute_with(|| Timestamp::set(RuntimeOrigin::signed(1), 30_000)); + ext + } + + fn load_fixture(basename: &str) -> Result + where + T: for<'de> serde::Deserialize<'de>, + { + let filepath: PathBuf = + [env!("CARGO_MANIFEST_DIR"), "tests", "fixtures", basename].iter().collect(); + serde_json::from_reader(File::open(filepath).unwrap()) + } + + pub fn load_execution_header_update_fixture() -> primitives::ExecutionHeaderUpdate { + load_fixture("execution-header-update.minimal.json").unwrap() + } + + pub fn load_checkpoint_update_fixture( + ) -> primitives::CheckpointUpdate<{ config::SYNC_COMMITTEE_SIZE }> { + load_fixture("initial-checkpoint.minimal.json").unwrap() + } + + pub fn load_sync_committee_update_fixture( + ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { + load_fixture("sync-committee-update.minimal.json").unwrap() + } + + pub fn load_finalized_header_update_fixture( + ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { + load_fixture("finalized-header-update.minimal.json").unwrap() + } + + pub fn load_next_sync_committee_update_fixture( + ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { + load_fixture("next-sync-committee-update.minimal.json").unwrap() + } + + pub fn load_next_finalized_header_update_fixture( + ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { + load_fixture("next-finalized-header-update.minimal.json").unwrap() + } + + pub fn get_message_verification_payload() -> (Log, Proof) { + ( + Log { + address: hex!("ee9170abfbf9421ad6dd07f6bdec9d89f2b581e0").into(), + topics: vec![ + hex!("1b11dcf133cc240f682dab2d3a8e4cd35c5da8c9cf99adac4336f8512584c5ad").into(), + hex!("00000000000000000000000000000000000000000000000000000000000003e8").into(), + hex!("0000000000000000000000000000000000000000000000000000000000000001").into(), + ], + data: hex!("0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004b000f000000000000000100d184c103f7acc340847eee82a0b909e3358bc28d440edffa1352b13227e8ee646f3ea37456dec701345772617070656420457468657210574554481235003511000000000000000000000000000000000000000000").into(), + }, + Proof { + block_hash: hex!("05aaa60b0f27cce9e71909508527264b77ee14da7b5bf915fcc4e32715333213").into(), + tx_index: 0, + data: (vec![ + hex!("cf0d1c1ba57d1e0edfb59786c7e30c2b7e12bd54612b00cd21c4eaeecedf44fb").to_vec(), + hex!("d21fc4f68ab05bc4dcb23c67008e92c4d466437cdd6ed7aad0c008944c185510").to_vec(), + hex!("b9890f91ca0d77aa2a4adfaf9b9e40c94cac9e638b6d9797923865872944b646").to_vec(), + ], vec![ + hex!("f90131a0b601337b3aa10a671caa724eba641e759399979856141d3aea6b6b4ac59b889ba00c7d5dd48be9060221a02fb8fa213860b4c50d47046c8fa65ffaba5737d569e0a094601b62a1086cd9c9cb71a7ebff9e718f3217fd6e837efe4246733c0a196f63a06a4b0dd0aefc37b3c77828c8f07d1b7a2455ceb5dbfd3c77d7d6aeeddc2f7e8ca0d6e8e23142cdd8ec219e1f5d8b56aa18e456702b195deeaa210327284d42ade4a08a313d4c87023005d1ab631bbfe3f5de1e405d0e66d0bef3e033f1e5711b5521a0bf09a5d9a48b10ade82b8d6a5362a15921c8b5228a3487479b467db97411d82fa0f95cccae2a7c572ef3c566503e30bac2b2feb2d2f26eebf6d870dcf7f8cf59cea0d21fc4f68ab05bc4dcb23c67008e92c4d466437cdd6ed7aad0c008944c1855108080808080808080").to_vec(), + hex!("f851a0b9890f91ca0d77aa2a4adfaf9b9e40c94cac9e638b6d9797923865872944b646a060a634b9280e3a23fb63375e7bbdd9ab07fd379ab6a67e2312bbc112195fa358808080808080808080808080808080").to_vec(), + hex!("f9030820b9030402f90300018301d6e2b9010000000000000800000000000020040008000000000000000000000000400000008000000000000000000000000000000000000000000000000000000000042010000000001000000000000000000000000000000000040000000000000000000000000000000000000000000000008000000000000000002000000000000000000000000200000000000000200000000000100000000040000001000200008000000000000200000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000f901f5f87a942ffa5ecdbe006d30397c7636d3e015eee251369ff842a0c965575a00553e094ca7c5d14f02e107c258dda06867cbf9e0e69f80e71bbcc1a000000000000000000000000000000000000000000000000000000000000003e8a000000000000000000000000000000000000000000000000000000000000003e8f9011c94ee9170abfbf9421ad6dd07f6bdec9d89f2b581e0f863a01b11dcf133cc240f682dab2d3a8e4cd35c5da8c9cf99adac4336f8512584c5ada000000000000000000000000000000000000000000000000000000000000003e8a00000000000000000000000000000000000000000000000000000000000000001b8a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004b000f000000000000000100d184c103f7acc340847eee82a0b909e3358bc28d440edffa1352b13227e8ee646f3ea37456dec701345772617070656420457468657210574554481235003511000000000000000000000000000000000000000000f858948cf6147918a5cbb672703f879f385036f8793a24e1a01449abf21e49fd025f33495e77f7b1461caefdd3d4bb646424a3f445c4576a5ba0000000000000000000000000440edffa1352b13227e8ee646f3ea37456dec701").to_vec(), + ]), + } + ) + } + + pub fn get_message_verification_header() -> CompactExecutionHeader { + CompactExecutionHeader { + parent_hash: hex!("04a7f6ab8282203562c62f38b0ab41d32aaebe2c7ea687702b463148a6429e04") + .into(), + block_number: 55, + state_root: hex!("894d968712976d613519f973a317cb0781c7b039c89f27ea2b7ca193f7befdb3") + .into(), + receipts_root: hex!("cf0d1c1ba57d1e0edfb59786c7e30c2b7e12bd54612b00cd21c4eaeecedf44fb") + .into(), + } + } +} + +#[cfg(feature = "beacon-spec-mainnet")] +pub mod mainnet { + use super::*; + + type Block = frame_system::mocking::MockBlock; + use sp_runtime::BuildStorage; + + frame_support::construct_runtime!( + 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}, + } + ); + + parameter_types! { + pub const BlockHashCount: u64 = 250; + pub const SS58Prefix: u8 = 42; + } + + impl frame_system::Config for Test { + type BaseCallFilter = frame_support::traits::Everything; + type OnSetCode = (); + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = u64; + type Lookup = IdentityLookup; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = BlockHashCount; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = (); + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = SS58Prefix; + type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; + type Block = Block; + } + + impl pallet_timestamp::Config for Test { + type Moment = u64; + type OnTimestampSet = (); + type MinimumPeriod = (); + type WeightInfo = (); + } + + parameter_types! { + pub const ChainForkVersions: ForkVersions = ForkVersions{ + genesis: Fork { + version: [0, 0, 16, 32], // 0x00001020 + epoch: 0, + }, + altair: Fork { + version: [1, 0, 16, 32], // 0x01001020 + epoch: 36660, + }, + bellatrix: Fork { + version: [2, 0, 16, 32], // 0x02001020 + epoch: 112260, + }, + capella: Fork { + version: [3, 0, 16, 32], // 0x03001020 + epoch: 162304, + }, + }; + pub const ExecutionHeadersPruneThreshold: u32 = 10; + } + + impl ethereum_beacon_client::Config for Test { + type RuntimeEvent = RuntimeEvent; + type ForkVersions = ChainForkVersions; + type MaxExecutionHeadersToKeep = ExecutionHeadersPruneThreshold; + type WeightInfo = (); + } + + // 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 mut ext = sp_io::TestExternalities::new(t); + let _ = ext.execute_with(|| Timestamp::set(RuntimeOrigin::signed(1), 30_000)); + ext + } +} diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/tests.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/tests.rs new file mode 100644 index 00000000000..92a93720ae9 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/tests.rs @@ -0,0 +1,1032 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use crate::{ + config::{EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH}, + functions::compute_period, + mock::minimal::*, + pallet::ExecutionHeaders, + sync_committee_sum, verify_merkle_branch, BeaconHeader, CompactBeaconState, Error, + ExecutionHeaderBuffer, FinalizedBeaconState, LatestExecutionState, LatestFinalizedBlockRoot, + NextSyncCommittee, SyncCommitteePrepared, +}; + +use frame_support::{assert_err, assert_noop, assert_ok}; +use hex_literal::hex; +use primitives::{ + CompactExecutionHeader, ExecutionHeaderState, Fork, ForkVersions, NextSyncCommitteeUpdate, +}; +use rand::{thread_rng, Rng}; +use snowbridge_core::{ + inbound::{VerificationError, Verifier}, + RingBufferMap, +}; +use sp_core::H256; +use sp_runtime::DispatchError; + +/// Arbitrary hash used for tests and invalid hashes. +const TEST_HASH: [u8; 32] = + hex!["5f6f02af29218292d21a69b64a794a7c0873b3e0f54611972863706e8cbdf371"]; + +/* UNIT TESTS */ + +#[test] +pub fn sum_sync_committee_participation() { + new_tester().execute_with(|| { + assert_eq!(sync_committee_sum(&[0, 1, 0, 1, 1, 0, 1, 0, 1]), 5); + }); +} + +#[test] +pub fn compute_domain() { + new_tester().execute_with(|| { + let domain = EthereumBeaconClient::compute_domain( + hex!("07000000").into(), + hex!("00000001"), + hex!("5dec7ae03261fde20d5b024dfabce8bac3276c9a4908e23d50ba8c9b50b0adff").into(), + ); + + assert_ok!(&domain); + assert_eq!( + domain.unwrap(), + hex!("0700000046324489ceb6ada6d118eacdbe94f49b1fcb49d5481a685979670c7c").into() + ); + }); +} + +#[test] +pub fn compute_signing_root_bls() { + new_tester().execute_with(|| { + let signing_root = EthereumBeaconClient::compute_signing_root( + &BeaconHeader { + slot: 3529537, + proposer_index: 192549, + parent_root: hex!( + "1f8dc05ea427f78e84e2e2666e13c3befb7106fd1d40ef8a3f67cf615f3f2a4c" + ) + .into(), + state_root: hex!( + "0dfb492a83da711996d2d76b64604f9bca9dc08b6c13cf63b3be91742afe724b" + ) + .into(), + body_root: hex!("66fba38f7c8c2526f7ddfe09c1a54dd12ff93bdd4d0df6a0950e88e802228bfa") + .into(), + }, + hex!("07000000afcaaba0efab1ca832a15152469bb09bb84641c405171dfa2d3fb45f").into(), + ); + + assert_ok!(&signing_root); + assert_eq!( + signing_root.unwrap(), + hex!("3ff6e9807da70b2f65cdd58ea1b25ed441a1d589025d2c4091182026d7af08fb").into() + ); + }); +} + +#[test] +pub fn compute_signing_root() { + new_tester().execute_with(|| { + let signing_root = EthereumBeaconClient::compute_signing_root( + &BeaconHeader { + slot: 222472, + proposer_index: 10726, + parent_root: hex!( + "5d481a9721f0ecce9610eab51d400d223683d599b7fcebca7e4c4d10cdef6ebb" + ) + .into(), + state_root: hex!( + "14eb4575895f996a84528b789ff2e4d5148242e2983f03068353b2c37015507a" + ) + .into(), + body_root: hex!("7bb669c75b12e0781d6fa85d7fc2f32d64eafba89f39678815b084c156e46cac") + .into(), + }, + hex!("07000000e7acb21061790987fa1c1e745cccfb358370b33e8af2b2c18938e6c2").into(), + ); + + assert_ok!(&signing_root); + assert_eq!( + signing_root.unwrap(), + hex!("da12b6a6d3516bc891e8a49f82fc1925cec40b9327e06457f695035303f55cd8").into() + ); + }); +} + +#[test] +pub fn compute_domain_bls() { + new_tester().execute_with(|| { + let domain = EthereumBeaconClient::compute_domain( + hex!("07000000").into(), + hex!("01000000"), + hex!("4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95").into(), + ); + + assert_ok!(&domain); + assert_eq!( + domain.unwrap(), + hex!("07000000afcaaba0efab1ca832a15152469bb09bb84641c405171dfa2d3fb45f").into() + ); + }); +} + +#[test] +pub fn verify_merkle_branch_for_finalized_root() { + new_tester().execute_with(|| { + assert!(verify_merkle_branch( + hex!("0000000000000000000000000000000000000000000000000000000000000000").into(), + &[ + hex!("0000000000000000000000000000000000000000000000000000000000000000").into(), + hex!("5f6f02af29218292d21a69b64a794a7c0873b3e0f54611972863706e8cbdf371").into(), + hex!("e7125ff9ab5a840c44bedb4731f440a405b44e15f2d1a89e27341b432fabe13d").into(), + hex!("002c1fe5bc0bd62db6f299a582f2a80a6d5748ccc82e7ed843eaf0ae0739f74a").into(), + hex!("d2dc4ba9fd4edff6716984136831e70a6b2e74fca27b8097a820cbbaa5a6e3c3").into(), + hex!("91f77a19d8afa4a08e81164bb2e570ecd10477b3b65c305566a6d2be88510584").into(), + ], + crate::config::FINALIZED_ROOT_INDEX, + crate::config::FINALIZED_ROOT_DEPTH, + hex!("e46559327592741956f6beaa0f52e49625eb85dce037a0bd2eff333c743b287f").into() + )); + }); +} + +#[test] +pub fn verify_merkle_branch_fails_if_depth_and_branch_dont_match() { + new_tester().execute_with(|| { + assert!(!verify_merkle_branch( + hex!("0000000000000000000000000000000000000000000000000000000000000000").into(), + &[ + hex!("0000000000000000000000000000000000000000000000000000000000000000").into(), + hex!("5f6f02af29218292d21a69b64a794a7c0873b3e0f54611972863706e8cbdf371").into(), + hex!("e7125ff9ab5a840c44bedb4731f440a405b44e15f2d1a89e27341b432fabe13d").into(), + ], + crate::config::FINALIZED_ROOT_INDEX, + crate::config::FINALIZED_ROOT_DEPTH, + hex!("e46559327592741956f6beaa0f52e49625eb85dce037a0bd2eff333c743b287f").into() + )); + }); +} + +#[test] +pub fn sync_committee_participation_is_supermajority() { + let bits = + hex!("bffffffff7f1ffdfcfeffeffbfdffffbfffffdffffefefffdffff7f7ffff77fffdf7bff77ffdf7fffafffffff77fefffeff7effffffff5f7fedfffdfb6ddff7b" + ); + let participation = primitives::decompress_sync_committee_bits::<512, 64>(bits); + assert_ok!(EthereumBeaconClient::sync_committee_participation_is_supermajority(&participation)); +} + +#[test] +pub fn sync_committee_participation_is_supermajority_errors_when_not_supermajority() { + new_tester().execute_with(|| { + let participation: [u8; 512] = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, + 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, + 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, + 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, + ]; + + assert_err!( + EthereumBeaconClient::sync_committee_participation_is_supermajority(&participation), + Error::::SyncCommitteeParticipantsNotSupermajority + ); + }); +} + +#[test] +pub fn execution_header_pruning() { + new_tester().execute_with(|| { + let execution_header_prune_threshold = ExecutionHeadersPruneThreshold::get(); + let to_be_deleted = execution_header_prune_threshold / 2; + + let mut stored_hashes = vec![]; + + for i in 0..execution_header_prune_threshold { + let mut hash = H256::default(); + thread_rng().try_fill(&mut hash.0[..]).unwrap(); + EthereumBeaconClient::store_execution_header( + hash, + CompactExecutionHeader::default(), + i as u64, + hash, + ); + stored_hashes.push(hash); + } + + // We should have stored everything until now + assert_eq!({ ExecutionHeaders::::iter().count() }, stored_hashes.len()); + + // Let's push extra entries so that some of the previous entries are deleted. + for i in 0..to_be_deleted { + let mut hash = H256::default(); + thread_rng().try_fill(&mut hash.0[..]).unwrap(); + EthereumBeaconClient::store_execution_header( + hash, + CompactExecutionHeader::default(), + (i + execution_header_prune_threshold) as u64, + hash, + ); + + stored_hashes.push(hash); + } + + // We should have only stored upto `execution_header_prune_threshold` + assert_eq!( + ExecutionHeaders::::iter().count() as u32, + execution_header_prune_threshold + ); + + // First `to_be_deleted` items must be deleted + for i in 0..to_be_deleted { + assert!(!ExecutionHeaders::::contains_key(stored_hashes[i as usize])); + } + + // Other entries should be part of data + for i in to_be_deleted..(to_be_deleted + execution_header_prune_threshold) { + assert!(ExecutionHeaders::::contains_key(stored_hashes[i as usize])); + } + }); +} + +#[test] +fn compute_fork_version() { + let mock_fork_versions = ForkVersions { + genesis: Fork { version: [0, 0, 0, 0], epoch: 0 }, + altair: Fork { version: [0, 0, 0, 1], epoch: 10 }, + bellatrix: Fork { version: [0, 0, 0, 2], epoch: 20 }, + capella: Fork { version: [0, 0, 0, 3], epoch: 30 }, + }; + new_tester().execute_with(|| { + assert_eq!(EthereumBeaconClient::select_fork_version(&mock_fork_versions, 0), [0, 0, 0, 0]); + assert_eq!(EthereumBeaconClient::select_fork_version(&mock_fork_versions, 1), [0, 0, 0, 0]); + assert_eq!( + EthereumBeaconClient::select_fork_version(&mock_fork_versions, 10), + [0, 0, 0, 1] + ); + assert_eq!( + EthereumBeaconClient::select_fork_version(&mock_fork_versions, 21), + [0, 0, 0, 2] + ); + assert_eq!( + EthereumBeaconClient::select_fork_version(&mock_fork_versions, 20), + [0, 0, 0, 2] + ); + assert_eq!( + EthereumBeaconClient::select_fork_version(&mock_fork_versions, 32), + [0, 0, 0, 3] + ); + }); +} + +#[test] +fn find_absent_keys() { + let participation: [u8; 32] = [ + 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, + ]; + let update = load_sync_committee_update_fixture(); + let sync_committee_prepared: SyncCommitteePrepared = + (&update.next_sync_committee_update.unwrap().next_sync_committee) + .try_into() + .unwrap(); + + new_tester().execute_with(|| { + let pubkeys = EthereumBeaconClient::find_pubkeys( + &participation, + (*sync_committee_prepared.pubkeys).as_ref(), + false, + ); + assert_eq!(pubkeys.len(), 2); + assert_eq!(pubkeys[0], sync_committee_prepared.pubkeys[0]); + assert_eq!(pubkeys[1], sync_committee_prepared.pubkeys[7]); + }); +} + +#[test] +fn find_present_keys() { + let participation: [u8; 32] = [ + 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 1, 0, + ]; + let update = load_sync_committee_update_fixture(); + let sync_committee_prepared: SyncCommitteePrepared = + (&update.next_sync_committee_update.unwrap().next_sync_committee) + .try_into() + .unwrap(); + + new_tester().execute_with(|| { + let pubkeys = EthereumBeaconClient::find_pubkeys( + &participation, + (*sync_committee_prepared.pubkeys).as_ref(), + true, + ); + assert_eq!(pubkeys.len(), 4); + assert_eq!(pubkeys[0], sync_committee_prepared.pubkeys[1]); + assert_eq!(pubkeys[1], sync_committee_prepared.pubkeys[8]); + assert_eq!(pubkeys[2], sync_committee_prepared.pubkeys[26]); + assert_eq!(pubkeys[3], sync_committee_prepared.pubkeys[30]); + }); +} + +#[test] +fn cross_check_execution_state() { + new_tester().execute_with(|| { + let header_root: H256 = TEST_HASH.into(); + >::insert( + header_root, + CompactBeaconState { + // set slot to period 5 + slot: ((EPOCHS_PER_SYNC_COMMITTEE_PERIOD * SLOTS_PER_EPOCH) * 5) as u64, + block_roots_root: Default::default(), + }, + ); + LatestFinalizedBlockRoot::::set(header_root); + >::set(ExecutionHeaderState { + beacon_block_root: Default::default(), + // set slot to period 2 + beacon_slot: ((EPOCHS_PER_SYNC_COMMITTEE_PERIOD * SLOTS_PER_EPOCH) * 2) as u64, + block_hash: Default::default(), + block_number: 0, + }); + + assert_err!( + EthereumBeaconClient::cross_check_execution_state(), + Error::::ExecutionHeaderTooFarBehind + ); + }); +} + +/* SYNC PROCESS TESTS */ + +#[test] +fn process_initial_checkpoint() { + let checkpoint = load_checkpoint_update_fixture(); + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::force_checkpoint( + RuntimeOrigin::root(), + Box::new(checkpoint.clone()) + )); + let block_root: H256 = checkpoint.header.hash_tree_root().unwrap(); + assert!(>::contains_key(block_root)); + }); +} + +#[test] +fn process_initial_checkpoint_with_invalid_sync_committee_proof() { + let mut checkpoint = load_checkpoint_update_fixture(); + checkpoint.current_sync_committee_branch[0] = TEST_HASH.into(); + + new_tester().execute_with(|| { + assert_err!( + EthereumBeaconClient::force_checkpoint(RuntimeOrigin::root(), Box::new(checkpoint)), + Error::::InvalidSyncCommitteeMerkleProof + ); + }); +} + +#[test] +fn process_initial_checkpoint_with_invalid_blocks_root_proof() { + let mut checkpoint = load_checkpoint_update_fixture(); + checkpoint.block_roots_branch[0] = TEST_HASH.into(); + + new_tester().execute_with(|| { + assert_err!( + EthereumBeaconClient::force_checkpoint(RuntimeOrigin::root(), Box::new(checkpoint)), + Error::::InvalidBlockRootsRootMerkleProof + ); + }); +} + +#[test] +fn submit_update_in_current_period() { + let checkpoint = load_checkpoint_update_fixture(); + let update = load_finalized_header_update_fixture(); + let initial_period = compute_period(checkpoint.header.slot); + let update_period = compute_period(update.finalized_header.slot); + assert_eq!(initial_period, update_period); + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert_ok!(EthereumBeaconClient::submit( + RuntimeOrigin::signed(1), + Box::new(update.clone()) + )); + let block_root: H256 = update.finalized_header.hash_tree_root().unwrap(); + assert!(>::contains_key(block_root)); + }); +} + +#[test] +fn submit_update_with_sync_committee_in_current_period() { + let checkpoint = load_checkpoint_update_fixture(); + let update = load_sync_committee_update_fixture(); + let init_period = compute_period(checkpoint.header.slot); + let update_period = compute_period(update.finalized_header.slot); + assert_eq!(init_period, update_period); + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert!(!>::exists()); + assert_ok!(EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update))); + assert!(>::exists()); + }); +} + +#[test] +fn submit_update_in_next_period() { + let checkpoint = load_checkpoint_update_fixture(); + let sync_committee_update = load_sync_committee_update_fixture(); + let update = load_next_finalized_header_update_fixture(); + let sync_committee_period = compute_period(sync_committee_update.finalized_header.slot); + let next_sync_committee_period = compute_period(update.finalized_header.slot); + assert_eq!(sync_committee_period + 1, next_sync_committee_period); + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert_ok!(EthereumBeaconClient::submit( + RuntimeOrigin::signed(1), + Box::new(sync_committee_update.clone()) + )); + assert_ok!(EthereumBeaconClient::submit( + RuntimeOrigin::signed(1), + Box::new(update.clone()) + )); + let block_root: H256 = update.finalized_header.clone().hash_tree_root().unwrap(); + assert!(>::contains_key(block_root)); + }); +} + +#[test] +fn submit_update_with_invalid_header_proof() { + let checkpoint = load_checkpoint_update_fixture(); + let mut update = load_sync_committee_update_fixture(); + let init_period = compute_period(checkpoint.header.slot); + let update_period = compute_period(update.finalized_header.slot); + assert_eq!(init_period, update_period); + update.finality_branch[0] = TEST_HASH.into(); + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert!(!>::exists()); + assert_err!( + EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), + Error::::InvalidHeaderMerkleProof + ); + }); +} + +#[test] +fn submit_update_with_invalid_block_roots_proof() { + let checkpoint = load_checkpoint_update_fixture(); + let mut update = load_sync_committee_update_fixture(); + let init_period = compute_period(checkpoint.header.slot); + let update_period = compute_period(update.finalized_header.slot); + assert_eq!(init_period, update_period); + update.block_roots_branch[0] = TEST_HASH.into(); + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert!(!>::exists()); + assert_err!( + EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), + Error::::InvalidBlockRootsRootMerkleProof + ); + }); +} + +#[test] +fn submit_update_with_invalid_next_sync_committee_proof() { + let checkpoint = load_checkpoint_update_fixture(); + let mut update = load_sync_committee_update_fixture(); + let init_period = compute_period(checkpoint.header.slot); + let update_period = compute_period(update.finalized_header.slot); + assert_eq!(init_period, update_period); + if let Some(ref mut next_sync_committee_update) = update.next_sync_committee_update { + next_sync_committee_update.next_sync_committee_branch[0] = TEST_HASH.into(); + } + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert!(!>::exists()); + assert_err!( + EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), + Error::::InvalidSyncCommitteeMerkleProof + ); + }); +} + +#[test] +fn submit_update_with_skipped_period() { + let checkpoint = load_checkpoint_update_fixture(); + let sync_committee_update = load_sync_committee_update_fixture(); + let mut update = load_next_finalized_header_update_fixture(); + update.signature_slot += (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * SLOTS_PER_EPOCH) as u64; + update.attested_header.slot = update.signature_slot - 1; + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert_ok!(EthereumBeaconClient::submit( + RuntimeOrigin::signed(1), + Box::new(sync_committee_update.clone()) + )); + assert_err!( + EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), + Error::::SkippedSyncCommitteePeriod + ); + }); +} + +#[test] +fn submit_update_with_sync_committee_in_next_period() { + let checkpoint = load_checkpoint_update_fixture(); + let update = load_sync_committee_update_fixture(); + let next_update = load_next_sync_committee_update_fixture(); + let update_period = compute_period(update.finalized_header.slot); + let next_update_period = compute_period(next_update.finalized_header.slot); + assert_eq!(update_period + 1, next_update_period); + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert!(!>::exists()); + assert_ok!(EthereumBeaconClient::submit( + RuntimeOrigin::signed(1), + Box::new(update.clone()) + )); + assert!(>::exists()); + assert_ok!(EthereumBeaconClient::submit( + RuntimeOrigin::signed(1), + Box::new(next_update.clone()) + )); + let last_finalized_state = + FinalizedBeaconState::::get(LatestFinalizedBlockRoot::::get()).unwrap(); + let last_synced_period = compute_period(last_finalized_state.slot); + assert_eq!(last_synced_period, next_update_period); + }); +} + +#[test] +fn submit_update_with_sync_committee_invalid_signature_slot() { + let checkpoint = load_checkpoint_update_fixture(); + let mut update = load_sync_committee_update_fixture(); + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + + // makes a invalid update with signature_slot should be more than attested_slot + update.signature_slot = update.attested_header.slot; + + assert_err!( + EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), + Error::::InvalidUpdateSlot + ); + }); +} + +#[test] +fn submit_update_with_skipped_sync_committee_period() { + let checkpoint = load_checkpoint_update_fixture(); + let finalized_update = load_next_finalized_header_update_fixture(); + let checkpoint_period = compute_period(checkpoint.header.slot); + let next_sync_committee_period = compute_period(finalized_update.finalized_header.slot); + assert_eq!(checkpoint_period + 1, next_sync_committee_period); + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert_err!( + EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(finalized_update)), + Error::::SkippedSyncCommitteePeriod + ); + }); +} + +#[test] +fn submit_update_execution_headers_too_far_behind() { + let checkpoint = load_checkpoint_update_fixture(); + let finalized_header_update = load_finalized_header_update_fixture(); + let execution_header_update = load_execution_header_update_fixture(); + let next_update = load_next_sync_committee_update_fixture(); + + new_tester().execute_with(|| { + let far_ahead_finalized_header_slot = finalized_header_update.finalized_header.slot + + (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * SLOTS_PER_EPOCH * 2) as u64; + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert_ok!(EthereumBeaconClient::submit( + RuntimeOrigin::signed(1), + Box::new(finalized_header_update) + )); + assert_ok!(EthereumBeaconClient::submit_execution_header( + RuntimeOrigin::signed(1), + Box::new(execution_header_update) + )); + + let header_root: H256 = TEST_HASH.into(); + >::insert( + header_root, + CompactBeaconState { + slot: far_ahead_finalized_header_slot, + block_roots_root: Default::default(), + }, + ); + LatestFinalizedBlockRoot::::set(header_root); + + assert_err!( + EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(next_update)), + Error::::ExecutionHeaderTooFarBehind + ); + }); +} + +#[test] +fn submit_irrelevant_update() { + let checkpoint = load_checkpoint_update_fixture(); + let mut update = load_next_finalized_header_update_fixture(); + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + + // makes an invalid update where the attested_header slot value should be greater than the + // checkpoint slot value + update.finalized_header.slot = checkpoint.header.slot; + update.attested_header.slot = checkpoint.header.slot; + update.signature_slot = checkpoint.header.slot + 1; + + assert_err!( + EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), + Error::::IrrelevantUpdate + ); + }); +} + +#[test] +fn submit_update_with_missing_bootstrap() { + let update = load_next_finalized_header_update_fixture(); + + new_tester().execute_with(|| { + assert_err!( + EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), + Error::::NotBootstrapped + ); + }); +} + +#[test] +fn submit_update_with_invalid_sync_committee_update() { + let checkpoint = load_checkpoint_update_fixture(); + let update = load_sync_committee_update_fixture(); + let mut next_update = load_next_sync_committee_update_fixture(); + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + + assert_ok!(EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update))); + + // makes update with invalid next_sync_committee + >::mutate(>::get(), |x| { + let prev = x.unwrap(); + *x = Some(CompactBeaconState { slot: next_update.attested_header.slot, ..prev }); + }); + next_update.attested_header.slot += 1; + next_update.signature_slot = next_update.attested_header.slot + 1; + let next_sync_committee = NextSyncCommitteeUpdate::default(); + next_update.next_sync_committee_update = Some(next_sync_committee); + + assert_err!( + EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(next_update)), + Error::::InvalidSyncCommitteeUpdate + ); + }); +} + +#[test] +fn submit_execution_header_update() { + let checkpoint = load_checkpoint_update_fixture(); + let finalized_header_update = load_finalized_header_update_fixture(); + let execution_header_update = load_execution_header_update_fixture(); + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert_ok!(EthereumBeaconClient::submit( + RuntimeOrigin::signed(1), + Box::new(finalized_header_update) + )); + assert_ok!(EthereumBeaconClient::submit_execution_header( + RuntimeOrigin::signed(1), + Box::new(execution_header_update.clone()) + )); + assert!(>::contains_key( + execution_header_update.execution_header.block_hash + )); + }); +} + +#[test] +fn submit_execution_header_update_invalid_ancestry_proof() { + let checkpoint = load_checkpoint_update_fixture(); + let finalized_header_update = load_finalized_header_update_fixture(); + let mut execution_header_update = load_execution_header_update_fixture(); + if let Some(ref mut ancestry_proof) = execution_header_update.ancestry_proof { + ancestry_proof.header_branch[0] = TEST_HASH.into() + } + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert_ok!(EthereumBeaconClient::submit( + RuntimeOrigin::signed(1), + Box::new(finalized_header_update) + )); + assert_err!( + EthereumBeaconClient::submit_execution_header( + RuntimeOrigin::signed(1), + Box::new(execution_header_update) + ), + Error::::InvalidAncestryMerkleProof + ); + }); +} + +#[test] +fn submit_execution_header_update_invalid_execution_header_proof() { + let checkpoint = load_checkpoint_update_fixture(); + let finalized_header_update = load_finalized_header_update_fixture(); + let mut execution_header_update = load_execution_header_update_fixture(); + execution_header_update.execution_branch[0] = TEST_HASH.into(); + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert_ok!(EthereumBeaconClient::submit( + RuntimeOrigin::signed(1), + Box::new(finalized_header_update) + )); + assert_err!( + EthereumBeaconClient::submit_execution_header( + RuntimeOrigin::signed(1), + Box::new(execution_header_update) + ), + Error::::InvalidExecutionHeaderProof + ); + }); +} + +#[test] +fn submit_execution_header_update_that_skips_block() { + let checkpoint = load_checkpoint_update_fixture(); + let finalized_header_update = load_finalized_header_update_fixture(); + let execution_header_update = load_execution_header_update_fixture(); + let mut skipped_block_execution_header_update = load_execution_header_update_fixture(); + skipped_block_execution_header_update.execution_header.block_number = + execution_header_update.execution_header.block_number + 2; + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert_ok!(EthereumBeaconClient::submit( + RuntimeOrigin::signed(1), + Box::new(finalized_header_update) + )); + assert_ok!(EthereumBeaconClient::submit_execution_header( + RuntimeOrigin::signed(1), + Box::new(execution_header_update.clone()) + )); + assert!(>::contains_key( + execution_header_update.execution_header.block_hash + )); + assert_err!( + EthereumBeaconClient::submit_execution_header( + RuntimeOrigin::signed(1), + Box::new(skipped_block_execution_header_update) + ), + Error::::ExecutionHeaderSkippedBlock + ); + }); +} + +#[test] +fn submit_execution_header_update_that_is_also_finalized_header_which_is_not_stored() { + let checkpoint = load_checkpoint_update_fixture(); + let finalized_header_update = load_finalized_header_update_fixture(); + let mut execution_header_update = load_execution_header_update_fixture(); + execution_header_update.ancestry_proof = None; + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert_ok!(EthereumBeaconClient::submit( + RuntimeOrigin::signed(1), + Box::new(finalized_header_update) + )); + assert_err!( + EthereumBeaconClient::submit_execution_header( + RuntimeOrigin::signed(1), + Box::new(execution_header_update) + ), + Error::::ExpectedFinalizedHeaderNotStored + ); + }); +} + +#[test] +fn submit_execution_header_update_that_is_also_finalized_header_which_is_stored_but_slots_dont_match( +) { + let checkpoint = load_checkpoint_update_fixture(); + let finalized_header_update = load_finalized_header_update_fixture(); + let mut execution_header_update = load_execution_header_update_fixture(); + execution_header_update.ancestry_proof = None; + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert_ok!(EthereumBeaconClient::submit( + RuntimeOrigin::signed(1), + Box::new(finalized_header_update) + )); + + let block_root: H256 = execution_header_update.header.hash_tree_root().unwrap(); + + >::insert( + block_root, + CompactBeaconState { + slot: execution_header_update.header.slot + 1, + block_roots_root: Default::default(), + }, + ); + LatestFinalizedBlockRoot::::set(block_root); + + assert_err!( + EthereumBeaconClient::submit_execution_header( + RuntimeOrigin::signed(1), + Box::new(execution_header_update) + ), + Error::::ExpectedFinalizedHeaderNotStored + ); + }); +} + +#[test] +fn submit_execution_header_not_finalized() { + let checkpoint = load_checkpoint_update_fixture(); + let finalized_header_update = load_finalized_header_update_fixture(); + let update = load_execution_header_update_fixture(); + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + assert_ok!(EthereumBeaconClient::submit( + RuntimeOrigin::signed(1), + Box::new(finalized_header_update) + )); + + >::mutate(>::get(), |x| { + let prev = x.unwrap(); + *x = Some(CompactBeaconState { slot: update.header.slot - 1, ..prev }); + }); + + assert_err!( + EthereumBeaconClient::submit_execution_header( + RuntimeOrigin::signed(1), + Box::new(update) + ), + Error::::HeaderNotFinalized + ); + }); +} + +/* IMPLS */ + +#[test] +fn verify_message() { + let header = get_message_verification_header(); + let (event_log, proof) = get_message_verification_payload(); + let block_hash = proof.block_hash; + + new_tester().execute_with(|| { + >::insert(block_hash, header); + assert_ok!(EthereumBeaconClient::verify(&event_log, &proof)); + }); +} + +#[test] +fn verify_message_missing_header() { + let (event_log, proof) = get_message_verification_payload(); + + new_tester().execute_with(|| { + assert_err!( + EthereumBeaconClient::verify(&event_log, &proof), + VerificationError::HeaderNotFound + ); + }); +} + +#[test] +fn verify_message_invalid_proof() { + let header = get_message_verification_header(); + let (event_log, mut proof) = get_message_verification_payload(); + proof.data.1[0] = TEST_HASH.into(); + let block_hash = proof.block_hash; + + new_tester().execute_with(|| { + >::insert(block_hash, header); + assert_err!( + EthereumBeaconClient::verify(&event_log, &proof), + VerificationError::InvalidProof + ); + }); +} + +#[test] +fn verify_message_invalid_receipts_root() { + let mut header = get_message_verification_header(); + let (event_log, proof) = get_message_verification_payload(); + let block_hash = proof.block_hash; + header.receipts_root = TEST_HASH.into(); + + new_tester().execute_with(|| { + >::insert(block_hash, header); + assert_err!( + EthereumBeaconClient::verify(&event_log, &proof), + VerificationError::InvalidProof + ); + }); +} + +#[test] +fn verify_message_invalid_log() { + let header = get_message_verification_header(); + let (mut event_log, proof) = get_message_verification_payload(); + let block_hash = proof.block_hash; + event_log.topics = vec![H256::zero(); 10]; + + new_tester().execute_with(|| { + >::insert(block_hash, header); + assert_err!( + EthereumBeaconClient::verify(&event_log, &proof), + VerificationError::InvalidLog + ); + }); +} + +#[test] +fn verify_message_receipt_does_not_contain_log() { + let header = get_message_verification_header(); + let (mut event_log, proof) = get_message_verification_payload(); + let block_hash = proof.block_hash; + event_log.data = hex!("f9013c94ee9170abfbf9421ad6dd07f6bdec9d89f2b581e0f863a01b11dcf133cc240f682dab2d3a8e4cd35c5da8c9cf99adac4336f8512584c5ada000000000000000000000000000000000000000000000000000000000000003e8a00000000000000000000000000000000000000000000000000000000000000002b8c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000068000f000000000000000101d184c103f7acc340847eee82a0b909e3358bc28d440edffa1352b13227e8ee646f3ea37456dec70100000101001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c0000e8890423c78a0000000000000000000000000000000000000000000000000000000000000000").to_vec(); + + new_tester().execute_with(|| { + >::insert(block_hash, header); + assert_err!( + EthereumBeaconClient::verify(&event_log, &proof), + VerificationError::LogNotFound + ); + }); +} + +#[test] +fn set_operating_mode() { + let checkpoint = load_checkpoint_update_fixture(); + let update = load_finalized_header_update_fixture(); + let execution_header_update = load_execution_header_update_fixture(); + + new_tester().execute_with(|| { + assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); + + assert_ok!(EthereumBeaconClient::set_operating_mode( + RuntimeOrigin::root(), + snowbridge_core::BasicOperatingMode::Halted + )); + + assert_noop!( + EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), + Error::::Halted + ); + + assert_noop!( + EthereumBeaconClient::submit_execution_header( + RuntimeOrigin::signed(1), + Box::new(execution_header_update) + ), + Error::::Halted + ); + }); +} + +#[test] +fn set_operating_mode_root_only() { + new_tester().execute_with(|| { + assert_noop!( + EthereumBeaconClient::set_operating_mode( + RuntimeOrigin::signed(1), + snowbridge_core::BasicOperatingMode::Halted + ), + DispatchError::BadOrigin + ); + }); +} diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/types.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/types.rs new file mode 100644 index 00000000000..5dcefea9f80 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/types.rs @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +pub use crate::config::{ + SLOTS_PER_HISTORICAL_ROOT, SYNC_COMMITTEE_BITS_SIZE as SC_BITS_SIZE, + SYNC_COMMITTEE_SIZE as SC_SIZE, +}; +use frame_support::storage::types::OptionQuery; +use snowbridge_core::RingBufferMapImpl; + +// Specialize types based on configured sync committee size +pub type SyncCommittee = primitives::SyncCommittee; +pub type SyncCommitteePrepared = primitives::SyncCommitteePrepared; +pub type SyncAggregate = primitives::SyncAggregate; +pub type CheckpointUpdate = primitives::CheckpointUpdate; +pub type Update = primitives::Update; +pub type NextSyncCommitteeUpdate = primitives::NextSyncCommitteeUpdate; + +pub use primitives::ExecutionHeaderUpdate; + +/// ExecutionHeader ring buffer implementation +pub type ExecutionHeaderBuffer = RingBufferMapImpl< + u32, + ::MaxExecutionHeadersToKeep, + crate::ExecutionHeaderIndex, + crate::ExecutionHeaderMapping, + crate::ExecutionHeaders, + OptionQuery, +>; + +/// FinalizedState ring buffer implementation +pub(crate) type FinalizedBeaconStateBuffer = RingBufferMapImpl< + u32, + crate::MaxFinalizedHeadersToKeep, + crate::FinalizedBeaconStateIndex, + crate::FinalizedBeaconStateMapping, + crate::FinalizedBeaconState, + OptionQuery, +>; diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/weights.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/weights.rs new file mode 100644 index 00000000000..69d3e809986 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/weights.rs @@ -0,0 +1,68 @@ +//! Autogenerated weights for ethereum_beacon_client +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-09-27, STEPS: `10`, REPEAT: 10, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("/tmp/snowbridge/spec.json"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/snowbridge +// benchmark +// pallet +// --chain +// /tmp/snowbridge/spec.json +// --execution=wasm +// --pallet +// ethereum_beacon_client +// --extrinsic +// * +// --steps +// 10 +// --repeat +// 10 +// --output +// pallets/ethereum-beacon-client/src/weights.rs +// --template +// templates/module-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for ethereum_beacon_client. +pub trait WeightInfo { + fn force_checkpoint() -> Weight; + fn submit() -> Weight; + fn submit_with_sync_committee() -> Weight; + fn submit_execution_header() -> Weight; +} + +// For backwards compatibility and tests +impl WeightInfo for () { + fn force_checkpoint() -> Weight { + Weight::from_parts(97_263_571_000_u64, 0) + .saturating_add(Weight::from_parts(0, 3501)) + .saturating_add(RocksDbWeight::get().reads(2)) + .saturating_add(RocksDbWeight::get().writes(9)) + } + fn submit() -> Weight { + Weight::from_parts(26_051_019_000_u64, 0) + .saturating_add(Weight::from_parts(0, 93857)) + .saturating_add(RocksDbWeight::get().reads(8)) + .saturating_add(RocksDbWeight::get().writes(4)) + } + fn submit_with_sync_committee() -> Weight { + Weight::from_parts(122_461_312_000_u64, 0) + .saturating_add(Weight::from_parts(0, 93857)) + .saturating_add(RocksDbWeight::get().reads(6)) + .saturating_add(RocksDbWeight::get().writes(1)) + } + fn submit_execution_header() -> Weight { + Weight::from_parts(113_158_000_u64, 0) + .saturating_add(Weight::from_parts(0, 3537)) + .saturating_add(RocksDbWeight::get().reads(5)) + .saturating_add(RocksDbWeight::get().writes(4)) + } +} diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/execution-header-update.minimal.json b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/execution-header-update.minimal.json new file mode 100644 index 00000000000..3e17c14f4ad --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/execution-header-update.minimal.json @@ -0,0 +1,43 @@ +{ + "header": { + "slot": 3622, + "proposer_index": 7, + "parent_root": "0x254c9215f6cce83e21b9776afb482181639602d3cb58cf99452a6a4a4f603930", + "state_root": "0xea98df6d30817d63f3e54ea118e2b1ba8675753c72dec1661c503d4eb43f9bdd", + "body_root": "0x765a0616a31d38e0ca2d10f6e8b234dd3d07e16aa929bcbc4de775c93f1972fd" + }, + "ancestry_proof": { + "header_branch": [ + "0x7690506882ac8c5f01d00f3ade06439259a3a0261ef5d61ec44920678b4104e6", + "0xf01aa0fdd7c9ef7b1affb7854fe8cbcc5c70643ee5b83e032faa702a0675a8cb", + "0x273a7b300b75ffa2c765af50680aa836299264f2107f38010278822313181801", + "0x30fe73a3bae6a31af32656ab759a4b67d27a213e01012b96cc4fedd0f2e77c75", + "0x7246cb3a35f13a1f0bbf907887985bb5382c45f2aa1699dbca48a0a82d5330af", + "0x5e7270e88a22dd4a905b2e76da2c8c358baeddd34de6c64a71bb1c80070ab717" + ], + "finalized_block_root": "0xa6fdc5df11c1759d11c9f0353a666715e5677e9ffd7d414e44cff0970553f1c9" + }, + "execution_header": { + "parent_hash": "0x6c9657f1267ad6040ea017ff6d02b55c4ba25cb092b8326d321dd98d01d1ee64", + "fee_recipient": "0x0000000000000000000000000000000000000000", + "state_root": "0x01f975f7cdff9b0a8844304aa59062fe18af0fef4636539312dfe20d238600ba", + "receipts_root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "logs_bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "prev_randao": "0xcdfcab74bc26b3f4311afdc72d2d21d33a4b045187a01fa208a9d687a6d1d25c", + "block_number": 3622, + "gas_limit": 30000000, + "gas_used": 0, + "timestamp": 1685722543, + "extra_data": "0xd983010b02846765746888676f312e31392e358664617277696e", + "base_fee_per_gas": 7, + "block_hash": "0x38c80e0e26cb80730df627d32f50266bd0fe32fb12b7606300ad81aa2b4033db", + "transactions_root": "0x7ffe241ea60187fdb0187bfa22de35d1f9bed7ab061d9401fd47e34a54fbede1", + "withdrawals_root": "0x28ba1834a3a7b657460ce79fa3a1d909ab8828fd557659d4d0554a9bdbc0ec30" + }, + "execution_branch": [ + "0x005b8d55b34b4323bfd4773c28b09eb53bc87959e65411ccd23728c7e42d5ff2", + "0x336488033fe5f3ef4ccc12af07b9370b92e553e35ecb4a337a1b1c0e4afe1e0e", + "0xdb56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71", + "0x7061330dada1ba1c602ba98f647a441885460ed0db00483fea1282385dfab84b" + ] +} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/finalized-header-update.minimal.json b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/finalized-header-update.minimal.json new file mode 100644 index 00000000000..c6473529b10 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/finalized-header-update.minimal.json @@ -0,0 +1,38 @@ +{ + "attested_header": { + "slot": 3640, + "proposer_index": 5, + "parent_root": "0xf062fcec9c3379a08e6add37a834b1e39af395fc343973e44957ecebbf2ecddd", + "state_root": "0xb1581cb62fe376e305e02f26463153f5dfb804d8df97ef40fc315c1bc30731ba", + "body_root": "0x98461abcc6d130b7bcb9430292c8a269ea9f01082685347e2968d892f716067c" + }, + "sync_aggregate": { + "sync_committee_bits": "0xffffffff", + "sync_committee_signature": "0x925c6e4b67890a7e28a7ca19853f88247e92014b9d233ac9058efd4f3827f0055db308debe17596e635b93727b5a851e1366ca801f30b03fdec722f45011504702a27646488b5ab5e3428fe7b4d4a50132f374612f66e45d68db27c568f96f08" + }, + "signature_slot": 3641, + "next_sync_committee_update": null, + "finalized_header": { + "slot": 3624, + "proposer_index": 7, + "parent_root": "0x7690506882ac8c5f01d00f3ade06439259a3a0261ef5d61ec44920678b4104e6", + "state_root": "0x3726ebb8d9973977a71a8389caf5fc5830eeb8cd4fdfbbc7b0c4e6ca3e6a4090", + "body_root": "0x0f9a3f0fa5a4ffaf7c10504c86f23e7d554366ffd069fe958a160b253c3fd409" + }, + "finality_branch": [ + "0xc501000000000000000000000000000000000000000000000000000000000000", + "0x10c726fac935bf9657cc7476d3cfa7bedec5983dcfb59e8a7df6d0a619e108d7", + "0x83c3d5360d254f4a44be712c1f433e88e810b6d1e0e789e90bada9e36126b857", + "0x97245fa01a89a6d7b4542cd731fef699f58b2bbaabdd6f641334c9e9eeae3a20", + "0xc3d19c773f66ab94bc2106d5e75a3205398dd6e94b6f8a5716f347741eb9fc5a", + "0x9e5040e56d765c1add56779a716be7497be27cba37f866cd8d34418d55e48715" + ], + "block_roots_root": "0x29a54625749fa25f9e36df14a3baa335c58246bba2f8c7eb8b1ec2e4908e2fd0", + "block_roots_branch": [ + "0x53616f9298818a8423c98adc47c92aaf82f0c5c911dc4ee5f88ba6d3022341c1", + "0x5d2f1c4bce6f63f26cbe3fbf480281c04a6b14bea74350a88ee945354ecbd79d", + "0x8333eefc7eaa4d10091e2014b3aae2bf6bd2d10c22c67100e189f8ab6caab261", + "0x3edfa69130bc193dec47c27a5903f03d5262b75899b69c0e95ac1816a664a3e7", + "0x5e046000f85aede8d4c28140b27778488d4ad21b1e16e345055d07ee53f2711b" + ] +} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/initial-checkpoint.minimal.json b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/initial-checkpoint.minimal.json new file mode 100644 index 00000000000..a7e48f45901 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/initial-checkpoint.minimal.json @@ -0,0 +1,62 @@ +{ + "header": { + "slot": 3616, + "proposer_index": 7, + "parent_root": "0x6c5e8c7b32b7bfbb250fa8fd7bc348d7325fb2bfc869e4c506af6802fcad87f4", + "state_root": "0x3e467e3429a1ae36572fe3fe1c953381242e950254cf97c7527a8cea8aa6c9de", + "body_root": "0x7da749680d2b0b4f779047fcfe7d0c13d247f6d23478817fe9c6fbe07993adb2" + }, + "current_sync_committee": { + "pubkeys": [ + "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", + "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", + "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", + "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", + "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", + "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", + "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", + "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", + "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", + "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", + "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", + "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", + "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", + "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", + "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", + "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", + "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c" + ], + "aggregate_pubkey": "0x8fe11476a05750c52618deb79918e2e674f56dfbf12dbce55ae4386d108e8a1e83c6326f5957e2ef19137582ce270dc6" + }, + "current_sync_committee_branch": [ + "0x46af3f54acbea439b63aa5bb699c8f25ff584b23912366788f7c8e95011ce324", + "0x41dcb71ec3b3940399118d28e09fdc58a8e33b818b8c5cbb933c59929504ca08", + "0xfa53febb29348e3493a50c0e7c6d35796bf69c54dfc6f42f7600612789d0ed6d", + "0x5e7ea1693066b604fc60d4657b43e7a4aafd3f4f54d9a740d2abe765e92d8385", + "0x16c9bca64a82e80c23817bfec345d088e0adc3865e392965c1244f97979f816a" + ], + "validators_root": "0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69", + "block_roots_root": "0x00f6bbdeac1e1a922a9bf0e78720c0bffe558d8195e8ede8cb72bbd295f242f2", + "block_roots_branch": [ + "0x7a61086fb9e53ab4dd87243d6288c51793696168a73773277630da5b20bf6091", + "0x60733905cdc5dd65d05161bb3138eecc47d6d6057ab36b0d36cf5a3200484143", + "0x86d7de634ae45de5b3cbbc562dd976de7d06a3d96f83147413536e6b108c7a39", + "0x0ada571c9e0da6fce8dd13e6d9ce173768521ac32e0af456634556176789fa6e", + "0x2341538fd0aafbc1ff0f513545e5dcd4b8905dc9e00d6173480c18a4e8086ebc" + ] +} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-finalized-header-update.minimal.json b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-finalized-header-update.minimal.json new file mode 100755 index 00000000000..8f1ddc827c1 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-finalized-header-update.minimal.json @@ -0,0 +1,38 @@ +{ + "attested_header": { + "slot": 3696, + "proposer_index": 1, + "parent_root": "0x04a63c5dfb726c31a32a72c1c426ff89e21363223d7096486b629f1d58abe5d8", + "state_root": "0xbe20e69420cbf9400224ec5edeb0843776a2ccf945e9a3ba9311ae812cad1e30", + "body_root": "0x1d2acd1748f1c58096d1edc8badd3a1d7e1dc3c33bcb9229e4c03f3a84efeadb" + }, + "sync_aggregate": { + "sync_committee_bits": "0xffffffff", + "sync_committee_signature": "0xafa79bc0f3c731ab1eb6aeafc582a7dd1c100ea471df3af6ff485b58661b3ef8077264dea0b60df9aec2d3ca8ddab6770fc9d061462e5a6dc718146085425f863d00921c42413805cb5b4c5175f36f2087cfed740bb7d57e8d5b48352643cd5b" + }, + "signature_slot": 3697, + "next_sync_committee_update": null, + "finalized_header": { + "slot": 3680, + "proposer_index": 7, + "parent_root": "0x4d8f4fc47ad3eb045bd20cae13af6df02f96a3f8d7c8a285190ba10cfe2b84cf", + "state_root": "0xd498766d77277fe16a6a4609ab3ac3a6e9887d162d8dfffdfc9cc4ae833e4127", + "body_root": "0x9ba73bc9a4907cac0b887550e2b01a63dcc70473753ffcc243d33394cc64b4c0" + }, + "finality_branch": [ + "0xcc01000000000000000000000000000000000000000000000000000000000000", + "0x10c726fac935bf9657cc7476d3cfa7bedec5983dcfb59e8a7df6d0a619e108d7", + "0x142061c4bc3673bf774cb8c7b6085057bd0ca85672b43afa2d9581b0b6a44e54", + "0x48b8cd8ca9d9563e30c1cca2a854cd7f75eb4cb013d10809b3138a72d94ea0c5", + "0x9b39523d05013ac7cbb9f43e5d6f9dc033b12aa1d6d6edd994ddc4f5efe7be9d", + "0x066c9aa26107bc8cb28bc73e518da6cc865ec1d67516b6ca24663b6b7ae3cb21" + ], + "block_roots_root": "0xb15aa2483811d8c5616cb93710f4fcb809d97443caac9de163f943a30f385db6", + "block_roots_branch": [ + "0xf7a43ad317417daa4c2a1e93c54895895a824ef1e43320eb44eab16673da5a61", + "0xe4b8d640660f765c2ef4dc886025dc8e54c6e70b66192582f42837ed5e9d8d41", + "0x841f113dc81e76419b6cdec8b0cf2fc20f9381492ed3c79e9b49179b4d3eacbc", + "0xeb5fdc4d8b5282b653ecbc9caa93bcfe482f6d6a32cbb0d9eb011bef947579bb", + "0x1f328cc5640efb191ae6aa86223b1aa9d083b26ac3e1fa3c071327bb09dc5727" + ] +} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-sync-committee-update.minimal.json b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-sync-committee-update.minimal.json new file mode 100755 index 00000000000..8f1c8b9ce21 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-sync-committee-update.minimal.json @@ -0,0 +1,83 @@ +{ + "attested_header": { + "slot": 3664, + "proposer_index": 4, + "parent_root": "0x15ac23a0c16bfa81e8595621118040c3e6cbddd4b09bae6fb39ba5fefd0258e8", + "state_root": "0x6fb81aa3827e7d580bb05b4df2686c9a49508bde2f8342fd75be609a23dd8362", + "body_root": "0x9906a1ae8065d268f8acb7f1b3119408d2f7f8e6e0764370c16ea3d15134981f" + }, + "sync_aggregate": { + "sync_committee_bits": "0xffffffff", + "sync_committee_signature": "0xa9b5584ec9290a4ac6c5616639d031f9ab1064d63b4889f1da52f6f4d66b645fca48bbe2fe8484adb0c05c647edd694d0340cf684b8ccf8e34c6d8cf447cfcfdcb856f5abdcfd85ada5a4a04d4c8f6f40c6e99308893c3941485a436d6c8e5f7" + }, + "signature_slot": 3665, + "next_sync_committee_update": { + "next_sync_committee": { + "pubkeys": [ + "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", + "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", + "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", + "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", + "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", + "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", + "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", + "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", + "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", + "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", + "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", + "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", + "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", + "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", + "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", + "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373" + ], + "aggregate_pubkey": "0x8fe11476a05750c52618deb79918e2e674f56dfbf12dbce55ae4386d108e8a1e83c6326f5957e2ef19137582ce270dc6" + }, + "next_sync_committee_branch": [ + "0x46af3f54acbea439b63aa5bb699c8f25ff584b23912366788f7c8e95011ce324", + "0x5b118fe110ee4a1b0cf9823bc189fb38eb55a7b49adbdafcf466ec7cd4b7fd68", + "0xc2f12fb91a61abedb47f62a98258960edca21f31494cdf59b47a1c721e3e98f8", + "0x16fdfd5e6b591b3140a76efa4593a9c4d105b9e5c62d6f44edbd24790657be50", + "0xc8175ab66690cc94c0a24452754addd62a06948de5db9814e813437a130de452" + ] + }, + "finalized_header": { + "slot": 3648, + "proposer_index": 1, + "parent_root": "0x991ee98a70e8f90bdd61d0f5554e53d37473e75e16af171f6d88f27d20223dae", + "state_root": "0x59b04d660ac772005a13a7dc1d5f99bb0d0292f3c422f04f7365198d70dd30de", + "body_root": "0x5151f035e146258e7327ad9cf1df13f8ddec7a7842c19993cf739358717b5565" + }, + "finality_branch": [ + "0xc801000000000000000000000000000000000000000000000000000000000000", + "0x10c726fac935bf9657cc7476d3cfa7bedec5983dcfb59e8a7df6d0a619e108d7", + "0x142061c4bc3673bf774cb8c7b6085057bd0ca85672b43afa2d9581b0b6a44e54", + "0xc2f12fb91a61abedb47f62a98258960edca21f31494cdf59b47a1c721e3e98f8", + "0x16fdfd5e6b591b3140a76efa4593a9c4d105b9e5c62d6f44edbd24790657be50", + "0xc8175ab66690cc94c0a24452754addd62a06948de5db9814e813437a130de452" + ], + "block_roots_root": "0xe6e2adaaad45363d7112945ef670e21c66bcb3276dc450962ade1e8950230380", + "block_roots_branch": [ + "0x386ede102258966d4c23031c5a02de2af8180d475c4c1716b07fb5b9f142a817", + "0x35e6c89bc38d993a1957f8a9fb1fbeab7420688091ba2cd7ee7b19b7e187f7d6", + "0x99249309825cafef7e694c09c4fdf95eb4b1e8743d3b23f6959d9980ad2d69b0", + "0x5e028d1d905db6430f0ce4aafbc78f442047ec3a132b4e69557fdf804a4cfbf3", + "0xd34afeab37851937920243683a1c926c41c626aacb145718fce755782d4996dd" + ] +} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/sync-committee-update.minimal.json b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/sync-committee-update.minimal.json new file mode 100644 index 00000000000..a962a0c87c4 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/sync-committee-update.minimal.json @@ -0,0 +1,83 @@ +{ + "attested_header": { + "slot": 3600, + "proposer_index": 7, + "parent_root": "0xdf60c2d58beccd89678b9267c689e9ba1cf1d58ce5114ad5c16e8341459cfd75", + "state_root": "0x023f14c7a38ef4d6ec19b522edfb427c6b70c6ffbd8610ca802dd1491c92c852", + "body_root": "0x0f78a1c45e42711efc5fb7b7f6238be1bee9273f7c44ff6892d815858bb77e25" + }, + "sync_aggregate": { + "sync_committee_bits": "0xffffffff", + "sync_committee_signature": "0xa4dd8f0991de88ca6f81476f72f48cdb67b9414ad7bf6bba37f627c5ec84dd2c2ebc12cddd5d2e7c927276cee2d3d144158b4c067db3e9911fe52fe1875b14c93f90e4eb57bf5e8f0e6e6effe22f9ba076f30207e0ec683354961ae8e9779556" + }, + "signature_slot": 3601, + "next_sync_committee_update": { + "next_sync_committee": { + "pubkeys": [ + "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", + "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", + "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", + "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", + "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", + "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", + "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", + "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", + "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", + "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", + "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", + "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", + "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", + "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", + "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", + "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", + "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c" + ], + "aggregate_pubkey": "0x8fe11476a05750c52618deb79918e2e674f56dfbf12dbce55ae4386d108e8a1e83c6326f5957e2ef19137582ce270dc6" + }, + "next_sync_committee_branch": [ + "0x1446606d0129c324a4ea374bd29a625175e0659512cd8650097e0a9c38ce6379", + "0xd92466c7e9a53b7b55f4fdb151746a3058931d7559b7e84e7b15384ddc903ca0", + "0x9fd10c3f68b75cfd3ebd2af0d4e2cbbfbe120e0b5423dde89ff0f743c7a4f937", + "0x1ed6aac0ab29a883de2bb2e3579ad4d6807ddcf3db8afcaf0ae25a076ac9a5f4", + "0xf17a840df410a15f0e4e48abf521c29ad0d296d3fb4e8b847ea37f2cc8236f1f" + ] + }, + "finalized_header": { + "slot": 3584, + "proposer_index": 1, + "parent_root": "0x91c285af2ec25d485310391afe667108b787ec570cdbb0e3fd87b1e0e2c47bd7", + "state_root": "0xccc4baf90024e035f1252520d2f2ef1e50f840ff0ecc8e6e365721e083871a32", + "body_root": "0x91df5e0077434aad609aaa7e030005cee77cca83868ffc2724e5befe9a3f6a02" + }, + "finality_branch": [ + "0xc001000000000000000000000000000000000000000000000000000000000000", + "0x10c726fac935bf9657cc7476d3cfa7bedec5983dcfb59e8a7df6d0a619e108d7", + "0x83c3d5360d254f4a44be712c1f433e88e810b6d1e0e789e90bada9e36126b857", + "0x9fd10c3f68b75cfd3ebd2af0d4e2cbbfbe120e0b5423dde89ff0f743c7a4f937", + "0x1ed6aac0ab29a883de2bb2e3579ad4d6807ddcf3db8afcaf0ae25a076ac9a5f4", + "0xf17a840df410a15f0e4e48abf521c29ad0d296d3fb4e8b847ea37f2cc8236f1f" + ], + "block_roots_root": "0x9eab8a05c396a29c32f4f8ac9654fc0fb7cd97ec659236392ede48951a794505", + "block_roots_branch": [ + "0x5c175efdbafacdfdab21c93a318b0e8e2291a5a86c40b1fc564f91ad33c106d4", + "0x5c1e0b76176ab033858b2835f90d5e25d708b563f77efd7d9938f0faa1c20878", + "0x7aea32464adee801e2a05c3af227f24231d3c088e3b7265a5fada9ac850549fe", + "0x9d9fca29e23c5d4ae433adf17e7fd9a0e4d1b09b68f5c45e7ca1b13ebe4a9e98", + "0x6b35238f188021c859d6b317457ebb6fe4cf362cab35c988010cb1343eabbfc5" + ] +} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/inbound-queue/Cargo.toml b/snowbridge/parachain/pallets/inbound-queue/Cargo.toml new file mode 100644 index 00000000000..f9e4d20be0f --- /dev/null +++ b/snowbridge/parachain/pallets/inbound-queue/Cargo.toml @@ -0,0 +1,93 @@ +[package] +name = "snowbridge-inbound-queue" +description = "Snowbridge Inbound Queue" +version = "0.1.1" +edition = "2021" +authors = ["Snowfork "] +repository = "https://github.com/Snowfork/snowbridge" +license = "Apache-2.0" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +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 } +log = { version = "0.4.20", default-features = false } +alloy-primitives = { version = "0.4.2", default-features = false, features = ["rlp"] } +alloy-sol-types = { version = "0.4.2", default-features = false } +alloy-rlp = { version = "0.3.3", default-features = false, features = ["derive"] } +num-traits = { version = "0.2.16", default-features = false } + +frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking", default-features = false, optional = true } +frame-support = { path = "../../../../../substrate/frame/support", default-features = false } +frame-system = { path = "../../../../../substrate/frame/system", default-features = false } +pallet-balances = { path = "../../../../../substrate/frame/balances", default-features = false } +sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } +sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } +sp-io = { path = "../../../../../substrate/primitives/io", default-features = false } +sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } + +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false } + +snowbridge-core = { path = "../../primitives/core", default-features = false } +snowbridge-ethereum = { path = "../../primitives/ethereum", default-features = false } +snowbridge-router-primitives = { path = "../../primitives/router", default-features = false } +snowbridge-beacon-primitives = { path = "../../primitives/beacon", default-features = false, optional = true } + +[dev-dependencies] +frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking" } +sp-keyring = { path = "../../../../../substrate/primitives/keyring" } +snowbridge-beacon-primitives = { path = "../../primitives/beacon" } +snowbridge-ethereum-beacon-client = { path = "../../pallets/ethereum-beacon-client" } +hex-literal = { version = "0.4.1" } + +[features] +default = ["std"] +std = [ + "alloy-primitives/std", + "alloy-rlp/std", + "alloy-sol-types/std", + "codec/std", + "frame-benchmarking/std", + "frame-support/std", + "frame-system/std", + "log/std", + "num-traits/std", + "pallet-balances/std", + "scale-info/std", + "serde", + "snowbridge-core/std", + "snowbridge-ethereum/std", + "snowbridge-router-primitives/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", + "xcm-builder/std", + "xcm/std", +] +runtime-benchmarks = [ + "frame-benchmarking", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "hex-literal", + "pallet-balances/runtime-benchmarks", + "snowbridge-beacon-primitives", + "snowbridge-core/runtime-benchmarks", + "snowbridge-ethereum-beacon-client/runtime-benchmarks", + "snowbridge-router-primitives/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", +] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-balances/try-runtime", + "snowbridge-ethereum-beacon-client/try-runtime", + "sp-runtime/try-runtime", +] diff --git a/snowbridge/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs b/snowbridge/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs new file mode 100644 index 00000000000..4f2382d072a --- /dev/null +++ b/snowbridge/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs @@ -0,0 +1,40 @@ +use hex_literal::hex; +use snowbridge_beacon_primitives::CompactExecutionHeader; +use snowbridge_core::inbound::{Log, Message, Proof}; +use sp_std::vec; + +pub struct InboundQueueTest { + pub execution_header: CompactExecutionHeader, + pub message: Message, +} + +pub fn make_create_message() -> InboundQueueTest { + InboundQueueTest{ + execution_header: CompactExecutionHeader{ + parent_hash: hex!("b5608f0af7c3b6fe5c593772fc25436b8d6549eb236adb0855c6ad33e0004e04").into(), + block_number: 115, + state_root: hex!("47ed174789836c622499d9659a4ac32c3b91a7b15642d39b0a11b82ff23995c1").into(), + receipts_root: hex!("42c08b5303fcdf9e49c833fe5f1182cdbc8206bf8aec581125fc34aba11e1f1a").into(), + }, + message: Message { + event_log: Log { + address: hex!("eda338e4dc46038493b885327842fd3e301cab39").into(), + topics: vec![ + hex!("7153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84f").into(), + hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539").into(), + hex!("5f7060e971b0dc81e63f0aa41831091847d97c1a4693ac450cc128c7214e65e0").into(), + ], + data: hex!("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002e00a736aa00000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7d00e40b54020000000000000000000000000000000000000000000000000000000000").into(), + }, + proof: Proof { + block_hash: hex!("add15f439c8a57fe375d0a679870b1359921d70cb0e3e44f0dd3e272849f4097").into(), + tx_index: 0, + data: (vec![ + hex!("42c08b5303fcdf9e49c833fe5f1182cdbc8206bf8aec581125fc34aba11e1f1a").to_vec(), + ], vec![ + hex!("f9028e822080b9028802f90284018301ed20b9010000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000080000000000000000000000000000004000000000080000000000000000000000000000000000010100000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000040004000000000000002000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000200000000000010f90179f85894eda338e4dc46038493b885327842fd3e301cab39e1a0f78bb28d4b1d7da699e5c0bc2be29c2b04b5aab6aacf6298fe5304f9db9c6d7ea000000000000000000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7df9011c94eda338e4dc46038493b885327842fd3e301cab39f863a07153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84fa0c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539a05f7060e971b0dc81e63f0aa41831091847d97c1a4693ac450cc128c7214e65e0b8a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002e00a736aa00000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7d00e40b54020000000000000000000000000000000000000000000000000000000000").to_vec(), + ]), + }, + }, + } +} diff --git a/snowbridge/parachain/pallets/inbound-queue/src/benchmarking/mod.rs b/snowbridge/parachain/pallets/inbound-queue/src/benchmarking/mod.rs new file mode 100644 index 00000000000..c10de9dff2f --- /dev/null +++ b/snowbridge/parachain/pallets/inbound-queue/src/benchmarking/mod.rs @@ -0,0 +1,55 @@ +mod fixtures; + +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use super::*; + +use crate::Pallet as InboundQueue; +use frame_benchmarking::v2::*; +use frame_support::assert_ok; +use frame_system::RawOrigin; + +#[benchmarks] +mod benchmarks { + use super::*; + use crate::benchmarking::fixtures::make_create_message; + + #[benchmark] + fn submit() -> Result<(), BenchmarkError> { + let caller: T::AccountId = whitelisted_caller(); + + let create_message = make_create_message(); + + T::Helper::initialize_storage( + create_message.message.proof.block_hash, + create_message.execution_header, + ); + + let sovereign_account = sibling_sovereign_account::(1000u32.into()); + + let minimum_balance = T::Token::minimum_balance(); + + // So that the receiving account exists + assert_ok!(T::Token::mint_into(&caller, minimum_balance)); + // Fund the sovereign account (parachain sovereign account) so it can transfer a reward + // fee to the caller account + assert_ok!(T::Token::mint_into( + &sovereign_account, + 3_000_000_000_000u128 + .try_into() + .unwrap_or_else(|_| panic!("unable to cast sovereign account balance")), + )); + + #[block] + { + assert_ok!(InboundQueue::::submit( + RawOrigin::Signed(caller.clone()).into(), + create_message.message, + )); + } + + Ok(()) + } + + impl_benchmark_test_suite!(InboundQueue, crate::mock::new_tester(), crate::mock::Test); +} diff --git a/snowbridge/parachain/pallets/inbound-queue/src/envelope.rs b/snowbridge/parachain/pallets/inbound-queue/src/envelope.rs new file mode 100644 index 00000000000..826d535c2cb --- /dev/null +++ b/snowbridge/parachain/pallets/inbound-queue/src/envelope.rs @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use snowbridge_core::{inbound::Log, ChannelId}; + +use sp_core::{RuntimeDebug, H160, H256}; +use sp_std::{convert::TryFrom, prelude::*}; + +use alloy_primitives::B256; +use alloy_sol_types::{sol, SolEvent}; + +sol! { + event OutboundMessageAccepted(bytes32 indexed channel_id, uint64 nonce, bytes32 indexed message_id, bytes payload); +} + +/// An inbound message that has had its outer envelope decoded. +#[derive(Clone, RuntimeDebug)] +pub struct Envelope { + /// The address of the outbound queue on Ethereum that emitted this message as an event log + pub gateway: H160, + /// The message Channel + pub channel_id: ChannelId, + /// A nonce for enforcing replay protection and ordering. + pub nonce: u64, + /// An id for tracing the message on its route (has no role in bridge consensus) + pub message_id: H256, + /// The inner payload generated from the source application. + pub payload: Vec, +} + +#[derive(Copy, Clone, RuntimeDebug)] +pub struct EnvelopeDecodeError; + +impl TryFrom<&Log> for Envelope { + type Error = EnvelopeDecodeError; + + fn try_from(log: &Log) -> Result { + let topics: Vec = log.topics.iter().map(|x| B256::from_slice(x.as_ref())).collect(); + + let event = OutboundMessageAccepted::decode_log(topics, &log.data, true) + .map_err(|_| EnvelopeDecodeError)?; + + Ok(Self { + gateway: log.address, + channel_id: ChannelId::from(event.channel_id.as_ref()), + nonce: event.nonce, + message_id: H256::from(event.message_id.as_ref()), + payload: event.payload, + }) + } +} diff --git a/snowbridge/parachain/pallets/inbound-queue/src/lib.rs b/snowbridge/parachain/pallets/inbound-queue/src/lib.rs new file mode 100644 index 00000000000..834e805fbef --- /dev/null +++ b/snowbridge/parachain/pallets/inbound-queue/src/lib.rs @@ -0,0 +1,342 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! Inbound Queue +//! +//! # Overview +//! +//! Receives messages emitted by the Gateway contract on Ethereum, whereupon they are verified, +//! translated to XCM, and finally sent to their final destination parachain. +//! +//! The message relayers are rewarded using native currency from the sovereign account of the +//! destination parachain. +//! +//! # Extrinsics +//! +//! ## Governance +//! +//! * [`Call::set_operating_mode`]: Set the operating mode of the pallet. Can be used to disable +//! processing of inbound messages. +//! +//! ## Message Submission +//! +//! * [`Call::submit`]: Submit a message for verification and dispatch the final destination +//! parachain. +#![cfg_attr(not(feature = "std"), no_std)] + +mod envelope; + +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; + +#[cfg(feature = "runtime-benchmarks")] +use snowbridge_beacon_primitives::CompactExecutionHeader; + +pub mod weights; + +#[cfg(test)] +mod mock; + +#[cfg(test)] +mod test; + +use codec::{Decode, DecodeAll, Encode}; +use envelope::Envelope; +use frame_support::{ + traits::{ + fungible::{Inspect, Mutate}, + tokens::{Fortitude, Precision, Preservation}, + }, + weights::WeightToFee, + PalletError, +}; +use frame_system::ensure_signed; +use scale_info::TypeInfo; +use sp_core::{H160, H256}; +use sp_std::{convert::TryFrom, vec}; +use xcm::prelude::{ + send_xcm, Instruction::SetTopic, Junction::*, Junctions::*, MultiLocation, + SendError as XcmpSendError, SendXcm, Xcm, XcmHash, +}; + +use snowbridge_core::{ + inbound::{Message, VerificationError, Verifier}, + sibling_sovereign_account, BasicOperatingMode, Channel, ChannelId, ParaId, StaticLookup, +}; +use snowbridge_router_primitives::{ + inbound, + inbound::{ConvertMessage, ConvertMessageError}, +}; +use sp_runtime::traits::Saturating; + +pub use weights::WeightInfo; + +type BalanceOf = + <::Token as Inspect<::AccountId>>::Balance; + +pub use pallet::*; + +pub const LOG_TARGET: &str = "snowbridge-inbound-queue"; + +#[frame_support::pallet] +pub mod pallet { + use super::*; + + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + use snowbridge_core::PricingParameters; + + #[pallet::pallet] + pub struct Pallet(_); + + #[cfg(feature = "runtime-benchmarks")] + pub trait BenchmarkHelper { + fn initialize_storage(block_hash: H256, header: CompactExecutionHeader); + } + + #[pallet::config] + pub trait Config: frame_system::Config { + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + + /// The verifier for inbound messages from Ethereum + type Verifier: Verifier; + + /// Message relayers are rewarded with this asset + type Token: Mutate + Inspect; + + /// XCM message sender + type XcmSender: SendXcm; + + // Address of the Gateway contract + #[pallet::constant] + type GatewayAddress: Get; + + /// Convert inbound message to XCM + type MessageConverter: ConvertMessage< + AccountId = Self::AccountId, + Balance = BalanceOf, + >; + + /// Lookup a channel descriptor + type ChannelLookup: StaticLookup; + + /// Lookup pricing parameters + type PricingParameters: Get>>; + + type WeightInfo: WeightInfo; + + #[cfg(feature = "runtime-benchmarks")] + type Helper: BenchmarkHelper; + + /// Convert a weight value into deductible balance type. + type WeightToFee: WeightToFee>; + + /// Convert a length value into deductible balance type + type LengthToFee: WeightToFee>; + + /// The upper limit here only used to estimate delivery cost + type MaxMessageSize: Get; + } + + #[pallet::hooks] + impl Hooks> for Pallet {} + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// A message was received from Ethereum + MessageReceived { + /// The message channel + channel_id: ChannelId, + /// The message nonce + nonce: u64, + /// ID of the XCM message which was forwarded to the final destination parachain + message_id: [u8; 32], + }, + /// Set OperatingMode + OperatingModeChanged { mode: BasicOperatingMode }, + } + + #[pallet::error] + pub enum Error { + /// Message came from an invalid outbound channel on the Ethereum side. + InvalidGateway, + /// Message has an invalid envelope. + InvalidEnvelope, + /// Message has an unexpected nonce. + InvalidNonce, + /// Message has an invalid payload. + InvalidPayload, + /// Message channel is invalid + InvalidChannel, + /// The max nonce for the type has been reached + MaxNonceReached, + /// Cannot convert location + InvalidAccountConversion, + /// Pallet is halted + Halted, + /// Message verification error, + Verification(VerificationError), + /// XCMP send failure + Send(SendError), + /// Message conversion error + ConvertMessage(ConvertMessageError), + } + + #[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, TypeInfo, PalletError)] + pub enum SendError { + NotApplicable, + NotRoutable, + Transport, + DestinationUnsupported, + ExceedsMaxMessageSize, + MissingArgument, + Fees, + } + + impl From for Error { + fn from(e: XcmpSendError) -> Self { + match e { + 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::MissingArgument => Error::::Send(SendError::MissingArgument), + XcmpSendError::Fees => Error::::Send(SendError::Fees), + } + } + } + + /// The current nonce for each channel + #[pallet::storage] + pub type Nonce = StorageMap<_, Twox64Concat, ChannelId, u64, ValueQuery>; + + /// The current operating mode of the pallet. + #[pallet::storage] + #[pallet::getter(fn operating_mode)] + pub type OperatingMode = StorageValue<_, BasicOperatingMode, ValueQuery>; + + #[pallet::call] + impl Pallet { + /// Submit an inbound message originating from the Gateway contract on Ethereum + #[pallet::call_index(0)] + #[pallet::weight(T::WeightInfo::submit())] + pub fn submit(origin: OriginFor, message: Message) -> DispatchResult { + let who = ensure_signed(origin)?; + ensure!(!Self::operating_mode().is_halted(), Error::::Halted); + + // submit message to verifier for verification + T::Verifier::verify(&message.event_log, &message.proof) + .map_err(|e| Error::::Verification(e))?; + + // Decode event log into an Envelope + let envelope = + Envelope::try_from(&message.event_log).map_err(|_| Error::::InvalidEnvelope)?; + + // Verify that the message was submitted from the known Gateway contract + ensure!(T::GatewayAddress::get() == envelope.gateway, Error::::InvalidGateway); + + // Retrieve the registered channel for this message + let channel = + T::ChannelLookup::lookup(envelope.channel_id).ok_or(Error::::InvalidChannel)?; + + // Verify message nonce + >::try_mutate(envelope.channel_id, |nonce| -> DispatchResult { + if *nonce == u64::MAX { + return Err(Error::::MaxNonceReached.into()) + } + if envelope.nonce != nonce.saturating_add(1) { + Err(Error::::InvalidNonce.into()) + } else { + *nonce = nonce.saturating_add(1); + Ok(()) + } + })?; + + // Reward relayer from the sovereign account of the destination parachain + // Expected to fail if sovereign account has no funds + let sovereign_account = sibling_sovereign_account::(channel.para_id); + let delivery_cost = Self::calculate_delivery_cost(message.encode().len() as u32); + T::Token::transfer(&sovereign_account, &who, delivery_cost, Preservation::Preserve)?; + + // Decode message into XCM + let (xcm, fee) = + match inbound::VersionedMessage::decode_all(&mut envelope.payload.as_ref()) { + Ok(message) => Self::do_convert(envelope.message_id, message)?, + Err(_) => return Err(Error::::InvalidPayload.into()), + }; + + // We embed fees for xcm execution inside the xcm program using teleports + // so we must burn the amount of the fee embedded into the XCM script. + T::Token::burn_from(&sovereign_account, fee, Precision::Exact, Fortitude::Polite)?; + + log::info!( + target: LOG_TARGET, + "💫 xcm {:?} sent with fee {:?}", + xcm, + fee + ); + + // Attempt to send XCM to a dest parachain + let message_id = Self::send_xcm(xcm, channel.para_id)?; + + Self::deposit_event(Event::MessageReceived { + channel_id: envelope.channel_id, + nonce: envelope.nonce, + message_id, + }); + + Ok(()) + } + + /// Halt or resume all pallet operations. May only be called by root. + #[pallet::call_index(1)] + #[pallet::weight((T::DbWeight::get().reads_writes(1, 1), DispatchClass::Operational))] + pub fn set_operating_mode( + origin: OriginFor, + mode: BasicOperatingMode, + ) -> DispatchResult { + ensure_root(origin)?; + OperatingMode::::set(mode); + Self::deposit_event(Event::OperatingModeChanged { mode }); + Ok(()) + } + } + + impl Pallet { + pub fn do_convert( + message_id: H256, + message: inbound::VersionedMessage, + ) -> Result<(Xcm<()>, BalanceOf), Error> { + let (mut xcm, fee) = + T::MessageConverter::convert(message).map_err(|e| Error::::ConvertMessage(e))?; + // Append the message id as an XCM topic + xcm.inner_mut().extend(vec![SetTopic(message_id.into())]); + Ok((xcm, fee)) + } + + pub fn send_xcm(xcm: Xcm<()>, dest: ParaId) -> Result> { + let dest = MultiLocation { parents: 1, interior: X1(Parachain(dest.into())) }; + let (xcm_hash, _) = send_xcm::(dest, xcm).map_err(Error::::from)?; + Ok(xcm_hash) + } + + pub fn calculate_delivery_cost(length: u32) -> BalanceOf { + let weight_fee = T::WeightToFee::weight_to_fee(&T::WeightInfo::submit()); + let len_fee = T::LengthToFee::weight_to_fee(&Weight::from_parts(length as u64, 0)); + weight_fee + .saturating_add(len_fee) + .saturating_add(T::PricingParameters::get().rewards.local) + } + } + + /// API for accessing the delivery cost of a message + impl Get> for Pallet { + fn get() -> BalanceOf { + // Cost here based on MaxMessagePayloadSize(the worst case) + Self::calculate_delivery_cost(T::MaxMessageSize::get()) + } + } +} diff --git a/snowbridge/parachain/pallets/inbound-queue/src/mock.rs b/snowbridge/parachain/pallets/inbound-queue/src/mock.rs new file mode 100644 index 00000000000..6b79a55e3c9 --- /dev/null +++ b/snowbridge/parachain/pallets/inbound-queue/src/mock.rs @@ -0,0 +1,311 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use super::*; + +use frame_support::{ + parameter_types, + traits::{ConstU128, ConstU32, Everything}, + weights::IdentityFee, +}; +use hex_literal::hex; +use snowbridge_beacon_primitives::{Fork, ForkVersions}; +use snowbridge_core::{ + gwei, + inbound::{Log, Proof, VerificationError}, + meth, Channel, ChannelId, PricingParameters, Rewards, StaticLookup, +}; +use snowbridge_router_primitives::inbound::MessageToXcm; +use sp_core::{H160, H256}; +use sp_runtime::{ + traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Verify}, + BuildStorage, FixedU128, MultiSignature, +}; +use sp_std::convert::From; +use xcm::v3::{prelude::*, MultiAssets, SendXcm}; + +use crate::{self as inbound_queue}; + +type Block = frame_system::mocking::MockBlock; + +frame_support::construct_runtime!( + pub enum Test + { + System: frame_system::{Pallet, Call, Storage, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + EthereumBeaconClient: snowbridge_ethereum_beacon_client::{Pallet, Call, Storage, Event}, + InboundQueue: inbound_queue::{Pallet, Call, Storage, Event}, + } +); + +pub type Signature = MultiSignature; +pub type AccountId = <::Signer as IdentifyAccount>::AccountId; + +parameter_types! { + pub const BlockHashCount: u64 = 250; +} + +type Balance = u128; + +impl frame_system::Config for Test { + type BaseCallFilter = Everything; + type BlockWeights = (); + type BlockLength = (); + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = AccountId; + type Lookup = IdentityLookup; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = BlockHashCount; + type DbWeight = (); + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; + type Block = Block; +} + +impl pallet_balances::Config for Test { + type MaxLocks = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; + type Balance = Balance; + type RuntimeEvent = RuntimeEvent; + type DustRemoval = (); + type ExistentialDeposit = ConstU128<1>; + type AccountStore = System; + type WeightInfo = (); + type FreezeIdentifier = (); + type MaxFreezes = (); + type RuntimeHoldReason = (); + type RuntimeFreezeReason = (); + type MaxHolds = (); +} + +parameter_types! { + pub const ExecutionHeadersPruneThreshold: u32 = 10; + pub const ChainForkVersions: ForkVersions = ForkVersions{ + genesis: Fork { + version: [0, 0, 0, 1], // 0x00000001 + epoch: 0, + }, + altair: Fork { + version: [1, 0, 0, 1], // 0x01000001 + epoch: 0, + }, + bellatrix: Fork { + version: [2, 0, 0, 1], // 0x02000001 + epoch: 0, + }, + capella: Fork { + version: [3, 0, 0, 1], // 0x03000001 + epoch: 0, + }, + }; +} + +impl snowbridge_ethereum_beacon_client::Config for Test { + type RuntimeEvent = RuntimeEvent; + type ForkVersions = ChainForkVersions; + type MaxExecutionHeadersToKeep = ExecutionHeadersPruneThreshold; + type WeightInfo = (); +} + +// Mock verifier +pub struct MockVerifier; + +impl Verifier for MockVerifier { + fn verify(_: &Log, _: &Proof) -> Result<(), VerificationError> { + Ok(()) + } +} + +const GATEWAY_ADDRESS: [u8; 20] = hex!["eda338e4dc46038493b885327842fd3e301cab39"]; + +parameter_types! { + pub const EthereumNetwork: xcm::v3::NetworkId = xcm::v3::NetworkId::Ethereum { chain_id: 11155111 }; + pub const GatewayAddress: H160 = H160(GATEWAY_ADDRESS); + pub const CreateAssetCall: [u8;2] = [53, 0]; + pub const CreateAssetExecutionFee: u128 = 2_000_000_000; + pub const CreateAssetDeposit: u128 = 100_000_000_000; + pub const SendTokenExecutionFee: u128 = 1_000_000_000; + pub const InitialFund: u128 = 1_000_000_000_000; + pub const InboundQueuePalletInstance: u8 = 80; +} + +#[cfg(feature = "runtime-benchmarks")] +impl BenchmarkHelper for Test { + // not implemented since the MockVerifier is used for tests + fn initialize_storage(_: H256, _: CompactExecutionHeader) {} +} + +// Mock XCM sender that always succeeds +pub struct MockXcmSender; + +impl SendXcm for MockXcmSender { + type Ticket = Xcm<()>; + + fn validate( + dest: &mut Option, + xcm: &mut Option>, + ) -> SendResult { + match dest { + Some(MultiLocation { interior, .. }) => { + if let X1(Parachain(1001)) = interior { + return Err(XcmpSendError::NotApplicable) + } + Ok((xcm.clone().unwrap(), MultiAssets::default())) + }, + _ => Ok((xcm.clone().unwrap(), MultiAssets::default())), + } + } + + fn deliver(xcm: Self::Ticket) -> core::result::Result { + let hash = xcm.using_encoded(sp_io::hashing::blake2_256); + Ok(hash) + } +} + +parameter_types! { + pub const OwnParaId: ParaId = ParaId::new(1013); + pub Parameters: PricingParameters = PricingParameters { + exchange_rate: FixedU128::from_rational(1, 400), + fee_per_gas: gwei(20), + rewards: Rewards { local: DOT, remote: meth(1) } + }; +} + +pub const DOT: u128 = 10_000_000_000; + +pub struct MockChannelLookup; +impl StaticLookup for MockChannelLookup { + type Source = ChannelId; + type Target = Channel; + + fn lookup(channel_id: Self::Source) -> Option { + if channel_id != + hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539").into() + { + return None + } + Some(Channel { agent_id: H256::zero(), para_id: ASSET_HUB_PARAID.into() }) + } +} + +impl inbound_queue::Config for Test { + type RuntimeEvent = RuntimeEvent; + type Verifier = MockVerifier; + type Token = Balances; + type XcmSender = MockXcmSender; + type WeightInfo = (); + type GatewayAddress = GatewayAddress; + type MessageConverter = MessageToXcm< + CreateAssetCall, + CreateAssetDeposit, + InboundQueuePalletInstance, + AccountId, + Balance, + >; + type PricingParameters = Parameters; + type ChannelLookup = MockChannelLookup; + #[cfg(feature = "runtime-benchmarks")] + type Helper = Test; + type WeightToFee = IdentityFee; + type LengthToFee = IdentityFee; + type MaxMessageSize = ConstU32<1024>; +} + +pub fn last_events(n: usize) -> Vec { + frame_system::Pallet::::events() + .into_iter() + .rev() + .take(n) + .rev() + .map(|e| e.event) + .collect() +} + +pub fn expect_events(e: Vec) { + assert_eq!(last_events(e.len()), e); +} + +pub fn setup() { + System::set_block_number(1); + Balances::mint_into( + &sibling_sovereign_account::(ASSET_HUB_PARAID.into()), + InitialFund::get(), + ) + .unwrap(); + Balances::mint_into( + &sibling_sovereign_account::(TEMPLATE_PARAID.into()), + InitialFund::get(), + ) + .unwrap(); +} + +pub fn new_tester() -> sp_io::TestExternalities { + let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); + let mut ext: sp_io::TestExternalities = storage.into(); + ext.execute_with(setup); + ext +} + +// Generated from smoketests: +// cd smoketests +// ./make-bindings +// cargo test --test register_token -- --nocapture +pub fn mock_event_log() -> Log { + Log { + // gateway address + address: hex!("eda338e4dc46038493b885327842fd3e301cab39").into(), + topics: vec![ + hex!("7153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84f").into(), + // channel id + hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539").into(), + // message id + hex!("5f7060e971b0dc81e63f0aa41831091847d97c1a4693ac450cc128c7214e65e0").into(), + ], + // Nonce + Payload + data: hex!("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002e000f000000000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7d00e40b54020000000000000000000000000000000000000000000000000000000000").into(), + } +} + +pub fn mock_event_log_invalid_channel() -> Log { + Log { + address: hex!("eda338e4dc46038493b885327842fd3e301cab39").into(), + topics: vec![ + hex!("7153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84f").into(), + // invalid channel id + hex!("0000000000000000000000000000000000000000000000000000000000000000").into(), + hex!("5f7060e971b0dc81e63f0aa41831091847d97c1a4693ac450cc128c7214e65e0").into(), + ], + data: hex!("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001e000f000000000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7d0000").into(), + } +} + +pub fn mock_event_log_invalid_gateway() -> Log { + Log { + // gateway address + address: H160::zero(), + topics: vec![ + hex!("7153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84f").into(), + // channel id + hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539").into(), + // message id + hex!("5f7060e971b0dc81e63f0aa41831091847d97c1a4693ac450cc128c7214e65e0").into(), + ], + // Nonce + Payload + data: hex!("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001e000f000000000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7d0000").into(), + } +} + +pub const ASSET_HUB_PARAID: u32 = 1000u32; +pub const TEMPLATE_PARAID: u32 = 1001u32; diff --git a/snowbridge/parachain/pallets/inbound-queue/src/test.rs b/snowbridge/parachain/pallets/inbound-queue/src/test.rs new file mode 100644 index 00000000000..6dc3ac45374 --- /dev/null +++ b/snowbridge/parachain/pallets/inbound-queue/src/test.rs @@ -0,0 +1,211 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use super::*; + +use frame_support::{assert_noop, assert_ok}; +use hex_literal::hex; +use snowbridge_core::{inbound::Proof, ChannelId}; +use sp_keyring::AccountKeyring as Keyring; +use sp_runtime::{DispatchError, TokenError}; +use sp_std::convert::From; + +use crate::{Error, Event as InboundQueueEvent}; + +use crate::mock::*; + +#[test] +fn test_submit_happy_path() { + new_tester().execute_with(|| { + let relayer: AccountId = Keyring::Bob.into(); + let channel_sovereign = sibling_sovereign_account::(ASSET_HUB_PARAID.into()); + + let origin = RuntimeOrigin::signed(relayer.clone()); + + // Submit message + let message = Message { + event_log: mock_event_log(), + proof: Proof { + block_hash: Default::default(), + tx_index: Default::default(), + data: Default::default(), + }, + }; + + let initial_fund = InitialFund::get(); + assert_eq!(Balances::balance(&relayer), 0); + assert_eq!(Balances::balance(&channel_sovereign), initial_fund); + + assert_ok!(InboundQueue::submit(origin.clone(), message.clone())); + expect_events(vec![InboundQueueEvent::MessageReceived { + channel_id: hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539") + .into(), + nonce: 1, + message_id: [ + 27, 217, 88, 127, 46, 143, 199, 70, 236, 66, 212, 244, 85, 221, 153, 104, 175, 37, + 224, 20, 140, 95, 140, 7, 27, 74, 182, 199, 77, 12, 194, 236, + ], + } + .into()]); + + let delivery_cost = InboundQueue::calculate_delivery_cost(message.encode().len() as u32); + assert!( + Parameters::get().rewards.local < delivery_cost, + "delivery cost exceeds pure reward" + ); + + assert_eq!(Balances::balance(&relayer), delivery_cost, "relayer was rewarded"); + assert!( + Balances::balance(&channel_sovereign) <= initial_fund - delivery_cost, + "sovereign account paid reward" + ); + }); +} + +#[test] +fn test_submit_xcm_invalid_channel() { + new_tester().execute_with(|| { + let relayer: AccountId = Keyring::Bob.into(); + let origin = RuntimeOrigin::signed(relayer); + + // Deposit funds into sovereign account of parachain 1001 + let sovereign_account = sibling_sovereign_account::(TEMPLATE_PARAID.into()); + println!("account: {}", sovereign_account); + let _ = Balances::mint_into(&sovereign_account, 10000); + + // Submit message + let message = Message { + event_log: mock_event_log_invalid_channel(), + proof: Proof { + block_hash: Default::default(), + tx_index: Default::default(), + data: Default::default(), + }, + }; + assert_noop!( + InboundQueue::submit(origin.clone(), message.clone()), + Error::::InvalidChannel, + ); + }); +} + +#[test] +fn test_submit_with_invalid_gateway() { + new_tester().execute_with(|| { + let relayer: AccountId = Keyring::Bob.into(); + let origin = RuntimeOrigin::signed(relayer); + + // Deposit funds into sovereign account of Asset Hub (Statemint) + let sovereign_account = sibling_sovereign_account::(ASSET_HUB_PARAID.into()); + let _ = Balances::mint_into(&sovereign_account, 10000); + + // Submit message + let message = Message { + event_log: mock_event_log_invalid_gateway(), + proof: Proof { + block_hash: Default::default(), + tx_index: Default::default(), + data: Default::default(), + }, + }; + assert_noop!( + InboundQueue::submit(origin.clone(), message.clone()), + Error::::InvalidGateway + ); + }); +} + +#[test] +fn test_submit_with_invalid_nonce() { + new_tester().execute_with(|| { + let relayer: AccountId = Keyring::Bob.into(); + let origin = RuntimeOrigin::signed(relayer); + + // Deposit funds into sovereign account of Asset Hub (Statemint) + let sovereign_account = sibling_sovereign_account::(ASSET_HUB_PARAID.into()); + let _ = Balances::mint_into(&sovereign_account, 10000); + + // Submit message + let message = Message { + event_log: mock_event_log(), + proof: Proof { + block_hash: Default::default(), + tx_index: Default::default(), + data: Default::default(), + }, + }; + assert_ok!(InboundQueue::submit(origin.clone(), message.clone())); + + let nonce: u64 = >::get(ChannelId::from(hex!( + "c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539" + ))); + assert_eq!(nonce, 1); + + // Submit the same again + assert_noop!( + InboundQueue::submit(origin.clone(), message.clone()), + Error::::InvalidNonce + ); + }); +} + +#[test] +fn test_submit_no_funds_to_reward_relayers() { + new_tester().execute_with(|| { + let relayer: AccountId = Keyring::Bob.into(); + let origin = RuntimeOrigin::signed(relayer); + + // Reset balance of sovereign_account to zero so to trigger the FundsUnavailable error + let sovereign_account = sibling_sovereign_account::(ASSET_HUB_PARAID.into()); + Balances::set_balance(&sovereign_account, 0); + + // Submit message + let message = Message { + event_log: mock_event_log(), + proof: Proof { + block_hash: Default::default(), + tx_index: Default::default(), + data: Default::default(), + }, + }; + assert_noop!( + InboundQueue::submit(origin.clone(), message.clone()), + TokenError::FundsUnavailable + ); + }); +} + +#[test] +fn test_set_operating_mode() { + new_tester().execute_with(|| { + let relayer: AccountId = Keyring::Bob.into(); + let origin = RuntimeOrigin::signed(relayer); + let message = Message { + event_log: mock_event_log(), + proof: Proof { + block_hash: Default::default(), + tx_index: Default::default(), + data: Default::default(), + }, + }; + + assert_ok!(InboundQueue::set_operating_mode( + RuntimeOrigin::root(), + snowbridge_core::BasicOperatingMode::Halted + )); + + assert_noop!(InboundQueue::submit(origin, message), Error::::Halted); + }); +} + +#[test] +fn test_set_operating_mode_root_only() { + new_tester().execute_with(|| { + assert_noop!( + InboundQueue::set_operating_mode( + RuntimeOrigin::signed(Keyring::Bob.into()), + snowbridge_core::BasicOperatingMode::Halted + ), + DispatchError::BadOrigin + ); + }); +} diff --git a/snowbridge/parachain/pallets/inbound-queue/src/weights.rs b/snowbridge/parachain/pallets/inbound-queue/src/weights.rs new file mode 100644 index 00000000000..c2c665f40d9 --- /dev/null +++ b/snowbridge/parachain/pallets/inbound-queue/src/weights.rs @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! Autogenerated weights for `snowbridge_inbound_queue` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `macbook pro 14 m2`, CPU: `m2-arm64` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for ethereum_beacon_client. +pub trait WeightInfo { + fn submit() -> Weight; +} + +// For backwards compatibility and tests +impl WeightInfo for () { + fn submit() -> Weight { + Weight::from_parts(70_000_000, 0) + .saturating_add(Weight::from_parts(0, 3601)) + .saturating_add(RocksDbWeight::get().reads(2)) + .saturating_add(RocksDbWeight::get().writes(2)) + } +} diff --git a/snowbridge/parachain/pallets/outbound-queue/Cargo.toml b/snowbridge/parachain/pallets/outbound-queue/Cargo.toml new file mode 100644 index 00000000000..66dd1d838e7 --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/Cargo.toml @@ -0,0 +1,78 @@ +[package] +name = "snowbridge-outbound-queue" +description = "Snowbridge Outbound Queue" +version = "0.1.1" +edition = "2021" +authors = ["Snowfork "] +repository = "https://github.com/Snowfork/snowbridge" +license = "Apache-2.0" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +serde = { version = "1.0.188", features = ["alloc", "derive"], default-features = false } +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 } + +frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking", default-features = false, optional = true } +frame-support = { path = "../../../../../substrate/frame/support", default-features = false } +frame-system = { path = "../../../../../substrate/frame/system", default-features = false } +sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } +sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } +sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } +sp-io = { path = "../../../../../substrate/primitives/io", default-features = false } +sp-arithmetic = { path = "../../../../../substrate/primitives/arithmetic", default-features = false } + +bridge-hub-common = { path = "../../../../../cumulus/parachains/runtimes/bridge-hubs/common", default-features = false } + +snowbridge-core = { path = "../../primitives/core", features = ["serde"], 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 = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } + +[dev-dependencies] +pallet-message-queue = { path = "../../../../../substrate/frame/message-queue", default-features = false } +sp-keyring = { path = "../../../../../substrate/primitives/keyring" } +hex-literal = { version = "0.4.1" } + +[features] +default = ["std"] +std = [ + "bridge-hub-common/std", + "codec/std", + "ethabi/std", + "frame-benchmarking/std", + "frame-support/std", + "frame-system/std", + "pallet-message-queue/std", + "scale-info/std", + "serde/std", + "snowbridge-core/std", + "snowbridge-outbound-queue-merkle-tree/std", + "sp-arithmetic/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", + "xcm/std", +] +runtime-benchmarks = [ + "bridge-hub-common/runtime-benchmarks", + "frame-benchmarking", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "hex-literal", + "pallet-message-queue/runtime-benchmarks", + "snowbridge-core/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", +] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-message-queue/try-runtime", + "sp-runtime/try-runtime", +] diff --git a/snowbridge/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml b/snowbridge/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml new file mode 100644 index 00000000000..a3432163622 --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "snowbridge-outbound-queue-merkle-tree" +description = "Snowbridge Outbound Queue Merkle Tree" +version = "0.1.1" +edition = "2021" +authors = ["Snowfork "] +repository = "https://github.com/Snowfork/snowbridge" +license = "Apache-2.0" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +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 = { path = "../../../../../../substrate/primitives/core", default-features = false } +sp-runtime = { path = "../../../../../../substrate/primitives/runtime", default-features = false } + +[dev-dependencies] +hex-literal = { version = "0.4.1" } +env_logger = "0.9" +hex = "0.4" +array-bytes = "4.1" + +[features] +default = ["std"] +std = [ + "codec/std", + "scale-info/std", + "sp-core/std", + "sp-runtime/std", +] diff --git a/snowbridge/parachain/pallets/outbound-queue/merkle-tree/src/lib.rs b/snowbridge/parachain/pallets/outbound-queue/merkle-tree/src/lib.rs new file mode 100644 index 00000000000..d03eb578ef4 --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/merkle-tree/src/lib.rs @@ -0,0 +1,464 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +// SPDX-FileCopyrightText: 2021-2022 Parity Technologies (UK) Ltd. +#![cfg_attr(not(feature = "std"), no_std)] +#![warn(missing_docs)] + +//! This crate implements a simple binary Merkle Tree utilities required for inter-op with Ethereum +//! bridge & Solidity contract. +//! +//! The implementation is optimised for usage within Substrate Runtime and supports no-std +//! compilation targets. +//! +//! Merkle Tree is constructed from arbitrary-length leaves, that are initially hashed using the +//! same `\[`Hasher`\]` as the inner nodes. +//! Inner nodes are created by concatenating child hashes and hashing again. The implementation +//! does not perform any sorting of the input data (leaves) nor when inner nodes are created. +//! +//! If the number of leaves is not even, last leaf (hash of) is promoted to the upper layer. + +#[cfg(not(feature = "std"))] +extern crate alloc; +#[cfg(not(feature = "std"))] +use alloc::vec; +#[cfg(not(feature = "std"))] +use alloc::vec::Vec; + +use codec::{Decode, Encode}; +use scale_info::TypeInfo; +use sp_core::{RuntimeDebug, H256}; +use sp_runtime::traits::Hash; + +/// Construct a root hash of a Binary Merkle Tree created from given leaves. +/// +/// See crate-level docs for details about Merkle Tree construction. +/// +/// In case an empty list of leaves is passed the function returns a 0-filled hash. +pub fn merkle_root(leaves: I) -> H256 +where + H: Hash, + I: Iterator, +{ + merkelize::(leaves, &mut ()) +} + +fn merkelize(leaves: I, visitor: &mut V) -> H256 +where + H: Hash, + V: Visitor, + I: Iterator, +{ + let upper = Vec::with_capacity(leaves.size_hint().0); + let mut next = match merkelize_row::(leaves, upper, visitor) { + Ok(root) => return root, + Err(next) if next.is_empty() => return H256::default(), + Err(next) => next, + }; + + let mut upper = Vec::with_capacity((next.len() + 1) / 2); + loop { + visitor.move_up(); + + match merkelize_row::(next.drain(..), upper, visitor) { + Ok(root) => return root, + Err(t) => { + // swap collections to avoid allocations + upper = next; + next = t; + }, + }; + } +} + +/// A generated merkle proof. +/// +/// The structure contains all necessary data to later on verify the proof and the leaf itself. +#[derive(Encode, Decode, RuntimeDebug, PartialEq, Eq, TypeInfo)] +pub struct MerkleProof { + /// Root hash of generated merkle tree. + pub root: H256, + /// Proof items (does not contain the leaf hash, nor the root obviously). + /// + /// This vec contains all inner node hashes necessary to reconstruct the root hash given the + /// leaf hash. + pub proof: Vec, + /// Number of leaves in the original tree. + /// + /// This is needed to detect a case where we have an odd number of leaves that "get promoted" + /// to upper layers. + pub number_of_leaves: u64, + /// Index of the leaf the proof is for (0-based). + pub leaf_index: u64, + /// Leaf content (hashed). + pub leaf: H256, +} + +/// A trait of object inspecting merkle root creation. +/// +/// It can be passed to [`merkelize_row`] or [`merkelize`] functions and will be notified +/// about tree traversal. +trait Visitor { + /// We are moving one level up in the tree. + fn move_up(&mut self); + + /// We are creating an inner node from given `left` and `right` nodes. + /// + /// Note that in case of last odd node in the row `right` might be empty. + /// The method will also visit the `root` hash (level 0). + /// + /// The `index` is an index of `left` item. + fn visit(&mut self, index: u64, left: &Option, right: &Option); +} + +/// No-op implementation of the visitor. +impl Visitor for () { + fn move_up(&mut self) {} + fn visit(&mut self, _index: u64, _left: &Option, _right: &Option) {} +} + +/// Construct a Merkle Proof for leaves given by indices. +/// +/// The function constructs a (partial) Merkle Tree first and stores all elements required +/// to prove the requested item (leaf) given the root hash. +/// +/// Both the Proof and the Root Hash are returned. +/// +/// # Panic +/// +/// The function will panic if given `leaf_index` is greater than the number of leaves. +pub fn merkle_proof(leaves: I, leaf_index: u64) -> MerkleProof +where + H: Hash, + I: Iterator, +{ + let mut leaf = None; + let mut hashes = vec![]; + let mut number_of_leaves = 0; + for (idx, l) in (0u64..).zip(leaves) { + // count the leaves + number_of_leaves = idx + 1; + hashes.push(l); + // find the leaf for the proof + if idx == leaf_index { + leaf = Some(l); + } + } + + /// The struct collects a proof for single leaf. + struct ProofCollection { + proof: Vec, + position: u64, + } + + impl ProofCollection { + fn new(position: u64) -> Self { + ProofCollection { proof: Default::default(), position } + } + } + + impl Visitor for ProofCollection { + fn move_up(&mut self) { + self.position /= 2; + } + + fn visit(&mut self, index: u64, left: &Option, right: &Option) { + // we are at left branch - right goes to the proof. + if self.position == index { + if let Some(right) = right { + self.proof.push(*right); + } + } + // we are at right branch - left goes to the proof. + if self.position == index + 1 { + if let Some(left) = left { + self.proof.push(*left); + } + } + } + } + + let mut collect_proof = ProofCollection::new(leaf_index); + + let root = merkelize::(hashes.into_iter(), &mut collect_proof); + let leaf = leaf.expect("Requested `leaf_index` is greater than number of leaves."); + + #[cfg(feature = "debug")] + log::debug!( + "[merkle_proof] Proof: {:?}", + collect_proof.proof.iter().map(hex::encode).collect::>() + ); + + MerkleProof { root, proof: collect_proof.proof, number_of_leaves, leaf_index, leaf } +} + +/// Leaf node for proof verification. +/// +/// Can be either a value that needs to be hashed first, +/// or the hash itself. +#[derive(Debug, PartialEq, Eq)] +pub enum Leaf<'a> { + /// Leaf content. + Value(&'a [u8]), + /// Hash of the leaf content. + Hash(H256), +} + +impl<'a, T: AsRef<[u8]>> From<&'a T> for Leaf<'a> { + fn from(v: &'a T) -> Self { + Leaf::Value(v.as_ref()) + } +} + +impl<'a> From for Leaf<'a> { + fn from(v: H256) -> Self { + Leaf::Hash(v) + } +} + +/// Verify Merkle Proof correctness versus given root hash. +/// +/// The proof is NOT expected to contain leaf hash as the first +/// element, but only all adjacent nodes required to eventually by process of +/// concatenating and hashing end up with given root hash. +/// +/// The proof must not contain the root hash. +pub fn verify_proof<'a, H, P, L>( + root: &'a H256, + proof: P, + number_of_leaves: u64, + leaf_index: u64, + leaf: L, +) -> bool +where + H: Hash, + P: IntoIterator, + L: Into>, +{ + if leaf_index >= number_of_leaves { + return false + } + + let leaf_hash = match leaf.into() { + Leaf::Value(content) => ::hash(content), + Leaf::Hash(hash) => hash, + }; + + let hash_len = ::LENGTH; + let mut combined = [0_u8; 64]; + let computed = proof.into_iter().fold(leaf_hash, |a, b| { + if a < b { + combined[..hash_len].copy_from_slice(a.as_ref()); + combined[hash_len..].copy_from_slice(b.as_ref()); + } else { + combined[..hash_len].copy_from_slice(b.as_ref()); + combined[hash_len..].copy_from_slice(a.as_ref()); + } + ::hash(&combined) + }); + + root == &computed +} + +/// Processes a single row (layer) of a tree by taking pairs of elements, +/// concatenating them, hashing and placing into resulting vector. +/// +/// In case only one element is provided it is returned via `Ok` result, in any other case (also an +/// empty iterator) an `Err` with the inner nodes of upper layer is returned. +fn merkelize_row( + mut iter: I, + mut next: Vec, + visitor: &mut V, +) -> Result> +where + H: Hash, + V: Visitor, + I: Iterator, +{ + #[cfg(feature = "debug")] + log::debug!("[merkelize_row]"); + next.clear(); + + let hash_len = ::LENGTH; + let mut index = 0; + let mut combined = vec![0_u8; hash_len * 2]; + loop { + let a = iter.next(); + let b = iter.next(); + visitor.visit(index, &a, &b); + + #[cfg(feature = "debug")] + log::debug!(" {:?}\n {:?}", a.as_ref().map(hex::encode), b.as_ref().map(hex::encode)); + + index += 2; + match (a, b) { + (Some(a), Some(b)) => { + if a < b { + combined[..hash_len].copy_from_slice(a.as_ref()); + combined[hash_len..].copy_from_slice(b.as_ref()); + } else { + combined[..hash_len].copy_from_slice(b.as_ref()); + combined[hash_len..].copy_from_slice(a.as_ref()); + } + + next.push(::hash(&combined)); + }, + // Odd number of items. Promote the item to the upper layer. + (Some(a), None) if !next.is_empty() => { + next.push(a); + }, + // Last item = root. + (Some(a), None) => return Ok(a), + // Finish up, no more items. + _ => { + #[cfg(feature = "debug")] + log::debug!( + "[merkelize_row] Next: {:?}", + next.iter().map(hex::encode).collect::>() + ); + return Err(next) + }, + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use hex_literal::hex; + use sp_core::keccak_256; + use sp_runtime::traits::Keccak256; + + fn make_leaves(count: u64) -> Vec { + (0..count).map(|i| keccak_256(&i.to_le_bytes()).into()).collect() + } + + #[test] + fn should_generate_empty_root() { + // given + let _ = env_logger::try_init(); + let data = vec![]; + + // when + let out = merkle_root::(data.into_iter()); + + // then + assert_eq!( + hex::encode(out), + "0000000000000000000000000000000000000000000000000000000000000000" + ); + } + + #[test] + fn should_generate_single_root() { + // given + let _ = env_logger::try_init(); + let data = make_leaves(1); + + // when + let out = merkle_root::(data.into_iter()); + + // then + assert_eq!( + hex::encode(out), + "011b4d03dd8c01f1049143cf9c4c817e4b167f1d1b83e5c6f0f10d89ba1e7bce" + ); + } + + #[test] + fn should_generate_root_pow_2() { + // given + let _ = env_logger::try_init(); + let data = make_leaves(2); + + // when + let out = merkle_root::(data.into_iter()); + + // then + assert_eq!( + hex::encode(out), + "e497bd1c13b13a60af56fa0d2703517c232fde213ad20d2c3dd60735c6604512" + ); + } + + #[test] + fn should_generate_root_complex() { + let _ = env_logger::try_init(); + let test = |root, data: Vec| { + assert_eq!( + array_bytes::bytes2hex("", merkle_root::(data.into_iter()).as_ref()), + root + ); + }; + + test("816cc37bd8d39f7b0851838ebc875faf2afe58a03e95aca3b1333b3693f39dd3", make_leaves(3)); + + test("7501ea976cb92f305cca65ab11254589ea28bb8b59d3161506350adaa237d22f", make_leaves(4)); + + test("d26ba4eb398747bdd39255b1fadb99b803ce39696021b3b0bff7301ac146ee4e", make_leaves(10)); + } + + #[test] + #[ignore] + fn should_generate_and_verify_proof() { + // given + let _ = env_logger::try_init(); + let data: Vec = make_leaves(3); + + // when + let proof0 = merkle_proof::(data.clone().into_iter(), 0); + assert!(verify_proof::( + &proof0.root, + proof0.proof.clone(), + data.len() as u64, + proof0.leaf_index, + &data[0], + )); + + let proof1 = merkle_proof::(data.clone().into_iter(), 1); + assert!(verify_proof::( + &proof1.root, + proof1.proof, + data.len() as u64, + proof1.leaf_index, + &proof1.leaf, + )); + + let proof2 = merkle_proof::(data.clone().into_iter(), 2); + assert!(verify_proof::( + &proof2.root, + proof2.proof, + data.len() as u64, + proof2.leaf_index, + &proof2.leaf + )); + + // then + assert_eq!(hex::encode(proof0.root), hex::encode(proof1.root)); + assert_eq!(hex::encode(proof2.root), hex::encode(proof1.root)); + + assert!(!verify_proof::( + &H256::from_slice(&hex!( + "fb3b3be94be9e983ba5e094c9c51a7d96a4fa2e5d8e891df00ca89ba05bb1239" + )), + proof0.proof, + data.len() as u64, + proof0.leaf_index, + &proof0.leaf + )); + + assert!(!verify_proof::( + &proof0.root, + vec![], + data.len() as u64, + proof0.leaf_index, + &proof0.leaf + )); + } + + #[test] + #[should_panic] + fn should_panic_on_invalid_leaf_index() { + let _ = env_logger::try_init(); + merkle_proof::(make_leaves(1).into_iter(), 5); + } +} diff --git a/snowbridge/parachain/pallets/outbound-queue/runtime-api/Cargo.toml b/snowbridge/parachain/pallets/outbound-queue/runtime-api/Cargo.toml new file mode 100644 index 00000000000..c92e725c60d --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/runtime-api/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "snowbridge-outbound-queue-runtime-api" +description = "Snowbridge Outbound Queue Runtime API" +version = "0.1.0" +edition = "2021" +authors = ["Snowfork "] +repository = "https://github.com/Snowfork/snowbridge" +license = "Apache-2.0" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +codec = { version = "3.1.5", package = "parity-scale-codec", features = ["derive"], default-features = false } +sp-core = { path = "../../../../../../substrate/primitives/core", default-features = false } +sp-std = { path = "../../../../../../substrate/primitives/std", default-features = false } +sp-api = { path = "../../../../../../substrate/primitives/api", default-features = false } +frame-support = { path = "../../../../../../substrate/frame/support", default-features = false } +xcm = { package = "staging-xcm", path = "../../../../../../polkadot/xcm", default-features = false } +snowbridge-outbound-queue-merkle-tree = { path = "../merkle-tree", default-features = false } +snowbridge-core = { path = "../../../primitives/core", default-features = false } + +[features] +default = ["std"] +std = [ + "codec/std", + "frame-support/std", + "snowbridge-core/std", + "snowbridge-outbound-queue-merkle-tree/std", + "sp-api/std", + "sp-core/std", + "sp-std/std", + "xcm/std", +] diff --git a/snowbridge/parachain/pallets/outbound-queue/runtime-api/src/lib.rs b/snowbridge/parachain/pallets/outbound-queue/runtime-api/src/lib.rs new file mode 100644 index 00000000000..51f46a7b49c --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/runtime-api/src/lib.rs @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +#![cfg_attr(not(feature = "std"), no_std)] + +use frame_support::traits::tokens::Balance as BalanceT; +use snowbridge_core::outbound::Message; +use snowbridge_outbound_queue_merkle_tree::MerkleProof; + +sp_api::decl_runtime_apis! { + pub trait OutboundQueueApi where Balance: BalanceT + { + /// Generate a merkle proof for a committed message identified by `leaf_index`. + /// The merkle root is stored in the block header as a + /// `\[`sp_runtime::generic::DigestItem::Other`\]` + fn prove_message(leaf_index: u64) -> Option; + + /// Calculate the delivery fee for `message` + fn calculate_fee(message: Message) -> Option; + } +} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/api.rs b/snowbridge/parachain/pallets/outbound-queue/src/api.rs new file mode 100644 index 00000000000..44d63f1e2d2 --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/src/api.rs @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! Helpers for implementing runtime api + +use crate::{Config, MessageLeaves}; +use frame_support::storage::StorageStreamIter; +use snowbridge_core::outbound::{Message, SendMessage}; +use snowbridge_outbound_queue_merkle_tree::{merkle_proof, MerkleProof}; + +pub fn prove_message(leaf_index: u64) -> Option +where + T: Config, +{ + if !MessageLeaves::::exists() { + return None + } + let proof = + merkle_proof::<::Hashing, _>(MessageLeaves::::stream_iter(), leaf_index); + Some(proof) +} + +pub fn calculate_fee(message: Message) -> Option +where + T: Config, +{ + match crate::Pallet::::validate(&message) { + Ok((_, fees)) => Some(fees.total()), + _ => None, + } +} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/benchmarking.rs b/snowbridge/parachain/pallets/outbound-queue/src/benchmarking.rs new file mode 100644 index 00000000000..ee5754e8696 --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/src/benchmarking.rs @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use super::*; + +use bridge_hub_common::AggregateMessageOrigin; +use codec::Encode; +use frame_benchmarking::v2::*; +use snowbridge_core::{ + outbound::{Command, Initializer}, + ChannelId, +}; +use sp_core::{H160, H256}; + +#[allow(unused_imports)] +use crate::Pallet as OutboundQueue; + +#[benchmarks( + where + ::MaxMessagePayloadSize: Get, +)] +mod benchmarks { + use super::*; + + /// Benchmark for processing a message. + #[benchmark] + fn do_process_message() -> Result<(), BenchmarkError> { + let enqueued_message = QueuedMessage { + id: H256::zero(), + channel_id: ChannelId::from([1; 32]), + command: Command::Upgrade { + impl_address: H160::zero(), + impl_code_hash: H256::zero(), + initializer: Some(Initializer { + params: [7u8; 256].into_iter().collect(), + maximum_required_gas: 200_000, + }), + }, + }; + let origin = AggregateMessageOrigin::Snowbridge([1; 32].into()); + let encoded_enqueued_message = enqueued_message.encode(); + + #[block] + { + let _ = OutboundQueue::::do_process_message(origin, &encoded_enqueued_message); + } + + assert_eq!(MessageLeaves::::decode_len().unwrap(), 1); + + Ok(()) + } + + /// Benchmark for producing final messages commitment + #[benchmark] + fn commit() -> Result<(), BenchmarkError> { + // Assume worst case, where `MaxMessagesPerBlock` messages need to be committed. + for i in 0..T::MaxMessagesPerBlock::get() { + let leaf_data: [u8; 1] = [i as u8]; + let leaf = ::Hashing::hash(&leaf_data); + MessageLeaves::::append(leaf); + } + + #[block] + { + OutboundQueue::::commit(); + } + + Ok(()) + } + + /// Benchmark for producing commitment for a single message + #[benchmark] + fn commit_single() -> Result<(), BenchmarkError> { + let leaf = ::Hashing::hash(&[100; 1]); + MessageLeaves::::append(leaf); + + #[block] + { + OutboundQueue::::commit(); + } + + Ok(()) + } + + impl_benchmark_test_suite!(OutboundQueue, crate::mock::new_tester(), crate::mock::Test,); +} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/lib.rs b/snowbridge/parachain/pallets/outbound-queue/src/lib.rs new file mode 100644 index 00000000000..201e524fb91 --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/src/lib.rs @@ -0,0 +1,413 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! Pallet for committing outbound messages for delivery to Ethereum +//! +//! # Overview +//! +//! Messages come either from sibling parachains via XCM, or BridgeHub itself +//! via the `snowbridge-system` pallet: +//! +//! 1. `snowbridge_router_primitives::outbound::EthereumBlobExporter::deliver` +//! 2. `snowbridge_system::Pallet::send` +//! +//! The message submission pipeline works like this: +//! 1. The message is first validated via the implementation for +//! [`snowbridge_core::outbound::SendMessage::validate`] +//! 2. The message is then enqueued for later processing via the implementation for +//! [`snowbridge_core::outbound::SendMessage::deliver`] +//! 3. The underlying message queue is implemented by [`Config::MessageQueue`] +//! 4. The message queue delivers messages back to this pallet via the implementation for +//! [`frame_support::traits::ProcessMessage::process_message`] +//! 5. The message is processed in `Pallet::do_process_message`: a. Assigned a nonce b. ABI-encoded, +//! hashed, and stored in the `MessageLeaves` vector +//! 6. At the end of the block, a merkle root is constructed from all the leaves in `MessageLeaves`. +//! 7. This merkle root is inserted into the parachain header as a digest item +//! 8. Offchain relayers are able to relay the message to Ethereum after: a. Generating a merkle +//! proof for the committed message using the `prove_message` runtime API b. Reading the actual +//! message content from the `Messages` vector in storage +//! +//! On the Ethereum side, the message root is ultimately the thing being +//! verified by the Polkadot light client. +//! +//! # Message Priorities +//! +//! The processing of governance commands can never be halted. This effectively +//! allows us to pause processing of normal user messages while still allowing +//! governance commands to be sent to Ethereum. +//! +//! # Fees +//! +//! An upfront fee must be paid for delivering a message. This fee covers several +//! components: +//! 1. The weight of processing the message locally +//! 2. The gas refund paid out to relayers for message submission +//! 3. An additional reward paid out to relayers for message submission +//! +//! Messages are weighed to determine the maximum amount of gas they could +//! consume on Ethereum. Using this upper bound, a final fee can be calculated. +//! +//! The fee calculation also requires the following parameters: +//! * ETH/DOT exchange rate +//! * Ether fee per unit of gas +//! +//! By design, it is expected that governance should manually update these +//! parameters every few weeks using the `set_pricing_parameters` extrinsic in the +//! system pallet. +//! +//! ## Fee Computation Function +//! +//! ```text +//! LocalFee(Message) = WeightToFee(ProcessMessageWeight(Message)) +//! RemoteFee(Message) = MaxGasRequired(Message) * FeePerGas + Reward +//! Fee(Message) = LocalFee(Message) + (RemoteFee(Message) / Ratio("ETH/DOT")) +//! ``` +//! +//! By design, the computed fee is always going to conservative, to cover worst-case +//! costs of dispatch on Ethereum. In future iterations of the design, we will optimize +//! this, or provide a mechanism to asynchronously refund a portion of collected fees. +//! +//! # Extrinsics +//! +//! * [`Call::set_operating_mode`]: Set the operating mode +//! +//! # Runtime API +//! +//! * `prove_message`: Generate a merkle proof for a committed message +//! * `calculate_fee`: Calculate the delivery fee for a message +#![cfg_attr(not(feature = "std"), no_std)] +pub mod api; +pub mod process_message_impl; +pub mod send_message_impl; +pub mod types; +pub mod weights; + +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; + +#[cfg(test)] +mod mock; + +#[cfg(test)] +mod test; + +use bridge_hub_common::{AggregateMessageOrigin, CustomDigestItem}; +use codec::Decode; +use frame_support::{ + storage::StorageStreamIter, + traits::{tokens::Balance, Contains, Defensive, EnqueueMessage, Get, ProcessMessageError}, + weights::{Weight, WeightToFee}, +}; +use snowbridge_core::{ + outbound::{Fee, GasMeter, QueuedMessage, VersionedQueuedMessage, ETHER_DECIMALS}, + BasicOperatingMode, ChannelId, +}; +use snowbridge_outbound_queue_merkle_tree::merkle_root; +pub use snowbridge_outbound_queue_merkle_tree::MerkleProof; +use sp_core::{H256, U256}; +use sp_runtime::{ + traits::{CheckedDiv, Hash}, + DigestItem, +}; +use sp_std::prelude::*; +pub use types::{CommittedMessage, FeeConfigRecord, ProcessMessageOriginOf}; +pub use weights::WeightInfo; + +pub use pallet::*; + +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + use snowbridge_core::PricingParameters; + use sp_arithmetic::FixedU128; + + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::config] + pub trait Config: frame_system::Config { + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + + type Hashing: Hash; + + type MessageQueue: EnqueueMessage; + + /// Measures the maximum gas used to execute a command on Ethereum + type GasMeter: GasMeter; + + type Balance: Balance + From; + + /// Number of decimal places in native currency + #[pallet::constant] + type Decimals: Get; + + /// Max bytes in a message payload + #[pallet::constant] + type MaxMessagePayloadSize: Get; + + /// Max number of messages processed per block + #[pallet::constant] + type MaxMessagesPerBlock: Get; + + /// Check whether a channel exists + type Channels: Contains; + + type PricingParameters: Get>; + + /// Convert a weight value into a deductible fee based. + type WeightToFee: WeightToFee; + + /// Weight information for extrinsics in this pallet + type WeightInfo: WeightInfo; + } + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// Message has been queued and will be processed in the future + MessageQueued { + /// ID of the message. Usually the XCM message hash or a SetTopic. + id: H256, + }, + /// Message will be committed at the end of current block. From now on, to track the + /// progress the message, use the `nonce` of `id`. + MessageAccepted { + /// ID of the message + id: H256, + /// The nonce assigned to this message + nonce: u64, + }, + /// Some messages have been committed + MessagesCommitted { + /// Merkle root of the committed messages + root: H256, + /// number of committed messages + count: u64, + }, + /// Set OperatingMode + OperatingModeChanged { + mode: BasicOperatingMode, + }, + FeeConfigChanged { + fee_config: FeeConfigRecord, + }, + } + + #[pallet::error] + pub enum Error { + /// The message is too large + MessageTooLarge, + /// The pallet is halted + Halted, + // Invalid fee config + InvalidFeeConfig, + /// Invalid Channel + InvalidChannel, + } + + /// Messages to be committed in the current block. This storage value is killed in + /// `on_initialize`, so should never go into block PoV. + /// + /// Is never read in the runtime, only by offchain message relayers. + /// + /// Inspired by the `frame_system::Pallet::Events` storage value + #[pallet::storage] + #[pallet::unbounded] + pub(super) type Messages = StorageValue<_, Vec, ValueQuery>; + + /// Hashes of the ABI-encoded messages in the [`Messages`] storage value. Used to generate a + /// merkle root during `on_finalize`. This storage value is killed in + /// `on_initialize`, so should never go into block PoV. + #[pallet::storage] + #[pallet::unbounded] + #[pallet::getter(fn message_leaves)] + pub(super) type MessageLeaves = StorageValue<_, Vec, ValueQuery>; + + /// The current nonce for each message origin + #[pallet::storage] + pub type Nonce = StorageMap<_, Twox64Concat, ChannelId, u64, ValueQuery>; + + /// The current operating mode of the pallet. + #[pallet::storage] + #[pallet::getter(fn operating_mode)] + pub type OperatingMode = StorageValue<_, BasicOperatingMode, ValueQuery>; + + #[pallet::hooks] + impl Hooks> for Pallet + where + T::AccountId: AsRef<[u8]>, + { + fn on_initialize(_: BlockNumberFor) -> Weight { + // Remove storage from previous block + Messages::::kill(); + MessageLeaves::::kill(); + // Reserve some weight for the `on_finalize` handler + T::WeightInfo::commit() + } + + fn on_finalize(_: BlockNumberFor) { + Self::commit(); + } + + fn integrity_test() { + let decimals = T::Decimals::get(); + assert!(decimals == 10 || decimals == 12, "Decimals should be 10 or 12"); + } + } + + #[pallet::call] + impl Pallet { + /// Halt or resume all pallet operations. May only be called by root. + #[pallet::call_index(0)] + #[pallet::weight((T::DbWeight::get().reads_writes(1, 1), DispatchClass::Operational))] + pub fn set_operating_mode( + origin: OriginFor, + mode: BasicOperatingMode, + ) -> DispatchResult { + ensure_root(origin)?; + OperatingMode::::put(mode); + Self::deposit_event(Event::OperatingModeChanged { mode }); + Ok(()) + } + } + + impl Pallet { + /// Generate a messages commitment and insert it into the header digest + pub(crate) fn commit() { + let count = MessageLeaves::::decode_len().unwrap_or_default() as u64; + if count == 0 { + return + } + + // Create merkle root of messages + let root = merkle_root::<::Hashing, _>(MessageLeaves::::stream_iter()); + + let digest_item: DigestItem = CustomDigestItem::Snowbridge(root).into(); + + // Insert merkle root into the header digest + >::deposit_log(digest_item); + + Self::deposit_event(Event::MessagesCommitted { root, count }); + } + + /// Process a message delivered by the MessageQueue pallet + pub(crate) fn do_process_message( + _: ProcessMessageOriginOf, + mut message: &[u8], + ) -> Result { + use ProcessMessageError::*; + + // Yield if the maximum number of messages has been processed this block. + // This ensures that the weight of `on_finalize` has a known maximum bound. + ensure!( + MessageLeaves::::decode_len().unwrap_or(0) < + T::MaxMessagesPerBlock::get() as usize, + Yield + ); + + // Decode bytes into versioned message + let versioned_queued_message: VersionedQueuedMessage = + VersionedQueuedMessage::decode(&mut message).map_err(|_| Corrupt)?; + + // Convert versioned message into latest supported message version + let queued_message: QueuedMessage = + versioned_queued_message.try_into().map_err(|_| Unsupported)?; + + // Obtain next nonce + let nonce = >::try_mutate( + queued_message.channel_id, + |nonce| -> Result { + *nonce = nonce.checked_add(1).ok_or(Unsupported)?; + Ok(*nonce) + }, + )?; + + let pricing_params = T::PricingParameters::get(); + let command = queued_message.command.index(); + let params = queued_message.command.abi_encode(); + let max_dispatch_gas = + T::GasMeter::maximum_dispatch_gas_used_at_most(&queued_message.command); + let reward = pricing_params.rewards.remote; + + // Construct the final committed message + let message = CommittedMessage { + channel_id: queued_message.channel_id, + nonce, + command, + params, + max_dispatch_gas, + max_fee_per_gas: pricing_params + .fee_per_gas + .try_into() + .defensive_unwrap_or(u128::MAX), + reward: reward.try_into().defensive_unwrap_or(u128::MAX), + id: queued_message.id, + }; + + // ABI-encode and hash the prepared message + let message_abi_encoded = ethabi::encode(&[message.clone().into()]); + let message_abi_encoded_hash = ::Hashing::hash(&message_abi_encoded); + + Messages::::append(Box::new(message)); + MessageLeaves::::append(message_abi_encoded_hash); + + Self::deposit_event(Event::MessageAccepted { id: queued_message.id, nonce }); + + Ok(true) + } + + /// Calculate total fee in native currency to cover all costs of delivering a message to the + /// remote destination. See module-level documentation for more details. + pub(crate) fn calculate_fee( + gas_used_at_most: u64, + params: PricingParameters, + ) -> Fee { + // Remote fee in ether + let fee = Self::calculate_remote_fee( + gas_used_at_most, + params.fee_per_gas, + params.rewards.remote, + ); + + // downcast to u128 + let fee: u128 = fee.try_into().defensive_unwrap_or(u128::MAX); + + // convert to local currency + let fee = FixedU128::from_inner(fee) + .checked_div(¶ms.exchange_rate) + .expect("exchange rate is not zero; qed") + .into_inner(); + + // adjust fixed point to match local currency + let fee = Self::convert_from_ether_decimals(fee); + + Fee::from((Self::calculate_local_fee(), fee)) + } + + /// Calculate fee in remote currency for dispatching a message on Ethereum + pub(crate) fn calculate_remote_fee( + gas_used_at_most: u64, + fee_per_gas: U256, + reward: U256, + ) -> U256 { + fee_per_gas.saturating_mul(gas_used_at_most.into()).saturating_add(reward) + } + + /// The local component of the message processing fees in native currency + pub(crate) fn calculate_local_fee() -> T::Balance { + T::WeightToFee::weight_to_fee( + &T::WeightInfo::do_process_message().saturating_add(T::WeightInfo::commit_single()), + ) + } + + // 1 DOT has 10 digits of precision + // 1 KSM has 12 digits of precision + // 1 ETH has 18 digits of precision + pub(crate) fn convert_from_ether_decimals(value: u128) -> T::Balance { + let decimals = ETHER_DECIMALS.saturating_sub(T::Decimals::get()) as u32; + let denom = 10u128.saturating_pow(decimals); + value.checked_div(denom).expect("divisor is non-zero; qed").into() + } + } +} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/mock.rs b/snowbridge/parachain/pallets/outbound-queue/src/mock.rs new file mode 100644 index 00000000000..dd8fee4e2ed --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/src/mock.rs @@ -0,0 +1,189 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use super::*; + +use frame_support::{ + parameter_types, + traits::{Everything, Hooks}, + weights::IdentityFee, +}; + +use snowbridge_core::{ + gwei, meth, + outbound::*, + pricing::{PricingParameters, Rewards}, + ParaId, PRIMARY_GOVERNANCE_CHANNEL, +}; +use sp_core::{ConstU32, ConstU8, H160, H256}; +use sp_runtime::{ + traits::{BlakeTwo256, IdentityLookup, Keccak256}, + AccountId32, BuildStorage, FixedU128, +}; +use sp_std::marker::PhantomData; + +type Block = frame_system::mocking::MockBlock; +type AccountId = AccountId32; + +frame_support::construct_runtime!( + pub enum Test + { + System: frame_system::{Pallet, Call, Storage, Event}, + MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event}, + OutboundQueue: crate::{Pallet, Storage, Event}, + } +); + +parameter_types! { + pub const BlockHashCount: u64 = 250; +} + +impl frame_system::Config for Test { + type BaseCallFilter = Everything; + type BlockWeights = (); + type BlockLength = (); + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = AccountId; + type Lookup = IdentityLookup; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = BlockHashCount; + type DbWeight = (); + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = (); + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; + type Block = Block; +} + +parameter_types! { + pub const HeapSize: u32 = 32 * 1024; + pub const MaxStale: u32 = 32; + pub static ServiceWeight: Option = Some(Weight::from_parts(100, 100)); +} + +impl pallet_message_queue::Config for Test { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = (); + type MessageProcessor = OutboundQueue; + type Size = u32; + type QueueChangeHandler = (); + type HeapSize = HeapSize; + type MaxStale = MaxStale; + type ServiceWeight = ServiceWeight; + type QueuePausedQuery = (); +} + +parameter_types! { + pub const OwnParaId: ParaId = ParaId::new(1013); + pub Parameters: PricingParameters = PricingParameters { + exchange_rate: FixedU128::from_rational(1, 400), + fee_per_gas: gwei(20), + rewards: Rewards { local: DOT, remote: meth(1) } + }; +} + +pub const DOT: u128 = 10_000_000_000; + +impl crate::Config for Test { + type RuntimeEvent = RuntimeEvent; + type Hashing = Keccak256; + type MessageQueue = MessageQueue; + type Decimals = ConstU8<12>; + type MaxMessagePayloadSize = ConstU32<1024>; + type MaxMessagesPerBlock = ConstU32<20>; + type GasMeter = ConstantGasMeter; + type Balance = u128; + type PricingParameters = Parameters; + type Channels = Everything; + type WeightToFee = IdentityFee; + type WeightInfo = (); +} + +fn setup() { + System::set_block_number(1); +} + +pub fn new_tester() -> sp_io::TestExternalities { + let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); + let mut ext: sp_io::TestExternalities = storage.into(); + ext.execute_with(setup); + ext +} + +pub fn run_to_end_of_next_block() { + // finish current block + MessageQueue::on_finalize(System::block_number()); + OutboundQueue::on_finalize(System::block_number()); + System::on_finalize(System::block_number()); + // start next block + System::set_block_number(System::block_number() + 1); + System::on_initialize(System::block_number()); + OutboundQueue::on_initialize(System::block_number()); + MessageQueue::on_initialize(System::block_number()); + // finish next block + MessageQueue::on_finalize(System::block_number()); + OutboundQueue::on_finalize(System::block_number()); + System::on_finalize(System::block_number()); +} + +pub fn mock_governance_message() -> Message +where + T: Config, +{ + let _marker = PhantomData::; // for clippy + + Message { + id: None, + channel_id: PRIMARY_GOVERNANCE_CHANNEL, + command: Command::Upgrade { + impl_address: H160::zero(), + impl_code_hash: H256::zero(), + initializer: None, + }, + } +} + +// Message should fail validation as it is too large +pub fn mock_invalid_governance_message() -> Message +where + T: Config, +{ + let _marker = PhantomData::; // for clippy + + Message { + id: None, + channel_id: PRIMARY_GOVERNANCE_CHANNEL, + command: Command::Upgrade { + impl_address: H160::zero(), + impl_code_hash: H256::zero(), + initializer: Some(Initializer { + params: (0..1000).map(|_| 1u8).collect::>(), + maximum_required_gas: 0, + }), + }, + } +} + +pub fn mock_message(sibling_para_id: u32) -> Message { + Message { + id: None, + channel_id: ParaId::from(sibling_para_id).into(), + command: Command::AgentExecute { + agent_id: Default::default(), + command: AgentExecuteCommand::TransferToken { + token: Default::default(), + recipient: Default::default(), + amount: 0, + }, + }, + } +} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/process_message_impl.rs b/snowbridge/parachain/pallets/outbound-queue/src/process_message_impl.rs new file mode 100644 index 00000000000..575ed9e0e7c --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/src/process_message_impl.rs @@ -0,0 +1,23 @@ +//! Implementation for [`frame_support::traits::ProcessMessage`] +use super::*; +use crate::weights::WeightInfo; +use frame_support::{ + traits::{ProcessMessage, ProcessMessageError}, + weights::WeightMeter, +}; + +impl ProcessMessage for Pallet { + type Origin = AggregateMessageOrigin; + fn process_message( + message: &[u8], + origin: Self::Origin, + meter: &mut WeightMeter, + _: &mut [u8; 32], + ) -> Result { + let weight = T::WeightInfo::do_process_message(); + if meter.try_consume(weight).is_err() { + return Err(ProcessMessageError::Overweight(weight)) + } + Self::do_process_message(origin, message) + } +} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/send_message_impl.rs b/snowbridge/parachain/pallets/outbound-queue/src/send_message_impl.rs new file mode 100644 index 00000000000..a84e2c520e5 --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/src/send_message_impl.rs @@ -0,0 +1,98 @@ +//! Implementation for [`snowbridge_core::outbound::SendMessage`] +use super::*; +use bridge_hub_common::AggregateMessageOrigin; +use codec::Encode; +use frame_support::{ + ensure, + traits::{EnqueueMessage, Get}, + CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, +}; +use frame_system::unique; +use snowbridge_core::{ + outbound::{ + Fee, Message, QueuedMessage, SendError, SendMessage, SendMessageFeeProvider, + VersionedQueuedMessage, + }, + ChannelId, PRIMARY_GOVERNANCE_CHANNEL, +}; +use sp_core::H256; +use sp_runtime::BoundedVec; + +/// The maximal length of an enqueued message, as determined by the MessageQueue pallet +pub type MaxEnqueuedMessageSizeOf = + <::MessageQueue as EnqueueMessage>::MaxMessageLen; + +#[derive(Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound)] +pub struct Ticket +where + T: Config, +{ + pub message_id: H256, + pub channel_id: ChannelId, + pub message: BoundedVec>, +} + +impl SendMessage for Pallet +where + T: Config, +{ + type Ticket = Ticket; + + fn validate( + message: &Message, + ) -> Result<(Self::Ticket, Fee<::Balance>), SendError> { + // The inner payload should not be too large + let payload = message.command.abi_encode(); + ensure!( + payload.len() < T::MaxMessagePayloadSize::get() as usize, + SendError::MessageTooLarge + ); + + // Ensure there is a registered channel we can transmit this message on + ensure!(T::Channels::contains(&message.channel_id), SendError::InvalidChannel); + + // Generate a unique message id unless one is provided + let message_id: H256 = message + .id + .unwrap_or_else(|| unique((message.channel_id, &message.command)).into()); + + let gas_used_at_most = T::GasMeter::maximum_gas_used_at_most(&message.command); + let fee = Self::calculate_fee(gas_used_at_most, T::PricingParameters::get()); + + let queued_message: VersionedQueuedMessage = QueuedMessage { + id: message_id, + channel_id: message.channel_id, + command: message.command.clone(), + } + .into(); + // The whole message should not be too large + let encoded = queued_message.encode().try_into().map_err(|_| SendError::MessageTooLarge)?; + + let ticket = Ticket { message_id, channel_id: message.channel_id, message: encoded }; + + Ok((ticket, fee)) + } + + fn deliver(ticket: Self::Ticket) -> Result { + let origin = AggregateMessageOrigin::Snowbridge(ticket.channel_id); + + if ticket.channel_id != PRIMARY_GOVERNANCE_CHANNEL { + ensure!(!Self::operating_mode().is_halted(), SendError::Halted); + } + + let message = ticket.message.as_bounded_slice(); + + T::MessageQueue::enqueue_message(message, origin); + Self::deposit_event(Event::MessageQueued { id: ticket.message_id }); + Ok(ticket.message_id) + } +} + +impl SendMessageFeeProvider for Pallet { + type Balance = T::Balance; + + /// The local component of the message processing fees in native currency + fn local_fee() -> Self::Balance { + Self::calculate_local_fee() + } +} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/test.rs b/snowbridge/parachain/pallets/outbound-queue/src/test.rs new file mode 100644 index 00000000000..0028d75e7b7 --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/src/test.rs @@ -0,0 +1,268 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use crate::{mock::*, *}; + +use frame_support::{ + assert_err, assert_noop, assert_ok, + traits::{Hooks, ProcessMessage, ProcessMessageError}, + weights::WeightMeter, +}; + +use codec::Encode; +use snowbridge_core::{ + outbound::{Command, SendError, SendMessage}, + ParaId, +}; +use sp_arithmetic::FixedU128; +use sp_core::H256; +use sp_runtime::FixedPointNumber; + +#[test] +fn submit_messages_and_commit() { + new_tester().execute_with(|| { + for para_id in 1000..1004 { + let message = mock_message(para_id); + let (ticket, _) = OutboundQueue::validate(&message).unwrap(); + assert_ok!(OutboundQueue::deliver(ticket)); + } + + ServiceWeight::set(Some(Weight::MAX)); + run_to_end_of_next_block(); + + for para_id in 1000..1004 { + let origin: ParaId = (para_id as u32).into(); + let channel_id: ChannelId = origin.into(); + assert_eq!(Nonce::::get(channel_id), 1); + } + + let digest = System::digest(); + let digest_items = digest.logs(); + assert!(digest_items.len() == 1 && digest_items[0].as_other().is_some()); + assert_eq!(Messages::::decode_len(), Some(4)); + }); +} + +#[test] +fn submit_message_fail_too_large() { + new_tester().execute_with(|| { + let message = mock_invalid_governance_message::(); + assert_err!(OutboundQueue::validate(&message), SendError::MessageTooLarge); + }); +} + +#[test] +fn convert_from_ether_decimals() { + assert_eq!( + OutboundQueue::convert_from_ether_decimals(1_000_000_000_000_000_000), + 1_000_000_000_000 + ); +} + +#[test] +fn commit_exits_early_if_no_processed_messages() { + new_tester().execute_with(|| { + // on_finalize should do nothing, nor should it panic + OutboundQueue::on_finalize(System::block_number()); + + let digest = System::digest(); + let digest_items = digest.logs(); + assert_eq!(digest_items.len(), 0); + }); +} + +#[test] +fn process_message_yields_on_max_messages_per_block() { + new_tester().execute_with(|| { + for _ in 0..::MaxMessagesPerBlock::get() { + MessageLeaves::::append(H256::zero()) + } + + let channel_id: ChannelId = ParaId::from(1000).into(); + let origin = AggregateMessageOrigin::Snowbridge(channel_id); + let message = QueuedMessage { + id: Default::default(), + channel_id, + command: Command::Upgrade { + impl_address: Default::default(), + impl_code_hash: Default::default(), + initializer: None, + }, + } + .encode(); + + let mut meter = WeightMeter::new(); + + assert_noop!( + OutboundQueue::process_message(message.as_slice(), origin, &mut meter, &mut [0u8; 32]), + ProcessMessageError::Yield + ); + }) +} + +#[test] +fn process_message_fails_on_max_nonce_reached() { + new_tester().execute_with(|| { + let sibling_id = 1000; + let channel_id: ChannelId = ParaId::from(sibling_id).into(); + let origin = AggregateMessageOrigin::Snowbridge(channel_id); + let message: QueuedMessage = QueuedMessage { + id: H256::zero(), + channel_id, + command: mock_message(sibling_id).command, + }; + let versioned_queued_message: VersionedQueuedMessage = message.try_into().unwrap(); + let encoded = versioned_queued_message.encode(); + let mut meter = WeightMeter::with_limit(Weight::MAX); + + Nonce::::set(channel_id, u64::MAX); + + assert_noop!( + OutboundQueue::process_message(encoded.as_slice(), origin, &mut meter, &mut [0u8; 32]), + ProcessMessageError::Unsupported + ); + }) +} + +#[test] +fn process_message_fails_on_overweight_message() { + new_tester().execute_with(|| { + let sibling_id = 1000; + let channel_id: ChannelId = ParaId::from(sibling_id).into(); + let origin = AggregateMessageOrigin::Snowbridge(channel_id); + let message: QueuedMessage = QueuedMessage { + id: H256::zero(), + channel_id, + command: mock_message(sibling_id).command, + }; + let versioned_queued_message: VersionedQueuedMessage = message.try_into().unwrap(); + let encoded = versioned_queued_message.encode(); + let mut meter = WeightMeter::with_limit(Weight::from_parts(1, 1)); + assert_noop!( + OutboundQueue::process_message(encoded.as_slice(), origin, &mut meter, &mut [0u8; 32]), + ProcessMessageError::Overweight(::WeightInfo::do_process_message()) + ); + }) +} + +// Governance messages should be able to bypass a halted operating mode +// Other message sends should fail when halted +#[test] +fn submit_upgrade_message_success_when_queue_halted() { + new_tester().execute_with(|| { + // halt the outbound queue + OutboundQueue::set_operating_mode(RuntimeOrigin::root(), BasicOperatingMode::Halted) + .unwrap(); + + // submit a high priority message from bridge_hub should success + let message = mock_governance_message::(); + let (ticket, _) = OutboundQueue::validate(&message).unwrap(); + assert_ok!(OutboundQueue::deliver(ticket)); + + // submit a low priority message from asset_hub will fail as pallet is halted + let message = mock_message(1000); + let (ticket, _) = OutboundQueue::validate(&message).unwrap(); + assert_noop!(OutboundQueue::deliver(ticket), SendError::Halted); + }); +} + +#[test] +fn governance_message_does_not_get_the_chance_to_processed_in_same_block_when_congest_of_low_priority_sibling_messages( +) { + use snowbridge_core::PRIMARY_GOVERNANCE_CHANNEL; + use AggregateMessageOrigin::*; + + let sibling_id: u32 = 1000; + let sibling_channel_id: ChannelId = ParaId::from(sibling_id).into(); + + new_tester().execute_with(|| { + // submit a lot of low priority messages from asset_hub which will need multiple blocks to + // execute(20 messages for each block so 40 required at least 2 blocks) + let max_messages = 40; + for _ in 0..max_messages { + // submit low priority message + let message = mock_message(sibling_id); + let (ticket, _) = OutboundQueue::validate(&message).unwrap(); + OutboundQueue::deliver(ticket).unwrap(); + } + + let footprint = MessageQueue::footprint(Snowbridge(sibling_channel_id)); + assert_eq!(footprint.storage.count, (max_messages) as u64); + + let message = mock_governance_message::(); + let (ticket, _) = OutboundQueue::validate(&message).unwrap(); + OutboundQueue::deliver(ticket).unwrap(); + + // move to next block + ServiceWeight::set(Some(Weight::MAX)); + run_to_end_of_next_block(); + + // first process 20 messages from sibling channel + let footprint = MessageQueue::footprint(Snowbridge(sibling_channel_id)); + assert_eq!(footprint.storage.count, 40 - 20); + + // and governance message does not have the chance to execute in same block + let footprint = MessageQueue::footprint(Snowbridge(PRIMARY_GOVERNANCE_CHANNEL)); + assert_eq!(footprint.storage.count, 1); + + // move to next block + ServiceWeight::set(Some(Weight::MAX)); + run_to_end_of_next_block(); + + // now governance message get executed in this block + let footprint = MessageQueue::footprint(Snowbridge(PRIMARY_GOVERNANCE_CHANNEL)); + assert_eq!(footprint.storage.count, 0); + + // and this time process 19 messages from sibling channel so we have 1 message left + let footprint = MessageQueue::footprint(Snowbridge(sibling_channel_id)); + assert_eq!(footprint.storage.count, 1); + + // move to the next block, the last 1 message from sibling channel get executed + ServiceWeight::set(Some(Weight::MAX)); + run_to_end_of_next_block(); + let footprint = MessageQueue::footprint(Snowbridge(sibling_channel_id)); + assert_eq!(footprint.storage.count, 0); + }); +} + +#[test] +fn convert_local_currency() { + new_tester().execute_with(|| { + let fee: u128 = 1_000_000; + let fee1 = FixedU128::from_inner(fee).into_inner(); + let fee2 = FixedU128::from(fee) + .into_inner() + .checked_div(FixedU128::accuracy()) + .expect("accuracy is not zero; qed"); + assert_eq!(fee, fee1); + assert_eq!(fee, fee2); + }); +} + +#[test] +fn encode_digest_item_with_correct_index() { + new_tester().execute_with(|| { + let digest_item: DigestItem = CustomDigestItem::Snowbridge(H256::default()).into(); + let enum_prefix = match digest_item { + DigestItem::Other(data) => data[0], + _ => u8::MAX, + }; + assert_eq!(enum_prefix, 0); + }); +} + +#[test] +fn encode_digest_item() { + new_tester().execute_with(|| { + let digest_item: DigestItem = CustomDigestItem::Snowbridge([5u8; 32].into()).into(); + let digest_item_raw = digest_item.encode(); + assert_eq!(digest_item_raw[0], 0); // DigestItem::Other + assert_eq!(digest_item_raw[2], 0); // CustomDigestItem::Snowbridge + assert_eq!( + digest_item_raw, + [ + 0, 132, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5 + ] + ); + }); +} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/types.rs b/snowbridge/parachain/pallets/outbound-queue/src/types.rs new file mode 100644 index 00000000000..07803ed9b73 --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/src/types.rs @@ -0,0 +1,99 @@ +use codec::{Decode, Encode, MaxEncodedLen}; +use ethabi::Token; +use frame_support::traits::ProcessMessage; +use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; +use sp_arithmetic::FixedU128; +use sp_core::H256; +use sp_runtime::{traits::Zero, RuntimeDebug}; +use sp_std::prelude::*; + +use super::Pallet; + +use snowbridge_core::ChannelId; +pub use snowbridge_outbound_queue_merkle_tree::MerkleProof; + +pub type ProcessMessageOriginOf = as ProcessMessage>::Origin; + +pub const LOG_TARGET: &str = "snowbridge-outbound-queue"; + +/// Message which has been assigned a nonce and will be committed at the end of a block +#[derive(Encode, Decode, Clone, PartialEq, RuntimeDebug, TypeInfo)] +pub struct CommittedMessage { + /// Message channel + pub channel_id: ChannelId, + /// Unique nonce to prevent replaying messages + #[codec(compact)] + pub nonce: u64, + /// Command to execute in the Gateway contract + pub command: u8, + /// Params for the command + pub params: Vec, + /// Maximum gas allowed for message dispatch + #[codec(compact)] + pub max_dispatch_gas: u64, + /// Maximum fee per gas + #[codec(compact)] + pub max_fee_per_gas: u128, + /// Reward in ether for delivering this message, in addition to the gas refund + #[codec(compact)] + pub reward: u128, + /// Message ID (Used for tracing messages across route, has no role in consensus) + pub id: H256, +} + +/// Convert message into an ABI-encoded form for delivery to the InboundQueue contract on Ethereum +impl From for Token { + fn from(x: CommittedMessage) -> Token { + Token::Tuple(vec![ + Token::FixedBytes(Vec::from(x.channel_id.as_ref())), + Token::Uint(x.nonce.into()), + Token::Uint(x.command.into()), + Token::Bytes(x.params.to_vec()), + Token::Uint(x.max_dispatch_gas.into()), + Token::Uint(x.max_fee_per_gas.into()), + Token::Uint(x.reward.into()), + Token::FixedBytes(Vec::from(x.id.as_ref())), + ]) + } +} + +/// Configuration for fee calculations +#[derive( + Encode, + Decode, + Copy, + Clone, + PartialEq, + RuntimeDebug, + MaxEncodedLen, + TypeInfo, + Serialize, + Deserialize, +)] +pub struct FeeConfigRecord { + /// ETH/DOT exchange rate + pub exchange_rate: FixedU128, + /// Ether fee per unit of gas + pub fee_per_gas: u128, + /// Ether reward for delivering message + pub reward: u128, +} + +#[derive(RuntimeDebug)] +pub struct InvalidFeeConfig; + +impl FeeConfigRecord { + pub fn validate(&self) -> Result<(), InvalidFeeConfig> { + if self.exchange_rate == FixedU128::zero() { + return Err(InvalidFeeConfig) + } + if self.fee_per_gas == 0 { + return Err(InvalidFeeConfig) + } + if self.reward == 0 { + return Err(InvalidFeeConfig) + } + Ok(()) + } +} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/weights.rs b/snowbridge/parachain/pallets/outbound-queue/src/weights.rs new file mode 100644 index 00000000000..e4b6f8439b0 --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/src/weights.rs @@ -0,0 +1,81 @@ + +//! Autogenerated weights for `snowbridge_outbound_queue` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-10-19, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `192.168.1.7`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: `1024` + +// Executed Command: +// target/release/polkadot-parachain +// benchmark +// pallet +// --chain=bridge-hub-rococo-dev +// --pallet=snowbridge_outbound_queue +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --template +// ../parachain/templates/module-weight-template.hbs +// --output +// ../parachain/pallets/outbound-queue/src/weights.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use core::marker::PhantomData; + +/// Weight functions needed for `snowbridge_outbound_queue`. +pub trait WeightInfo { + fn do_process_message() -> Weight; + fn commit() -> Weight; + fn commit_single() -> Weight; +} + +// For backwards compatibility and tests. +impl WeightInfo for () { + /// Storage: EthereumOutboundQueue MessageLeaves (r:1 w:1) + /// Proof Skipped: EthereumOutboundQueue MessageLeaves (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: EthereumOutboundQueue PendingHighPriorityMessageCount (r:1 w:1) + /// Proof: EthereumOutboundQueue PendingHighPriorityMessageCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EthereumOutboundQueue Nonce (r:1 w:1) + /// Proof: EthereumOutboundQueue Nonce (max_values: None, max_size: Some(20), added: 2495, mode: MaxEncodedLen) + /// Storage: EthereumOutboundQueue Messages (r:1 w:1) + /// Proof Skipped: EthereumOutboundQueue Messages (max_values: Some(1), max_size: None, mode: Measured) + fn do_process_message() -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `3485` + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(39_000_000, 3485) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(4_u64)) + } + /// Storage: EthereumOutboundQueue MessageLeaves (r:1 w:0) + /// Proof Skipped: EthereumOutboundQueue MessageLeaves (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: System Digest (r:1 w:1) + /// Proof Skipped: System Digest (max_values: Some(1), max_size: None, mode: Measured) + fn commit() -> Weight { + // Proof Size summary in bytes: + // Measured: `1094` + // Estimated: `2579` + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(28_000_000, 2579) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + + fn commit_single() -> Weight { + // Proof Size summary in bytes: + // Measured: `1094` + // Estimated: `2579` + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(9_000_000, 1586) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } +} diff --git a/snowbridge/parachain/pallets/system/Cargo.toml b/snowbridge/parachain/pallets/system/Cargo.toml new file mode 100644 index 00000000000..4356bf57220 --- /dev/null +++ b/snowbridge/parachain/pallets/system/Cargo.toml @@ -0,0 +1,83 @@ +[package] +name = "snowbridge-system" +description = "Snowbridge System" +version = "0.1.1" +authors = ["Snowfork "] +edition = "2021" +repository = "https://github.com/Snowfork/snowbridge" +license = "Apache-2.0" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +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"] } +frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking", default-features = false, optional = true } +frame-support = { path = "../../../../../substrate/frame/support", default-features = false } +frame-system = { path = "../../../../../substrate/frame/system", default-features = false } +log = { version = "0.4.20", default-features = false } + +sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } +sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } +sp-io = { path = "../../../../../substrate/primitives/io", default-features = false } +sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } + +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false } + +ethabi = { git = "https://github.com/Snowfork/ethabi-decode.git", package = "ethabi-decode", branch = "master", default-features = false } +snowbridge-core = { path = "../../primitives/core", default-features = false } + +[dev-dependencies] +hex = "0.4.1" +hex-literal = { version = "0.4.1" } +pallet-balances = { path = "../../../../../substrate/frame/balances" } +sp-keyring = { path = "../../../../../substrate/primitives/keyring" } +polkadot-primitives = { path = "../../../../../polkadot/primitives" } +pallet-message-queue = { path = "../../../../../substrate/frame/message-queue" } +snowbridge-outbound-queue = { path = "../outbound-queue" } + +[features] +default = ["std"] +std = [ + "codec/std", + "ethabi/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "log/std", + "scale-info/std", + "snowbridge-core/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm/std", +] +runtime-benchmarks = [ + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-message-queue/runtime-benchmarks", + "polkadot-primitives/runtime-benchmarks", + "snowbridge-core/runtime-benchmarks", + "snowbridge-outbound-queue/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", +] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-balances/try-runtime", + "pallet-message-queue/try-runtime", + "snowbridge-outbound-queue/try-runtime", + "sp-runtime/try-runtime", +] diff --git a/snowbridge/parachain/pallets/system/README.md b/snowbridge/parachain/pallets/system/README.md new file mode 100644 index 00000000000..9e4dc55267d --- /dev/null +++ b/snowbridge/parachain/pallets/system/README.md @@ -0,0 +1 @@ +License: MIT-0 diff --git a/snowbridge/parachain/pallets/system/runtime-api/Cargo.toml b/snowbridge/parachain/pallets/system/runtime-api/Cargo.toml new file mode 100644 index 00000000000..97d0735bf63 --- /dev/null +++ b/snowbridge/parachain/pallets/system/runtime-api/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "snowbridge-system-runtime-api" +description = "Snowbridge System Runtime API" +version = "0.1.0" +edition = "2021" +authors = ["Snowfork "] +repository = "https://github.com/Snowfork/snowbridge" +license = "Apache-2.0" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = [ + "derive", +] } +sp-core = { path = "../../../../../../substrate/primitives/core", default-features = false } +sp-std = { path = "../../../../../../substrate/primitives/std", default-features = false } +sp-api = { path = "../../../../../../substrate/primitives/api", default-features = false } +xcm = { package = "staging-xcm", path = "../../../../../../polkadot/xcm", default-features = false } +snowbridge-core = { path = "../../../primitives/core", default-features = false } + +[features] +default = ["std"] +std = [ + "codec/std", + "snowbridge-core/std", + "sp-api/std", + "sp-core/std", + "sp-std/std", + "xcm/std", +] diff --git a/snowbridge/parachain/pallets/system/runtime-api/src/lib.rs b/snowbridge/parachain/pallets/system/runtime-api/src/lib.rs new file mode 100644 index 00000000000..d99b456c848 --- /dev/null +++ b/snowbridge/parachain/pallets/system/runtime-api/src/lib.rs @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +#![cfg_attr(not(feature = "std"), no_std)] + +use snowbridge_core::AgentId; +use xcm::VersionedMultiLocation; + +sp_api::decl_runtime_apis! { + pub trait ControlApi + { + fn agent_id(location: VersionedMultiLocation) -> Option; + } +} diff --git a/snowbridge/parachain/pallets/system/src/api.rs b/snowbridge/parachain/pallets/system/src/api.rs new file mode 100644 index 00000000000..245e6eea1c1 --- /dev/null +++ b/snowbridge/parachain/pallets/system/src/api.rs @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! Helpers for implementing runtime api + +use snowbridge_core::AgentId; +use xcm::{prelude::*, VersionedMultiLocation}; + +use crate::{agent_id_of, Config}; + +pub fn agent_id(location: VersionedMultiLocation) -> Option +where + Runtime: Config, +{ + let location: MultiLocation = location.try_into().ok()?; + agent_id_of::(&location).ok() +} diff --git a/snowbridge/parachain/pallets/system/src/benchmarking.rs b/snowbridge/parachain/pallets/system/src/benchmarking.rs new file mode 100644 index 00000000000..8d26408b38e --- /dev/null +++ b/snowbridge/parachain/pallets/system/src/benchmarking.rs @@ -0,0 +1,167 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! Benchmarking setup for pallet-template +use super::*; + +#[allow(unused)] +use crate::Pallet as SnowbridgeControl; +use frame_benchmarking::v2::*; +use frame_system::RawOrigin; +use snowbridge_core::{eth, outbound::OperatingMode}; +use sp_runtime::SaturatedConversion; +use xcm::prelude::*; + +#[allow(clippy::result_large_err)] +fn fund_sovereign_account(para_id: ParaId) -> Result<(), BenchmarkError> { + let amount: BalanceOf = (10_000_000_000_000_u64).saturated_into::().saturated_into(); + let sovereign_account = sibling_sovereign_account::(para_id); + T::Token::mint_into(&sovereign_account, amount)?; + Ok(()) +} + +#[benchmarks] +mod benchmarks { + use super::*; + + #[benchmark] + fn upgrade() -> Result<(), BenchmarkError> { + let impl_address = H160::repeat_byte(1); + let impl_code_hash = H256::repeat_byte(1); + + // Assume 256 bytes passed to initializer + let params: Vec = (0..256).map(|_| 1u8).collect(); + + #[extrinsic_call] + _( + RawOrigin::Root, + impl_address, + impl_code_hash, + Some(Initializer { params, maximum_required_gas: 100000 }), + ); + + Ok(()) + } + + #[benchmark] + fn set_operating_mode() -> Result<(), BenchmarkError> { + #[extrinsic_call] + _(RawOrigin::Root, OperatingMode::RejectingOutboundMessages); + + Ok(()) + } + + #[benchmark] + fn set_pricing_parameters() -> Result<(), BenchmarkError> { + let params = T::DefaultPricingParameters::get(); + + #[extrinsic_call] + _(RawOrigin::Root, params); + + Ok(()) + } + + #[benchmark] + fn create_agent() -> Result<(), BenchmarkError> { + let origin_para_id = 2000; + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let origin = T::Helper::make_xcm_origin(origin_location); + fund_sovereign_account::(origin_para_id.into())?; + + #[extrinsic_call] + _(origin as T::RuntimeOrigin); + + Ok(()) + } + + #[benchmark] + fn create_channel() -> Result<(), BenchmarkError> { + let origin_para_id = 2000; + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let origin = T::Helper::make_xcm_origin(origin_location); + fund_sovereign_account::(origin_para_id.into())?; + + SnowbridgeControl::::create_agent(origin.clone())?; + + #[extrinsic_call] + _(origin as T::RuntimeOrigin, OperatingMode::Normal); + + Ok(()) + } + + #[benchmark] + fn update_channel() -> Result<(), BenchmarkError> { + let origin_para_id = 2000; + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let origin = T::Helper::make_xcm_origin(origin_location); + fund_sovereign_account::(origin_para_id.into())?; + SnowbridgeControl::::create_agent(origin.clone())?; + SnowbridgeControl::::create_channel(origin.clone(), OperatingMode::Normal)?; + + #[extrinsic_call] + _(origin as T::RuntimeOrigin, OperatingMode::RejectingOutboundMessages); + + Ok(()) + } + + #[benchmark] + fn force_update_channel() -> Result<(), BenchmarkError> { + let origin_para_id = 2000; + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let origin = T::Helper::make_xcm_origin(origin_location); + let channel_id: ChannelId = ParaId::from(origin_para_id).into(); + + fund_sovereign_account::(origin_para_id.into())?; + SnowbridgeControl::::create_agent(origin.clone())?; + SnowbridgeControl::::create_channel(origin.clone(), OperatingMode::Normal)?; + + #[extrinsic_call] + _(RawOrigin::Root, channel_id, OperatingMode::RejectingOutboundMessages); + + Ok(()) + } + + #[benchmark] + fn transfer_native_from_agent() -> Result<(), BenchmarkError> { + let origin_para_id = 2000; + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let origin = T::Helper::make_xcm_origin(origin_location); + fund_sovereign_account::(origin_para_id.into())?; + SnowbridgeControl::::create_agent(origin.clone())?; + SnowbridgeControl::::create_channel(origin.clone(), OperatingMode::Normal)?; + + #[extrinsic_call] + _(origin as T::RuntimeOrigin, H160::default(), 1); + + Ok(()) + } + + #[benchmark] + fn force_transfer_native_from_agent() -> Result<(), BenchmarkError> { + let origin_para_id = 2000; + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let origin = T::Helper::make_xcm_origin(origin_location); + fund_sovereign_account::(origin_para_id.into())?; + SnowbridgeControl::::create_agent(origin.clone())?; + + let versioned_location: VersionedMultiLocation = origin_location.into(); + + #[extrinsic_call] + _(RawOrigin::Root, Box::new(versioned_location), H160::default(), 1); + + Ok(()) + } + + #[benchmark] + fn set_token_transfer_fees() -> Result<(), BenchmarkError> { + #[extrinsic_call] + _(RawOrigin::Root, 1, 1, eth(1)); + + Ok(()) + } + + impl_benchmark_test_suite!( + SnowbridgeControl, + crate::mock::new_test_ext(true), + crate::mock::Test + ); +} diff --git a/snowbridge/parachain/pallets/system/src/lib.rs b/snowbridge/parachain/pallets/system/src/lib.rs new file mode 100644 index 00000000000..0042093ee66 --- /dev/null +++ b/snowbridge/parachain/pallets/system/src/lib.rs @@ -0,0 +1,681 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! Governance API for controlling the Ethereum side of the bridge +//! +//! # Extrinsics +//! +//! ## Agents +//! +//! Agents are smart contracts on Ethereum that act as proxies for consensus systems on Polkadot +//! networks. +//! +//! * [`Call::create_agent`]: Create agent for a sibling parachain +//! * [`Call::transfer_native_from_agent`]: Withdraw ether from an agent +//! +//! The `create_agent` extrinsic should be called via an XCM `Transact` instruction from the sibling +//! parachain. +//! +//! ## Channels +//! +//! Each sibling parachain has its own dedicated messaging channel for sending and receiving +//! messages. As a prerequisite to creating a channel, the sibling should have already created +//! an agent using the `create_agent` extrinsic. +//! +//! * [`Call::create_channel`]: Create channel for a sibling +//! * [`Call::update_channel`]: Update a channel for a sibling +//! +//! ## Governance +//! +//! Only Polkadot governance itself can call these extrinsics. Delivery fees are waived. +//! +//! * [`Call::upgrade`]`: Upgrade the gateway contract +//! * [`Call::set_operating_mode`]: Update the operating mode of the gateway contract +//! * [`Call::force_update_channel`]: Allow root to update a channel for a sibling +//! * [`Call::force_transfer_native_from_agent`]: Allow root to withdraw ether from an agent +//! +//! Typically, Polkadot governance will use the `force_transfer_native_from_agent` and +//! `force_update_channel` and extrinsics to manage agents and channels for system parachains. +#![cfg_attr(not(feature = "std"), no_std)] + +pub use pallet::*; + +#[cfg(test)] +mod mock; + +#[cfg(test)] +mod tests; + +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; +pub mod migration; + +pub mod api; +pub mod weights; +pub use weights::*; + +use frame_support::{ + pallet_prelude::*, + traits::{ + fungible::{Inspect, Mutate}, + tokens::Preservation, + Contains, EnsureOrigin, + }, +}; +use frame_system::pallet_prelude::*; +use snowbridge_core::{ + meth, + outbound::{Command, Initializer, Message, OperatingMode, SendError, SendMessage}, + sibling_sovereign_account, AgentId, Channel, ChannelId, ParaId, + PricingParameters as PricingParametersRecord, PRIMARY_GOVERNANCE_CHANNEL, + SECONDARY_GOVERNANCE_CHANNEL, +}; +use sp_core::{RuntimeDebug, H160, H256}; +use sp_io::hashing::blake2_256; +use sp_runtime::{traits::BadOrigin, DispatchError, SaturatedConversion}; +use sp_std::prelude::*; +use xcm::prelude::*; +use xcm_executor::traits::ConvertLocation; + +#[cfg(feature = "runtime-benchmarks")] +use frame_support::traits::OriginTrait; + +pub use pallet::*; + +pub type BalanceOf = + <::Token as Inspect<::AccountId>>::Balance; +pub type AccountIdOf = ::AccountId; +pub type PricingParametersOf = PricingParametersRecord>; + +/// Ensure origin location is a sibling +fn ensure_sibling(location: &MultiLocation) -> Result<(ParaId, H256), DispatchError> +where + T: Config, +{ + match location { + MultiLocation { parents: 1, interior: X1(Parachain(para_id)) } => { + let agent_id = agent_id_of::(location)?; + Ok(((*para_id).into(), agent_id)) + }, + _ => Err(BadOrigin.into()), + } +} + +/// Hash the location to produce an agent id +fn agent_id_of(location: &MultiLocation) -> Result { + T::AgentIdOf::convert_location(location).ok_or(Error::::LocationConversionFailed.into()) +} + +#[cfg(feature = "runtime-benchmarks")] +pub trait BenchmarkHelper +where + O: OriginTrait, +{ + fn make_xcm_origin(location: MultiLocation) -> O; +} + +/// Whether a fee should be withdrawn to an account for sending an outbound message +#[derive(Clone, PartialEq, RuntimeDebug)] +pub enum PaysFee +where + T: Config, +{ + /// Fully charge includes (local + remote fee) + Yes(AccountIdOf), + /// Partially charge includes local fee only + Partial(AccountIdOf), + /// No charge + No, +} + +#[frame_support::pallet] +pub mod pallet { + use snowbridge_core::StaticLookup; + use sp_core::U256; + + use super::*; + + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::config] + pub trait Config: frame_system::Config { + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + + /// Send messages to Ethereum + type OutboundQueue: SendMessage>; + + /// Origin check for XCM locations that can create agents + type SiblingOrigin: EnsureOrigin; + + /// Converts MultiLocation to AgentId + type AgentIdOf: ConvertLocation; + + /// Token reserved for control operations + type Token: Mutate; + + /// TreasuryAccount to collect fees + #[pallet::constant] + type TreasuryAccount: Get; + + /// Number of decimal places of local currency + type DefaultPricingParameters: Get>; + + /// Cost of delivering a message from Ethereum + type InboundDeliveryCost: Get>; + + type WeightInfo: WeightInfo; + + #[cfg(feature = "runtime-benchmarks")] + type Helper: BenchmarkHelper; + } + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// An Upgrade message was sent to the Gateway + Upgrade { + impl_address: H160, + impl_code_hash: H256, + initializer_params_hash: Option, + }, + /// An CreateAgent message was sent to the Gateway + CreateAgent { + location: Box, + agent_id: AgentId, + }, + /// An CreateChannel message was sent to the Gateway + CreateChannel { + channel_id: ChannelId, + agent_id: AgentId, + }, + /// An UpdateChannel message was sent to the Gateway + UpdateChannel { + channel_id: ChannelId, + mode: OperatingMode, + }, + /// An SetOperatingMode message was sent to the Gateway + SetOperatingMode { + mode: OperatingMode, + }, + /// An TransferNativeFromAgent message was sent to the Gateway + TransferNativeFromAgent { + agent_id: AgentId, + recipient: H160, + amount: u128, + }, + /// A SetTokenTransferFees message was sent to the Gateway + SetTokenTransferFees { + create_asset_xcm: u128, + transfer_asset_xcm: u128, + register_token: U256, + }, + PricingParametersChanged { + params: PricingParametersOf, + }, + } + + #[pallet::error] + pub enum Error { + LocationConversionFailed, + AgentAlreadyCreated, + NoAgent, + ChannelAlreadyCreated, + NoChannel, + UnsupportedLocationVersion, + InvalidLocation, + Send(SendError), + InvalidTokenTransferFees, + InvalidPricingParameters, + } + + /// The set of registered agents + #[pallet::storage] + #[pallet::getter(fn agents)] + pub type Agents = StorageMap<_, Twox64Concat, AgentId, (), OptionQuery>; + + /// The set of registered channels + #[pallet::storage] + #[pallet::getter(fn channels)] + pub type Channels = StorageMap<_, Twox64Concat, ChannelId, Channel, OptionQuery>; + + #[pallet::storage] + #[pallet::getter(fn parameters)] + pub type PricingParameters = + StorageValue<_, PricingParametersOf, ValueQuery, T::DefaultPricingParameters>; + + #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] + pub struct GenesisConfig { + // Own parachain id + pub para_id: ParaId, + // AssetHub's parachain id + pub asset_hub_para_id: ParaId, + #[serde(skip)] + pub _config: PhantomData, + } + + #[pallet::genesis_build] + impl BuildGenesisConfig for GenesisConfig { + fn build(&self) { + Pallet::::initialize(self.para_id, self.asset_hub_para_id).expect("infallible; qed"); + } + } + + #[pallet::call] + impl Pallet { + /// Sends command to the Gateway contract to upgrade itself with a new implementation + /// contract + /// + /// Fee required: No + /// + /// - `origin`: Must be `Root`. + /// - `impl_address`: The address of the implementation contract. + /// - `impl_code_hash`: The codehash of the implementation contract. + /// - `initializer`: Optionally call an initializer on the implementation contract. + #[pallet::call_index(0)] + #[pallet::weight((T::WeightInfo::upgrade(), DispatchClass::Operational))] + pub fn upgrade( + origin: OriginFor, + impl_address: H160, + impl_code_hash: H256, + initializer: Option, + ) -> DispatchResult { + ensure_root(origin)?; + + let initializer_params_hash: Option = + initializer.as_ref().map(|i| H256::from(blake2_256(i.params.as_ref()))); + let command = Command::Upgrade { impl_address, impl_code_hash, initializer }; + Self::send(PRIMARY_GOVERNANCE_CHANNEL, command, PaysFee::::No)?; + + Self::deposit_event(Event::::Upgrade { + impl_address, + impl_code_hash, + initializer_params_hash, + }); + Ok(()) + } + + /// Sends a message to the Gateway contract to change its operating mode + /// + /// Fee required: No + /// + /// - `origin`: Must be `MultiLocation` + #[pallet::call_index(1)] + #[pallet::weight((T::WeightInfo::set_operating_mode(), DispatchClass::Operational))] + pub fn set_operating_mode(origin: OriginFor, mode: OperatingMode) -> DispatchResult { + ensure_root(origin)?; + + let command = Command::SetOperatingMode { mode }; + Self::send(PRIMARY_GOVERNANCE_CHANNEL, command, PaysFee::::No)?; + + Self::deposit_event(Event::::SetOperatingMode { mode }); + Ok(()) + } + + /// Set pricing parameters on both sides of the bridge + /// + /// Fee required: No + /// + /// - `origin`: Must be root + #[pallet::call_index(2)] + #[pallet::weight((T::WeightInfo::set_pricing_parameters(), DispatchClass::Operational))] + pub fn set_pricing_parameters( + origin: OriginFor, + params: PricingParametersOf, + ) -> DispatchResult { + ensure_root(origin)?; + params.validate().map_err(|_| Error::::InvalidPricingParameters)?; + PricingParameters::::put(params.clone()); + + let command = Command::SetPricingParameters { + exchange_rate: params.exchange_rate.into(), + delivery_cost: T::InboundDeliveryCost::get().saturated_into::(), + }; + Self::send(PRIMARY_GOVERNANCE_CHANNEL, command, PaysFee::::No)?; + + Self::deposit_event(Event::PricingParametersChanged { params }); + Ok(()) + } + + /// Sends a command to the Gateway contract to instantiate a new agent contract representing + /// `origin`. + /// + /// Fee required: Yes + /// + /// - `origin`: Must be `MultiLocation` of a sibling parachain + #[pallet::call_index(3)] + #[pallet::weight(T::WeightInfo::create_agent())] + pub fn create_agent(origin: OriginFor) -> DispatchResult { + let origin_location: MultiLocation = T::SiblingOrigin::ensure_origin(origin)?; + + // Ensure that origin location is some consensus system on a sibling parachain + let (para_id, agent_id) = ensure_sibling::(&origin_location)?; + + // Record the agent id or fail if it has already been created + ensure!(!Agents::::contains_key(agent_id), Error::::AgentAlreadyCreated); + Agents::::insert(agent_id, ()); + + let command = Command::CreateAgent { agent_id }; + let pays_fee = PaysFee::::Yes(sibling_sovereign_account::(para_id)); + Self::send(SECONDARY_GOVERNANCE_CHANNEL, command, pays_fee)?; + + Self::deposit_event(Event::::CreateAgent { + location: Box::new(origin_location), + agent_id, + }); + Ok(()) + } + + /// Sends a message to the Gateway contract to create a new channel representing `origin` + /// + /// Fee required: Yes + /// + /// This extrinsic is permissionless, so a fee is charged to prevent spamming and pay + /// for execution costs on the remote side. + /// + /// The message is sent over the bridge on BridgeHub's own channel to the Gateway. + /// + /// - `origin`: Must be `MultiLocation` + /// - `mode`: Initial operating mode of the channel + #[pallet::call_index(4)] + #[pallet::weight(T::WeightInfo::create_channel())] + pub fn create_channel(origin: OriginFor, mode: OperatingMode) -> DispatchResult { + let origin_location: MultiLocation = T::SiblingOrigin::ensure_origin(origin)?; + + // Ensure that origin location is a sibling parachain + let (para_id, agent_id) = ensure_sibling::(&origin_location)?; + + let channel_id: ChannelId = para_id.into(); + + ensure!(Agents::::contains_key(agent_id), Error::::NoAgent); + ensure!(!Channels::::contains_key(channel_id), Error::::ChannelAlreadyCreated); + + let channel = Channel { agent_id, para_id }; + Channels::::insert(channel_id, channel); + + let command = Command::CreateChannel { channel_id, agent_id, mode }; + let pays_fee = PaysFee::::Yes(sibling_sovereign_account::(para_id)); + Self::send(SECONDARY_GOVERNANCE_CHANNEL, command, pays_fee)?; + + Self::deposit_event(Event::::CreateChannel { channel_id, agent_id }); + Ok(()) + } + + /// Sends a message to the Gateway contract to update a channel configuration + /// + /// The origin must already have a channel initialized, as this message is sent over it. + /// + /// A partial fee will be charged for local processing only. + /// + /// - `origin`: Must be `MultiLocation` + /// - `mode`: Initial operating mode of the channel + #[pallet::call_index(5)] + #[pallet::weight(T::WeightInfo::update_channel())] + pub fn update_channel(origin: OriginFor, mode: OperatingMode) -> DispatchResult { + let origin_location: MultiLocation = T::SiblingOrigin::ensure_origin(origin)?; + + // Ensure that origin location is a sibling parachain + let (para_id, _) = ensure_sibling::(&origin_location)?; + + let channel_id: ChannelId = para_id.into(); + + ensure!(Channels::::contains_key(channel_id), Error::::NoChannel); + + let command = Command::UpdateChannel { channel_id, mode }; + let pays_fee = PaysFee::::Partial(sibling_sovereign_account::(para_id)); + + // Parachains send the update message on their own channel + Self::send(channel_id, command, pays_fee)?; + + Self::deposit_event(Event::::UpdateChannel { channel_id, mode }); + Ok(()) + } + + /// Sends a message to the Gateway contract to update an arbitrary channel + /// + /// Fee required: No + /// + /// - `origin`: Must be root + /// - `channel_id`: ID of channel + /// - `mode`: Initial operating mode of the channel + /// - `outbound_fee`: Fee charged to users for sending outbound messages to Polkadot + #[pallet::call_index(6)] + #[pallet::weight(T::WeightInfo::force_update_channel())] + pub fn force_update_channel( + origin: OriginFor, + channel_id: ChannelId, + mode: OperatingMode, + ) -> DispatchResult { + ensure_root(origin)?; + + ensure!(Channels::::contains_key(channel_id), Error::::NoChannel); + + let command = Command::UpdateChannel { channel_id, mode }; + Self::send(PRIMARY_GOVERNANCE_CHANNEL, command, PaysFee::::No)?; + + Self::deposit_event(Event::::UpdateChannel { channel_id, mode }); + Ok(()) + } + + /// Sends a message to the Gateway contract to transfer ether from an agent to `recipient`. + /// + /// A partial fee will be charged for local processing only. + /// + /// - `origin`: Must be `MultiLocation` + #[pallet::call_index(7)] + #[pallet::weight(T::WeightInfo::transfer_native_from_agent())] + pub fn transfer_native_from_agent( + origin: OriginFor, + recipient: H160, + amount: u128, + ) -> DispatchResult { + let origin_location: MultiLocation = T::SiblingOrigin::ensure_origin(origin)?; + + // Ensure that origin location is some consensus system on a sibling parachain + let (para_id, agent_id) = ensure_sibling::(&origin_location)?; + + // Since the origin is also the owner of the channel, they only need to pay + // the local processing fee. + let pays_fee = PaysFee::::Partial(sibling_sovereign_account::(para_id)); + + Self::do_transfer_native_from_agent( + agent_id, + para_id.into(), + recipient, + amount, + pays_fee, + ) + } + + /// Sends a message to the Gateway contract to transfer ether from an agent to `recipient`. + /// + /// Privileged. Can only be called by root. + /// + /// Fee required: No + /// + /// - `origin`: Must be root + /// - `location`: Location used to resolve the agent + /// - `recipient`: Recipient of funds + /// - `amount`: Amount to transfer + #[pallet::call_index(8)] + #[pallet::weight(T::WeightInfo::force_transfer_native_from_agent())] + pub fn force_transfer_native_from_agent( + origin: OriginFor, + location: Box, + recipient: H160, + amount: u128, + ) -> DispatchResult { + ensure_root(origin)?; + + // Ensure that location is some consensus system on a sibling parachain + let location: MultiLocation = + (*location).try_into().map_err(|_| Error::::UnsupportedLocationVersion)?; + let (_, agent_id) = + ensure_sibling::(&location).map_err(|_| Error::::InvalidLocation)?; + + let pays_fee = PaysFee::::No; + + Self::do_transfer_native_from_agent( + agent_id, + PRIMARY_GOVERNANCE_CHANNEL, + recipient, + amount, + pays_fee, + ) + } + + /// Sends a message to the Gateway contract to update fee related parameters for + /// token transfers. + /// + /// Privileged. Can only be called by root. + /// + /// Fee required: No + /// + /// - `origin`: Must be root + /// - `create_asset_xcm`: The XCM execution cost for creating a new asset class on AssetHub, + /// in DOT + /// - `transfer_asset_xcm`: The XCM execution cost for performing a reserve transfer on + /// AssetHub, in DOT + /// - `register_token`: The Ether fee for registering a new token, to discourage spamming + #[pallet::call_index(9)] + #[pallet::weight((T::WeightInfo::set_token_transfer_fees(), DispatchClass::Operational))] + pub fn set_token_transfer_fees( + origin: OriginFor, + create_asset_xcm: u128, + transfer_asset_xcm: u128, + register_token: U256, + ) -> DispatchResult { + ensure_root(origin)?; + + // Basic validation of new costs. Particularly for token registration, we want to ensure + // its relatively expensive to discourage spamming. Like at least 100 USD. + ensure!( + create_asset_xcm > 0 && transfer_asset_xcm > 0 && register_token > meth(100), + Error::::InvalidTokenTransferFees + ); + + let command = Command::SetTokenTransferFees { + create_asset_xcm, + transfer_asset_xcm, + register_token, + }; + Self::send(PRIMARY_GOVERNANCE_CHANNEL, command, PaysFee::::No)?; + + Self::deposit_event(Event::::SetTokenTransferFees { + create_asset_xcm, + transfer_asset_xcm, + register_token, + }); + Ok(()) + } + } + + impl Pallet { + /// Send `command` to the Gateway on the Channel identified by `channel_id` + fn send(channel_id: ChannelId, command: Command, pays_fee: PaysFee) -> DispatchResult { + let message = Message { id: None, channel_id, command }; + let (ticket, fee) = + T::OutboundQueue::validate(&message).map_err(|err| Error::::Send(err))?; + + let payment = match pays_fee { + PaysFee::Yes(account) => Some((account, fee.total())), + PaysFee::Partial(account) => Some((account, fee.local)), + PaysFee::No => None, + }; + + if let Some((payer, fee)) = payment { + T::Token::transfer( + &payer, + &T::TreasuryAccount::get(), + fee, + Preservation::Preserve, + )?; + } + + T::OutboundQueue::deliver(ticket).map_err(|err| Error::::Send(err))?; + Ok(()) + } + + /// Issue a `Command::TransferNativeFromAgent` command. The command will be sent on the + /// channel `channel_id` + pub fn do_transfer_native_from_agent( + agent_id: H256, + channel_id: ChannelId, + recipient: H160, + amount: u128, + pays_fee: PaysFee, + ) -> DispatchResult { + ensure!(Agents::::contains_key(agent_id), Error::::NoAgent); + + let command = Command::TransferNativeFromAgent { agent_id, recipient, amount }; + Self::send(channel_id, command, pays_fee)?; + + Self::deposit_event(Event::::TransferNativeFromAgent { + agent_id, + recipient, + amount, + }); + Ok(()) + } + + /// Initializes agents and channels. + pub fn initialize(para_id: ParaId, asset_hub_para_id: ParaId) -> Result<(), DispatchError> { + // Asset Hub + let asset_hub_location: MultiLocation = + ParentThen(X1(Parachain(asset_hub_para_id.into()))).into(); + let asset_hub_agent_id = agent_id_of::(&asset_hub_location)?; + let asset_hub_channel_id: ChannelId = asset_hub_para_id.into(); + Agents::::insert(asset_hub_agent_id, ()); + Channels::::insert( + asset_hub_channel_id, + Channel { agent_id: asset_hub_agent_id, para_id: asset_hub_para_id }, + ); + + // Governance channels + let bridge_hub_agent_id = agent_id_of::(&MultiLocation::here())?; + // Agent for BridgeHub + Agents::::insert(bridge_hub_agent_id, ()); + + // Primary governance channel + Channels::::insert( + PRIMARY_GOVERNANCE_CHANNEL, + Channel { agent_id: bridge_hub_agent_id, para_id }, + ); + + // Secondary governance channel + Channels::::insert( + SECONDARY_GOVERNANCE_CHANNEL, + Channel { agent_id: bridge_hub_agent_id, para_id }, + ); + + Ok(()) + } + + /// Checks if the pallet has been initialized. + pub(crate) fn is_initialized() -> bool { + let primary_exists = Channels::::contains_key(PRIMARY_GOVERNANCE_CHANNEL); + let secondary_exists = Channels::::contains_key(SECONDARY_GOVERNANCE_CHANNEL); + primary_exists && secondary_exists + } + } + + impl StaticLookup for Pallet { + type Source = ChannelId; + type Target = Channel; + fn lookup(channel_id: Self::Source) -> Option { + Channels::::get(channel_id) + } + } + + impl Contains for Pallet { + fn contains(channel_id: &ChannelId) -> bool { + Channels::::get(channel_id).is_some() + } + } + + impl Get> for Pallet { + fn get() -> PricingParametersOf { + PricingParameters::::get() + } + } +} diff --git a/snowbridge/parachain/pallets/system/src/migration.rs b/snowbridge/parachain/pallets/system/src/migration.rs new file mode 100644 index 00000000000..ee94fc091bd --- /dev/null +++ b/snowbridge/parachain/pallets/system/src/migration.rs @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! Governance API for controlling the Ethereum side of the bridge +use super::*; +use frame_support::traits::OnRuntimeUpgrade; +use log; + +#[cfg(feature = "try-runtime")] +use sp_runtime::TryRuntimeError; + +pub mod v0 { + use frame_support::{pallet_prelude::*, weights::Weight}; + + use super::*; + + const LOG_TARGET: &str = "ethereum_system::migration"; + + pub struct InitializeOnUpgrade( + sp_std::marker::PhantomData<(T, BridgeHubParaId, AssetHubParaId)>, + ); + impl OnRuntimeUpgrade + for InitializeOnUpgrade + where + T: Config, + BridgeHubParaId: Get, + AssetHubParaId: Get, + { + fn on_runtime_upgrade() -> Weight { + if !Pallet::::is_initialized() { + Pallet::::initialize( + BridgeHubParaId::get().into(), + AssetHubParaId::get().into(), + ) + .expect("infallible; qed"); + log::info!( + target: LOG_TARGET, + "Ethereum system initialized." + ); + T::DbWeight::get().reads_writes(2, 5) + } else { + log::info!( + target: LOG_TARGET, + "Ethereum system already initialized. Skipping." + ); + T::DbWeight::get().reads(2) + } + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, TryRuntimeError> { + if !Pallet::::is_initialized() { + log::info!( + target: LOG_TARGET, + "Agents and channels not initialized. Initialization will run." + ); + } else { + log::info!( + target: LOG_TARGET, + "Agents and channels are initialized. Initialization will not run." + ); + } + Ok(vec![]) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_: Vec) -> Result<(), TryRuntimeError> { + frame_support::ensure!( + Pallet::::is_initialized(), + "Agents and channels were not initialized." + ); + Ok(()) + } + } +} diff --git a/snowbridge/parachain/pallets/system/src/mock.rs b/snowbridge/parachain/pallets/system/src/mock.rs new file mode 100644 index 00000000000..7a4f6118930 --- /dev/null +++ b/snowbridge/parachain/pallets/system/src/mock.rs @@ -0,0 +1,270 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use crate as snowbridge_system; +use frame_support::{ + parameter_types, + traits::{tokens::fungible::Mutate, ConstU128, ConstU16, ConstU64, ConstU8}, + weights::IdentityFee, + PalletId, +}; +use sp_core::H256; +use xcm_executor::traits::ConvertLocation; + +use snowbridge_core::{ + gwei, meth, outbound::ConstantGasMeter, sibling_sovereign_account, AgentId, AllowSiblingsOnly, + ParaId, PricingParameters, Rewards, +}; +use sp_runtime::{ + traits::{AccountIdConversion, BlakeTwo256, IdentityLookup, Keccak256}, + AccountId32, BuildStorage, FixedU128, +}; +use xcm::prelude::*; + +#[cfg(feature = "runtime-benchmarks")] +use crate::BenchmarkHelper; + +type Block = frame_system::mocking::MockBlock; +type Balance = u128; + +pub type AccountId = AccountId32; + +// A stripped-down version of pallet-xcm that only inserts an XCM origin into the runtime +#[allow(dead_code)] +#[frame_support::pallet] +mod pallet_xcm_origin { + use frame_support::{ + pallet_prelude::*, + traits::{Contains, OriginTrait}, + }; + use xcm::latest::prelude::*; + + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::config] + pub trait Config: frame_system::Config { + type RuntimeOrigin: From + From<::RuntimeOrigin>; + } + + // Insert this custom Origin into the aggregate RuntimeOrigin + #[pallet::origin] + #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] + pub struct Origin(pub MultiLocation); + + impl From for Origin { + fn from(location: MultiLocation) -> Origin { + Origin(location) + } + } + + /// `EnsureOrigin` implementation succeeding with a `MultiLocation` value to recognize and + /// filter the contained location + pub struct EnsureXcm(PhantomData); + impl, F: Contains> EnsureOrigin for EnsureXcm + where + O::PalletsOrigin: From + TryInto, + { + type Success = MultiLocation; + + fn try_origin(outer: O) -> Result { + outer.try_with_caller(|caller| { + caller.try_into().and_then(|o| match o { + Origin(location) if F::contains(&location) => Ok(location), + o => Err(o.into()), + }) + }) + } + + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + Ok(O::from(Origin(MultiLocation { parents: 1, interior: X1(Parachain(2000)) }))) + } + } +} + +// Configure a mock runtime to test the pallet. +frame_support::construct_runtime!( + pub enum Test + { + System: frame_system, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + XcmOrigin: pallet_xcm_origin::{Pallet, Origin}, + OutboundQueue: snowbridge_outbound_queue::{Pallet, Call, Storage, Event}, + EthereumSystem: snowbridge_system, + MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} + } +); + +impl frame_system::Config for Test { + type BaseCallFilter = frame_support::traits::Everything; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = AccountId; + type Lookup = IdentityLookup; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = ConstU64<250>; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = ConstU16<42>; + type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; + type Block = Block; +} + +impl pallet_balances::Config for Test { + type MaxLocks = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; + type Balance = Balance; + type RuntimeEvent = RuntimeEvent; + type DustRemoval = (); + type ExistentialDeposit = ConstU128<1>; + type AccountStore = System; + type WeightInfo = (); + type FreezeIdentifier = (); + type MaxFreezes = (); + type RuntimeHoldReason = (); + type RuntimeFreezeReason = (); + type MaxHolds = (); +} + +impl pallet_xcm_origin::Config for Test { + type RuntimeOrigin = RuntimeOrigin; +} + +parameter_types! { + pub const HeapSize: u32 = 32 * 1024; + pub const MaxStale: u32 = 32; + pub static ServiceWeight: Option = Some(Weight::from_parts(100, 100)); +} + +impl pallet_message_queue::Config for Test { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = (); + type MessageProcessor = OutboundQueue; + type Size = u32; + type QueueChangeHandler = (); + type HeapSize = HeapSize; + type MaxStale = MaxStale; + type ServiceWeight = ServiceWeight; + type QueuePausedQuery = (); +} + +parameter_types! { + pub const MaxMessagePayloadSize: u32 = 1024; + pub const MaxMessagesPerBlock: u32 = 20; + pub const OwnParaId: ParaId = ParaId::new(1013); +} + +impl snowbridge_outbound_queue::Config for Test { + type RuntimeEvent = RuntimeEvent; + type Hashing = Keccak256; + type MessageQueue = MessageQueue; + type Decimals = ConstU8<10>; + type MaxMessagePayloadSize = MaxMessagePayloadSize; + type MaxMessagesPerBlock = MaxMessagesPerBlock; + type GasMeter = ConstantGasMeter; + type Balance = u128; + type PricingParameters = EthereumSystem; + type Channels = EthereumSystem; + type WeightToFee = IdentityFee; + type WeightInfo = (); +} + +parameter_types! { + pub const SS58Prefix: u8 = 42; + pub const AnyNetwork: Option = None; + pub const RelayNetwork: Option = Some(NetworkId::Kusama); + pub const RelayLocation: MultiLocation = MultiLocation::parent(); + pub UniversalLocation: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(1013)); +} + +pub const DOT: u128 = 10_000_000_000; + +parameter_types! { + pub TreasuryAccount: AccountId = PalletId(*b"py/trsry").into_account_truncating(); + pub Fee: u64 = 1000; + pub const RococoNetwork: NetworkId = NetworkId::Rococo; + pub const InitialFunding: u128 = 1_000_000_000_000; + pub AssetHubParaId: ParaId = ParaId::new(1000); + pub TestParaId: u32 = 2000; + pub Parameters: PricingParameters = PricingParameters { + exchange_rate: FixedU128::from_rational(1, 400), + fee_per_gas: gwei(20), + rewards: Rewards { local: DOT, remote: meth(1) } + }; + pub const InboundDeliveryCost: u128 = 1_000_000_000; + +} + +#[cfg(feature = "runtime-benchmarks")] +impl BenchmarkHelper for () { + fn make_xcm_origin(location: MultiLocation) -> RuntimeOrigin { + RuntimeOrigin::from(pallet_xcm_origin::Origin(location)) + } +} + +impl crate::Config for Test { + type RuntimeEvent = RuntimeEvent; + type OutboundQueue = OutboundQueue; + type SiblingOrigin = pallet_xcm_origin::EnsureXcm; + type AgentIdOf = snowbridge_core::AgentIdOf; + type TreasuryAccount = TreasuryAccount; + type Token = Balances; + type DefaultPricingParameters = Parameters; + type WeightInfo = (); + type InboundDeliveryCost = InboundDeliveryCost; + #[cfg(feature = "runtime-benchmarks")] + type Helper = (); +} + +// Build genesis storage according to the mock runtime. +pub fn new_test_ext(genesis_build: bool) -> sp_io::TestExternalities { + let mut storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); + + if genesis_build { + crate::GenesisConfig:: { + para_id: OwnParaId::get(), + asset_hub_para_id: AssetHubParaId::get(), + _config: Default::default(), + } + .assimilate_storage(&mut storage) + .unwrap(); + } + + let mut ext: sp_io::TestExternalities = storage.into(); + let initial_amount = InitialFunding::get(); + let test_para_id = TestParaId::get(); + let sovereign_account = sibling_sovereign_account::(test_para_id.into()); + let treasury_account = TreasuryAccount::get(); + ext.execute_with(|| { + System::set_block_number(1); + Balances::mint_into(&AccountId32::from([0; 32]), initial_amount).unwrap(); + Balances::mint_into(&sovereign_account, initial_amount).unwrap(); + Balances::mint_into(&treasury_account, initial_amount).unwrap(); + }); + ext +} + +// Test helpers + +pub fn make_xcm_origin(location: MultiLocation) -> RuntimeOrigin { + pallet_xcm_origin::Origin(location).into() +} + +pub fn make_agent_id(location: MultiLocation) -> AgentId { + ::AgentIdOf::convert_location(&location) + .expect("convert location") +} diff --git a/snowbridge/parachain/pallets/system/src/tests.rs b/snowbridge/parachain/pallets/system/src/tests.rs new file mode 100644 index 00000000000..e07481c1e33 --- /dev/null +++ b/snowbridge/parachain/pallets/system/src/tests.rs @@ -0,0 +1,664 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use crate::{mock::*, *}; +use frame_support::{assert_noop, assert_ok}; +use hex_literal::hex; +use snowbridge_core::{eth, sibling_sovereign_account_raw}; +use sp_core::H256; +use sp_runtime::{AccountId32, DispatchError::BadOrigin, TokenError}; + +#[test] +fn create_agent() { + new_test_ext(true).execute_with(|| { + let origin_para_id = 2000; + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let agent_id = make_agent_id(origin_location); + let sovereign_account = sibling_sovereign_account::(origin_para_id.into()); + + // fund sovereign account of origin + let _ = Balances::mint_into(&sovereign_account, 10000); + + assert!(!Agents::::contains_key(agent_id)); + + let origin = make_xcm_origin(origin_location); + assert_ok!(EthereumSystem::create_agent(origin)); + + assert!(Agents::::contains_key(agent_id)); + }); +} + +#[test] +fn test_agent_for_here() { + new_test_ext(true).execute_with(|| { + let origin_location = MultiLocation::here(); + let agent_id = make_agent_id(origin_location); + assert_eq!( + agent_id, + hex!("03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314").into(), + ) + }); +} + +#[test] +fn create_agent_fails_on_funds_unavailable() { + new_test_ext(true).execute_with(|| { + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(2000)) }; + let origin = make_xcm_origin(origin_location); + // Reset balance of sovereign_account to zero so to trigger the FundsUnavailable error + let sovereign_account = sibling_sovereign_account::(2000.into()); + Balances::set_balance(&sovereign_account, 0); + assert_noop!(EthereumSystem::create_agent(origin), TokenError::FundsUnavailable); + }); +} + +#[test] +fn create_agent_bad_origin() { + new_test_ext(true).execute_with(|| { + // relay chain location not allowed + assert_noop!( + EthereumSystem::create_agent(make_xcm_origin(MultiLocation { + parents: 1, + interior: Here, + })), + BadOrigin, + ); + + // local account location not allowed + assert_noop!( + EthereumSystem::create_agent(make_xcm_origin(MultiLocation { + parents: 0, + interior: X1(Junction::AccountId32 { network: None, id: [67u8; 32] }), + })), + BadOrigin, + ); + + // Signed origin not allowed + assert_noop!( + EthereumSystem::create_agent(RuntimeOrigin::signed([14; 32].into())), + BadOrigin + ); + + // None origin not allowed + assert_noop!(EthereumSystem::create_agent(RuntimeOrigin::none()), BadOrigin); + }); +} + +#[test] +fn upgrade_as_root() { + new_test_ext(true).execute_with(|| { + let origin = RuntimeOrigin::root(); + let address: H160 = Default::default(); + let code_hash: H256 = Default::default(); + + assert_ok!(EthereumSystem::upgrade(origin, address, code_hash, None)); + + System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::Upgrade { + impl_address: address, + impl_code_hash: code_hash, + initializer_params_hash: None, + })); + }); +} + +#[test] +fn upgrade_as_signed_fails() { + new_test_ext(true).execute_with(|| { + let origin = RuntimeOrigin::signed(AccountId32::new([0; 32])); + let address: H160 = Default::default(); + let code_hash: H256 = Default::default(); + + assert_noop!(EthereumSystem::upgrade(origin, address, code_hash, None), BadOrigin); + }); +} + +#[test] +fn upgrade_with_params() { + new_test_ext(true).execute_with(|| { + let origin = RuntimeOrigin::root(); + let address: H160 = Default::default(); + let code_hash: H256 = Default::default(); + let initializer: Option = + Some(Initializer { params: [0; 256].into(), maximum_required_gas: 10000 }); + assert_ok!(EthereumSystem::upgrade(origin, address, code_hash, initializer)); + }); +} + +#[test] +fn set_operating_mode() { + new_test_ext(true).execute_with(|| { + let origin = RuntimeOrigin::root(); + let mode = OperatingMode::RejectingOutboundMessages; + + assert_ok!(EthereumSystem::set_operating_mode(origin, mode)); + + System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::SetOperatingMode { + mode, + })); + }); +} + +#[test] +fn set_operating_mode_as_signed_fails() { + new_test_ext(true).execute_with(|| { + let origin = RuntimeOrigin::signed([14; 32].into()); + let mode = OperatingMode::RejectingOutboundMessages; + + assert_noop!(EthereumSystem::set_operating_mode(origin, mode), BadOrigin); + }); +} + +#[test] +fn set_pricing_parameters() { + new_test_ext(true).execute_with(|| { + let origin = RuntimeOrigin::root(); + let mut params = Parameters::get(); + params.rewards.local = 7; + + assert_ok!(EthereumSystem::set_pricing_parameters(origin, params)); + + assert_eq!(PricingParameters::::get().rewards.local, 7); + }); +} + +#[test] +fn set_pricing_parameters_as_signed_fails() { + new_test_ext(true).execute_with(|| { + let origin = RuntimeOrigin::signed([14; 32].into()); + let params = Parameters::get(); + + assert_noop!(EthereumSystem::set_pricing_parameters(origin, params), BadOrigin); + }); +} + +#[test] +fn set_pricing_parameters_invalid() { + new_test_ext(true).execute_with(|| { + let origin = RuntimeOrigin::root(); + let mut params = Parameters::get(); + params.rewards.local = 0; + + assert_noop!( + EthereumSystem::set_pricing_parameters(origin.clone(), params), + Error::::InvalidPricingParameters + ); + + let mut params = Parameters::get(); + params.exchange_rate = 0u128.into(); + assert_noop!( + EthereumSystem::set_pricing_parameters(origin.clone(), params), + Error::::InvalidPricingParameters + ); + params = Parameters::get(); + params.fee_per_gas = sp_core::U256::zero(); + assert_noop!( + EthereumSystem::set_pricing_parameters(origin.clone(), params), + Error::::InvalidPricingParameters + ); + params = Parameters::get(); + params.rewards.local = 0; + assert_noop!( + EthereumSystem::set_pricing_parameters(origin.clone(), params), + Error::::InvalidPricingParameters + ); + params = Parameters::get(); + params.rewards.remote = sp_core::U256::zero(); + assert_noop!( + EthereumSystem::set_pricing_parameters(origin, params), + Error::::InvalidPricingParameters + ); + }); +} + +#[test] +fn set_token_transfer_fees() { + new_test_ext(true).execute_with(|| { + let origin = RuntimeOrigin::root(); + + assert_ok!(EthereumSystem::set_token_transfer_fees(origin, 1, 1, eth(1))); + }); +} + +#[test] +fn set_token_transfer_fees_root_only() { + new_test_ext(true).execute_with(|| { + let origin = RuntimeOrigin::signed([14; 32].into()); + + assert_noop!(EthereumSystem::set_token_transfer_fees(origin, 1, 1, 1.into()), BadOrigin); + }); +} + +#[test] +fn set_token_transfer_fees_invalid() { + new_test_ext(true).execute_with(|| { + let origin = RuntimeOrigin::root(); + + assert_noop!( + EthereumSystem::set_token_transfer_fees(origin, 0, 0, 0.into()), + Error::::InvalidTokenTransferFees + ); + }); +} + +#[test] +fn create_channel() { + new_test_ext(true).execute_with(|| { + let origin_para_id = 2000; + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let sovereign_account = sibling_sovereign_account::(origin_para_id.into()); + let origin = make_xcm_origin(origin_location); + + // fund sovereign account of origin + let _ = Balances::mint_into(&sovereign_account, 10000); + + assert_ok!(EthereumSystem::create_agent(origin.clone())); + assert_ok!(EthereumSystem::create_channel(origin, OperatingMode::Normal)); + }); +} + +#[test] +fn create_channel_fail_already_exists() { + new_test_ext(true).execute_with(|| { + let origin_para_id = 2000; + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let sovereign_account = sibling_sovereign_account::(origin_para_id.into()); + let origin = make_xcm_origin(origin_location); + + // fund sovereign account of origin + let _ = Balances::mint_into(&sovereign_account, 10000); + + assert_ok!(EthereumSystem::create_agent(origin.clone())); + assert_ok!(EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal)); + + assert_noop!( + EthereumSystem::create_channel(origin, OperatingMode::Normal), + Error::::ChannelAlreadyCreated + ); + }); +} + +#[test] +fn create_channel_bad_origin() { + new_test_ext(true).execute_with(|| { + // relay chain location not allowed + assert_noop!( + EthereumSystem::create_channel( + make_xcm_origin(MultiLocation { parents: 1, interior: Here }), + OperatingMode::Normal, + ), + BadOrigin, + ); + + // child of sibling location not allowed + assert_noop!( + EthereumSystem::create_channel( + make_xcm_origin(MultiLocation { + parents: 1, + interior: X2( + Parachain(2000), + Junction::AccountId32 { network: None, id: [67u8; 32] } + ), + }), + OperatingMode::Normal, + ), + BadOrigin, + ); + + // local account location not allowed + assert_noop!( + EthereumSystem::create_channel( + make_xcm_origin(MultiLocation { + parents: 0, + interior: X1(Junction::AccountId32 { network: None, id: [67u8; 32] }), + }), + OperatingMode::Normal, + ), + BadOrigin, + ); + + // Signed origin not allowed + assert_noop!( + EthereumSystem::create_channel( + RuntimeOrigin::signed([14; 32].into()), + OperatingMode::Normal, + ), + BadOrigin + ); + + // None origin not allowed + assert_noop!(EthereumSystem::create_agent(RuntimeOrigin::none()), BadOrigin); + }); +} + +#[test] +fn update_channel() { + new_test_ext(true).execute_with(|| { + let origin_para_id = 2000; + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let sovereign_account = sibling_sovereign_account::(origin_para_id.into()); + let origin = make_xcm_origin(origin_location); + + // First create the channel + let _ = Balances::mint_into(&sovereign_account, 10000); + assert_ok!(EthereumSystem::create_agent(origin.clone())); + assert_ok!(EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal)); + + // Now try to update it + assert_ok!(EthereumSystem::update_channel(origin, OperatingMode::Normal)); + + System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::UpdateChannel { + channel_id: ParaId::from(2000).into(), + mode: OperatingMode::Normal, + })); + }); +} + +#[test] +fn update_channel_bad_origin() { + new_test_ext(true).execute_with(|| { + let mode = OperatingMode::Normal; + + // relay chain location not allowed + assert_noop!( + EthereumSystem::update_channel( + make_xcm_origin(MultiLocation { parents: 1, interior: Here }), + mode, + ), + BadOrigin, + ); + + // child of sibling location not allowed + assert_noop!( + EthereumSystem::update_channel( + make_xcm_origin(MultiLocation { + parents: 1, + interior: X2( + Parachain(2000), + Junction::AccountId32 { network: None, id: [67u8; 32] } + ), + }), + mode, + ), + BadOrigin, + ); + + // local account location not allowed + assert_noop!( + EthereumSystem::update_channel( + make_xcm_origin(MultiLocation { + parents: 0, + interior: X1(Junction::AccountId32 { network: None, id: [67u8; 32] }), + }), + mode, + ), + BadOrigin, + ); + + // Signed origin not allowed + assert_noop!( + EthereumSystem::update_channel(RuntimeOrigin::signed([14; 32].into()), mode), + BadOrigin + ); + + // None origin not allowed + assert_noop!(EthereumSystem::update_channel(RuntimeOrigin::none(), mode), BadOrigin); + }); +} + +#[test] +fn update_channel_fails_not_exist() { + new_test_ext(true).execute_with(|| { + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(2000)) }; + let origin = make_xcm_origin(origin_location); + + // Now try to update it + assert_noop!( + EthereumSystem::update_channel(origin, OperatingMode::Normal), + Error::::NoChannel + ); + }); +} + +#[test] +fn force_update_channel() { + new_test_ext(true).execute_with(|| { + let origin_para_id = 2000; + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let sovereign_account = sibling_sovereign_account::(origin_para_id.into()); + let origin = make_xcm_origin(origin_location); + + let channel_id: ChannelId = ParaId::from(origin_para_id).into(); + + // First create the channel + let _ = Balances::mint_into(&sovereign_account, 10000); + assert_ok!(EthereumSystem::create_agent(origin.clone())); + assert_ok!(EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal)); + + // Now try to force update it + let force_origin = RuntimeOrigin::root(); + assert_ok!(EthereumSystem::force_update_channel( + force_origin, + channel_id, + OperatingMode::Normal, + )); + + System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::UpdateChannel { + channel_id: ParaId::from(2000).into(), + mode: OperatingMode::Normal, + })); + }); +} + +#[test] +fn force_update_channel_bad_origin() { + new_test_ext(true).execute_with(|| { + let mode = OperatingMode::Normal; + + // signed origin not allowed + assert_noop!( + EthereumSystem::force_update_channel( + RuntimeOrigin::signed([14; 32].into()), + ParaId::from(1000).into(), + mode, + ), + BadOrigin, + ); + }); +} + +#[test] +fn transfer_native_from_agent() { + new_test_ext(true).execute_with(|| { + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(2000)) }; + let origin = make_xcm_origin(origin_location); + let recipient: H160 = [27u8; 20].into(); + let amount = 103435; + + // First create the agent and channel + assert_ok!(EthereumSystem::create_agent(origin.clone())); + assert_ok!(EthereumSystem::create_channel(origin, OperatingMode::Normal)); + + let origin = make_xcm_origin(origin_location); + assert_ok!(EthereumSystem::transfer_native_from_agent(origin, recipient, amount),); + + System::assert_last_event(RuntimeEvent::EthereumSystem( + crate::Event::TransferNativeFromAgent { + agent_id: make_agent_id(origin_location), + recipient, + amount, + }, + )); + }); +} + +#[test] +fn force_transfer_native_from_agent() { + new_test_ext(true).execute_with(|| { + let origin = RuntimeOrigin::root(); + let location = MultiLocation { parents: 1, interior: X1(Parachain(2000)) }; + let versioned_location: Box = Box::new(location.into()); + let recipient: H160 = [27u8; 20].into(); + let amount = 103435; + + // First create the agent + Agents::::insert(make_agent_id(location), ()); + + assert_ok!(EthereumSystem::force_transfer_native_from_agent( + origin, + versioned_location, + recipient, + amount + ),); + + System::assert_last_event(RuntimeEvent::EthereumSystem( + crate::Event::TransferNativeFromAgent { + agent_id: make_agent_id(location), + recipient, + amount, + }, + )); + }); +} + +#[test] +fn force_transfer_native_from_agent_bad_origin() { + new_test_ext(true).execute_with(|| { + let recipient: H160 = [27u8; 20].into(); + let amount = 103435; + + // signed origin not allowed + assert_noop!( + EthereumSystem::force_transfer_native_from_agent( + RuntimeOrigin::signed([14; 32].into()), + Box::new( + MultiLocation { + parents: 1, + interior: X2( + Parachain(2000), + Junction::AccountId32 { network: None, id: [67u8; 32] } + ), + } + .into() + ), + recipient, + amount, + ), + BadOrigin, + ); + }); +} + +// NOTE: The following tests are not actually tests and are more about obtaining location +// conversions for devops purposes. They need to be removed here and incorporated into a command +// line utility. + +#[ignore] +#[test] +fn check_sibling_sovereign_account() { + new_test_ext(true).execute_with(|| { + let para_id = 1001; + let sovereign_account = sibling_sovereign_account::(para_id.into()); + let sovereign_account_raw = sibling_sovereign_account_raw(para_id.into()); + println!( + "Sovereign account for parachain {}: {:#?}", + para_id, + hex::encode(sovereign_account.clone()) + ); + assert_eq!(sovereign_account, sovereign_account_raw.into()); + }); +} + +#[test] +fn charge_fee_for_create_agent() { + new_test_ext(true).execute_with(|| { + let para_id: u32 = TestParaId::get(); + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(para_id)) }; + let origin = make_xcm_origin(origin_location); + let sovereign_account = sibling_sovereign_account::(para_id.into()); + let (_, agent_id) = ensure_sibling::(&origin_location).unwrap(); + + let initial_sovereign_balance = Balances::balance(&sovereign_account); + assert_ok!(EthereumSystem::create_agent(origin.clone())); + let fee_charged = initial_sovereign_balance - Balances::balance(&sovereign_account); + + assert_ok!(EthereumSystem::create_channel(origin, OperatingMode::Normal)); + + // assert sovereign_balance decreased by (fee.base_fee + fee.delivery_fee) + let message = Message { + id: None, + channel_id: ParaId::from(para_id).into(), + command: Command::CreateAgent { agent_id }, + }; + let (_, fee) = OutboundQueue::validate(&message).unwrap(); + assert_eq!(fee.local + fee.remote, fee_charged); + + // and treasury_balance increased + let treasury_balance = Balances::balance(&TreasuryAccount::get()); + assert!(treasury_balance > InitialFunding::get()); + + let final_sovereign_balance = Balances::balance(&sovereign_account); + // (sovereign_balance + treasury_balance) keeps the same + assert_eq!(final_sovereign_balance + treasury_balance, { InitialFunding::get() * 2 }); + }); +} + +#[test] +fn charge_fee_for_transfer_native_from_agent() { + new_test_ext(true).execute_with(|| { + let para_id: u32 = TestParaId::get(); + let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(para_id)) }; + let recipient: H160 = [27u8; 20].into(); + let amount = 103435; + let origin = make_xcm_origin(origin_location); + let (_, agent_id) = ensure_sibling::(&origin_location).unwrap(); + + let sovereign_account = sibling_sovereign_account::(para_id.into()); + + // create_agent & create_channel first + assert_ok!(EthereumSystem::create_agent(origin.clone())); + assert_ok!(EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal)); + + // assert sovereign_balance decreased by only the base_fee + let sovereign_balance_before = Balances::balance(&sovereign_account); + assert_ok!(EthereumSystem::transfer_native_from_agent(origin.clone(), recipient, amount)); + let message = Message { + id: None, + channel_id: ParaId::from(para_id).into(), + command: Command::TransferNativeFromAgent { agent_id, recipient, amount }, + }; + let (_, fee) = OutboundQueue::validate(&message).unwrap(); + let sovereign_balance_after = Balances::balance(&sovereign_account); + assert_eq!(sovereign_balance_after + fee.local, sovereign_balance_before); + }); +} + +#[test] +fn charge_fee_for_upgrade() { + new_test_ext(true).execute_with(|| { + let para_id: u32 = TestParaId::get(); + let origin = RuntimeOrigin::root(); + let address: H160 = Default::default(); + let code_hash: H256 = Default::default(); + let initializer: Option = + Some(Initializer { params: [0; 256].into(), maximum_required_gas: 10000 }); + assert_ok!(EthereumSystem::upgrade(origin, address, code_hash, initializer.clone())); + + // assert sovereign_balance does not change as we do not charge for sudo operations + let sovereign_account = sibling_sovereign_account::(para_id.into()); + let sovereign_balance = Balances::balance(&sovereign_account); + assert_eq!(sovereign_balance, InitialFunding::get()); + }); +} + +#[test] +fn genesis_build_initializes_correctly() { + new_test_ext(true).execute_with(|| { + assert!(EthereumSystem::is_initialized(), "Ethereum uninitialized."); + }); +} + +#[test] +fn no_genesis_build_is_uninitialized() { + new_test_ext(false).execute_with(|| { + assert!(!EthereumSystem::is_initialized(), "Ethereum initialized."); + }); +} diff --git a/snowbridge/parachain/pallets/system/src/weights.rs b/snowbridge/parachain/pallets/system/src/weights.rs new file mode 100644 index 00000000000..6e532a0d8a8 --- /dev/null +++ b/snowbridge/parachain/pallets/system/src/weights.rs @@ -0,0 +1,249 @@ + +//! Autogenerated weights for `snowbridge_system` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-10-09, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `crake.local`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: `1024` + +// Executed Command: +// target/release/polkadot-parachain +// benchmark +// pallet +// --chain +// bridge-hub-rococo-dev +// --pallet=snowbridge_system +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --template +// ../parachain/templates/module-weight-template.hbs +// --output +// ../parachain/pallets/control/src/weights.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use core::marker::PhantomData; + +/// Weight functions needed for `snowbridge_system`. +pub trait WeightInfo { + fn upgrade() -> Weight; + fn create_agent() -> Weight; + fn create_channel() -> Weight; + fn update_channel() -> Weight; + fn force_update_channel() -> Weight; + fn set_operating_mode() -> Weight; + fn transfer_native_from_agent() -> Weight; + fn force_transfer_native_from_agent() -> Weight; + fn set_token_transfer_fees() -> Weight; + fn set_pricing_parameters() -> Weight; +} + +// For backwards compatibility and tests. +impl WeightInfo for () { + /// Storage: ParachainInfo ParachainId (r:1 w:0) + /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) + /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: MessageQueue BookStateFor (r:1 w:1) + /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + /// Storage: MessageQueue ServiceHead (r:1 w:1) + /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + /// Storage: MessageQueue Pages (r:0 w:1) + /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) + fn upgrade() -> Weight { + // Proof Size summary in bytes: + // Measured: `80` + // Estimated: `3517` + // Minimum execution time: 44_000_000 picoseconds. + Weight::from_parts(44_000_000, 3517) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: EthereumSystem Agents (r:1 w:1) + /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: ParachainInfo ParachainId (r:1 w:0) + /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) + /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: MessageQueue BookStateFor (r:1 w:1) + /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + /// Storage: MessageQueue ServiceHead (r:1 w:1) + /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + /// Storage: MessageQueue Pages (r:0 w:1) + /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) + fn create_agent() -> Weight { + // Proof Size summary in bytes: + // Measured: `187` + // Estimated: `6196` + // Minimum execution time: 85_000_000 picoseconds. + Weight::from_parts(85_000_000, 6196) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) + } + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: EthereumSystem Agents (r:1 w:0) + /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) + /// Storage: EthereumSystem Channels (r:1 w:1) + /// Proof: EthereumSystem Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) + /// Storage: ParachainInfo ParachainId (r:1 w:0) + /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) + /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: MessageQueue BookStateFor (r:1 w:1) + /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + /// Storage: MessageQueue Pages (r:1 w:1) + /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) + fn create_channel() -> Weight { + // Proof Size summary in bytes: + // Measured: `602` + // Estimated: `69050` + // Minimum execution time: 83_000_000 picoseconds. + Weight::from_parts(83_000_000, 69050) + .saturating_add(RocksDbWeight::get().reads(8_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) + } + /// Storage: EthereumSystem Channels (r:1 w:0) + /// Proof: EthereumSystem Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) + /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) + /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: MessageQueue BookStateFor (r:2 w:2) + /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + /// Storage: MessageQueue ServiceHead (r:1 w:0) + /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + /// Storage: MessageQueue Pages (r:0 w:1) + /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) + fn update_channel() -> Weight { + // Proof Size summary in bytes: + // Measured: `256` + // Estimated: `6044` + // Minimum execution time: 40_000_000 picoseconds. + Weight::from_parts(40_000_000, 6044) + .saturating_add(RocksDbWeight::get().reads(5_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: EthereumSystem Channels (r:1 w:0) + /// Proof: EthereumSystem Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) + /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) + /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: MessageQueue BookStateFor (r:2 w:2) + /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + /// Storage: MessageQueue ServiceHead (r:1 w:0) + /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + /// Storage: MessageQueue Pages (r:0 w:1) + /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) + fn force_update_channel() -> Weight { + // Proof Size summary in bytes: + // Measured: `256` + // Estimated: `6044` + // Minimum execution time: 41_000_000 picoseconds. + Weight::from_parts(41_000_000, 6044) + .saturating_add(RocksDbWeight::get().reads(5_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: ParachainInfo ParachainId (r:1 w:0) + /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) + /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: MessageQueue BookStateFor (r:1 w:1) + /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + /// Storage: MessageQueue ServiceHead (r:1 w:1) + /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + /// Storage: MessageQueue Pages (r:0 w:1) + /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) + fn set_operating_mode() -> Weight { + // Proof Size summary in bytes: + // Measured: `80` + // Estimated: `3517` + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(31_000_000, 3517) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: EthereumSystem Agents (r:1 w:0) + /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) + /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) + /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: MessageQueue BookStateFor (r:2 w:2) + /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + /// Storage: MessageQueue ServiceHead (r:1 w:0) + /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + /// Storage: MessageQueue Pages (r:0 w:1) + /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) + fn transfer_native_from_agent() -> Weight { + // Proof Size summary in bytes: + // Measured: `252` + // Estimated: `6044` + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(45_000_000, 6044) + .saturating_add(RocksDbWeight::get().reads(5_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: EthereumSystem Agents (r:1 w:0) + /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) + /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) + /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: MessageQueue BookStateFor (r:2 w:2) + /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + /// Storage: MessageQueue ServiceHead (r:1 w:0) + /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + /// Storage: MessageQueue Pages (r:0 w:1) + /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) + fn force_transfer_native_from_agent() -> Weight { + // Proof Size summary in bytes: + // Measured: `252` + // Estimated: `6044` + // Minimum execution time: 42_000_000 picoseconds. + Weight::from_parts(42_000_000, 6044) + .saturating_add(RocksDbWeight::get().reads(5_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + + /// Storage: ParachainInfo ParachainId (r:1 w:0) + /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) + /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: MessageQueue BookStateFor (r:1 w:1) + /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + /// Storage: MessageQueue ServiceHead (r:1 w:1) + /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + /// Storage: MessageQueue Pages (r:0 w:1) + /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) + fn set_token_transfer_fees() -> Weight { + // Proof Size summary in bytes: + // Measured: `80` + // Estimated: `3517` + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(42_000_000, 3517) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + + /// Storage: ParachainInfo ParachainId (r:1 w:0) + /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) + /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: MessageQueue BookStateFor (r:1 w:1) + /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + /// Storage: MessageQueue ServiceHead (r:1 w:1) + /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + /// Storage: MessageQueue Pages (r:0 w:1) + /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) + fn set_pricing_parameters() -> Weight { + // Proof Size summary in bytes: + // Measured: `80` + // Estimated: `3517` + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(42_000_000, 3517) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } +} diff --git a/snowbridge/parachain/primitives/beacon/Cargo.toml b/snowbridge/parachain/primitives/beacon/Cargo.toml new file mode 100644 index 00000000000..e81e0208ba1 --- /dev/null +++ b/snowbridge/parachain/primitives/beacon/Cargo.toml @@ -0,0 +1,52 @@ +[package] +name = "snowbridge-beacon-primitives" +description = "Snowbridge Beacon Primitives" +version = "0.0.1" +authors = ["Snowfork "] +edition = "2021" +license = "Apache-2.0" + +[dependencies] +serde = { version = "1.0.188", optional = true, features = ["derive"] } +hex = { version = "0.4", default-features = false } +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 = { path = "../../../../../substrate/frame/support", default-features = false } +frame-system = { path = "../../../../../substrate/frame/system", default-features = false } +sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } +sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } +sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } +sp-io = { path = "../../../../../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 } +byte-slice-cast = { version = "1.2.1", default-features = false } + +snowbridge-ethereum = { path = "../../primitives/ethereum", default-features = false } +static_assertions = { version = "1.1.0" } +milagro_bls = { git = "https://github.com/snowfork/milagro_bls", default-features = false, rev = "a6d66e4eb89015e352fb1c9f7b661ecdbb5b2176" } + +[dev-dependencies] +hex-literal = { version = "0.4.1" } + +[features] +default = ["std"] +std = [ + "byte-slice-cast/std", + "codec/std", + "frame-support/std", + "frame-system/std", + "hex/std", + "milagro_bls/std", + "rlp/std", + "scale-info/std", + "serde", + "snowbridge-ethereum/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", + "ssz_rs/std", +] diff --git a/snowbridge/parachain/primitives/beacon/src/bits.rs b/snowbridge/parachain/primitives/beacon/src/bits.rs new file mode 100644 index 00000000000..72b7135ee29 --- /dev/null +++ b/snowbridge/parachain/primitives/beacon/src/bits.rs @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use sp_std::{convert::TryInto, prelude::*}; +use ssz_rs::{Bitvector, Deserialize}; + +pub fn decompress_sync_committee_bits< + const SYNC_COMMITTEE_SIZE: usize, + const SYNC_COMMITTEE_BITS_SIZE: usize, +>( + input: [u8; SYNC_COMMITTEE_BITS_SIZE], +) -> [u8; SYNC_COMMITTEE_SIZE] { + Bitvector::<{ SYNC_COMMITTEE_SIZE }>::deserialize(&input) + .expect("checked statically; qed") + .iter() + .map(|bit| u8::from(bit == true)) + .collect::>() + .try_into() + .expect("checked statically; qed") +} diff --git a/snowbridge/parachain/primitives/beacon/src/bls.rs b/snowbridge/parachain/primitives/beacon/src/bls.rs new file mode 100644 index 00000000000..589b72e6734 --- /dev/null +++ b/snowbridge/parachain/primitives/beacon/src/bls.rs @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use crate::{PublicKey, Signature}; +use codec::{Decode, Encode}; +use frame_support::{ensure, PalletError}; +pub use milagro_bls::{ + AggregatePublicKey, AggregateSignature, PublicKey as PublicKeyPrepared, + Signature as SignaturePrepared, +}; +use scale_info::TypeInfo; +use sp_core::H256; +use sp_runtime::RuntimeDebug; +use sp_std::prelude::*; + +#[derive(Copy, Clone, Encode, Decode, Eq, PartialEq, TypeInfo, RuntimeDebug, PalletError)] +pub enum BlsError { + InvalidSignature, + InvalidPublicKey, + InvalidAggregatePublicKeys, + SignatureVerificationFailed, +} + +/// fast_aggregate_verify optimized with aggregate key subtracting absent ones. +pub fn fast_aggregate_verify( + aggregate_pubkey: &PublicKeyPrepared, + absent_pubkeys: &Vec, + message: H256, + signature: &Signature, +) -> Result<(), BlsError> { + let agg_sig = prepare_aggregate_signature(signature)?; + let agg_key = prepare_aggregate_pubkey_from_absent(aggregate_pubkey, absent_pubkeys)?; + fast_aggregate_verify_pre_aggregated(agg_sig, agg_key, message) +} + +/// Decompress one public key into a point in G1. +pub fn prepare_milagro_pubkey(pubkey: &PublicKey) -> Result { + PublicKeyPrepared::from_bytes_unchecked(&pubkey.0).map_err(|_| BlsError::InvalidPublicKey) +} + +/// Prepare for G1 public keys. +pub fn prepare_g1_pubkeys(pubkeys: &[PublicKey]) -> Result, BlsError> { + pubkeys + .iter() + // Deserialize one public key from compressed bytes + .map(prepare_milagro_pubkey) + .collect::, BlsError>>() +} + +/// Prepare for G1 AggregatePublicKey. +pub fn prepare_aggregate_pubkey( + pubkeys: &[PublicKeyPrepared], +) -> Result { + AggregatePublicKey::into_aggregate(pubkeys).map_err(|_| BlsError::InvalidPublicKey) +} + +/// Prepare for G1 AggregatePublicKey. +pub fn prepare_aggregate_pubkey_from_absent( + aggregate_key: &PublicKeyPrepared, + absent_pubkeys: &Vec, +) -> Result { + let mut aggregate_pubkey = AggregatePublicKey::from_public_key(aggregate_key); + if !absent_pubkeys.is_empty() { + let absent_aggregate_key = prepare_aggregate_pubkey(absent_pubkeys)?; + aggregate_pubkey.point.sub(&absent_aggregate_key.point); + } + Ok(AggregatePublicKey { point: aggregate_pubkey.point }) +} + +/// Prepare for G2 AggregateSignature, normally more expensive than G1 operation. +pub fn prepare_aggregate_signature(signature: &Signature) -> Result { + Ok(AggregateSignature::from_signature( + &SignaturePrepared::from_bytes(&signature.0).map_err(|_| BlsError::InvalidSignature)?, + )) +} + +/// fast_aggregate_verify_pre_aggregated which is the most expensive call in beacon light client. +pub fn fast_aggregate_verify_pre_aggregated( + agg_sig: AggregateSignature, + aggregate_key: AggregatePublicKey, + message: H256, +) -> Result<(), BlsError> { + ensure!( + agg_sig.fast_aggregate_verify_pre_aggregated(&message[..], &aggregate_key), + BlsError::SignatureVerificationFailed + ); + Ok(()) +} diff --git a/snowbridge/parachain/primitives/beacon/src/config.rs b/snowbridge/parachain/primitives/beacon/src/config.rs new file mode 100644 index 00000000000..aa5fda706f9 --- /dev/null +++ b/snowbridge/parachain/primitives/beacon/src/config.rs @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +pub const MAX_PROOF_SIZE: u32 = 20; + +pub const FEE_RECIPIENT_SIZE: usize = 20; +pub const EXTRA_DATA_SIZE: usize = 32; +pub const LOGS_BLOOM_SIZE: usize = 256; + +pub const PUBKEY_SIZE: usize = 48; +pub const SIGNATURE_SIZE: usize = 96; diff --git a/snowbridge/parachain/primitives/beacon/src/lib.rs b/snowbridge/parachain/primitives/beacon/src/lib.rs new file mode 100644 index 00000000000..3527e1ff0d1 --- /dev/null +++ b/snowbridge/parachain/primitives/beacon/src/lib.rs @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +#![cfg_attr(not(feature = "std"), no_std)] + +pub mod bits; +pub mod bls; +pub mod config; +pub mod merkle_proof; +pub mod receipt; +pub mod ssz; +pub mod types; +pub mod updates; + +#[cfg(feature = "std")] +mod serde_utils; + +pub use types::{ + BeaconHeader, CompactBeaconState, CompactExecutionHeader, ExecutionHeaderState, + ExecutionPayloadHeader, FinalizedHeaderState, Fork, ForkData, ForkVersion, ForkVersions, Mode, + PublicKey, Signature, SigningData, SyncAggregate, SyncCommittee, SyncCommitteePrepared, +}; +pub use updates::{CheckpointUpdate, ExecutionHeaderUpdate, NextSyncCommitteeUpdate, Update}; + +pub use bits::decompress_sync_committee_bits; +pub use bls::{ + fast_aggregate_verify, prepare_aggregate_pubkey, prepare_aggregate_pubkey_from_absent, + prepare_aggregate_signature, prepare_g1_pubkeys, AggregatePublicKey, AggregateSignature, + BlsError, PublicKeyPrepared, SignaturePrepared, +}; +pub use merkle_proof::verify_merkle_branch; +pub use receipt::verify_receipt_proof; diff --git a/snowbridge/parachain/primitives/beacon/src/merkle_proof.rs b/snowbridge/parachain/primitives/beacon/src/merkle_proof.rs new file mode 100644 index 00000000000..a6ee6e9452c --- /dev/null +++ b/snowbridge/parachain/primitives/beacon/src/merkle_proof.rs @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use sp_core::H256; +use sp_io::hashing::sha2_256; + +/// Specified by +/// with improvements from +pub fn verify_merkle_branch( + leaf: H256, + branch: &[H256], + index: usize, + depth: usize, + root: H256, +) -> bool { + // verify the proof length + if branch.len() != depth { + return false + } + // verify the computed merkle root + root == compute_merkle_root(leaf, branch, index) +} + +fn compute_merkle_root(leaf: H256, proof: &[H256], index: usize) -> H256 { + let mut value: [u8; 32] = leaf.into(); + for (i, node) in proof.iter().enumerate() { + let mut data = [0u8; 64]; + if generalized_index_bit(index, i) { + // right node + data[0..32].copy_from_slice(node.as_bytes()); + data[32..64].copy_from_slice(&value); + value = sha2_256(&data); + } else { + // left node + data[0..32].copy_from_slice(&value); + data[32..64].copy_from_slice(node.as_bytes()); + value = sha2_256(&data); + } + } + value.into() +} + +/// Spec: +fn generalized_index_bit(index: usize, position: usize) -> bool { + index & (1 << position) > 0 +} + +/// Spec: +pub const fn subtree_index(generalized_index: usize) -> usize { + generalized_index % (1 << generalized_index_length(generalized_index)) +} + +/// Spec: +pub const fn generalized_index_length(generalized_index: usize) -> usize { + match generalized_index.checked_ilog2() { + Some(v) => v as usize, + None => panic!("checked statically; qed"), + } +} diff --git a/snowbridge/parachain/primitives/beacon/src/receipt.rs b/snowbridge/parachain/primitives/beacon/src/receipt.rs new file mode 100644 index 00000000000..0588f3f73f7 --- /dev/null +++ b/snowbridge/parachain/primitives/beacon/src/receipt.rs @@ -0,0 +1,96 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use sp_core::H256; +use sp_io::hashing::keccak_256; +use sp_std::prelude::*; + +use snowbridge_ethereum::{mpt, Receipt}; + +pub fn verify_receipt_proof( + receipts_root: H256, + proof: &[Vec], +) -> Option> { + match apply_merkle_proof(proof) { + Some((root, data)) if root == receipts_root => Some(rlp::decode(&data)), + Some((_, _)) => None, + None => None, + } +} + +fn apply_merkle_proof(proof: &[Vec]) -> Option<(H256, Vec)> { + let mut iter = proof.iter().rev(); + let first_bytes = match iter.next() { + Some(b) => b, + None => return None, + }; + let item_to_prove: mpt::ShortNode = rlp::decode(first_bytes).ok()?; + + let final_hash: Option<[u8; 32]> = iter.try_fold(keccak_256(first_bytes), |acc, x| { + let node: Box = x.as_slice().try_into().ok()?; + if (*node).contains_hash(acc.into()) { + return Some(keccak_256(x)) + } + None + }); + + final_hash.map(|hash| (hash.into(), item_to_prove.value)) +} + +#[cfg(test)] +mod tests { + use super::*; + use hex_literal::hex; + + #[test] + fn test_verify_receipt_proof() { + let root: H256 = + hex!("fd5e397a84884641f53c496804f24b5276cbb8c5c9cfc2342246be8e3ce5ad02").into(); + + // Valid proof + let proof_receipt5 = vec!( + hex!("f90131a0b5ba404eb5a6a88e56579f4d37ef9813b5ad7f86f0823ff3b407ac5a6bb465eca0398ead2655e78e03c127ce22c5830e90f18b1601ec055f938336c084feb915a9a026d322c26e46c50942c1aabde50e36df5cde572aed650ce73ea3182c6e90a02ca00600a356135f4db1db0d9842264cdff2652676f881669e91e316c0b6dd783011a0837f1deb4075336da320388c1edfffc56c448a43f4a5ba031300d32a7b509fc5a01c3ac82fd65b4aba7f9afaf604d9c82ec7e2deb573a091ae235751bc5c0c288da05d454159d9071b0f68b6e0503d290f23ac7602c1db0c569dee4605d8f5298f09a00bbed10350ec954448df795f6fd46e3faefc800ede061b3840eedc6e2b07a74da0acb02d26a3650f2064c14a435fdf1f668d8655daf455ebdf671713a7c089b3898080808080808080").to_vec(), + hex!("f901f180a00046a08d4f0bdbdc6b31903086ce323182bce6725e7d9415f7ff91ee8f4820bda0e7cd26ad5f3d2771e4b5ab788e268a14a10209f94ee918eb6c829d21d3d11c1da00d4a56d9e9a6751874fd86c7e3cb1c6ad5a848da62751325f478978a00ea966ea064b81920c8f04a8a1e21f53a8280e739fbb7b00b2ab92493ca3f610b70e8ac85a0b1040ed4c55a73178b76abb16f946ce5bebd6b93ab873c83327df54047d12c27a0de6485e9ac58dc6e2b04b4bb38f562684f0b1a2ee586cc11079e7d9a9dc40b32a0d394f4d3532c3124a65fa36e69147e04fd20453a72ee9c50660f17e13ce9df48a066501003fc3e3478efd2803cd0eded6bbe9243ca01ba754d6327071ddbcbc649a0b2684e518f325fee39fc8ea81b68f3f5c785be00d087f3bed8857ae2ee8da26ea071060a5c52042e8d7ce21092f8ecf06053beb9a0b773a6f91a30c4220aa276b2a0fc22436632574ccf6043d0986dede27ea94c9ca9a3bb5ec03ce776a4ddef24a9a05a8a1d6698c4e7d8cc3a2506cb9b12ea9a079c9c7099bc919dc804033cc556e4a0170c468b0716fd36d161f0bf05875f15756a2976de92f9efe7716320509d79c9a0182f909a90cab169f3efb62387f9cccdd61440acc4deec42f68a4f7ca58075c7a055cf0e9202ac75689b76318f1171f3a44465eddc06aae0713bfb6b34fdd27b7980").to_vec(), + hex!("f904de20b904daf904d701830652f0b9010004200000000000000000000080020000000000010000000000010000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000000000008000000220000000000400010000000000000000000000000000000000000000000000000000000000000040000000010000100000000000800000000004000000000000000000000000000080000004000000000020000000000020000000000000000000000000000000000000000000004000000000002000000000100000000000000000000000000001000000002000020000010200000000000010000000000000000000000000000000000000010000000f903ccf89b9421130f34829b4c343142047a28ce96ec07814b15f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa00000000000000000000000007d843005c7433c16b27ff939cb37471541561ebda0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a000000000000000000000000000000000000000000000000000000005d09b7380f89b9421130f34829b4c343142047a28ce96ec07814b15f863a08c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a00000000000000000000000007d843005c7433c16b27ff939cb37471541561ebda00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da0ffffffffffffffffffffffffffffffffffffffffffffffffffffffcc840c6920f89b94c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da000000000000000000000000000000000000000000000000003e973b5a5d1078ef87994e9c1281aae66801fa35ec404d5f2aea393ff6988e1a01c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1b840000000000000000000000000000000000000000000000000000001f1420ad1d40000000000000000000000000000000000000000000000014ad400879d159a38f8fc94e9c1281aae66801fa35ec404d5f2aea393ff6988f863a0d78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488db88000000000000000000000000000000000000000000000000000000005d415f3320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e973b5a5d1078ef87a94c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f842a07fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da000000000000000000000000000000000000000000000000003e973b5a5d1078e").to_vec(), + ); + assert!(verify_receipt_proof(root, &proof_receipt5).is_some()); + + // Various invalid proofs + let proof_empty: Vec> = vec![]; + let proof_missing_full_node = vec![proof_receipt5[0].clone(), proof_receipt5[2].clone()]; + let proof_missing_short_node1 = vec![proof_receipt5[0].clone(), proof_receipt5[1].clone()]; + let proof_missing_short_node2 = vec![proof_receipt5[0].clone()]; + let proof_invalid_encoding = vec![proof_receipt5[2][2..].to_vec()]; + let proof_no_full_node = vec![proof_receipt5[2].clone(), proof_receipt5[2].clone()]; + assert!(verify_receipt_proof(root, &proof_empty).is_none()); + assert!(verify_receipt_proof(root, &proof_missing_full_node).is_none()); + + assert_eq!( + verify_receipt_proof(root, &proof_missing_short_node1), + Some(Err(rlp::DecoderError::Custom("Unsupported receipt type"))) + ); + + assert_eq!( + verify_receipt_proof(root, &proof_missing_short_node2), + Some(Err(rlp::DecoderError::Custom("Unsupported receipt type"))) + ); + + assert!(verify_receipt_proof(root, &proof_invalid_encoding).is_none()); + assert!(verify_receipt_proof(root, &proof_no_full_node).is_none()); + } + + #[test] + fn test_verify_receipt_proof_with_intermediate_short_node() { + let root: H256 = + hex!("d128e3a57142d2bf15bc0cbcac7ad54f40750d571b5c3097e425882c10c9ba66").into(); + + let proof_receipt263 = vec![ + hex!("f90131a00d3cb8d3f57ac1c0e12918a2ebe0cafed8c273577b9dd73e7ed1079b403ef494a0678b9835b834f8a287c0dd33a8fca9146e456ca688555ed4ec1361a2180b778da0fe42da181a46677a043b3d9d4b8bb05a6a17b7b5c010c17e7c1d31cfb7c4f911a0c89f0e2c53241cdb578e1f2b4caf6ba36e00500bdc57fecd66b84a6a58394c19a086c3c1fae5a0575940b5d38e111c469d07883106c26856f3ef608469a2081f13a06c5992ff00aab6226a70a032fd2f571ba22f797321f45e2daa73020d638d21b0a050861e9503ef68728f6c90a44f7fe1bceb2a9bdab6957bbe7136166bd849561ea006aa6eaca8a07e57176e9aa41e6a09edfb7678d1a112404e0ec779d7e567e82ea0bb0b430d303ba21b0af11c487b8a218bd75db54c98940b3f11bad8ff47cad3ef8080808080808080").to_vec(), + hex!("f871a0246de222036ee6a03329b0105da0a6b3f916fc95a9ed5a403a581a0c4d74242ca0ac108a49a88b57a05ac34a108b39f1e45f6f167f2b9fbc8d52fb58e2e5a6af1ea0fcfe07ac2ccd3c28b6eab68d1bce112f6f6dbd9023e4ec3c05b96615aa803d798080808080808080808080808080").to_vec(), + hex!("e4820001a04fff54398cad4d05ea6abfd8b0f3b4fe14c04d7ff5f5211c5b927d9cf72ac1d8").to_vec(), + hex!("f851a096d010643ca2d47412ca66898286b5f2412963b9ec051b33e570d575914c9c5ca028cd24c652989542fe89479ec6388eac4592432242af5ba97563b3ac7c71c019808080808080808080808080808080").to_vec(), + hex!("f90211a0bb35a84c5b1dcb78ec9d32614912c696e62df77bebf9ab326ee55b5d3acdde46a01084b30dac8df0accfcd0fd6330b7f6fc72a4651246d0694be9162151686a620a03eed50afdce7909d784c6157c445a444c806b5f23d31f3b63786f600c84a95b2a0af5232f1df6c6d41879804d081abe867002abe26ba3e5f8e0254a83a54769831a0607915fb13dd5da594256389a45007a67a7f7a86e95d38d8462792b6c98a722ea00e1260fda1730f2738c650ce2bfba83857bc10f8fb119ebc4fb39acba24e6fbaa0d11de17e417327457812675ca3b84ae8e1b64827abfe01420953697c8313d5b1a05fcaf2f7a88f76336a0c32ffc78acb87ae2005454bd25d658035331be3173b46a03f94f4952ab9e650f83cfd0e7f367b1bcc493aacf39a06f16c4a2e1b5605da48a0bdb4ec79785ca8ae22d60f1bbd42d707b4d7ec4aff231a3ebab755e315b35053a043a67c3f2bcef37c8f47a673adcb7061007a553696d1092408601c11b2e6846aa0c519d5af48cae87c7f4538845417c9735813bee892a6fe2dda79f5c414e8576aa0f7058256e09589501d7c231d739e61c84a850e139690989d24fda6058b432e98a081a52faab520978cb19ce14400dba0cd5bcdc4e5a3c0740678aa8f97ee0e5c56a0bcecc61cadeae52518e3b68a48af4b11603dfd9d99d99d7985efa6d2de44f904a02cba4accfc6f39bc5adb6d4440eb6358b4a5103ef93298e4e694f1f940f8b48280").to_vec(), + hex!("f901ae20b901aaf901a70183bb444eb9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000001000000000000000000000000000100000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000010000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000002000000000000000000081000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000f89df89b94dac17f958d2ee523a2206206994597c13d831ec7f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa00000000000000000000000002e514404ff6823f1b46a8318a709251db414e5e1a000000000000000000000000055021c55847c00d764357a352e5803237d328954a0000000000000000000000000000000000000000000000000000000000201c370").to_vec(), + ]; + assert!(verify_receipt_proof(root, &proof_receipt263).is_some()); + } +} diff --git a/snowbridge/parachain/primitives/beacon/src/serde_utils.rs b/snowbridge/parachain/primitives/beacon/src/serde_utils.rs new file mode 100644 index 00000000000..07f5cbe724e --- /dev/null +++ b/snowbridge/parachain/primitives/beacon/src/serde_utils.rs @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use sp_core::U256; + +use core::fmt::Formatter; +use serde::{Deserialize, Deserializer}; + +// helper to deserialize arbitrary arrays like [T; N] +pub mod arrays { + use std::{convert::TryInto, marker::PhantomData}; + + use serde::{ + de::{SeqAccess, Visitor}, + ser::SerializeTuple, + Deserialize, Deserializer, Serialize, Serializer, + }; + + pub fn serialize( + data: &[T; N], + ser: S, + ) -> Result { + let mut s = ser.serialize_tuple(N)?; + for item in data { + s.serialize_element(item)?; + } + s.end() + } + + struct ArrayVisitor(PhantomData); + + impl<'de, T, const N: usize> Visitor<'de> for ArrayVisitor + where + T: Deserialize<'de>, + { + type Value = [T; N]; + + fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + formatter.write_str(&format!("an array of length {}", N)) + } + + #[inline] + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + // can be optimized using MaybeUninit + let mut data = Vec::with_capacity(N); + for _ in 0..N { + match (seq.next_element())? { + Some(val) => data.push(val), + None => return Err(serde::de::Error::invalid_length(N, &self)), + } + } + match data.try_into() { + Ok(arr) => Ok(arr), + Err(_) => unreachable!(), + } + } + } + + pub fn deserialize<'de, D, T, const N: usize>(deserializer: D) -> Result<[T; N], D::Error> + where + D: Deserializer<'de>, + T: Deserialize<'de>, + { + deserializer.deserialize_tuple(N, ArrayVisitor::(PhantomData)) + } +} + +pub(crate) fn from_hex_to_bytes<'de, D>(deserializer: D) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + let s = String::deserialize(deserializer)?; + + let str_without_0x = match s.strip_prefix("0x") { + Some(val) => val, + None => &s, + }; + + let hex_bytes = match hex::decode(str_without_0x) { + Ok(bytes) => bytes, + Err(e) => return Err(serde::de::Error::custom(e.to_string())), + }; + + Ok(hex_bytes) +} + +pub(crate) fn from_int_to_u256<'de, D>(deserializer: D) -> Result +where + D: Deserializer<'de>, +{ + let number = u128::deserialize(deserializer)?; + + Ok(U256::from(number)) +} + +pub struct HexVisitor(); + +impl<'de, const LENGTH: usize> serde::de::Visitor<'de> for HexVisitor { + type Value = [u8; LENGTH]; + + fn expecting(&self, formatter: &mut Formatter) -> sp_std::fmt::Result { + formatter.write_str("a hex string with an '0x' prefix") + } + + fn visit_str(self, v: &str) -> Result + where + E: serde::de::Error, + { + let stripped = match v.strip_prefix("0x") { + Some(stripped) => stripped, + None => v, + }; + + let decoded = match hex::decode(stripped) { + Ok(decoded) => decoded, + Err(e) => return Err(serde::de::Error::custom(e.to_string())), + }; + if decoded.len() != LENGTH { + return Err(serde::de::Error::custom("publickey expected to be 48 characters")) + } + + let data: Self::Value = decoded + .try_into() + .map_err(|_e| serde::de::Error::custom("hex data has unexpected length"))?; + + Ok(data) + } +} diff --git a/snowbridge/parachain/primitives/beacon/src/ssz.rs b/snowbridge/parachain/primitives/beacon/src/ssz.rs new file mode 100644 index 00000000000..4f8b19ca889 --- /dev/null +++ b/snowbridge/parachain/primitives/beacon/src/ssz.rs @@ -0,0 +1,194 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use crate::{ + config::{EXTRA_DATA_SIZE, FEE_RECIPIENT_SIZE, LOGS_BLOOM_SIZE, PUBKEY_SIZE, SIGNATURE_SIZE}, + types::{ + BeaconHeader, ExecutionPayloadHeader, ForkData, SigningData, SyncAggregate, SyncCommittee, + }, +}; +use byte_slice_cast::AsByteSlice; +use sp_core::H256; +use sp_std::{vec, vec::Vec}; +use ssz_rs::{ + prelude::{List, Vector}, + Bitvector, Deserialize, DeserializeError, SimpleSerialize, SimpleSerializeError, Sized, U256, +}; +use ssz_rs_derive::SimpleSerialize as SimpleSerializeDerive; + +#[derive(Default, SimpleSerializeDerive, Clone, Debug)] +pub struct SSZBeaconBlockHeader { + pub slot: u64, + pub proposer_index: u64, + pub parent_root: [u8; 32], + pub state_root: [u8; 32], + pub body_root: [u8; 32], +} + +impl From for SSZBeaconBlockHeader { + fn from(beacon_header: BeaconHeader) -> Self { + SSZBeaconBlockHeader { + slot: beacon_header.slot, + proposer_index: beacon_header.proposer_index, + parent_root: beacon_header.parent_root.to_fixed_bytes(), + state_root: beacon_header.state_root.to_fixed_bytes(), + body_root: beacon_header.body_root.to_fixed_bytes(), + } + } +} + +#[derive(Default, SimpleSerializeDerive, Clone)] +pub struct SSZSyncCommittee { + pub pubkeys: Vector, COMMITTEE_SIZE>, + pub aggregate_pubkey: Vector, +} + +impl From> + for SSZSyncCommittee +{ + fn from(sync_committee: SyncCommittee) -> Self { + let mut pubkeys_vec = Vec::new(); + + for pubkey in sync_committee.pubkeys.iter() { + // The only thing that can go wrong in the conversion from vec to Vector (ssz type) is + // that the Vector size is 0, or that the given data to create the Vector from does not + // match the expected size N. Because these sizes are statically checked (i.e. + // PublicKey's size is 48, and const PUBKEY_SIZE is 48, it is impossible for "try_from" + // to return an error condition. + let conv_pubkey = Vector::::try_from(pubkey.0.to_vec()) + .expect("checked statically; qed"); + + pubkeys_vec.push(conv_pubkey); + } + + let pubkeys = Vector::, { COMMITTEE_SIZE }>::try_from(pubkeys_vec) + .expect("checked statically; qed"); + + let aggregate_pubkey = + Vector::::try_from(sync_committee.aggregate_pubkey.0.to_vec()) + .expect("checked statically; qed"); + + SSZSyncCommittee { pubkeys, aggregate_pubkey } + } +} + +#[derive(Default, Debug, SimpleSerializeDerive, Clone)] +pub struct SSZSyncAggregate { + pub sync_committee_bits: Bitvector, + pub sync_committee_signature: Vector, +} + +impl + From> for SSZSyncAggregate +{ + fn from(sync_aggregate: SyncAggregate) -> Self { + SSZSyncAggregate { + sync_committee_bits: Bitvector::::deserialize( + &sync_aggregate.sync_committee_bits, + ) + .expect("checked statically; qed"), + sync_committee_signature: Vector::::try_from( + sync_aggregate.sync_committee_signature.0.to_vec(), + ) + .expect("checked statically; qed"), + } + } +} + +#[derive(Default, SimpleSerializeDerive, Clone)] +pub struct SSZForkData { + pub current_version: [u8; 4], + pub genesis_validators_root: [u8; 32], +} + +impl From for SSZForkData { + fn from(fork_data: ForkData) -> Self { + SSZForkData { + current_version: fork_data.current_version, + genesis_validators_root: fork_data.genesis_validators_root, + } + } +} + +#[derive(Default, SimpleSerializeDerive, Clone)] +pub struct SSZSigningData { + pub object_root: [u8; 32], + pub domain: [u8; 32], +} + +impl From for SSZSigningData { + fn from(signing_data: SigningData) -> Self { + SSZSigningData { + object_root: signing_data.object_root.into(), + domain: signing_data.domain.into(), + } + } +} + +#[derive(Default, SimpleSerializeDerive, Clone, Debug)] +pub struct SSZExecutionPayloadHeader { + pub parent_hash: [u8; 32], + pub fee_recipient: Vector, + pub state_root: [u8; 32], + pub receipts_root: [u8; 32], + pub logs_bloom: Vector, + pub prev_randao: [u8; 32], + pub block_number: u64, + pub gas_limit: u64, + pub gas_used: u64, + pub timestamp: u64, + pub extra_data: List, + pub base_fee_per_gas: U256, + pub block_hash: [u8; 32], + pub transactions_root: [u8; 32], + pub withdrawals_root: [u8; 32], +} + +impl TryFrom for SSZExecutionPayloadHeader { + type Error = SimpleSerializeError; + + fn try_from(payload: ExecutionPayloadHeader) -> Result { + Ok(SSZExecutionPayloadHeader { + parent_hash: payload.parent_hash.to_fixed_bytes(), + fee_recipient: Vector::::try_from( + payload.fee_recipient.to_fixed_bytes().to_vec(), + ) + .expect("checked statically; qed"), + state_root: payload.state_root.to_fixed_bytes(), + receipts_root: payload.receipts_root.to_fixed_bytes(), + // Logs bloom bytes size is not constrained, so here we do need to check the try_from + // error + logs_bloom: Vector::::try_from(payload.logs_bloom) + .map_err(|(_, err)| err)?, + prev_randao: payload.prev_randao.to_fixed_bytes(), + block_number: payload.block_number, + gas_limit: payload.gas_limit, + gas_used: payload.gas_used, + timestamp: payload.timestamp, + // Extra data bytes size is not constrained, so here we do need to check the try_from + // error + extra_data: List::::try_from(payload.extra_data) + .map_err(|(_, err)| err)?, + base_fee_per_gas: U256::from_bytes_le( + payload + .base_fee_per_gas + .as_byte_slice() + .try_into() + .expect("checked in prep; qed"), + ), + block_hash: payload.block_hash.to_fixed_bytes(), + transactions_root: payload.transactions_root.to_fixed_bytes(), + withdrawals_root: payload.withdrawals_root.to_fixed_bytes(), + }) + } +} + +pub fn hash_tree_root(mut object: T) -> Result { + match object.hash_tree_root() { + Ok(node) => { + let fixed_bytes: [u8; 32] = + node.as_ref().try_into().expect("Node is a newtype over [u8; 32]; qed"); + Ok(fixed_bytes.into()) + }, + Err(err) => Err(err.into()), + } +} diff --git a/snowbridge/parachain/primitives/beacon/src/types.rs b/snowbridge/parachain/primitives/beacon/src/types.rs new file mode 100644 index 00000000000..f893551d9d1 --- /dev/null +++ b/snowbridge/parachain/primitives/beacon/src/types.rs @@ -0,0 +1,512 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use codec::{Decode, Encode, MaxEncodedLen}; +use frame_support::{CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound}; +use scale_info::TypeInfo; +use sp_core::{H160, H256, U256}; +use sp_runtime::RuntimeDebug; +use sp_std::{boxed::Box, prelude::*}; + +use crate::config::{PUBKEY_SIZE, SIGNATURE_SIZE}; + +#[cfg(feature = "std")] +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[cfg(feature = "std")] +use crate::serde_utils::HexVisitor; + +use crate::ssz::{ + hash_tree_root, SSZBeaconBlockHeader, SSZExecutionPayloadHeader, SSZForkData, SSZSigningData, + SSZSyncAggregate, SSZSyncCommittee, +}; +use ssz_rs::SimpleSerializeError; + +pub use crate::bits::decompress_sync_committee_bits; + +use crate::bls::{prepare_g1_pubkeys, prepare_milagro_pubkey, BlsError}; +use milagro_bls::PublicKey as PublicKeyPrepared; + +pub type ValidatorIndex = u64; +pub type ForkVersion = [u8; 4]; + +#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] +pub struct ForkVersions { + pub genesis: Fork, + pub altair: Fork, + pub bellatrix: Fork, + pub capella: Fork, +} + +#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] +pub struct Fork { + pub version: [u8; 4], + pub epoch: u64, +} + +#[derive(Copy, Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] +pub struct PublicKey(pub [u8; PUBKEY_SIZE]); + +impl Default for PublicKey { + fn default() -> Self { + PublicKey([0u8; PUBKEY_SIZE]) + } +} + +impl From<[u8; PUBKEY_SIZE]> for PublicKey { + fn from(v: [u8; PUBKEY_SIZE]) -> Self { + Self(v) + } +} + +impl MaxEncodedLen for PublicKey { + fn max_encoded_len() -> usize { + PUBKEY_SIZE + } +} + +#[cfg(feature = "std")] +impl<'de> Deserialize<'de> for PublicKey { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_str(HexVisitor::()).map(|v| v.into()) + } +} + +#[cfg(feature = "std")] +impl Serialize for PublicKey { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_bytes(&self.0) + } +} + +#[derive(Copy, Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] +pub struct Signature(pub [u8; SIGNATURE_SIZE]); + +impl Default for Signature { + fn default() -> Self { + Signature([0u8; SIGNATURE_SIZE]) + } +} + +impl From<[u8; SIGNATURE_SIZE]> for Signature { + fn from(v: [u8; SIGNATURE_SIZE]) -> Self { + Self(v) + } +} + +#[cfg(feature = "std")] +impl<'de> Deserialize<'de> for Signature { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_str(HexVisitor::()).map(|v| v.into()) + } +} + +#[derive(Copy, Clone, Default, Encode, Decode, TypeInfo, MaxEncodedLen)] +pub struct ExecutionHeaderState { + pub beacon_block_root: H256, + pub beacon_slot: u64, + pub block_hash: H256, + pub block_number: u64, +} + +#[derive(Copy, Clone, Default, Encode, Decode, TypeInfo, MaxEncodedLen)] +pub struct FinalizedHeaderState { + pub beacon_block_root: H256, + pub beacon_slot: u64, +} + +#[derive(Clone, Default, Encode, Decode, PartialEq, RuntimeDebug)] +pub struct ForkData { + // 1 or 0 bit, indicates whether a sync committee participated in a vote + pub current_version: [u8; 4], + pub genesis_validators_root: [u8; 32], +} + +impl ForkData { + pub fn hash_tree_root(&self) -> Result { + hash_tree_root::(self.clone().into()) + } +} + +#[derive(Clone, Default, Encode, Decode, PartialEq, RuntimeDebug)] +pub struct SigningData { + pub object_root: H256, + pub domain: H256, +} + +impl SigningData { + pub fn hash_tree_root(&self) -> Result { + hash_tree_root::(self.clone().into()) + } +} + +/// Sync committee as it is stored in the runtime storage. +#[derive( + Encode, Decode, PartialEqNoBound, CloneNoBound, RuntimeDebugNoBound, TypeInfo, MaxEncodedLen, +)] +#[cfg_attr( + feature = "std", + derive(Serialize, Deserialize), + serde(deny_unknown_fields, bound(serialize = ""), bound(deserialize = "")) +)] +#[codec(mel_bound())] +pub struct SyncCommittee { + #[cfg_attr(feature = "std", serde(with = "crate::serde_utils::arrays"))] + pub pubkeys: [PublicKey; COMMITTEE_SIZE], + pub aggregate_pubkey: PublicKey, +} + +impl Default for SyncCommittee { + fn default() -> Self { + SyncCommittee { + pubkeys: [Default::default(); COMMITTEE_SIZE], + aggregate_pubkey: Default::default(), + } + } +} + +impl SyncCommittee { + pub fn hash_tree_root(&self) -> Result { + hash_tree_root::>(self.clone().into()) + } +} + +/// Prepared G1 public key of sync committee as it is stored in the runtime storage. +#[derive(Clone, PartialEq, Eq, Encode, Decode, TypeInfo, MaxEncodedLen)] +pub struct SyncCommitteePrepared { + pub root: H256, + pub pubkeys: Box<[PublicKeyPrepared; COMMITTEE_SIZE]>, + pub aggregate_pubkey: PublicKeyPrepared, +} + +impl Default for SyncCommitteePrepared { + fn default() -> Self { + SyncCommitteePrepared { + root: H256::default(), + pubkeys: Box::new([PublicKeyPrepared::default(); COMMITTEE_SIZE]), + aggregate_pubkey: PublicKeyPrepared::default(), + } + } +} + +impl TryFrom<&SyncCommittee> + for SyncCommitteePrepared +{ + type Error = BlsError; + + fn try_from(sync_committee: &SyncCommittee) -> Result { + let g1_pubkeys = prepare_g1_pubkeys(&sync_committee.pubkeys)?; + let sync_committee_root = sync_committee.hash_tree_root().expect("checked statically; qed"); + + Ok(SyncCommitteePrepared:: { + pubkeys: g1_pubkeys.try_into().expect("checked statically; qed"), + aggregate_pubkey: prepare_milagro_pubkey(&sync_committee.aggregate_pubkey)?, + root: sync_committee_root, + }) + } +} + +/// Beacon block header as it is stored in the runtime storage. The block root is the +/// Merkleization of a BeaconHeader. +#[derive( + Copy, Clone, Default, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen, +)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +pub struct BeaconHeader { + // The slot for which this block is created. Must be greater than the slot of the block defined + // by parent root. + pub slot: u64, + // The index of the validator that proposed the block. + pub proposer_index: ValidatorIndex, + // The block root of the parent block, forming a block chain. + pub parent_root: H256, + // The hash root of the post state of running the state transition through this block. + pub state_root: H256, + // The hash root of the beacon block body + pub body_root: H256, +} + +impl BeaconHeader { + pub fn hash_tree_root(&self) -> Result { + hash_tree_root::((*self).into()) + } +} + +#[derive(Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo)] +#[cfg_attr( + feature = "std", + derive(Deserialize), + serde( + try_from = "IntermediateSyncAggregate", + deny_unknown_fields, + bound(serialize = ""), + bound(deserialize = "") + ) +)] +#[codec(mel_bound())] +pub struct SyncAggregate { + pub sync_committee_bits: [u8; COMMITTEE_BITS_SIZE], + pub sync_committee_signature: Signature, +} + +impl Default + for SyncAggregate +{ + fn default() -> Self { + SyncAggregate { + sync_committee_bits: [0; COMMITTEE_BITS_SIZE], + sync_committee_signature: Default::default(), + } + } +} + +impl + SyncAggregate +{ + pub fn hash_tree_root(&self) -> Result { + hash_tree_root::>(self.clone().into()) + } +} + +/// Serde deserialization helper for SyncAggregate +#[cfg(feature = "std")] +#[derive(Deserialize)] +struct IntermediateSyncAggregate { + #[cfg_attr(feature = "std", serde(deserialize_with = "crate::serde_utils::from_hex_to_bytes"))] + pub sync_committee_bits: Vec, + pub sync_committee_signature: Signature, +} + +#[cfg(feature = "std")] +impl + TryFrom for SyncAggregate +{ + type Error = String; + + fn try_from(other: IntermediateSyncAggregate) -> Result { + Ok(Self { + sync_committee_bits: other + .sync_committee_bits + .try_into() + .map_err(|_| "unexpected length".to_owned())?, + sync_committee_signature: other.sync_committee_signature, + }) + } +} + +/// ExecutionPayloadHeader +/// +#[derive( + Default, Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo, +)] +#[cfg_attr( + feature = "std", + derive(Deserialize), + serde(deny_unknown_fields, bound(serialize = ""), bound(deserialize = "")) +)] +#[codec(mel_bound())] +pub struct ExecutionPayloadHeader { + pub parent_hash: H256, + pub fee_recipient: H160, + pub state_root: H256, + pub receipts_root: H256, + #[cfg_attr(feature = "std", serde(deserialize_with = "crate::serde_utils::from_hex_to_bytes"))] + pub logs_bloom: Vec, + pub prev_randao: H256, + pub block_number: u64, + pub gas_limit: u64, + pub gas_used: u64, + pub timestamp: u64, + #[cfg_attr(feature = "std", serde(deserialize_with = "crate::serde_utils::from_hex_to_bytes"))] + pub extra_data: Vec, + #[cfg_attr(feature = "std", serde(deserialize_with = "crate::serde_utils::from_int_to_u256"))] + pub base_fee_per_gas: U256, + pub block_hash: H256, + pub transactions_root: H256, + pub withdrawals_root: H256, +} + +impl ExecutionPayloadHeader { + pub fn hash_tree_root(&self) -> Result { + hash_tree_root::(self.clone().try_into()?) + } +} + +#[derive( + Default, + Encode, + Decode, + CloneNoBound, + PartialEqNoBound, + RuntimeDebugNoBound, + TypeInfo, + MaxEncodedLen, +)] +pub struct CompactExecutionHeader { + pub parent_hash: H256, + #[codec(compact)] + pub block_number: u64, + pub state_root: H256, + pub receipts_root: H256, +} + +impl From for CompactExecutionHeader { + fn from(execution_payload: ExecutionPayloadHeader) -> Self { + Self { + parent_hash: execution_payload.parent_hash, + block_number: execution_payload.block_number, + state_root: execution_payload.state_root, + receipts_root: execution_payload.receipts_root, + } + } +} + +#[derive( + Default, + Encode, + Decode, + Copy, + Clone, + PartialEqNoBound, + RuntimeDebugNoBound, + TypeInfo, + MaxEncodedLen, +)] +pub struct CompactBeaconState { + #[codec(compact)] + pub slot: u64, + pub block_roots_root: H256, +} + +#[cfg(test)] +mod tests { + use super::*; + use hex_literal::hex; + + #[test] + pub fn test_hash_beacon_header1() { + let hash_root = BeaconHeader { + slot: 3, + proposer_index: 2, + parent_root: hex!("796ea53efb534eab7777809cc5ee2d84e7f25024b9d0c4d7e5bcaab657e4bdbd") + .into(), + state_root: hex!("ba3ff080912be5c9c158b2e962c1b39a91bc0615762ba6fa2ecacafa94e9ae0a") + .into(), + body_root: hex!("a18d7fcefbb74a177c959160e0ee89c23546482154e6831237710414465dcae5") + .into(), + } + .hash_tree_root(); + + assert!(hash_root.is_ok()); + assert_eq!( + hash_root.unwrap(), + hex!("7d42595818709e805dd2fa710a2d2c1f62576ef1ab7273941ac9130fb94b91f7").into() + ); + } + + #[test] + pub fn test_hash_beacon_header2() { + let hash_root = BeaconHeader { + slot: 3476424, + proposer_index: 314905, + parent_root: hex!("c069d7b49cffd2b815b0fb8007eb9ca91202ea548df6f3db60000f29b2489f28") + .into(), + state_root: hex!("444d293e4533501ee508ad608783a7d677c3c566f001313e8a02ce08adf590a3") + .into(), + body_root: hex!("6508a0241047f21ba88f05d05b15534156ab6a6f8e029a9a5423da429834e04a") + .into(), + } + .hash_tree_root(); + + assert!(hash_root.is_ok()); + assert_eq!( + hash_root.unwrap(), + hex!("0aa41166ff01e58e111ac8c42309a738ab453cf8d7285ed8477b1c484acb123e").into() + ); + } + + #[test] + pub fn test_hash_fork_data() { + let hash_root = ForkData { + current_version: hex!("83f38a34"), + genesis_validators_root: hex!( + "22370bbbb358800f5711a10ea9845284272d8493bed0348cab87b8ab1e127930" + ), + } + .hash_tree_root(); + + assert!(hash_root.is_ok()); + assert_eq!( + hash_root.unwrap(), + hex!("57c12c4246bc7152b174b51920506bf943eff9c7ffa50b9533708e9cc1f680fc").into() + ); + } + + #[test] + pub fn test_hash_signing_data() { + let hash_root = SigningData { + object_root: hex!("63654cbe64fc07853f1198c165dd3d49c54fc53bc417989bbcc66da15f850c54") + .into(), + domain: hex!("037da907d1c3a03c0091b2254e1480d9b1783476e228ab29adaaa8f133e08f7a").into(), + } + .hash_tree_root(); + + assert!(hash_root.is_ok()); + assert_eq!( + hash_root.unwrap(), + hex!("b9eb2caf2d691b183c2d57f322afe505c078cd08101324f61c3641714789a54e").into() + ); + } + + #[test] + pub fn test_hash_sync_aggregate() { + let hash_root = SyncAggregate::<512, 64>{ + sync_committee_bits: hex!("cefffffefffffff767fffbedffffeffffeeffdffffdebffffff7f7dbdf7fffdffffbffcfffdff79dfffbbfefff2ffffff7ddeff7ffffc98ff7fbfffffffffff7"), + sync_committee_signature: hex!("8af1a8577bba419fe054ee49b16ed28e081dda6d3ba41651634685e890992a0b675e20f8d9f2ec137fe9eb50e838aa6117f9f5410e2e1024c4b4f0e098e55144843ce90b7acde52fe7b94f2a1037342c951dc59f501c92acf7ed944cb6d2b5f7").into(), + }.hash_tree_root(); + + assert!(hash_root.is_ok()); + assert_eq!( + hash_root.unwrap(), + hex!("e6dcad4f60ce9ff8a587b110facbaf94721f06cd810b6d8bf6cffa641272808d").into() + ); + } + + #[test] + pub fn test_hash_execution_payload() { + let hash_root = + ExecutionPayloadHeader{ + parent_hash: hex!("eadee5ab098dde64e9fd02ae5858064bad67064070679625b09f8d82dec183f7").into(), + fee_recipient: hex!("f97e180c050e5ab072211ad2c213eb5aee4df134").into(), + state_root: hex!("564fa064c2a324c2b5978d7fdfc5d4224d4f421a45388af1ed405a399c845dff").into(), + receipts_root: hex!("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").into(), + logs_bloom: hex!("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").to_vec(), + prev_randao: hex!("6bf538bdfbdf1c96ff528726a40658a91d0bda0f1351448c4c4f3604db2a0ccf").into(), + block_number: 477434, + gas_limit: 8154925, + gas_used: 0, + timestamp: 1652816940, + extra_data: vec![], + base_fee_per_gas: U256::from(7_i16), + block_hash: hex!("cd8df91b4503adb8f2f1c7a4f60e07a1f1a2cbdfa2a95bceba581f3ff65c1968").into(), + transactions_root: hex!("7ffe241ea60187fdb0187bfa22de35d1f9bed7ab061d9401fd47e34a54fbede1").into(), + withdrawals_root: hex!("28ba1834a3a7b657460ce79fa3a1d909ab8828fd557659d4d0554a9bdbc0ec30").into(), + }.hash_tree_root(); + assert!(hash_root.is_ok()); + } +} + +/// Operating modes for beacon client +#[derive(Encode, Decode, Copy, Clone, PartialEq, RuntimeDebug, TypeInfo)] +pub enum Mode { + Active, + Blocked, +} diff --git a/snowbridge/parachain/primitives/beacon/src/updates.rs b/snowbridge/parachain/primitives/beacon/src/updates.rs new file mode 100644 index 00000000000..9a78b4f1e2d --- /dev/null +++ b/snowbridge/parachain/primitives/beacon/src/updates.rs @@ -0,0 +1,110 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use codec::{Decode, Encode}; +use frame_support::{CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound}; +use scale_info::TypeInfo; +use sp_core::H256; +use sp_std::prelude::*; + +use crate::types::{BeaconHeader, ExecutionPayloadHeader, SyncAggregate, SyncCommittee}; + +#[derive(Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo)] +#[cfg_attr( + feature = "std", + derive(serde::Serialize, serde::Deserialize), + serde(deny_unknown_fields, bound(serialize = ""), bound(deserialize = "")) +)] +pub struct CheckpointUpdate { + pub header: BeaconHeader, + pub current_sync_committee: SyncCommittee, + pub current_sync_committee_branch: Vec, + pub validators_root: H256, + pub block_roots_root: H256, + pub block_roots_branch: Vec, +} + +impl Default for CheckpointUpdate { + fn default() -> Self { + CheckpointUpdate { + header: Default::default(), + current_sync_committee: Default::default(), + current_sync_committee_branch: Default::default(), + validators_root: Default::default(), + block_roots_root: Default::default(), + block_roots_branch: Default::default(), + } + } +} + +#[derive( + Default, Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo, +)] +#[cfg_attr( + feature = "std", + derive(serde::Deserialize), + serde(deny_unknown_fields, bound(serialize = ""), bound(deserialize = "")) +)] +pub struct Update { + /// A recent header attesting to the finalized header, using its `state_root`. + pub attested_header: BeaconHeader, + /// The signing data that the sync committee produced for this attested header, including + /// who participated in the vote and the resulting signature. + pub sync_aggregate: SyncAggregate, + /// The slot at which the sync aggregate can be found, typically attested_header.slot + 1, if + /// the next slot block was not missed. + pub signature_slot: u64, + /// The next sync committee for the next sync committee period, if present. + pub next_sync_committee_update: Option>, + /// The latest finalized header. + pub finalized_header: BeaconHeader, + /// The merkle proof testifying to the finalized header, using the `attested_header.state_root` + /// as tree root. + pub finality_branch: Vec, + /// The finalized_header's `block_roots` root in the beacon state, used for ancestry proofs. + pub block_roots_root: H256, + /// The merkle path to prove the `block_roots_root` value. + pub block_roots_branch: Vec, +} + +#[derive( + Default, Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo, +)] +#[cfg_attr( + feature = "std", + derive(serde::Deserialize), + serde(deny_unknown_fields, bound(serialize = ""), bound(deserialize = "")) +)] +pub struct NextSyncCommitteeUpdate { + pub next_sync_committee: SyncCommittee, + pub next_sync_committee_branch: Vec, +} + +#[derive(Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo)] +#[cfg_attr( + feature = "std", + derive(serde::Deserialize), + serde(deny_unknown_fields, bound(serialize = ""), bound(deserialize = "")) +)] +pub struct ExecutionHeaderUpdate { + /// Header for the beacon block containing the execution payload + pub header: BeaconHeader, + /// Proof that `header` is an ancestor of a finalized header + pub ancestry_proof: Option, + /// Execution header to be imported + pub execution_header: ExecutionPayloadHeader, + /// Merkle proof that execution payload is contained within `header` + pub execution_branch: Vec, +} + +#[derive(Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo)] +#[cfg_attr( + feature = "std", + derive(serde::Deserialize), + serde(deny_unknown_fields, bound(serialize = ""), bound(deserialize = "")) +)] +pub struct AncestryProof { + /// Merkle proof that `header` is an ancestor of `finalized_header` + pub header_branch: Vec, + /// Root of a finalized block that has already been imported into the light client + pub finalized_block_root: H256, +} diff --git a/snowbridge/parachain/primitives/core/Cargo.toml b/snowbridge/parachain/primitives/core/Cargo.toml new file mode 100644 index 00000000000..262fc60b0cb --- /dev/null +++ b/snowbridge/parachain/primitives/core/Cargo.toml @@ -0,0 +1,60 @@ +[package] +name = "snowbridge-core" +description = "Snowbridge Core" +version = "0.1.1" +authors = ["Snowfork "] +edition = "2021" +license = "Apache-2.0" + +[dependencies] +serde = { version = "1.0.188", optional = true, features = ["alloc", "derive"], default-features = false } +codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } +scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } +hex-literal = { version = "0.4.1" } + +polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false } +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false } + +frame-support = { path = "../../../../../substrate/frame/support", default-features = false } +frame-system = { path = "../../../../../substrate/frame/system", default-features = false } +sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } +sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } +sp-io = { path = "../../../../../substrate/primitives/io", default-features = false } +sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } +sp-arithmetic = { path = "../../../../../substrate/primitives/arithmetic", 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 } + +[dev-dependencies] +hex = { version = "0.4.3" } + +[features] +default = ["std"] +std = [ + "codec/std", + "ethabi/std", + "frame-support/std", + "frame-system/std", + "polkadot-parachain-primitives/std", + "scale-info/std", + "serde/std", + "snowbridge-beacon-primitives/std", + "sp-arithmetic/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", + "xcm-builder/std", + "xcm/std", +] +serde = ["dep:serde", "scale-info/serde"] +runtime-benchmarks = [ + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", +] diff --git a/snowbridge/parachain/primitives/core/src/inbound.rs b/snowbridge/parachain/primitives/core/src/inbound.rs new file mode 100644 index 00000000000..4b04470ad02 --- /dev/null +++ b/snowbridge/parachain/primitives/core/src/inbound.rs @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! Types for representing inbound messages + +use codec::{Decode, Encode}; +use frame_support::PalletError; +use scale_info::TypeInfo; +use sp_core::{H160, H256}; +use sp_runtime::RuntimeDebug; +use sp_std::vec::Vec; + +/// A trait for verifying inbound messages from Ethereum. +pub trait Verifier { + fn verify(event: &Log, proof: &Proof) -> Result<(), VerificationError>; +} + +#[derive(Clone, Encode, Decode, RuntimeDebug, PalletError, TypeInfo)] +#[cfg_attr(feature = "std", derive(PartialEq))] +pub enum VerificationError { + /// Execution header is missing + HeaderNotFound, + /// Event log was not found in the verified transaction receipt + LogNotFound, + /// Event log has an invalid format + InvalidLog, + /// Unable to verify the transaction receipt with the provided proof + InvalidProof, +} + +pub type MessageNonce = u64; + +/// A bridge message from the Gateway contract on Ethereum +#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] +pub struct Message { + /// Event log emitted by Gateway contract + pub event_log: Log, + /// Inclusion proof for a transaction receipt containing the event log + pub proof: Proof, +} + +const MAX_TOPICS: usize = 4; + +#[derive(Clone, RuntimeDebug)] +pub enum LogValidationError { + TooManyTopics, +} + +/// Event log +#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] +pub struct Log { + pub address: H160, + pub topics: Vec, + pub data: Vec, +} + +impl Log { + pub fn validate(&self) -> Result<(), LogValidationError> { + if self.topics.len() > MAX_TOPICS { + return Err(LogValidationError::TooManyTopics) + } + Ok(()) + } +} + +/// Inclusion proof for a transaction receipt +#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] +pub struct Proof { + // The block hash of the block in which the receipt was included. + pub block_hash: H256, + // The index of the transaction (and receipt) within the block. + pub tx_index: u32, + // Proof keys and values (receipts tree) + pub data: (Vec>, Vec>), +} diff --git a/snowbridge/parachain/primitives/core/src/lib.rs b/snowbridge/parachain/primitives/core/src/lib.rs new file mode 100644 index 00000000000..ecbc3bb365f --- /dev/null +++ b/snowbridge/parachain/primitives/core/src/lib.rs @@ -0,0 +1,174 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! # Core +//! +//! Common traits and types +#![cfg_attr(not(feature = "std"), no_std)] + +#[cfg(test)] +mod tests; + +pub mod inbound; +pub mod operating_mode; +pub mod outbound; +pub mod pricing; +pub mod ringbuffer; + +pub use polkadot_parachain_primitives::primitives::{ + Id as ParaId, IsSystem, Sibling as SiblingParaId, +}; +pub use ringbuffer::{RingBufferMap, RingBufferMapImpl}; +pub use sp_core::U256; + +use codec::{Decode, Encode, MaxEncodedLen}; +use frame_support::traits::Contains; +use hex_literal::hex; +use scale_info::TypeInfo; +use sp_core::H256; +use sp_io::hashing::keccak_256; +use sp_runtime::{traits::AccountIdConversion, RuntimeDebug}; +use sp_std::prelude::*; +use xcm::prelude::{ + Junction::Parachain, + Junctions::{Here, X1}, + MultiLocation, +}; +use xcm_builder::{DescribeAllTerminal, DescribeFamily, DescribeLocation, HashedDescription}; + +/// The ID of an agent contract +pub type AgentId = H256; +pub use operating_mode::BasicOperatingMode; + +pub use pricing::{PricingParameters, Rewards}; + +pub fn sibling_sovereign_account(para_id: ParaId) -> T::AccountId +where + T: frame_system::Config, +{ + SiblingParaId::from(para_id).into_account_truncating() +} + +pub fn sibling_sovereign_account_raw(para_id: ParaId) -> [u8; 32] { + SiblingParaId::from(para_id).into_account_truncating() +} + +pub struct AllowSiblingsOnly; +impl Contains for AllowSiblingsOnly { + fn contains(location: &MultiLocation) -> bool { + matches!(location, MultiLocation { parents: 1, interior: X1(Parachain(_)) }) + } +} + +pub fn gwei(x: u128) -> U256 { + U256::from(1_000_000_000u128).saturating_mul(x.into()) +} + +pub fn meth(x: u128) -> U256 { + U256::from(1_000_000_000_000_000u128).saturating_mul(x.into()) +} + +pub fn eth(x: u128) -> U256 { + U256::from(1_000_000_000_000_000_000u128).saturating_mul(x.into()) +} + +pub const ROC: u128 = 1_000_000_000_000; + +/// Identifier for a message channel +#[derive( + Clone, Copy, Encode, Decode, PartialEq, Eq, Default, RuntimeDebug, MaxEncodedLen, TypeInfo, +)] +pub struct ChannelId([u8; 32]); + +/// Deterministically derive a ChannelId for a sibling parachain +/// Generator: keccak256("para" + big_endian_bytes(para_id)) +/// +/// The equivalent generator on the Solidity side is in +/// contracts/src/Types.sol:into(). +fn derive_channel_id_for_sibling(para_id: ParaId) -> ChannelId { + let para_id: u32 = para_id.into(); + let para_id_bytes: [u8; 4] = para_id.to_be_bytes(); + let prefix: [u8; 4] = *b"para"; + let preimage: Vec = prefix.into_iter().chain(para_id_bytes).collect(); + keccak_256(&preimage).into() +} + +impl ChannelId { + pub const fn new(id: [u8; 32]) -> Self { + ChannelId(id) + } +} + +impl From for ChannelId { + fn from(value: ParaId) -> Self { + derive_channel_id_for_sibling(value) + } +} + +impl From<[u8; 32]> for ChannelId { + fn from(value: [u8; 32]) -> Self { + ChannelId(value) + } +} + +impl From for [u8; 32] { + fn from(value: ChannelId) -> Self { + value.0 + } +} + +impl<'a> From<&'a [u8; 32]> for ChannelId { + fn from(value: &'a [u8; 32]) -> Self { + ChannelId(*value) + } +} + +impl From for ChannelId { + fn from(value: H256) -> Self { + ChannelId(value.into()) + } +} + +impl AsRef<[u8]> for ChannelId { + fn as_ref(&self) -> &[u8] { + &self.0 + } +} + +#[derive(Clone, Encode, Decode, RuntimeDebug, MaxEncodedLen, TypeInfo)] +pub struct Channel { + /// ID of the agent contract deployed on Ethereum + pub agent_id: AgentId, + /// ID of the parachain who will receive or send messages using this channel + pub para_id: ParaId, +} + +pub trait StaticLookup { + /// Type to lookup from. + type Source; + /// Type to lookup into. + type Target; + /// Attempt a lookup. + fn lookup(s: Self::Source) -> Option; +} + +/// Channel for high-priority governance commands +pub const PRIMARY_GOVERNANCE_CHANNEL: ChannelId = + ChannelId::new(hex!("0000000000000000000000000000000000000000000000000000000000000001")); + +/// Channel for lower-priority governance commands +pub const SECONDARY_GOVERNANCE_CHANNEL: ChannelId = + ChannelId::new(hex!("0000000000000000000000000000000000000000000000000000000000000002")); + +pub struct DescribeHere; +impl DescribeLocation for DescribeHere { + fn describe_location(l: &MultiLocation) -> Option> { + match (l.parents, l.interior) { + (0, Here) => Some(Vec::::new().encode()), + _ => None, + } + } +} + +/// Creates an AgentId from a MultiLocation. An AgentId is a unique mapping to a Agent contract on +/// Ethereum which acts as the sovereign account for the MultiLocation. +pub type AgentIdOf = HashedDescription)>; diff --git a/snowbridge/parachain/primitives/core/src/operating_mode.rs b/snowbridge/parachain/primitives/core/src/operating_mode.rs new file mode 100644 index 00000000000..9894e587ef5 --- /dev/null +++ b/snowbridge/parachain/primitives/core/src/operating_mode.rs @@ -0,0 +1,25 @@ +use codec::{Decode, Encode, MaxEncodedLen}; +use scale_info::TypeInfo; +use sp_runtime::RuntimeDebug; + +/// Basic operating modes for a bridges module (Normal/Halted). +#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +pub enum BasicOperatingMode { + /// Normal mode, when all operations are allowed. + Normal, + /// The pallet is halted. All non-governance operations are disabled. + Halted, +} + +impl Default for BasicOperatingMode { + fn default() -> Self { + Self::Normal + } +} + +impl BasicOperatingMode { + pub fn is_halted(&self) -> bool { + *self == BasicOperatingMode::Halted + } +} diff --git a/snowbridge/parachain/primitives/core/src/outbound.rs b/snowbridge/parachain/primitives/core/src/outbound.rs new file mode 100644 index 00000000000..bce123878d3 --- /dev/null +++ b/snowbridge/parachain/primitives/core/src/outbound.rs @@ -0,0 +1,413 @@ +use codec::{Decode, Encode}; +use frame_support::PalletError; +use scale_info::TypeInfo; +use sp_arithmetic::traits::{BaseArithmetic, Unsigned}; +use sp_core::{RuntimeDebug, H256}; +pub use v1::{AgentExecuteCommand, Command, Initializer, Message, OperatingMode, QueuedMessage}; + +/// Enqueued outbound messages need to be versioned to prevent data corruption +/// or loss after forkless runtime upgrades +#[derive(Encode, Decode, TypeInfo, Clone, RuntimeDebug)] +#[cfg_attr(feature = "std", derive(PartialEq))] +pub enum VersionedQueuedMessage { + V1(QueuedMessage), +} + +impl TryFrom for QueuedMessage { + type Error = (); + fn try_from(x: VersionedQueuedMessage) -> Result { + use VersionedQueuedMessage::*; + match x { + V1(x) => Ok(x), + } + } +} + +impl> From for VersionedQueuedMessage { + fn from(x: T) -> Self { + VersionedQueuedMessage::V1(x.into()) + } +} + +mod v1 { + use crate::{pricing::UD60x18, ChannelId}; + use codec::{Decode, Encode}; + use ethabi::Token; + use scale_info::TypeInfo; + use sp_core::{RuntimeDebug, H160, H256, U256}; + use sp_std::{borrow::ToOwned, vec, vec::Vec}; + + /// A message which can be accepted by implementations of `/[`SendMessage`\]` + #[derive(Encode, Decode, TypeInfo, Clone, RuntimeDebug)] + #[cfg_attr(feature = "std", derive(PartialEq))] + pub struct Message { + /// ID for this message. One will be automatically generated if not provided. + /// + /// When this message is created from an XCM message, the ID should be extracted + /// from the `SetTopic` instruction. + /// + /// The ID plays no role in bridge consensus, and is purely meant for message tracing. + pub id: Option, + /// The message channel ID + pub channel_id: ChannelId, + /// The stable ID for a receiving gateway contract + pub command: Command, + } + + /// The operating mode of Channels and Gateway contract on Ethereum. + #[derive(Copy, Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, TypeInfo)] + pub enum OperatingMode { + /// Normal operations. Allow sending and receiving messages. + Normal, + /// Reject outbound messages. This allows receiving governance messages but does now allow + /// enqueuing of new messages from the Ethereum side. This can be used to close off an + /// deprecated channel or pause the bridge for upgrade operations. + RejectingOutboundMessages, + } + + /// A command which is executable by the Gateway contract on Ethereum + #[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] + #[cfg_attr(feature = "std", derive(PartialEq))] + pub enum Command { + /// Execute a sub-command within an agent for a consensus system in Polkadot + AgentExecute { + /// The ID of the agent + agent_id: H256, + /// The sub-command to be executed + command: AgentExecuteCommand, + }, + /// Upgrade the Gateway contract + Upgrade { + /// Address of the new implementation contract + impl_address: H160, + /// Codehash of the implementation contract + impl_code_hash: H256, + /// Optionally invoke an initializer in the implementation contract + initializer: Option, + }, + /// Create an agent representing a consensus system on Polkadot + CreateAgent { + /// The ID of the agent, derived from the `MultiLocation` of the consensus system on + /// Polkadot + agent_id: H256, + }, + /// Create bidirectional messaging channel to a parachain + CreateChannel { + /// The ID of the channel + channel_id: ChannelId, + /// The agent ID of the parachain + agent_id: H256, + /// Initial operating mode + mode: OperatingMode, + }, + /// Update the configuration of a channel + UpdateChannel { + /// The ID of the channel + channel_id: ChannelId, + /// The new operating mode + mode: OperatingMode, + }, + /// Set the global operating mode of the Gateway contract + SetOperatingMode { + /// The new operating mode + mode: OperatingMode, + }, + /// Transfer ether from an agent contract to a recipient account + TransferNativeFromAgent { + /// The agent ID + agent_id: H256, + /// The recipient of the ether + recipient: H160, + /// The amount to transfer + amount: u128, + }, + /// Set token fees of the Gateway contract + SetTokenTransferFees { + /// The fee(DOT) for the cost of creating asset on AssetHub + create_asset_xcm: u128, + /// The fee(DOT) for the cost of sending asset on AssetHub + transfer_asset_xcm: u128, + /// The fee(Ether) for register token to discourage spamming + register_token: U256, + }, + /// Set pricing parameters + SetPricingParameters { + // ETH/DOT exchange rate + exchange_rate: UD60x18, + // Cost of delivering a message from Ethereum to BridgeHub, in ROC/KSM/DOT + delivery_cost: u128, + }, + } + + impl Command { + /// Compute the enum variant index + pub fn index(&self) -> u8 { + match self { + Command::AgentExecute { .. } => 0, + Command::Upgrade { .. } => 1, + Command::CreateAgent { .. } => 2, + Command::CreateChannel { .. } => 3, + Command::UpdateChannel { .. } => 4, + Command::SetOperatingMode { .. } => 5, + Command::TransferNativeFromAgent { .. } => 6, + Command::SetTokenTransferFees { .. } => 7, + Command::SetPricingParameters { .. } => 8, + } + } + + /// ABI-encode the Command. + pub fn abi_encode(&self) -> Vec { + match self { + Command::AgentExecute { agent_id, command } => + ethabi::encode(&[Token::Tuple(vec![ + Token::FixedBytes(agent_id.as_bytes().to_owned()), + Token::Bytes(command.abi_encode()), + ])]), + Command::Upgrade { impl_address, impl_code_hash, initializer, .. } => + ethabi::encode(&[Token::Tuple(vec![ + Token::Address(*impl_address), + Token::FixedBytes(impl_code_hash.as_bytes().to_owned()), + initializer + .clone() + .map_or(Token::Bytes(vec![]), |i| Token::Bytes(i.params)), + ])]), + Command::CreateAgent { agent_id } => + ethabi::encode(&[Token::Tuple(vec![Token::FixedBytes( + agent_id.as_bytes().to_owned(), + )])]), + Command::CreateChannel { channel_id, agent_id, mode } => + ethabi::encode(&[Token::Tuple(vec![ + Token::FixedBytes(channel_id.as_ref().to_owned()), + Token::FixedBytes(agent_id.as_bytes().to_owned()), + Token::Uint(U256::from((*mode) as u64)), + ])]), + Command::UpdateChannel { channel_id, mode } => + ethabi::encode(&[Token::Tuple(vec![ + Token::FixedBytes(channel_id.as_ref().to_owned()), + Token::Uint(U256::from((*mode) as u64)), + ])]), + Command::SetOperatingMode { mode } => + ethabi::encode(&[Token::Tuple(vec![Token::Uint(U256::from((*mode) as u64))])]), + Command::TransferNativeFromAgent { agent_id, recipient, amount } => + ethabi::encode(&[Token::Tuple(vec![ + Token::FixedBytes(agent_id.as_bytes().to_owned()), + Token::Address(*recipient), + Token::Uint(U256::from(*amount)), + ])]), + Command::SetTokenTransferFees { + create_asset_xcm, + transfer_asset_xcm, + register_token, + } => ethabi::encode(&[Token::Tuple(vec![ + Token::Uint(U256::from(*create_asset_xcm)), + Token::Uint(U256::from(*transfer_asset_xcm)), + Token::Uint(*register_token), + ])]), + Command::SetPricingParameters { exchange_rate, delivery_cost } => + ethabi::encode(&[Token::Tuple(vec![ + Token::Uint(exchange_rate.clone().into_inner()), + Token::Uint(U256::from(*delivery_cost)), + ])]), + } + } + } + + /// Representation of a call to the initializer of an implementation contract. + /// The initializer has the following ABI signature: `initialize(bytes)`. + #[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] + pub struct Initializer { + /// ABI-encoded params of type `bytes` to pass to the initializer + pub params: Vec, + /// The initializer is allowed to consume this much gas at most. + pub maximum_required_gas: u64, + } + + /// A Sub-command executable within an agent + #[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] + #[cfg_attr(feature = "std", derive(PartialEq))] + pub enum AgentExecuteCommand { + /// Transfer ERC20 tokens + TransferToken { + /// Address of the ERC20 token + token: H160, + /// The recipient of the tokens + recipient: H160, + /// The amount of tokens to transfer + amount: u128, + }, + } + + impl AgentExecuteCommand { + fn index(&self) -> u8 { + match self { + AgentExecuteCommand::TransferToken { .. } => 0, + } + } + + /// ABI-encode the sub-command + pub fn abi_encode(&self) -> Vec { + match self { + AgentExecuteCommand::TransferToken { token, recipient, amount } => + ethabi::encode(&[ + Token::Uint(self.index().into()), + Token::Bytes(ethabi::encode(&[ + Token::Address(*token), + Token::Address(*recipient), + Token::Uint(U256::from(*amount)), + ])), + ]), + } + } + } + + /// Message which is awaiting processing in the MessageQueue pallet + #[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] + #[cfg_attr(feature = "std", derive(PartialEq))] + pub struct QueuedMessage { + /// Message ID + pub id: H256, + /// Channel ID + pub channel_id: ChannelId, + /// Command to execute in the Gateway contract + pub command: Command, + } +} + +#[cfg_attr(feature = "std", derive(PartialEq, Debug))] +/// Fee for delivering message +pub struct Fee +where + Balance: BaseArithmetic + Unsigned + Copy, +{ + /// Fee to cover cost of processing the message locally + pub local: Balance, + /// Fee to cover cost processing the message remotely + pub remote: Balance, +} + +impl Fee +where + Balance: BaseArithmetic + Unsigned + Copy, +{ + pub fn total(&self) -> Balance { + self.local.saturating_add(self.remote) + } +} + +impl From<(Balance, Balance)> for Fee +where + Balance: BaseArithmetic + Unsigned + Copy, +{ + fn from((local, remote): (Balance, Balance)) -> Self { + Self { local, remote } + } +} + +/// A trait for sending messages to Ethereum +pub trait SendMessage: SendMessageFeeProvider { + type Ticket: Clone + Encode + Decode; + + /// Validate an outbound message and return a tuple: + /// 1. Ticket for submitting the message + /// 2. Delivery fee + fn validate( + message: &Message, + ) -> Result<(Self::Ticket, Fee<::Balance>), SendError>; + + /// Submit the message ticket for eventual delivery to Ethereum + fn deliver(ticket: Self::Ticket) -> Result; +} + +pub trait Ticket: Encode + Decode + Clone { + fn message_id(&self) -> H256; +} + +/// A trait for getting the local costs associated with sending a message. +pub trait SendMessageFeeProvider { + type Balance: BaseArithmetic + Unsigned + Copy; + + /// The local component of the message processing fees in native currency + fn local_fee() -> Self::Balance; +} + +/// Reasons why sending to Ethereum could not be initiated +#[derive(Copy, Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, PalletError, TypeInfo)] +pub enum SendError { + /// Message is too large to be safely executed on Ethereum + MessageTooLarge, + /// The bridge has been halted for maintenance + Halted, + /// Invalid Channel + InvalidChannel, +} + +pub trait GasMeter { + /// All the gas used for submitting a message to Ethereum, minus the cost of dispatching + /// the command within the message + const MAXIMUM_BASE_GAS: u64; + + fn maximum_gas_used_at_most(command: &Command) -> u64 { + Self::MAXIMUM_BASE_GAS + Self::maximum_dispatch_gas_used_at_most(command) + } + + /// Measures the maximum amount of gas a command payload will require to dispatch, AFTER + /// validation & verification. + fn maximum_dispatch_gas_used_at_most(command: &Command) -> u64; +} + +/// A meter that assigns a constant amount of gas for the execution of a command +/// +/// The gas figures are extracted from this report: +/// > forge test --match-path test/Gateway.t.sol --gas-report +/// +/// A healthy buffer is added on top of these figures to account for: +/// * The EIP-150 63/64 rule +/// * Future EVM upgrades that may increase gas cost +pub struct ConstantGasMeter; + +impl GasMeter for ConstantGasMeter { + // The base transaction cost, which includes: + // 21_000 transaction cost, roughly worst case 64_000 for calldata, and 100_000 + // for message verification + const MAXIMUM_BASE_GAS: u64 = 185_000; + + fn maximum_dispatch_gas_used_at_most(command: &Command) -> u64 { + match command { + Command::CreateAgent { .. } => 275_000, + Command::CreateChannel { .. } => 100_000, + Command::UpdateChannel { .. } => 50_000, + Command::TransferNativeFromAgent { .. } => 60_000, + Command::SetOperatingMode { .. } => 40_000, + Command::AgentExecute { command, .. } => match command { + // Execute IERC20.transferFrom + // + // Worst-case assumptions are important: + // * No gas refund for clearing storage slot of source account in ERC20 contract + // * Assume dest account in ERC20 contract does not yet have a storage slot + // * ERC20.transferFrom possibly does other business logic besides updating balances + AgentExecuteCommand::TransferToken { .. } => 100_000, + }, + Command::Upgrade { initializer, .. } => { + let initializer_max_gas = match *initializer { + Some(Initializer { maximum_required_gas, .. }) => maximum_required_gas, + None => 0, + }; + // total maximum gas must also include the gas used for updating the proxy before + // the the initializer is called. + 50_000 + initializer_max_gas + }, + Command::SetTokenTransferFees { .. } => 60_000, + Command::SetPricingParameters { .. } => 60_000, + } + } +} + +impl GasMeter for () { + const MAXIMUM_BASE_GAS: u64 = 1; + + fn maximum_dispatch_gas_used_at_most(_: &Command) -> u64 { + 1 + } +} + +pub const ETHER_DECIMALS: u8 = 18; diff --git a/snowbridge/parachain/primitives/core/src/pricing.rs b/snowbridge/parachain/primitives/core/src/pricing.rs new file mode 100644 index 00000000000..33aeda6d15c --- /dev/null +++ b/snowbridge/parachain/primitives/core/src/pricing.rs @@ -0,0 +1,67 @@ +use codec::{Decode, Encode, MaxEncodedLen}; +use scale_info::TypeInfo; +use sp_arithmetic::traits::{BaseArithmetic, Unsigned, Zero}; +use sp_core::U256; +use sp_runtime::{FixedU128, RuntimeDebug}; +use sp_std::prelude::*; + +#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)] +pub struct PricingParameters { + /// ETH/DOT exchange rate + pub exchange_rate: FixedU128, + /// Relayer rewards + pub rewards: Rewards, + /// Ether (wei) fee per gas unit + pub fee_per_gas: U256, +} + +#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)] +pub struct Rewards { + /// Local reward in DOT + pub local: Balance, + /// Remote reward in ETH (wei) + pub remote: U256, +} + +#[derive(RuntimeDebug)] +pub struct InvalidPricingParameters; + +impl PricingParameters +where + Balance: BaseArithmetic + Unsigned + Copy, +{ + pub fn validate(&self) -> Result<(), InvalidPricingParameters> { + if self.exchange_rate == FixedU128::zero() { + return Err(InvalidPricingParameters) + } + if self.fee_per_gas == U256::zero() { + return Err(InvalidPricingParameters) + } + if self.rewards.local.is_zero() { + return Err(InvalidPricingParameters) + } + if self.rewards.remote.is_zero() { + return Err(InvalidPricingParameters) + } + Ok(()) + } +} + +/// Holder for fixed point number implemented in +#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[cfg_attr(feature = "std", derive(PartialEq))] +pub struct UD60x18(U256); + +impl From for UD60x18 { + fn from(value: FixedU128) -> Self { + // Both FixedU128 and UD60x18 have 18 decimal places + let inner: u128 = value.into_inner(); + UD60x18(inner.into()) + } +} + +impl UD60x18 { + pub fn into_inner(self) -> U256 { + self.0 + } +} diff --git a/snowbridge/parachain/primitives/core/src/ringbuffer.rs b/snowbridge/parachain/primitives/core/src/ringbuffer.rs new file mode 100644 index 00000000000..dcee20359a7 --- /dev/null +++ b/snowbridge/parachain/primitives/core/src/ringbuffer.rs @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use codec::FullCodec; +use core::{cmp::Ord, marker::PhantomData, ops::Add}; +use frame_support::storage::{types::QueryKindTrait, StorageMap, StorageValue}; +use sp_core::{Get, GetDefault}; +use sp_runtime::traits::{One, Zero}; + +/// Trait object presenting the ringbuffer interface. +pub trait RingBufferMap +where + Key: FullCodec, + Value: FullCodec, + QueryKind: QueryKindTrait, +{ + /// Insert a map entry. + fn insert(k: Key, v: Value); + + /// Check if map contains a key + fn contains_key(k: Key) -> bool; + + /// Get the value of the key + fn get(k: Key) -> QueryKind::Query; +} + +pub struct RingBufferMapImpl( + PhantomData<(Index, B, CurrentIndex, Intermediate, M, QueryKind)>, +); + +/// Ringbuffer implementation based on `RingBufferTransient` +impl + RingBufferMap + for RingBufferMapImpl +where + Key: FullCodec + Clone, + Value: FullCodec, + Index: Ord + One + Zero + Add + Copy + FullCodec + Eq, + B: Get, + CurrentIndex: StorageValue, + Intermediate: StorageMap, + M: StorageMap, + QueryKind: QueryKindTrait, +{ + /// Insert a map entry. + fn insert(k: Key, v: Value) { + let bound = B::get(); + let mut current_index = CurrentIndex::get(); + + // Adding one here as bound denotes number of items but our index starts with zero. + if (current_index + Index::one()) >= bound { + current_index = Index::zero(); + } else { + current_index = current_index + Index::one(); + } + + // Deleting earlier entry if it exists + if Intermediate::contains_key(current_index) { + let older_key = Intermediate::get(current_index); + M::remove(older_key); + } + + Intermediate::insert(current_index, k.clone()); + CurrentIndex::set(current_index); + M::insert(k, v); + } + + /// Check if map contains a key + fn contains_key(k: Key) -> bool { + M::contains_key(k) + } + + /// Get the value associated with key + fn get(k: Key) -> M::Query { + M::get(k) + } +} diff --git a/snowbridge/parachain/primitives/core/src/tests.rs b/snowbridge/parachain/primitives/core/src/tests.rs new file mode 100644 index 00000000000..725fff1a9c9 --- /dev/null +++ b/snowbridge/parachain/primitives/core/src/tests.rs @@ -0,0 +1,13 @@ +use crate::{ChannelId, ParaId}; +use hex_literal::hex; + +const EXPECT_CHANNEL_ID: [u8; 32] = + hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539"); + +// The Solidity equivalent code is tested in Gateway.t.sol:testDeriveChannelID +#[test] +fn generate_channel_id() { + let para_id: ParaId = 1000.into(); + let channel_id: ChannelId = para_id.into(); + assert_eq!(channel_id, EXPECT_CHANNEL_ID.into()); +} diff --git a/snowbridge/parachain/primitives/core/tests/fixtures/packet.scale b/snowbridge/parachain/primitives/core/tests/fixtures/packet.scale new file mode 100644 index 0000000000000000000000000000000000000000..d5f6696ea69fffd243e7b5b8eb5cef9a7943802c GIT binary patch literal 386 zcmey$@{`eO3a|PGwn>f$OiR<|zm;Bl`pg~PD;FOw$X>r+c>lSjPtL_$Twtw|kh$jl zS?;w<-}_0i&Ng4rqdapbBLjuNfq?!6$nxj^t@@rJ)2R`gdVXI+cf(Vr%+%t(^(>-d z?ZwGzC;u(1Q~eXvo@h4tq|k&po77ghPx+MPfvlelHWvXs+^mce@x_gJwk~)F6RXwch5{*^j}NN-C3"] +edition = "2021" +license = "Apache-2.0" + +[dependencies] +serde = { version = "1.0.188", optional = true, features = ["derive"] } +serde-big-array = { version = "0.3.2", optional = true, features = ["const-generics"] } +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 } +hex-literal = { version = "0.4.1", default-features = false } +parity-bytes = { version = "0.1.2", default-features = false } +rlp = { version = "0.5.2", default-features = false } + +sp-io = { path = "../../../../../substrate/primitives/io", default-features = false } +sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } +sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } +sp-runtime = { path = "../../../../../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_json = "1.0.96" + +[features] +default = ["std"] +expensive_tests = [] +std = [ + "codec/std", + "ethabi/std", + "ethbloom/std", + "ethereum-types/std", + "hex/std", + "parity-bytes/std", + "rlp/std", + "scale-info/std", + "serde", + "serde-big-array", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", +] diff --git a/snowbridge/parachain/primitives/ethereum/src/header.rs b/snowbridge/parachain/primitives/ethereum/src/header.rs new file mode 100644 index 00000000000..f0b51f8c79d --- /dev/null +++ b/snowbridge/parachain/primitives/ethereum/src/header.rs @@ -0,0 +1,414 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use codec::{Decode, Encode}; +use ethbloom::Bloom as EthBloom; +use hex_literal::hex; +use parity_bytes::Bytes; +use rlp::RlpStream; +use scale_info::TypeInfo; +use sp_io::hashing::keccak_256; +use sp_runtime::RuntimeDebug; +use sp_std::{convert::TryInto, prelude::*}; + +#[cfg(feature = "std")] +use serde::{Deserialize, Serialize}; + +#[cfg(feature = "std")] +use serde_big_array::BigArray; + +use ethereum_types::{Address, H256, H64, U256}; + +use crate::{mpt, receipt}; + +/// Complete block header id. +#[derive(Clone, Copy, Default, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] +pub struct HeaderId { + /// Header number. + pub number: u64, + /// Header hash. + pub hash: H256, +} + +const EMPTY_OMMERS_HASH: [u8; 32] = + hex!("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"); + +/// An Ethereum block header. +#[derive(Clone, Default, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +pub struct Header { + /// Parent block hash. + pub parent_hash: H256, + /// Block timestamp. + pub timestamp: u64, + /// Block number. + pub number: u64, + /// Block author. + pub author: Address, + + /// Transactions root. + pub transactions_root: H256, + /// Block ommers hash. + pub ommers_hash: H256, + /// Block extra data. + pub extra_data: Bytes, + + /// State root. + pub state_root: H256, + /// Block receipts root. + pub receipts_root: H256, + /// Block bloom. + pub logs_bloom: Bloom, + /// Gas used for contracts execution. + pub gas_used: U256, + /// Block gas limit. + pub gas_limit: U256, + + /// Block difficulty. + pub difficulty: U256, + /// Vector of post-RLP-encoded fields. + pub seal: Vec, + + // Base fee per gas (EIP-1559), only in headers from the London hardfork onwards. + pub base_fee: Option, +} + +impl Header { + /// Compute hash of this header (keccak of the RLP with seal). + pub fn compute_hash(&self) -> H256 { + keccak_256(&self.rlp(true)).into() + } + + /// Compute hash of the truncated header i.e. excluding seal. + pub fn compute_partial_hash(&self) -> H256 { + keccak_256(&self.rlp(false)).into() + } + + pub fn check_receipt_proof( + &self, + proof: &[Vec], + ) -> Option> { + match self.apply_merkle_proof(proof) { + Some((root, data)) if root == self.receipts_root => Some(rlp::decode(&data)), + Some((_, _)) => None, + None => None, + } + } + + pub fn apply_merkle_proof(&self, proof: &[Vec]) -> Option<(H256, Vec)> { + let mut iter = proof.iter().rev(); + let first_bytes = match iter.next() { + Some(b) => b, + None => return None, + }; + let item_to_prove: mpt::ShortNode = rlp::decode(first_bytes).ok()?; + + let final_hash: Option<[u8; 32]> = iter.try_fold(keccak_256(first_bytes), |acc, x| { + let node: Box = x.as_slice().try_into().ok()?; + if (*node).contains_hash(acc.into()) { + return Some(keccak_256(x)) + } + None + }); + + final_hash.map(|hash| (hash.into(), item_to_prove.value)) + } + + pub fn mix_hash(&self) -> Option { + let bytes: Bytes = self.decoded_seal_field(0, 32)?; + let size = bytes.len(); + let mut mix_hash = [0u8; 32]; + for i in 0..size { + mix_hash[31 - i] = bytes[size - 1 - i]; + } + Some(mix_hash.into()) + } + + pub fn nonce(&self) -> Option { + let bytes: Bytes = self.decoded_seal_field(1, 8)?; + let size = bytes.len(); + let mut nonce = [0u8; 8]; + for i in 0..size { + nonce[7 - i] = bytes[size - 1 - i]; + } + Some(nonce.into()) + } + + pub fn has_ommers(&self) -> bool { + self.ommers_hash != EMPTY_OMMERS_HASH.into() + } + + fn decoded_seal_field(&self, index: usize, max_len: usize) -> Option { + let bytes: Bytes = rlp::decode(self.seal.get(index)?).ok()?; + if bytes.len() > max_len { + return None + } + Some(bytes) + } + + /// Returns header RLP with or without seals. + /// For EIP-1559 baseFee addition refer to: + /// + fn rlp(&self, with_seal: bool) -> Bytes { + let mut s = RlpStream::new(); + + let stream_length_without_seal = if self.base_fee.is_some() { 14 } else { 13 }; + + if with_seal { + s.begin_list(stream_length_without_seal + self.seal.len()); + } else { + s.begin_list(stream_length_without_seal); + } + + s.append(&self.parent_hash); + s.append(&self.ommers_hash); + s.append(&self.author); + s.append(&self.state_root); + s.append(&self.transactions_root); + s.append(&self.receipts_root); + s.append(&EthBloom::from(self.logs_bloom.0)); + s.append(&self.difficulty); + s.append(&self.number); + s.append(&self.gas_limit); + s.append(&self.gas_used); + s.append(&self.timestamp); + s.append(&self.extra_data); + + if with_seal { + for b in &self.seal { + s.append_raw(b, 1); + } + } + + if let Some(base_fee) = self.base_fee { + s.append(&base_fee); + } + + s.out().to_vec() + } +} + +/// Logs bloom. +#[derive(Clone, Debug, Encode, Decode, TypeInfo)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +pub struct Bloom(#[cfg_attr(feature = "std", serde(with = "BigArray"))] [u8; 256]); + +impl<'a> From<&'a [u8; 256]> for Bloom { + fn from(buffer: &'a [u8; 256]) -> Bloom { + Bloom(*buffer) + } +} + +impl PartialEq for Bloom { + fn eq(&self, other: &Bloom) -> bool { + self.0.iter().zip(other.0.iter()).all(|(l, r)| l == r) + } +} + +impl Default for Bloom { + fn default() -> Self { + Bloom([0; 256]) + } +} + +impl rlp::Decodable for Bloom { + fn decode(rlp: &rlp::Rlp) -> Result { + let v: Vec = rlp.as_val()?; + match v.len() { + 256 => { + let mut bytes = [0u8; 256]; + bytes.copy_from_slice(&v); + Ok(Self(bytes)) + }, + _ => Err(rlp::DecoderError::Custom("Expected 256 bytes")), + } + } +} + +#[cfg(test)] +mod tests { + + use super::*; + + #[test] + fn bloom_decode_rlp() { + let raw_bloom = hex!( + " + b901000420000000000000000000008002000000000001000000000001000000000000000000 + 0000000000000000000000000002000000080000000000000000200000000000000000000000 + 0000080000002200000000004000100000000000000000000000000000000000000000000000 + 0000000000000004000000001000010000000000080000000000400000000000000000000000 + 0000080000004000000000020000000000020000000000000000000000000000000000000000 + 0000040000000000020000000001000000000000000000000000000010000000020000200000 + 10200000000000010000000000000000000000000000000000000010000000 + " + ); + let expected_bytes = &raw_bloom[3..]; + let bloom: Bloom = rlp::decode(&raw_bloom).unwrap(); + assert_eq!(bloom.0, expected_bytes); + } + + #[test] + fn header_compute_hash_poa() { + // PoA header + let header = Header { + parent_hash: Default::default(), + timestamp: 0, + number: 0, + author: Default::default(), + transactions_root: hex!( + "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" + ) + .into(), + ommers_hash: hex!("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347") + .into(), + extra_data: vec![], + state_root: hex!("eccf6b74c2bcbe115c71116a23fe963c54406010c244d9650526028ad3e32cce") + .into(), + receipts_root: hex!("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421") + .into(), + logs_bloom: Default::default(), + gas_used: Default::default(), + gas_limit: 0x222222.into(), + difficulty: 0x20000.into(), + seal: vec![vec![0x80], { + let mut vec = vec![0xb8, 0x41]; + vec.resize(67, 0); + vec + }], + base_fee: None, + }; + assert_eq!( + header.compute_hash().as_bytes(), + hex!("9ff57c7fa155853586382022f0982b71c51fa313a0942f8c456300896643e890"), + ); + } + + #[test] + fn header_compute_hash_pow() { + // + let nonce = hex!("6935bbe7b63c4f8e").to_vec(); + let mix_hash = + hex!("be3adfb0087be62b28b716e2cdf3c79329df5caa04c9eee035d35b5d52102815").to_vec(); + let header = Header { + parent_hash: hex!("bede0bddd6f32c895fc505ffe0c39d9bde58e9a5272f31a3dee448b796edcbe3") + .into(), + timestamp: 1603160977, + number: 11090290, + author: hex!("ea674fdde714fd979de3edf0f56aa9716b898ec8").into(), + transactions_root: hex!( + "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" + ) + .into(), + ommers_hash: hex!("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347") + .into(), + extra_data: hex!("65746865726d696e652d61736961312d33").to_vec(), + state_root: hex!("7dcb8aca872b712bad81df34a89d4efedc293566ffc3eeeb5cbcafcc703e42c9") + .into(), + receipts_root: hex!("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421") + .into(), + logs_bloom: Default::default(), + gas_used: 0.into(), + gas_limit: 0xbe8c19.into(), + difficulty: 0xbc140caa61087i64.into(), + seal: vec![rlp::encode(&mix_hash).to_vec(), rlp::encode(&nonce).to_vec()], + base_fee: None, + }; + assert_eq!( + header.compute_hash().as_bytes(), + hex!("0f9bdc91c2e0140acb873330742bda8c8181fa3add91fe7ae046251679cedef7"), + ); + } + + #[test] + fn header_pow_seal_fields_extracted_correctly() { + let nonce: H64 = hex!("6935bbe7b63c4f8e").into(); + let mix_hash: H256 = + hex!("be3adfb0087be62b28b716e2cdf3c79329df5caa04c9eee035d35b5d52102815").into(); + let header = Header { + seal: vec![ + rlp::encode(&mix_hash.0.to_vec()).to_vec(), + rlp::encode(&nonce.0.to_vec()).to_vec(), + ], + ..Default::default() + }; + + assert_eq!(header.nonce().unwrap(), nonce); + assert_eq!(header.mix_hash().unwrap(), mix_hash); + } + + #[test] + fn header_pow_seal_fields_return_none_for_invalid_values() { + let nonce = hex!("696935bbe7b63c4f8e").to_vec(); + let mix_hash = + hex!("bebe3adfb0087be62b28b716e2cdf3c79329df5caa04c9eee035d35b5d52102815").to_vec(); + let mut header = Header { + seal: vec![rlp::encode(&mix_hash).to_vec(), rlp::encode(&nonce).to_vec()], + ..Default::default() + }; + assert_eq!(header.nonce(), None); + assert_eq!(header.mix_hash(), None); + + header.seal = Vec::new(); + assert_eq!(header.nonce(), None); + assert_eq!(header.mix_hash(), None); + } + + #[test] + fn header_check_receipt_proof() { + let header = Header { + receipts_root: hex!("fd5e397a84884641f53c496804f24b5276cbb8c5c9cfc2342246be8e3ce5ad02") + .into(), + ..Default::default() + }; + + // Valid proof + let proof_receipt5 = vec!( + hex!("f90131a0b5ba404eb5a6a88e56579f4d37ef9813b5ad7f86f0823ff3b407ac5a6bb465eca0398ead2655e78e03c127ce22c5830e90f18b1601ec055f938336c084feb915a9a026d322c26e46c50942c1aabde50e36df5cde572aed650ce73ea3182c6e90a02ca00600a356135f4db1db0d9842264cdff2652676f881669e91e316c0b6dd783011a0837f1deb4075336da320388c1edfffc56c448a43f4a5ba031300d32a7b509fc5a01c3ac82fd65b4aba7f9afaf604d9c82ec7e2deb573a091ae235751bc5c0c288da05d454159d9071b0f68b6e0503d290f23ac7602c1db0c569dee4605d8f5298f09a00bbed10350ec954448df795f6fd46e3faefc800ede061b3840eedc6e2b07a74da0acb02d26a3650f2064c14a435fdf1f668d8655daf455ebdf671713a7c089b3898080808080808080").to_vec(), + hex!("f901f180a00046a08d4f0bdbdc6b31903086ce323182bce6725e7d9415f7ff91ee8f4820bda0e7cd26ad5f3d2771e4b5ab788e268a14a10209f94ee918eb6c829d21d3d11c1da00d4a56d9e9a6751874fd86c7e3cb1c6ad5a848da62751325f478978a00ea966ea064b81920c8f04a8a1e21f53a8280e739fbb7b00b2ab92493ca3f610b70e8ac85a0b1040ed4c55a73178b76abb16f946ce5bebd6b93ab873c83327df54047d12c27a0de6485e9ac58dc6e2b04b4bb38f562684f0b1a2ee586cc11079e7d9a9dc40b32a0d394f4d3532c3124a65fa36e69147e04fd20453a72ee9c50660f17e13ce9df48a066501003fc3e3478efd2803cd0eded6bbe9243ca01ba754d6327071ddbcbc649a0b2684e518f325fee39fc8ea81b68f3f5c785be00d087f3bed8857ae2ee8da26ea071060a5c52042e8d7ce21092f8ecf06053beb9a0b773a6f91a30c4220aa276b2a0fc22436632574ccf6043d0986dede27ea94c9ca9a3bb5ec03ce776a4ddef24a9a05a8a1d6698c4e7d8cc3a2506cb9b12ea9a079c9c7099bc919dc804033cc556e4a0170c468b0716fd36d161f0bf05875f15756a2976de92f9efe7716320509d79c9a0182f909a90cab169f3efb62387f9cccdd61440acc4deec42f68a4f7ca58075c7a055cf0e9202ac75689b76318f1171f3a44465eddc06aae0713bfb6b34fdd27b7980").to_vec(), + hex!("f904de20b904daf904d701830652f0b9010004200000000000000000000080020000000000010000000000010000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000000000008000000220000000000400010000000000000000000000000000000000000000000000000000000000000040000000010000100000000000800000000004000000000000000000000000000080000004000000000020000000000020000000000000000000000000000000000000000000004000000000002000000000100000000000000000000000000001000000002000020000010200000000000010000000000000000000000000000000000000010000000f903ccf89b9421130f34829b4c343142047a28ce96ec07814b15f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa00000000000000000000000007d843005c7433c16b27ff939cb37471541561ebda0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a000000000000000000000000000000000000000000000000000000005d09b7380f89b9421130f34829b4c343142047a28ce96ec07814b15f863a08c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a00000000000000000000000007d843005c7433c16b27ff939cb37471541561ebda00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da0ffffffffffffffffffffffffffffffffffffffffffffffffffffffcc840c6920f89b94c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da000000000000000000000000000000000000000000000000003e973b5a5d1078ef87994e9c1281aae66801fa35ec404d5f2aea393ff6988e1a01c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1b840000000000000000000000000000000000000000000000000000001f1420ad1d40000000000000000000000000000000000000000000000014ad400879d159a38f8fc94e9c1281aae66801fa35ec404d5f2aea393ff6988f863a0d78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488db88000000000000000000000000000000000000000000000000000000005d415f3320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e973b5a5d1078ef87a94c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f842a07fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da000000000000000000000000000000000000000000000000003e973b5a5d1078e").to_vec(), + ); + assert!(header.check_receipt_proof(&proof_receipt5).is_some()); + + // Various invalid proofs + let proof_empty: Vec> = vec![]; + let proof_missing_full_node = vec![proof_receipt5[0].clone(), proof_receipt5[2].clone()]; + let proof_missing_short_node1 = vec![proof_receipt5[0].clone(), proof_receipt5[1].clone()]; + let proof_missing_short_node2 = vec![proof_receipt5[0].clone()]; + let proof_invalid_encoding = vec![proof_receipt5[2][2..].to_vec()]; + let proof_no_full_node = vec![proof_receipt5[2].clone(), proof_receipt5[2].clone()]; + assert!(header.check_receipt_proof(&proof_empty).is_none()); + assert!(header.check_receipt_proof(&proof_missing_full_node).is_none()); + + assert_eq!( + header.check_receipt_proof(&proof_missing_short_node1), + Some(Err(rlp::DecoderError::Custom("Unsupported receipt type"))) + ); + + assert_eq!( + header.check_receipt_proof(&proof_missing_short_node2), + Some(Err(rlp::DecoderError::Custom("Unsupported receipt type"))) + ); + + assert!(header.check_receipt_proof(&proof_invalid_encoding).is_none()); + assert!(header.check_receipt_proof(&proof_no_full_node).is_none()); + } + + #[test] + fn header_check_receipt_proof_with_intermediate_short_node() { + let header = Header { + receipts_root: hex!("d128e3a57142d2bf15bc0cbcac7ad54f40750d571b5c3097e425882c10c9ba66") + .into(), + ..Default::default() + }; + + let proof_receipt263 = vec![ + hex!("f90131a00d3cb8d3f57ac1c0e12918a2ebe0cafed8c273577b9dd73e7ed1079b403ef494a0678b9835b834f8a287c0dd33a8fca9146e456ca688555ed4ec1361a2180b778da0fe42da181a46677a043b3d9d4b8bb05a6a17b7b5c010c17e7c1d31cfb7c4f911a0c89f0e2c53241cdb578e1f2b4caf6ba36e00500bdc57fecd66b84a6a58394c19a086c3c1fae5a0575940b5d38e111c469d07883106c26856f3ef608469a2081f13a06c5992ff00aab6226a70a032fd2f571ba22f797321f45e2daa73020d638d21b0a050861e9503ef68728f6c90a44f7fe1bceb2a9bdab6957bbe7136166bd849561ea006aa6eaca8a07e57176e9aa41e6a09edfb7678d1a112404e0ec779d7e567e82ea0bb0b430d303ba21b0af11c487b8a218bd75db54c98940b3f11bad8ff47cad3ef8080808080808080").to_vec(), + hex!("f871a0246de222036ee6a03329b0105da0a6b3f916fc95a9ed5a403a581a0c4d74242ca0ac108a49a88b57a05ac34a108b39f1e45f6f167f2b9fbc8d52fb58e2e5a6af1ea0fcfe07ac2ccd3c28b6eab68d1bce112f6f6dbd9023e4ec3c05b96615aa803d798080808080808080808080808080").to_vec(), + hex!("e4820001a04fff54398cad4d05ea6abfd8b0f3b4fe14c04d7ff5f5211c5b927d9cf72ac1d8").to_vec(), + hex!("f851a096d010643ca2d47412ca66898286b5f2412963b9ec051b33e570d575914c9c5ca028cd24c652989542fe89479ec6388eac4592432242af5ba97563b3ac7c71c019808080808080808080808080808080").to_vec(), + hex!("f90211a0bb35a84c5b1dcb78ec9d32614912c696e62df77bebf9ab326ee55b5d3acdde46a01084b30dac8df0accfcd0fd6330b7f6fc72a4651246d0694be9162151686a620a03eed50afdce7909d784c6157c445a444c806b5f23d31f3b63786f600c84a95b2a0af5232f1df6c6d41879804d081abe867002abe26ba3e5f8e0254a83a54769831a0607915fb13dd5da594256389a45007a67a7f7a86e95d38d8462792b6c98a722ea00e1260fda1730f2738c650ce2bfba83857bc10f8fb119ebc4fb39acba24e6fbaa0d11de17e417327457812675ca3b84ae8e1b64827abfe01420953697c8313d5b1a05fcaf2f7a88f76336a0c32ffc78acb87ae2005454bd25d658035331be3173b46a03f94f4952ab9e650f83cfd0e7f367b1bcc493aacf39a06f16c4a2e1b5605da48a0bdb4ec79785ca8ae22d60f1bbd42d707b4d7ec4aff231a3ebab755e315b35053a043a67c3f2bcef37c8f47a673adcb7061007a553696d1092408601c11b2e6846aa0c519d5af48cae87c7f4538845417c9735813bee892a6fe2dda79f5c414e8576aa0f7058256e09589501d7c231d739e61c84a850e139690989d24fda6058b432e98a081a52faab520978cb19ce14400dba0cd5bcdc4e5a3c0740678aa8f97ee0e5c56a0bcecc61cadeae52518e3b68a48af4b11603dfd9d99d99d7985efa6d2de44f904a02cba4accfc6f39bc5adb6d4440eb6358b4a5103ef93298e4e694f1f940f8b48280").to_vec(), + hex!("f901ae20b901aaf901a70183bb444eb9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000001000000000000000000000000000100000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000010000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000002000000000000000000081000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000f89df89b94dac17f958d2ee523a2206206994597c13d831ec7f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa00000000000000000000000002e514404ff6823f1b46a8318a709251db414e5e1a000000000000000000000000055021c55847c00d764357a352e5803237d328954a0000000000000000000000000000000000000000000000000000000000201c370").to_vec(), + ]; + assert!(header.check_receipt_proof(&proof_receipt263).is_some()); + } +} diff --git a/snowbridge/parachain/primitives/ethereum/src/lib.rs b/snowbridge/parachain/primitives/ethereum/src/lib.rs new file mode 100644 index 00000000000..1a10ea9abb7 --- /dev/null +++ b/snowbridge/parachain/primitives/ethereum/src/lib.rs @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +#![cfg_attr(not(feature = "std"), no_std)] + +pub mod header; +pub mod log; +pub mod mpt; +pub mod receipt; + +pub use ethereum_types::{Address, H160, H256, H64, U256}; + +pub use header::{Bloom, Header, HeaderId}; +pub use log::Log; +pub use receipt::Receipt; + +#[derive(Debug)] +pub enum DecodeError { + // Unexpected RLP data + InvalidRLP(rlp::DecoderError), + // Data does not match expected ABI + InvalidABI(ethabi::Error), + // Invalid message payload + InvalidPayload, +} + +impl From for DecodeError { + fn from(err: rlp::DecoderError) -> Self { + DecodeError::InvalidRLP(err) + } +} + +impl From for DecodeError { + fn from(err: ethabi::Error) -> Self { + DecodeError::InvalidABI(err) + } +} diff --git a/snowbridge/parachain/primitives/ethereum/src/log.rs b/snowbridge/parachain/primitives/ethereum/src/log.rs new file mode 100644 index 00000000000..7b8e35bb113 --- /dev/null +++ b/snowbridge/parachain/primitives/ethereum/src/log.rs @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use codec::{Decode, Encode}; +use ethereum_types::{H160, H256}; +use sp_std::prelude::*; + +#[derive(Clone, Debug, Encode, Decode, PartialEq, Eq)] +pub struct Log { + pub address: H160, + pub topics: Vec, + pub data: Vec, +} + +impl rlp::Decodable for Log { + /// We need to implement rlp::Decodable manually as the derive macro RlpDecodable + /// didn't seem to generate the correct code for parsing our logs. + fn decode(rlp: &rlp::Rlp) -> Result { + let mut iter = rlp.iter(); + + let address: H160 = match iter.next() { + Some(data) => data.as_val()?, + None => return Err(rlp::DecoderError::Custom("Expected log address")), + }; + + let topics: Vec = match iter.next() { + Some(data) => data.as_list()?, + None => return Err(rlp::DecoderError::Custom("Expected log topics")), + }; + + let data: Vec = match iter.next() { + Some(data) => data.data()?.to_vec(), + None => return Err(rlp::DecoderError::Custom("Expected log data")), + }; + + Ok(Self { address, topics, data }) + } +} + +#[cfg(test)] +mod tests { + + use super::Log; + use hex_literal::hex; + + const RAW_LOG: [u8; 605] = hex!( + " + f9025a941cfd66659d44cfe2e627c5742ba7477a3284cffae1a0266413be5700ce8dd5ac6b9a7dfb + abe99b3e45cae9a68ac2757858710b401a38b9022000000000000000000000000000000000000000 + 00000000000000000000000060000000000000000000000000000000000000000000000000000000 + 00000000c00000000000000000000000000000000000000000000000000000000000000100000000 + 00000000000000000000000000000000000000000000000000000000283163466436363635394434 + 34636665324536323763353734324261373437376133323834634666410000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000000000000000000000 + 000000000773656e6445544800000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000001000000000000000000000000 + 00cffeaaf7681c89285d65cfbe808b80e50269657300000000000000000000000000000000000000 + 000000000000000000000000a0000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000000000000a000000 + 00000000000000000000000000000000000000000000000000000000020000000000000000000000 + 00000000000000000000000000000000000000002f3146524d4d3850456957585961783772705336 + 5834585a5831614141785357783143724b5479725659685632346667000000000000000000000000 + 0000000000 + " + ); + + #[test] + fn decode_log() { + let log: Log = rlp::decode(&RAW_LOG).unwrap(); + assert_eq!(log.address.as_bytes(), hex!["1cfd66659d44cfe2e627c5742ba7477a3284cffa"]); + assert_eq!( + log.topics[0].as_bytes(), + hex!["266413be5700ce8dd5ac6b9a7dfbabe99b3e45cae9a68ac2757858710b401a38"] + ); + } +} diff --git a/snowbridge/parachain/primitives/ethereum/src/mpt.rs b/snowbridge/parachain/primitives/ethereum/src/mpt.rs new file mode 100644 index 00000000000..9a2dae486dc --- /dev/null +++ b/snowbridge/parachain/primitives/ethereum/src/mpt.rs @@ -0,0 +1,142 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! Helper types to work with Ethereum's Merkle Patricia Trie nodes + +use ethereum_types::H256; +use sp_std::{convert::TryFrom, prelude::*}; + +pub trait Node { + fn contains_hash(&self, hash: H256) -> bool; +} + +impl TryFrom<&[u8]> for Box { + type Error = rlp::DecoderError; + + fn try_from(bytes: &[u8]) -> Result, Self::Error> { + let rlp = rlp::Rlp::new(bytes); + match rlp.item_count()? { + 2 => { + let node: ShortNode = rlp.as_val()?; + Ok(Box::new(node)) + }, + 17 => { + let node: FullNode = rlp.as_val()?; + Ok(Box::new(node)) + }, + _ => Err(rlp::DecoderError::Custom("Invalid number of list elements")), + } + } +} + +/// Intermediate trie node with children (refers to node with same name in Geth). +/// This struct only handles the proof representation, i.e. a child is either empty +/// or a 32-byte hash of its subtree. +pub struct FullNode { + pub children: Vec>, +} + +impl rlp::Decodable for FullNode { + fn decode(rlp: &rlp::Rlp) -> Result { + let children: Vec> = rlp + .iter() + .map(|item| { + let v: Vec = item.as_val()?; + match v.len() { + 0 => Ok(None), + 32 => { + let mut bytes = [0u8; 32]; + bytes.copy_from_slice(&v); + Ok(Some(bytes.into())) + }, + _ => Err(rlp::DecoderError::Custom("Expected 32-byte hash or empty child")), + } + }) + .collect::>()?; + + Ok(Self { children }) + } +} + +impl Node for FullNode { + fn contains_hash(&self, hash: H256) -> bool { + self.children.iter().any(|h| Some(hash) == *h) + } +} + +/// Trie node where `value` is either the RLP-encoded item we're +/// proving or an intermediate hash (refers to node with same name in Geth) +/// Proof verification should return `value`. `key` is an implementation +/// detail of the trie. +pub struct ShortNode { + pub key: Vec, + pub value: Vec, +} + +impl rlp::Decodable for ShortNode { + fn decode(rlp: &rlp::Rlp) -> Result { + let mut iter = rlp.iter(); + + let key: Vec = match iter.next() { + Some(data) => data.as_val()?, + None => return Err(rlp::DecoderError::Custom("Expected key bytes")), + }; + + let value: Vec = match iter.next() { + Some(data) => data.as_val()?, + None => return Err(rlp::DecoderError::Custom("Expected value bytes")), + }; + + Ok(Self { key, value }) + } +} + +impl Node for ShortNode { + fn contains_hash(&self, hash: H256) -> bool { + self.value == hash.0 + } +} + +#[cfg(test)] +mod tests { + + use super::*; + use hex_literal::hex; + + const RAW_PROOF: [&[u8]; 3] = [ + &hex!("f90131a0b5ba404eb5a6a88e56579f4d37ef9813b5ad7f86f0823ff3b407ac5a6bb465eca0398ead2655e78e03c127ce22c5830e90f18b1601ec055f938336c084feb915a9a026d322c26e46c50942c1aabde50e36df5cde572aed650ce73ea3182c6e90a02ca00600a356135f4db1db0d9842264cdff2652676f881669e91e316c0b6dd783011a0837f1deb4075336da320388c1edfffc56c448a43f4a5ba031300d32a7b509fc5a01c3ac82fd65b4aba7f9afaf604d9c82ec7e2deb573a091ae235751bc5c0c288da05d454159d9071b0f68b6e0503d290f23ac7602c1db0c569dee4605d8f5298f09a00bbed10350ec954448df795f6fd46e3faefc800ede061b3840eedc6e2b07a74da0acb02d26a3650f2064c14a435fdf1f668d8655daf455ebdf671713a7c089b3898080808080808080"), + &hex!("f901f180a00046a08d4f0bdbdc6b31903086ce323182bce6725e7d9415f7ff91ee8f4820bda0e7cd26ad5f3d2771e4b5ab788e268a14a10209f94ee918eb6c829d21d3d11c1da00d4a56d9e9a6751874fd86c7e3cb1c6ad5a848da62751325f478978a00ea966ea064b81920c8f04a8a1e21f53a8280e739fbb7b00b2ab92493ca3f610b70e8ac85a0b1040ed4c55a73178b76abb16f946ce5bebd6b93ab873c83327df54047d12c27a0de6485e9ac58dc6e2b04b4bb38f562684f0b1a2ee586cc11079e7d9a9dc40b32a0d394f4d3532c3124a65fa36e69147e04fd20453a72ee9c50660f17e13ce9df48a066501003fc3e3478efd2803cd0eded6bbe9243ca01ba754d6327071ddbcbc649a0b2684e518f325fee39fc8ea81b68f3f5c785be00d087f3bed8857ae2ee8da26ea071060a5c52042e8d7ce21092f8ecf06053beb9a0b773a6f91a30c4220aa276b2a0fc22436632574ccf6043d0986dede27ea94c9ca9a3bb5ec03ce776a4ddef24a9a05a8a1d6698c4e7d8cc3a2506cb9b12ea9a079c9c7099bc919dc804033cc556e4a0170c468b0716fd36d161f0bf05875f15756a2976de92f9efe7716320509d79c9a0182f909a90cab169f3efb62387f9cccdd61440acc4deec42f68a4f7ca58075c7a055cf0e9202ac75689b76318f1171f3a44465eddc06aae0713bfb6b34fdd27b7980"), + &hex!("f904de20b904daf904d701830652f0b9010004200000000000000000000080020000000000010000000000010000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000000000008000000220000000000400010000000000000000000000000000000000000000000000000000000000000040000000010000100000000000800000000004000000000000000000000000000080000004000000000020000000000020000000000000000000000000000000000000000000004000000000002000000000100000000000000000000000000001000000002000020000010200000000000010000000000000000000000000000000000000010000000f903ccf89b9421130f34829b4c343142047a28ce96ec07814b15f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa00000000000000000000000007d843005c7433c16b27ff939cb37471541561ebda0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a000000000000000000000000000000000000000000000000000000005d09b7380f89b9421130f34829b4c343142047a28ce96ec07814b15f863a08c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a00000000000000000000000007d843005c7433c16b27ff939cb37471541561ebda00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da0ffffffffffffffffffffffffffffffffffffffffffffffffffffffcc840c6920f89b94c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da000000000000000000000000000000000000000000000000003e973b5a5d1078ef87994e9c1281aae66801fa35ec404d5f2aea393ff6988e1a01c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1b840000000000000000000000000000000000000000000000000000001f1420ad1d40000000000000000000000000000000000000000000000014ad400879d159a38f8fc94e9c1281aae66801fa35ec404d5f2aea393ff6988f863a0d78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488db88000000000000000000000000000000000000000000000000000000005d415f3320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e973b5a5d1078ef87a94c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f842a07fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da000000000000000000000000000000000000000000000000003e973b5a5d1078e"), + ]; + + #[test] + fn decode_full_node() { + let node1: FullNode = rlp::decode(RAW_PROOF[0]).unwrap(); + let node2: FullNode = rlp::decode(RAW_PROOF[1]).unwrap(); + assert_eq!(node1.children.len(), 17); + assert_eq!(node2.children.len(), 17); + assert_eq!(node1.children.iter().filter(|c| c.is_none()).count(), 8); + assert_eq!(node2.children.iter().filter(|c| c.is_none()).count(), 2); + + let result: Result = rlp::decode(RAW_PROOF[2]); + assert!(result.is_err()); + } + + #[test] + fn decode_short_node() { + // key + item value + let node: ShortNode = rlp::decode(RAW_PROOF[2]).unwrap(); + assert_eq!(node.key, vec![32]); + assert!(!node.value.is_empty()); + + // key + item hash + let node: ShortNode = rlp::decode(&hex!( + "e4820001a04fff54398cad4d05ea6abfd8b0f3b4fe14c04d7ff5f5211c5b927d9cf72ac1d8" + )) + .unwrap(); + assert_eq!(node.key, vec![0, 1]); + assert_eq!( + node.value, + hex!("4fff54398cad4d05ea6abfd8b0f3b4fe14c04d7ff5f5211c5b927d9cf72ac1d8").to_vec() + ); + } +} diff --git a/snowbridge/parachain/primitives/ethereum/src/receipt.rs b/snowbridge/parachain/primitives/ethereum/src/receipt.rs new file mode 100644 index 00000000000..665a93dbb1e --- /dev/null +++ b/snowbridge/parachain/primitives/ethereum/src/receipt.rs @@ -0,0 +1,139 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +use crate::{Bloom, Log}; +use codec::{Decode, Encode}; +use sp_runtime::RuntimeDebug; +use sp_std::prelude::*; + +#[derive(Clone, Default, Encode, Decode, PartialEq, RuntimeDebug)] +pub struct Receipt { + pub post_state_or_status: Vec, + pub cumulative_gas_used: u64, + pub bloom: Bloom, + pub logs: Vec, +} + +impl Receipt { + pub fn contains_log(&self, log: &Log) -> bool { + self.logs.iter().any(|l| l == log) + } + + fn decode_list(rlp: &rlp::Rlp) -> Result { + let mut iter = rlp.iter(); + + let post_state_or_status: Vec = match iter.next() { + Some(data) => data.as_val()?, + None => return Err(rlp::DecoderError::Custom("Expected receipt post state or status")), + }; + + let cumulative_gas_used: u64 = match iter.next() { + Some(data) => data.as_val()?, + None => return Err(rlp::DecoderError::Custom("Expected receipt cumulative gas used")), + }; + + let bloom: Bloom = match iter.next() { + Some(data) => data.as_val()?, + None => return Err(rlp::DecoderError::Custom("Expected receipt bloom")), + }; + + let logs: Vec = match iter.next() { + Some(data) => data.as_list()?, + None => return Err(rlp::DecoderError::Custom("Expected receipt logs")), + }; + + Ok(Self { post_state_or_status, cumulative_gas_used, bloom, logs }) + } +} + +impl rlp::Decodable for Receipt { + fn decode(rlp: &rlp::Rlp) -> Result { + if rlp.is_data() { + // Typed receipt + let data = rlp.as_raw(); + match data[0] { + // 1 = EIP-2930, 2 = EIP-1559 + 1 | 2 => { + let receipt_rlp = &rlp::Rlp::new(&data[1..]); + if !receipt_rlp.is_list() { + return Err(rlp::DecoderError::RlpExpectedToBeList) + } + Self::decode_list(&rlp::Rlp::new(&data[1..])) + }, + _ => Err(rlp::DecoderError::Custom("Unsupported receipt type")), + } + } else if rlp.is_list() { + // Legacy receipt + Self::decode_list(rlp) + } else { + Err(rlp::DecoderError::RlpExpectedToBeList) + } + } +} + +#[cfg(test)] +mod tests { + + use super::Receipt; + use hex_literal::hex; + + const RAW_RECEIPT: [u8; 1242] = hex!( + " + f904d701830652f0b901000420000000000000000000008002000000000001000000000001000000 + 00000000000000000000000000000000000000020000000800000000000000002000000000000000 + 00000000000008000000220000000000400010000000000000000000000000000000000000000000 + 00000000000000000004000000001000010000000000080000000000400000000000000000000000 + 00000800000040000000000200000000000200000000000000000000000000000000000000000000 + 04000000000002000000000100000000000000000000000000001000000002000020000010200000 + 000000010000000000000000000000000000000000000010000000f903ccf89b9421130f34829b4c + 343142047a28ce96ec07814b15f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a116 + 28f55a4df523b3efa00000000000000000000000007d843005c7433c16b27ff939cb37471541561e + bda0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a00000000000 + 0000000000000000000000000000000000000000000005d09b7380f89b9421130f34829b4c343142 + 047a28ce96ec07814b15f863a08c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200a + c8c7c3b925a00000000000000000000000007d843005c7433c16b27ff939cb37471541561ebda000 + 00000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da0ffffffffffffffff + ffffffffffffffffffffffffffffffffffffffcc840c6920f89b94c02aaa39b223fe8d0a0e5c4f27 + ead9083c756cc2f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523 + b3efa0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a000000000 + 00000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da00000000000000000000000 + 0000000000000000000000000003e973b5a5d1078ef87994e9c1281aae66801fa35ec404d5f2aea3 + 93ff6988e1a01c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1b840 + 000000000000000000000000000000000000000000000000000001f1420ad1d40000000000000000 + 000000000000000000000000000000014ad400879d159a38f8fc94e9c1281aae66801fa35ec404d5 + f2aea393ff6988f863a0d78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159 + d822a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da000000000 + 00000000000000007a250d5630b4cf539739df2c5dacb4c659f2488db88000000000000000000000 + 000000000000000000000000000000000005d415f332000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000003e973b5a5d1078ef87a + 94c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f842a07fcf532c15f0a6db0bd6d0e038bea71d + 30d808c7d98cb3bf7268a95bf5081b65a00000000000000000000000007a250d5630b4cf539739df + 2c5dacb4c659f2488da000000000000000000000000000000000000000000000000003e973b5a5d1 + 078e + " + ); + + #[test] + fn decode_legacy_receipt() { + let receipt: Receipt = rlp::decode(&RAW_RECEIPT).unwrap(); + assert_eq!(receipt.post_state_or_status, vec!(1)); + assert_eq!(receipt.cumulative_gas_used, 414448); + assert_eq!( + receipt.bloom, + (&hex!( + " + 042000000000000000000000800200000000000100000000000100000000000000000000 + 000000000000000000000000020000000800000000000000002000000000000000000000 + 000000080000002200000000004000100000000000000000000000000000000000000000 + 000000000000000000000400000000100001000000000008000000000040000000000000 + 000000000000000800000040000000000200000000000200000000000000000000000000 + 000000000000000000040000000000020000000001000000000000000000000000000010 + 000000020000200000102000000000000100000000000000000000000000000000000000 + 10000000 + " + )) + .into(), + ); + assert_eq!(receipt.logs.len(), 6); + } +} diff --git a/snowbridge/parachain/primitives/router/Cargo.toml b/snowbridge/parachain/primitives/router/Cargo.toml new file mode 100644 index 00000000000..7badfebb606 --- /dev/null +++ b/snowbridge/parachain/primitives/router/Cargo.toml @@ -0,0 +1,61 @@ +[package] +name = "snowbridge-router-primitives" +description = "Snowbridge Router Primitives" +version = "0.1.1" +authors = ["Snowfork "] +edition = "2021" +license = "Apache-2.0" + +[dependencies] +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 = "../../../../../substrate/frame/support", default-features = false } +frame-system = { path = "../../../../../substrate/frame/system", default-features = false } +sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } +sp-io = { path = "../../../../../substrate/primitives/io", default-features = false } +sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } +sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } + +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false } + +snowbridge-core = { path = "../../primitives/core", default-features = false } + +ethabi = { git = "https://github.com/Snowfork/ethabi-decode.git", package = "ethabi-decode", branch = "master", default-features = false } + +hex-literal = { version = "0.4.1" } + +[dev-dependencies] +hex = { package = "rustc-hex", version = "2.1.0" } + +[features] +default = ["std"] +std = [ + "codec/std", + "ethabi/std", + "frame-support/std", + "frame-system/std", + "log/std", + "scale-info/std", + "serde", + "snowbridge-core/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm/std", +] +runtime-benchmarks = [ + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "snowbridge-core/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", +] diff --git a/snowbridge/parachain/primitives/router/src/inbound/mod.rs b/snowbridge/parachain/primitives/router/src/inbound/mod.rs new file mode 100644 index 00000000000..a07e0eae5d7 --- /dev/null +++ b/snowbridge/parachain/primitives/router/src/inbound/mod.rs @@ -0,0 +1,320 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! Converts messages from Ethereum to XCM messages + +#[cfg(test)] +mod tests; + +use codec::{Decode, Encode}; +use core::marker::PhantomData; +use frame_support::{traits::tokens::Balance as BalanceT, weights::Weight, PalletError}; +use scale_info::TypeInfo; +use sp_core::{Get, RuntimeDebug, H160}; +use sp_io::hashing::blake2_256; +use sp_runtime::MultiAddress; +use sp_std::prelude::*; +use xcm::prelude::{Junction::AccountKey20, *}; +use xcm_executor::traits::ConvertLocation; + +const MINIMUM_DEPOSIT: u128 = 1; + +/// Messages from Ethereum are versioned. This is because in future, +/// we may want to evolve the protocol so that the ethereum side sends XCM messages directly. +/// Instead having BridgeHub transcode the messages into XCM. +#[derive(Clone, Encode, Decode, RuntimeDebug)] +pub enum VersionedMessage { + V1(MessageV1), +} + +/// For V1, the ethereum side sends messages which are transcoded into XCM. These messages are +/// self-contained, in that they can be transcoded using only information in the message. +#[derive(Clone, Encode, Decode, RuntimeDebug)] +pub struct MessageV1 { + /// EIP-155 chain id of the origin Ethereum network + pub chain_id: u64, + /// The command originating from the Gateway contract + pub command: Command, +} + +#[derive(Clone, Encode, Decode, RuntimeDebug)] +pub enum Command { + /// Register a wrapped token on the AssetHub `ForeignAssets` pallet + RegisterToken { + /// The address of the ERC20 token to be bridged over to AssetHub + token: H160, + /// XCM execution fee on AssetHub + fee: u128, + }, + /// Send a token to AssetHub or another parachain + SendToken { + /// The address of the ERC20 token to be bridged over to AssetHub + token: H160, + /// The destination for the transfer + destination: Destination, + /// Amount to transfer + amount: u128, + /// XCM execution fee on AssetHub + fee: u128, + }, +} + +/// Destination for bridged tokens +#[derive(Clone, Encode, Decode, RuntimeDebug)] +pub enum Destination { + /// The funds will be deposited into account `id` on AssetHub + AccountId32 { id: [u8; 32] }, + /// The funds will deposited into the sovereign account of destination parachain `para_id` on + /// AssetHub, Account `id` on the destination parachain will receive the funds via a + /// reserve-backed transfer. See + ForeignAccountId32 { + para_id: u32, + id: [u8; 32], + /// XCM execution fee on final destination + fee: u128, + }, + /// The funds will deposited into the sovereign account of destination parachain `para_id` on + /// AssetHub, Account `id` on the destination parachain will receive the funds via a + /// reserve-backed transfer. See + ForeignAccountId20 { + para_id: u32, + id: [u8; 20], + /// XCM execution fee on final destination + fee: u128, + }, +} + +pub struct MessageToXcm< + CreateAssetCall, + CreateAssetDeposit, + InboundQueuePalletInstance, + AccountId, + Balance, +> where + CreateAssetCall: Get, + CreateAssetDeposit: Get, + Balance: BalanceT, +{ + _phantom: PhantomData<( + CreateAssetCall, + CreateAssetDeposit, + InboundQueuePalletInstance, + AccountId, + Balance, + )>, +} + +/// Reason why a message conversion failed. +#[derive(Copy, Clone, TypeInfo, PalletError, Encode, Decode, RuntimeDebug)] +pub enum ConvertMessageError { + /// The message version is not supported for conversion. + UnsupportedVersion, +} + +/// convert the inbound message to xcm which will be forwarded to the destination chain +pub trait ConvertMessage { + type Balance: BalanceT + From; + type AccountId; + /// Converts a versioned message into an XCM message and an optional topicID + fn convert(message: VersionedMessage) -> Result<(Xcm<()>, Self::Balance), ConvertMessageError>; +} + +pub type CallIndex = [u8; 2]; + +impl + ConvertMessage + for MessageToXcm< + CreateAssetCall, + CreateAssetDeposit, + InboundQueuePalletInstance, + AccountId, + Balance, + > where + CreateAssetCall: Get, + CreateAssetDeposit: Get, + InboundQueuePalletInstance: Get, + Balance: BalanceT + From, + AccountId: Into<[u8; 32]>, +{ + type Balance = Balance; + type AccountId = AccountId; + + fn convert(message: VersionedMessage) -> Result<(Xcm<()>, Self::Balance), ConvertMessageError> { + use Command::*; + use VersionedMessage::*; + match message { + V1(MessageV1 { chain_id, command: RegisterToken { token, fee } }) => + Ok(Self::convert_register_token(chain_id, token, fee)), + V1(MessageV1 { chain_id, command: SendToken { token, destination, amount, fee } }) => + Ok(Self::convert_send_token(chain_id, token, destination, amount, fee)), + } + } +} + +impl + MessageToXcm +where + CreateAssetCall: Get, + CreateAssetDeposit: Get, + InboundQueuePalletInstance: Get, + Balance: BalanceT + From, + AccountId: Into<[u8; 32]>, +{ + fn convert_register_token(chain_id: u64, token: H160, fee: u128) -> (Xcm<()>, Balance) { + let network = Ethereum { chain_id }; + let xcm_fee: MultiAsset = (MultiLocation::parent(), fee).into(); + let deposit: MultiAsset = (MultiLocation::parent(), CreateAssetDeposit::get()).into(); + + let total_amount = fee + CreateAssetDeposit::get(); + let total: MultiAsset = (MultiLocation::parent(), total_amount).into(); + + let bridge_location: MultiLocation = (Parent, Parent, GlobalConsensus(network)).into(); + + let owner = GlobalConsensusEthereumConvertsFor::<[u8; 32]>::from_chain_id(&chain_id); + let asset_id = Self::convert_token_address(network, token); + let create_call_index: [u8; 2] = CreateAssetCall::get(); + let inbound_queue_pallet_index = InboundQueuePalletInstance::get(); + + let xcm: Xcm<()> = vec![ + // Teleport required fees. + ReceiveTeleportedAsset(total.into()), + // Pay for execution. + BuyExecution { fees: xcm_fee, weight_limit: Unlimited }, + // Fund the snowbridge sovereign with the required deposit for creation. + DepositAsset { assets: Definite(deposit.into()), beneficiary: bridge_location }, + // Only our inbound-queue pallet is allowed to invoke `UniversalOrigin` + DescendOrigin(X1(PalletInstance(inbound_queue_pallet_index))), + // Change origin to the bridge. + UniversalOrigin(GlobalConsensus(network)), + // Call create_asset on foreign assets pallet. + Transact { + origin_kind: OriginKind::Xcm, + require_weight_at_most: Weight::from_parts(400_000_000, 8_000), + call: ( + create_call_index, + asset_id, + MultiAddress::<[u8; 32], ()>::Id(owner), + MINIMUM_DEPOSIT, + ) + .encode() + .into(), + }, + RefundSurplus, + // Clear the origin so that remaining assets in holding + // are claimable by the physical origin (BridgeHub) + ClearOrigin, + ] + .into(); + + (xcm, total_amount.into()) + } + + fn convert_send_token( + chain_id: u64, + token: H160, + destination: Destination, + amount: u128, + asset_hub_fee: u128, + ) -> (Xcm<()>, Balance) { + let network = Ethereum { chain_id }; + let asset_hub_fee_asset: MultiAsset = (MultiLocation::parent(), asset_hub_fee).into(); + let asset: MultiAsset = (Self::convert_token_address(network, token), amount).into(); + + let (dest_para_id, beneficiary, dest_para_fee) = match destination { + // Final destination is a 32-byte account on AssetHub + Destination::AccountId32 { id } => ( + None, + MultiLocation { parents: 0, interior: X1(AccountId32 { network: None, id }) }, + 0, + ), + // Final destination is a 32-byte account on a sibling of AssetHub + Destination::ForeignAccountId32 { para_id, id, fee } => ( + Some(para_id), + MultiLocation { parents: 0, interior: X1(AccountId32 { network: None, id }) }, + // Total fee needs to cover execution on AssetHub and Sibling + fee, + ), + // Final destination is a 20-byte account on a sibling of AssetHub + Destination::ForeignAccountId20 { para_id, id, fee } => ( + Some(para_id), + MultiLocation { parents: 0, interior: X1(AccountKey20 { network: None, key: id }) }, + // Total fee needs to cover execution on AssetHub and Sibling + fee, + ), + }; + + let total_fees = asset_hub_fee.saturating_add(dest_para_fee); + let total_fee_asset: MultiAsset = (MultiLocation::parent(), total_fees).into(); + let inbound_queue_pallet_index = InboundQueuePalletInstance::get(); + + let mut instructions = vec![ + ReceiveTeleportedAsset(total_fee_asset.into()), + BuyExecution { fees: asset_hub_fee_asset, weight_limit: Unlimited }, + DescendOrigin(X1(PalletInstance(inbound_queue_pallet_index))), + UniversalOrigin(GlobalConsensus(network)), + ReserveAssetDeposited(asset.clone().into()), + ClearOrigin, + ]; + + match dest_para_id { + Some(dest_para_id) => { + let dest_para_fee_asset: MultiAsset = + (MultiLocation::parent(), dest_para_fee).into(); + + instructions.extend(vec![ + // Perform a deposit reserve to send to destination chain. + DepositReserveAsset { + assets: Definite(vec![dest_para_fee_asset.clone(), asset.clone()].into()), + dest: MultiLocation { parents: 1, interior: X1(Parachain(dest_para_id)) }, + xcm: vec![ + // Buy execution on target. + BuyExecution { fees: dest_para_fee_asset, weight_limit: Unlimited }, + // Deposit asset to beneficiary. + DepositAsset { assets: Definite(asset.into()), beneficiary }, + ] + .into(), + }, + ]); + }, + None => { + instructions.extend(vec![ + // Deposit asset to beneficiary. + DepositAsset { assets: Definite(asset.into()), beneficiary }, + ]); + }, + } + + (instructions.into(), total_fees.into()) + } + + // Convert ERC20 token address to a Multilocation that can be understood by Assets Hub. + fn convert_token_address(network: NetworkId, token: H160) -> MultiLocation { + MultiLocation { + parents: 2, + interior: X2( + GlobalConsensus(network), + AccountKey20 { network: None, key: token.into() }, + ), + } + } +} + +pub struct GlobalConsensusEthereumConvertsFor(PhantomData); +impl ConvertLocation for GlobalConsensusEthereumConvertsFor +where + AccountId: From<[u8; 32]> + Clone, +{ + fn convert_location(location: &MultiLocation) -> Option { + if let MultiLocation { interior: X1(GlobalConsensus(Ethereum { chain_id })), .. } = location + { + Some(Self::from_chain_id(chain_id).into()) + } else { + None + } + } +} + +impl GlobalConsensusEthereumConvertsFor { + pub fn from_chain_id(chain_id: &u64) -> [u8; 32] { + (b"ethereum-chain", chain_id).using_encoded(blake2_256) + } +} diff --git a/snowbridge/parachain/primitives/router/src/inbound/tests.rs b/snowbridge/parachain/primitives/router/src/inbound/tests.rs new file mode 100644 index 00000000000..8c96c13cf22 --- /dev/null +++ b/snowbridge/parachain/primitives/router/src/inbound/tests.rs @@ -0,0 +1,41 @@ +use super::GlobalConsensusEthereumConvertsFor; +use crate::inbound::CallIndex; +use frame_support::parameter_types; +use hex_literal::hex; +use xcm::v3::prelude::*; +use xcm_executor::traits::ConvertLocation; + +const NETWORK: NetworkId = Ethereum { chain_id: 11155111 }; + +parameter_types! { + pub EthereumNetwork: NetworkId = NETWORK; + + pub const CreateAssetCall: CallIndex = [1, 1]; + pub const CreateAssetExecutionFee: u128 = 123; + pub const CreateAssetDeposit: u128 = 891; + pub const SendTokenExecutionFee: u128 = 592; +} + +#[test] +fn test_contract_location_with_network_converts_successfully() { + let expected_account: [u8; 32] = + hex!("ce796ae65569a670d0c1cc1ac12515a3ce21b5fbf729d63d7b289baad070139d"); + let contract_location = MultiLocation { parents: 2, interior: X1(GlobalConsensus(NETWORK)) }; + + let account = + GlobalConsensusEthereumConvertsFor::<[u8; 32]>::convert_location(&contract_location) + .unwrap(); + + assert_eq!(account, expected_account); +} + +#[test] +fn test_contract_location_with_incorrect_location_fails_convert() { + let contract_location = + MultiLocation { parents: 2, interior: X2(GlobalConsensus(Polkadot), Parachain(1000)) }; + + assert_eq!( + GlobalConsensusEthereumConvertsFor::<[u8; 32]>::convert_location(&contract_location), + None, + ); +} diff --git a/snowbridge/parachain/primitives/router/src/lib.rs b/snowbridge/parachain/primitives/router/src/lib.rs new file mode 100644 index 00000000000..d9031c69b22 --- /dev/null +++ b/snowbridge/parachain/primitives/router/src/lib.rs @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +#![cfg_attr(not(feature = "std"), no_std)] + +pub mod inbound; +pub mod outbound; diff --git a/snowbridge/parachain/primitives/router/src/outbound/mod.rs b/snowbridge/parachain/primitives/router/src/outbound/mod.rs new file mode 100644 index 00000000000..c7f2f440834 --- /dev/null +++ b/snowbridge/parachain/primitives/router/src/outbound/mod.rs @@ -0,0 +1,282 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! Converts XCM messages into simpler commands that can be processed by the Gateway contract + +#[cfg(test)] +mod tests; + +use core::slice::Iter; + +use codec::{Decode, Encode}; + +use frame_support::{ensure, traits::Get}; +use snowbridge_core::{ + outbound::{AgentExecuteCommand, Command, Message, SendMessage}, + ChannelId, ParaId, +}; +use sp_core::{H160, H256}; +use sp_std::{iter::Peekable, marker::PhantomData, prelude::*}; +use xcm::v3::prelude::*; +use xcm_executor::traits::{ConvertLocation, ExportXcm}; + +pub struct EthereumBlobExporter< + UniversalLocation, + EthereumNetwork, + OutboundQueue, + AgentHashedDescription, +>(PhantomData<(UniversalLocation, EthereumNetwork, OutboundQueue, AgentHashedDescription)>); + +impl ExportXcm + for EthereumBlobExporter +where + UniversalLocation: Get, + EthereumNetwork: Get, + OutboundQueue: SendMessage, + AgentHashedDescription: ConvertLocation, +{ + type Ticket = (Vec, XcmHash); + + fn validate( + network: NetworkId, + _channel: u32, + universal_source: &mut Option, + destination: &mut Option, + message: &mut Option>, + ) -> SendResult { + let expected_network = EthereumNetwork::get(); + let universal_location = UniversalLocation::get(); + + if network != expected_network { + log::trace!(target: "xcm::ethereum_blob_exporter", "skipped due to unmatched bridge network {network:?}."); + return Err(SendError::NotApplicable) + } + + let dest = destination.take().ok_or(SendError::MissingArgument)?; + if dest != Here { + log::trace!(target: "xcm::ethereum_blob_exporter", "skipped due to unmatched remote destination {dest:?}."); + return Err(SendError::NotApplicable) + } + + let (local_net, local_sub) = universal_source + .take() + .ok_or_else(|| { + log::error!(target: "xcm::ethereum_blob_exporter", "universal source not provided."); + SendError::MissingArgument + })? + .split_global() + .map_err(|()| { + log::error!(target: "xcm::ethereum_blob_exporter", "could not get global consensus from universal source '{universal_source:?}'."); + SendError::Unroutable + })?; + + if Ok(local_net) != universal_location.global_consensus() { + log::trace!(target: "xcm::ethereum_blob_exporter", "skipped due to unmatched relay network {local_net:?}."); + return Err(SendError::NotApplicable) + } + + let para_id = match local_sub { + X1(Parachain(para_id)) => para_id, + _ => { + log::error!(target: "xcm::ethereum_blob_exporter", "could not get parachain id from universal source '{local_sub:?}'."); + return Err(SendError::MissingArgument) + }, + }; + + let message = message.take().ok_or_else(|| { + log::error!(target: "xcm::ethereum_blob_exporter", "xcm message not provided."); + SendError::MissingArgument + })?; + + let mut converter = XcmConverter::new(&message, &expected_network); + let (agent_execute_command, message_id) = converter.convert().map_err(|err|{ + log::error!(target: "xcm::ethereum_blob_exporter", "unroutable due to pattern matching error '{err:?}'."); + SendError::Unroutable + })?; + + let source_location: MultiLocation = MultiLocation { parents: 1, interior: local_sub }; + let agent_id = match AgentHashedDescription::convert_location(&source_location) { + Some(id) => id, + None => { + log::error!(target: "xcm::ethereum_blob_exporter", "unroutable due to not being able to create agent id. '{source_location:?}'"); + return Err(SendError::Unroutable) + }, + }; + + let channel_id: ChannelId = ParaId::from(para_id).into(); + + let outbound_message = Message { + id: Some(message_id.into()), + channel_id, + command: Command::AgentExecute { agent_id, command: agent_execute_command }, + }; + + // validate the message + let (ticket, fee) = OutboundQueue::validate(&outbound_message).map_err(|err| { + log::error!(target: "xcm::ethereum_blob_exporter", "OutboundQueue validation of message failed. {err:?}"); + SendError::Unroutable + })?; + + // convert fee to MultiAsset + let fee = MultiAsset::from((MultiLocation::parent(), fee.total())).into(); + + Ok(((ticket.encode(), message_id), fee)) + } + + fn deliver(blob: (Vec, XcmHash)) -> Result { + let ticket: OutboundQueue::Ticket = OutboundQueue::Ticket::decode(&mut blob.0.as_ref()) + .map_err(|_| { + log::trace!(target: "xcm::ethereum_blob_exporter", "undeliverable due to decoding error"); + SendError::NotApplicable + })?; + + let message_id = OutboundQueue::deliver(ticket).map_err(|_| { + log::error!(target: "xcm::ethereum_blob_exporter", "OutboundQueue submit of message failed"); + SendError::Transport("other transport error") + })?; + + log::info!(target: "xcm::ethereum_blob_exporter", "message delivered {message_id:#?}."); + Ok(message_id.into()) + } +} + +/// Errors that can be thrown to the pattern matching step. +#[derive(PartialEq, Debug)] +enum XcmConverterError { + UnexpectedEndOfXcm, + EndOfXcmMessageExpected, + WithdrawAssetExpected, + DepositAssetExpected, + NoReserveAssets, + FilterDoesNotConsumeAllAssets, + TooManyAssets, + ZeroAssetTransfer, + BeneficiaryResolutionFailed, + AssetResolutionFailed, + InvalidFeeAsset, + SetTopicExpected, +} + +macro_rules! match_expression { + ($expression:expr, $(|)? $( $pattern:pat_param )|+ $( if $guard: expr )?, $value:expr $(,)?) => { + match $expression { + $( $pattern )|+ $( if $guard )? => Some($value), + _ => None, + } + }; +} + +struct XcmConverter<'a, Call> { + iter: Peekable>>, + ethereum_network: &'a NetworkId, +} +impl<'a, Call> XcmConverter<'a, Call> { + fn new(message: &'a Xcm, ethereum_network: &'a NetworkId) -> Self { + Self { iter: message.inner().iter().peekable(), ethereum_network } + } + + fn convert(&mut self) -> Result<(AgentExecuteCommand, [u8; 32]), XcmConverterError> { + // Get withdraw/deposit and make native tokens create message. + let result = self.native_tokens_unlock_message()?; + + // All xcm instructions must be consumed before exit. + if self.next().is_ok() { + return Err(XcmConverterError::EndOfXcmMessageExpected) + } + + Ok(result) + } + + fn native_tokens_unlock_message( + &mut self, + ) -> Result<(AgentExecuteCommand, [u8; 32]), XcmConverterError> { + use XcmConverterError::*; + + // Get the reserve assets from WithdrawAsset. + let reserve_assets = + match_expression!(self.next()?, WithdrawAsset(reserve_assets), reserve_assets) + .ok_or(WithdrawAssetExpected)?; + + // Check if clear origin exists and skip over it. + if match_expression!(self.peek(), Ok(ClearOrigin), ()).is_some() { + let _ = self.next(); + } + + // Get the fee asset item from BuyExecution or continue parsing. + let fee_asset = match_expression!(self.peek(), Ok(BuyExecution { fees, .. }), fees); + if fee_asset.is_some() { + let _ = self.next(); + } + + let (deposit_assets, beneficiary) = match_expression!( + self.next()?, + DepositAsset { assets, beneficiary }, + (assets, beneficiary) + ) + .ok_or(DepositAssetExpected)?; + + // assert that the beneficiary is AccountKey20. + let recipient = match_expression!( + beneficiary, + MultiLocation { parents: 0, interior: X1(AccountKey20 { network, key }) } + if self.network_matches(network), + H160(*key) + ) + .ok_or(BeneficiaryResolutionFailed)?; + + // Make sure there are reserved assets. + if reserve_assets.len() == 0 { + return Err(NoReserveAssets) + } + + // Check the the deposit asset filter matches what was reserved. + if reserve_assets.inner().iter().any(|asset| !deposit_assets.matches(asset)) { + return Err(FilterDoesNotConsumeAllAssets) + } + + // We only support a single asset at a time. + ensure!(reserve_assets.len() == 1, TooManyAssets); + let reserve_asset = reserve_assets.get(0).ok_or(AssetResolutionFailed)?; + + // If there was a fee specified verify it. + if let Some(fee_asset) = fee_asset { + // The fee asset must be the same as the reserve asset. + if fee_asset.id != reserve_asset.id || fee_asset.fun > reserve_asset.fun { + return Err(InvalidFeeAsset) + } + } + + let (token, amount) = match_expression!( + reserve_asset, + MultiAsset { + id: Concrete(MultiLocation { parents: 0, interior: X1(AccountKey20 { network , key })}), + fun: Fungible(amount) + } if self.network_matches(network), + (H160(*key), *amount) + ) + .ok_or(AssetResolutionFailed)?; + + // transfer amount must be greater than 0. + ensure!(amount > 0, ZeroAssetTransfer); + + // Check if there is a SetTopic and skip over it if found. + let topic_id = match_expression!(self.next()?, SetTopic(id), id).ok_or(SetTopicExpected)?; + + Ok((AgentExecuteCommand::TransferToken { token, recipient, amount }, *topic_id)) + } + + fn next(&mut self) -> Result<&'a Instruction, XcmConverterError> { + self.iter.next().ok_or(XcmConverterError::UnexpectedEndOfXcm) + } + + fn peek(&mut self) -> Result<&&'a Instruction, XcmConverterError> { + self.iter.peek().ok_or(XcmConverterError::UnexpectedEndOfXcm) + } + + fn network_matches(&self, network: &Option) -> bool { + if let Some(network) = network { + network == self.ethereum_network + } else { + true + } + } +} diff --git a/snowbridge/parachain/primitives/router/src/outbound/tests.rs b/snowbridge/parachain/primitives/router/src/outbound/tests.rs new file mode 100644 index 00000000000..153d934c390 --- /dev/null +++ b/snowbridge/parachain/primitives/router/src/outbound/tests.rs @@ -0,0 +1,1063 @@ +use frame_support::parameter_types; +use hex_literal::hex; +use snowbridge_core::{ + outbound::{Fee, SendError, SendMessageFeeProvider}, + AgentIdOf, +}; +use xcm::v3::prelude::SendError as XcmSendError; + +use super::*; + +parameter_types! { + const MaxMessageSize: u32 = u32::MAX; + const RelayNetwork: NetworkId = Polkadot; + const UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(RelayNetwork::get()), Parachain(1013)); + const BridgedNetwork: NetworkId = Ethereum{ chain_id: 1 }; + const NonBridgedNetwork: NetworkId = Ethereum{ chain_id: 2 }; +} + +struct MockOkOutboundQueue; +impl SendMessage for MockOkOutboundQueue { + type Ticket = (); + + fn validate(_: &Message) -> Result<(Self::Ticket, Fee), SendError> { + Ok(((), Fee { local: 1, remote: 1 })) + } + + fn deliver(_: Self::Ticket) -> Result { + Ok(H256::zero()) + } +} + +impl SendMessageFeeProvider for MockOkOutboundQueue { + type Balance = u128; + + fn local_fee() -> Self::Balance { + 1 + } +} +struct MockErrOutboundQueue; +impl SendMessage for MockErrOutboundQueue { + type Ticket = (); + + fn validate(_: &Message) -> Result<(Self::Ticket, Fee), SendError> { + Err(SendError::MessageTooLarge) + } + + fn deliver(_: Self::Ticket) -> Result { + Err(SendError::MessageTooLarge) + } +} + +impl SendMessageFeeProvider for MockErrOutboundQueue { + type Balance = u128; + + fn local_fee() -> Self::Balance { + 1 + } +} + +#[test] +fn exporter_validate_with_unknown_network_yields_not_applicable() { + let network = Ethereum { chain_id: 1337 }; + let channel: u32 = 0; + let mut universal_source: Option = None; + let mut destination: Option = None; + let mut message: Option> = None; + + let result = EthereumBlobExporter::< + UniversalLocation, + BridgedNetwork, + MockOkOutboundQueue, + AgentIdOf, + >::validate( + network, channel, &mut universal_source, &mut destination, &mut message + ); + assert_eq!(result, Err(XcmSendError::NotApplicable)); +} + +#[test] +fn exporter_validate_with_invalid_destination_yields_missing_argument() { + let network = BridgedNetwork::get(); + let channel: u32 = 0; + let mut universal_source: Option = None; + let mut destination: Option = None; + let mut message: Option> = None; + + let result = EthereumBlobExporter::< + UniversalLocation, + BridgedNetwork, + MockOkOutboundQueue, + AgentIdOf, + >::validate( + network, channel, &mut universal_source, &mut destination, &mut message + ); + assert_eq!(result, Err(XcmSendError::MissingArgument)); +} + +#[test] +fn exporter_validate_with_x8_destination_yields_not_applicable() { + let network = BridgedNetwork::get(); + let channel: u32 = 0; + let mut universal_source: Option = None; + let mut destination: Option = Some(X8( + OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild, + )); + let mut message: Option> = None; + + let result = EthereumBlobExporter::< + UniversalLocation, + BridgedNetwork, + MockOkOutboundQueue, + AgentIdOf, + >::validate( + network, channel, &mut universal_source, &mut destination, &mut message + ); + assert_eq!(result, Err(XcmSendError::NotApplicable)); +} + +#[test] +fn exporter_validate_without_universal_source_yields_missing_argument() { + let network = BridgedNetwork::get(); + let channel: u32 = 0; + let mut universal_source: Option = None; + let mut destination: Option = Here.into(); + let mut message: Option> = None; + + let result = EthereumBlobExporter::< + UniversalLocation, + BridgedNetwork, + MockOkOutboundQueue, + AgentIdOf, + >::validate( + network, channel, &mut universal_source, &mut destination, &mut message + ); + assert_eq!(result, Err(XcmSendError::MissingArgument)); +} + +#[test] +fn exporter_validate_without_global_universal_location_yields_unroutable() { + let network = BridgedNetwork::get(); + let channel: u32 = 0; + let mut universal_source: Option = Here.into(); + let mut destination: Option = Here.into(); + let mut message: Option> = None; + + let result = EthereumBlobExporter::< + UniversalLocation, + BridgedNetwork, + MockOkOutboundQueue, + AgentIdOf, + >::validate( + network, channel, &mut universal_source, &mut destination, &mut message + ); + assert_eq!(result, Err(XcmSendError::Unroutable)); +} + +#[test] +fn exporter_validate_without_global_bridge_location_yields_not_applicable() { + let network = NonBridgedNetwork::get(); + let channel: u32 = 0; + let mut universal_source: Option = Here.into(); + let mut destination: Option = Here.into(); + let mut message: Option> = None; + + let result = EthereumBlobExporter::< + UniversalLocation, + BridgedNetwork, + MockOkOutboundQueue, + AgentIdOf, + >::validate( + network, channel, &mut universal_source, &mut destination, &mut message + ); + assert_eq!(result, Err(XcmSendError::NotApplicable)); +} + +#[test] +fn exporter_validate_with_remote_universal_source_yields_not_applicable() { + let network = BridgedNetwork::get(); + let channel: u32 = 0; + let mut universal_source: Option = + Some(X2(GlobalConsensus(Kusama), Parachain(1000))); + let mut destination: Option = Here.into(); + let mut message: Option> = None; + + let result = EthereumBlobExporter::< + UniversalLocation, + BridgedNetwork, + MockOkOutboundQueue, + AgentIdOf, + >::validate( + network, channel, &mut universal_source, &mut destination, &mut message + ); + assert_eq!(result, Err(XcmSendError::NotApplicable)); +} + +#[test] +fn exporter_validate_without_para_id_in_source_yields_missing_argument() { + let network = BridgedNetwork::get(); + let channel: u32 = 0; + let mut universal_source: Option = Some(X1(GlobalConsensus(Polkadot))); + let mut destination: Option = Here.into(); + let mut message: Option> = None; + + let result = EthereumBlobExporter::< + UniversalLocation, + BridgedNetwork, + MockOkOutboundQueue, + AgentIdOf, + >::validate( + network, channel, &mut universal_source, &mut destination, &mut message + ); + assert_eq!(result, Err(XcmSendError::MissingArgument)); +} + +#[test] +fn exporter_validate_complex_para_id_in_source_yields_missing_argument() { + let network = BridgedNetwork::get(); + let channel: u32 = 0; + let mut universal_source: Option = + Some(X3(GlobalConsensus(Polkadot), Parachain(1000), PalletInstance(12))); + let mut destination: Option = Here.into(); + let mut message: Option> = None; + + let result = EthereumBlobExporter::< + UniversalLocation, + BridgedNetwork, + MockOkOutboundQueue, + AgentIdOf, + >::validate( + network, channel, &mut universal_source, &mut destination, &mut message + ); + assert_eq!(result, Err(XcmSendError::MissingArgument)); +} + +#[test] +fn exporter_validate_without_xcm_message_yields_missing_argument() { + let network = BridgedNetwork::get(); + let channel: u32 = 0; + let mut universal_source: Option = + Some(X2(GlobalConsensus(Polkadot), Parachain(1000))); + let mut destination: Option = Here.into(); + let mut message: Option> = None; + + let result = EthereumBlobExporter::< + UniversalLocation, + BridgedNetwork, + MockOkOutboundQueue, + AgentIdOf, + >::validate( + network, channel, &mut universal_source, &mut destination, &mut message + ); + assert_eq!(result, Err(XcmSendError::MissingArgument)); +} + +#[test] +fn exporter_validate_with_max_target_fee_yields_unroutable() { + let network = BridgedNetwork::get(); + let mut destination: Option = Here.into(); + + let mut universal_source: Option = + Some(X2(GlobalConsensus(Polkadot), Parachain(1000))); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let channel: u32 = 0; + let fee = MultiAsset { id: Concrete(Here.into()), fun: Fungible(1000) }; + let fees: MultiAssets = vec![fee.clone()].into(); + let assets: MultiAssets = vec![MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + fun: Fungible(1000), + }] + .into(); + let filter: MultiAssetFilter = assets.clone().into(); + + let mut message: Option> = Some( + vec![ + WithdrawAsset(fees), + BuyExecution { fees: fee, weight_limit: Unlimited }, + WithdrawAsset(assets), + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: Some(network), key: beneficiary_address }) + .into(), + }, + SetTopic([0; 32]), + ] + .into(), + ); + + let result = EthereumBlobExporter::< + UniversalLocation, + BridgedNetwork, + MockOkOutboundQueue, + AgentIdOf, + >::validate( + network, channel, &mut universal_source, &mut destination, &mut message + ); + + assert_eq!(result, Err(XcmSendError::Unroutable)); +} + +#[test] +fn exporter_validate_with_unparsable_xcm_yields_unroutable() { + let network = BridgedNetwork::get(); + let mut destination: Option = Here.into(); + + let mut universal_source: Option = + Some(X2(GlobalConsensus(Polkadot), Parachain(1000))); + + let channel: u32 = 0; + let fee = MultiAsset { id: Concrete(Here.into()), fun: Fungible(1000) }; + let fees: MultiAssets = vec![fee.clone()].into(); + + let mut message: Option> = + Some(vec![WithdrawAsset(fees), BuyExecution { fees: fee, weight_limit: Unlimited }].into()); + + let result = EthereumBlobExporter::< + UniversalLocation, + BridgedNetwork, + MockOkOutboundQueue, + AgentIdOf, + >::validate( + network, channel, &mut universal_source, &mut destination, &mut message + ); + + assert_eq!(result, Err(XcmSendError::Unroutable)); +} + +#[test] +fn exporter_validate_xcm_success_case_1() { + let network = BridgedNetwork::get(); + let mut destination: Option = Here.into(); + + let mut universal_source: Option = + Some(X2(GlobalConsensus(Polkadot), Parachain(1000))); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let channel: u32 = 0; + let assets: MultiAssets = vec![MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + fun: Fungible(1000), + }] + .into(); + let fee = assets.clone().get(0).unwrap().clone(); + let filter: MultiAssetFilter = assets.clone().into(); + + let mut message: Option> = Some( + vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: fee, weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ] + .into(), + ); + + let result = EthereumBlobExporter::< + UniversalLocation, + BridgedNetwork, + MockOkOutboundQueue, + AgentIdOf, + >::validate( + network, channel, &mut universal_source, &mut destination, &mut message + ); + + assert!(result.is_ok()); +} + +#[test] +fn exporter_deliver_with_submit_failure_yields_unroutable() { + let result = EthereumBlobExporter::< + UniversalLocation, + BridgedNetwork, + MockErrOutboundQueue, + AgentIdOf, + >::deliver((hex!("deadbeef").to_vec(), XcmHash::default())); + assert_eq!(result, Err(XcmSendError::Transport("other transport error"))) +} + +#[test] +fn xcm_converter_convert_success() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + fun: Fungible(1000), + }] + .into(); + let filter: MultiAssetFilter = assets.clone().into(); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + let expected_payload = AgentExecuteCommand::TransferToken { + token: token_address.into(), + recipient: beneficiary_address.into(), + amount: 1000, + }; + let result = converter.convert(); + assert_eq!(result, Ok((expected_payload, [0; 32]))); +} + +#[test] +fn xcm_converter_convert_without_buy_execution_yields_success() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + fun: Fungible(1000), + }] + .into(); + let filter: MultiAssetFilter = assets.clone().into(); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + let expected_payload = AgentExecuteCommand::TransferToken { + token: token_address.into(), + recipient: beneficiary_address.into(), + amount: 1000, + }; + let result = converter.convert(); + assert_eq!(result, Ok((expected_payload, [0; 32]))); +} + +#[test] +fn xcm_converter_convert_with_wildcard_all_asset_filter_succeeds() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + fun: Fungible(1000), + }] + .into(); + let filter: MultiAssetFilter = Wild(All); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + let expected_payload = AgentExecuteCommand::TransferToken { + token: token_address.into(), + recipient: beneficiary_address.into(), + amount: 1000, + }; + let result = converter.convert(); + assert_eq!(result, Ok((expected_payload, [0; 32]))); +} + +#[test] +fn xcm_converter_convert_with_fees_less_than_reserve_yields_success() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let asset_location = X1(AccountKey20 { network: None, key: token_address }).into(); + let fee_asset = MultiAsset { id: Concrete(asset_location), fun: Fungible(500) }; + + let assets: MultiAssets = + vec![MultiAsset { id: Concrete(asset_location), fun: Fungible(1000) }].into(); + + let filter: MultiAssetFilter = assets.clone().into(); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: fee_asset, weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + let expected_payload = AgentExecuteCommand::TransferToken { + token: token_address.into(), + recipient: beneficiary_address.into(), + amount: 1000, + }; + let result = converter.convert(); + assert_eq!(result, Ok((expected_payload, [0; 32]))); +} + +#[test] +fn xcm_converter_convert_without_set_topic_yields_set_topic_expected() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + fun: Fungible(1000), + }] + .into(); + let filter: MultiAssetFilter = assets.clone().into(); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + ClearTopic, + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::SetTopicExpected)); +} + +#[test] +fn xcm_converter_convert_with_partial_message_yields_unexpected_end_of_xcm() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let assets: MultiAssets = vec![MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + fun: Fungible(1000), + }] + .into(); + let message: Xcm<()> = vec![WithdrawAsset(assets)].into(); + + let mut converter = XcmConverter::new(&message, &network); + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::UnexpectedEndOfXcm)); +} + +#[test] +fn xcm_converter_with_different_fee_asset_fails() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let asset_location = X1(AccountKey20 { network: None, key: token_address }).into(); + let fee_asset = MultiAsset { + id: Concrete(MultiLocation { parents: 0, interior: Here }), + fun: Fungible(1000), + }; + + let assets: MultiAssets = + vec![MultiAsset { id: Concrete(asset_location), fun: Fungible(1000) }].into(); + + let filter: MultiAssetFilter = assets.clone().into(); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: fee_asset, weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::InvalidFeeAsset)); +} + +#[test] +fn xcm_converter_with_fees_greater_than_reserve_fails() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let asset_location = X1(AccountKey20 { network: None, key: token_address }).into(); + let fee_asset = MultiAsset { id: Concrete(asset_location), fun: Fungible(1001) }; + + let assets: MultiAssets = + vec![MultiAsset { id: Concrete(asset_location), fun: Fungible(1000) }].into(); + + let filter: MultiAssetFilter = assets.clone().into(); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: fee_asset, weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::InvalidFeeAsset)); +} + +#[test] +fn xcm_converter_convert_with_empty_xcm_yields_unexpected_end_of_xcm() { + let network = BridgedNetwork::get(); + + let message: Xcm<()> = vec![].into(); + + let mut converter = XcmConverter::new(&message, &network); + + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::UnexpectedEndOfXcm)); +} + +#[test] +fn xcm_converter_convert_with_extra_instructions_yields_end_of_xcm_message_expected() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + fun: Fungible(1000), + }] + .into(); + let filter: MultiAssetFilter = assets.clone().into(); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ClearError, + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::EndOfXcmMessageExpected)); +} + +#[test] +fn xcm_converter_convert_without_withdraw_asset_yields_withdraw_expected() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + fun: Fungible(1000), + }] + .into(); + let filter: MultiAssetFilter = assets.clone().into(); + + let message: Xcm<()> = vec![ + ClearOrigin, + BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::WithdrawAssetExpected)); +} + +#[test] +fn xcm_converter_convert_without_withdraw_asset_yields_deposit_expected() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + fun: Fungible(1000), + }] + .into(); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::DepositAssetExpected)); +} + +#[test] +fn xcm_converter_convert_without_assets_yields_no_reserve_assets() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![].into(); + let filter: MultiAssetFilter = assets.clone().into(); + + let fee = MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + fun: Fungible(1000), + }; + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: fee, weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::NoReserveAssets)); +} + +#[test] +fn xcm_converter_convert_with_two_assets_yields_too_many_assets() { + let network = BridgedNetwork::get(); + + let token_address_1: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let token_address_2: [u8; 20] = hex!("1100000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![ + MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address_1 }).into()), + fun: Fungible(1000), + }, + MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address_2 }).into()), + fun: Fungible(500), + }, + ] + .into(); + let filter: MultiAssetFilter = assets.clone().into(); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::TooManyAssets)); +} + +#[test] +fn xcm_converter_convert_without_consuming_filter_yields_filter_does_not_consume_all_assets() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + fun: Fungible(1000), + }] + .into(); + let filter: MultiAssetFilter = Wild(WildMultiAsset::AllCounted(0)); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::FilterDoesNotConsumeAllAssets)); +} + +#[test] +fn xcm_converter_convert_with_zero_amount_asset_yields_zero_asset_transfer() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + fun: Fungible(0), + }] + .into(); + let filter: MultiAssetFilter = Wild(WildMultiAsset::AllCounted(1)); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::ZeroAssetTransfer)); +} + +#[test] +fn xcm_converter_convert_non_ethereum_asset_yields_asset_resolution_failed() { + let network = BridgedNetwork::get(); + + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![MultiAsset { + id: Concrete(X3(GlobalConsensus(Polkadot), Parachain(1000), GeneralIndex(0)).into()), + fun: Fungible(1000), + }] + .into(); + let filter: MultiAssetFilter = Wild(WildMultiAsset::AllCounted(1)); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::AssetResolutionFailed)); +} + +#[test] +fn xcm_converter_convert_non_ethereum_chain_asset_yields_asset_resolution_failed() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![MultiAsset { + id: Concrete( + X1(AccountKey20 { network: Some(Ethereum { chain_id: 2 }), key: token_address }).into(), + ), + fun: Fungible(1000), + }] + .into(); + let filter: MultiAssetFilter = Wild(WildMultiAsset::AllCounted(1)); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::AssetResolutionFailed)); +} + +#[test] +fn xcm_converter_convert_non_ethereum_chain_yields_asset_resolution_failed() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![MultiAsset { + id: Concrete( + X1(AccountKey20 { network: Some(NonBridgedNetwork::get()), key: token_address }).into(), + ), + fun: Fungible(1000), + }] + .into(); + let filter: MultiAssetFilter = Wild(WildMultiAsset::AllCounted(1)); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::AssetResolutionFailed)); +} + +#[test] +fn xcm_converter_convert_with_non_ethereum_beneficiary_yields_beneficiary_resolution_failed() { + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + + let beneficiary_address: [u8; 32] = + hex!("2000000000000000000000000000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + fun: Fungible(1000), + }] + .into(); + let filter: MultiAssetFilter = Wild(WildMultiAsset::AllCounted(1)); + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X3( + GlobalConsensus(Polkadot), + Parachain(1000), + AccountId32 { network: Some(Polkadot), id: beneficiary_address }, + ) + .into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::BeneficiaryResolutionFailed)); +} + +#[test] +fn xcm_converter_convert_with_non_ethereum_chain_beneficiary_yields_beneficiary_resolution_failed() +{ + let network = BridgedNetwork::get(); + + let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); + let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); + + let assets: MultiAssets = vec![MultiAsset { + id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + fun: Fungible(1000), + }] + .into(); + let filter: MultiAssetFilter = Wild(WildMultiAsset::AllCounted(1)); + + let message: Xcm<()> = vec![ + WithdrawAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, + DepositAsset { + assets: filter, + beneficiary: X1(AccountKey20 { + network: Some(Ethereum { chain_id: 2 }), + key: beneficiary_address, + }) + .into(), + }, + SetTopic([0; 32]), + ] + .into(); + let mut converter = XcmConverter::new(&message, &network); + + let result = converter.convert(); + assert_eq!(result.err(), Some(XcmConverterError::BeneficiaryResolutionFailed)); +} + +#[test] +fn test_describe_asset_hub() { + let legacy_location: MultiLocation = + MultiLocation { parents: 0, interior: X1(Parachain(1000)) }; + let legacy_agent_id = AgentIdOf::convert_location(&legacy_location).unwrap(); + assert_eq!( + legacy_agent_id, + hex!("72456f48efed08af20e5b317abf8648ac66e86bb90a411d9b0b713f7364b75b4").into() + ); + let location: MultiLocation = MultiLocation { parents: 1, interior: X1(Parachain(1000)) }; + let agent_id = AgentIdOf::convert_location(&location).unwrap(); + assert_eq!( + agent_id, + hex!("81c5ab2571199e3188135178f3c2c8e2d268be1313d029b30f534fa579b69b79").into() + ) +} + +#[test] +fn test_describe_here() { + let location: MultiLocation = MultiLocation { parents: 0, interior: Here }; + let agent_id = AgentIdOf::convert_location(&location).unwrap(); + assert_eq!( + agent_id, + hex!("03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314").into() + ) +} diff --git a/snowbridge/parachain/runtime/rococo-common/Cargo.toml b/snowbridge/parachain/runtime/rococo-common/Cargo.toml new file mode 100644 index 00000000000..656ed6de26e --- /dev/null +++ b/snowbridge/parachain/runtime/rococo-common/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "snowbridge-rococo-common" +description = "Snowbridge Rococo Common" +version = "0.0.1" +authors = ["Snowfork "] +edition = "2021" +license = "Apache-2.0" + +[dependencies] +log = { version = "0.4.20", default-features = false } + +frame-support = { path = "../../../../../substrate/frame/support", default-features = false } +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } + +[dev-dependencies] + +[features] +default = ["std"] +std = [ + "frame-support/std", + "log/std", + "xcm/std", +] +runtime-benchmarks = [ + "frame-support/runtime-benchmarks", +] diff --git a/snowbridge/parachain/runtime/rococo-common/src/lib.rs b/snowbridge/parachain/runtime/rococo-common/src/lib.rs new file mode 100644 index 00000000000..97f0332fe66 --- /dev/null +++ b/snowbridge/parachain/runtime/rococo-common/src/lib.rs @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! # Rococo Common +//! +//! Config used for the Rococo asset hub and bridge hub runtimes. +#![cfg_attr(not(feature = "std"), no_std)] + +use frame_support::parameter_types; +use xcm::opaque::lts::NetworkId; + +pub const INBOUND_QUEUE_MESSAGES_PALLET_INDEX: u8 = 80; + +parameter_types! { + // Network and location for the Ethereum chain. + pub EthereumNetwork: NetworkId = NetworkId::Ethereum { chain_id: 11155111 }; +} diff --git a/snowbridge/parachain/runtime/runtime-common/Cargo.toml b/snowbridge/parachain/runtime/runtime-common/Cargo.toml new file mode 100644 index 00000000000..b835152cac0 --- /dev/null +++ b/snowbridge/parachain/runtime/runtime-common/Cargo.toml @@ -0,0 +1,41 @@ +[package] +name = "snowbridge-runtime-common" +description = "Snowbridge Runtime Common" +version = "0.1.1" +authors = ["Snowfork "] +edition = "2021" +license = "Apache-2.0" + +[dependencies] +log = { version = "0.4.20", default-features = false } + +frame-support = { path = "../../../../../substrate/frame/support", default-features = false } +frame-system = { path = "../../../../../substrate/frame/system", default-features = false } +sp-arithmetic = { path = "../../../../../substrate/primitives/arithmetic", default-features = false } +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false } + +snowbridge-core = { path = "../../primitives/core", default-features = false } + +[dev-dependencies] + +[features] +default = ["std"] +std = [ + "frame-support/std", + "frame-system/std", + "log/std", + "snowbridge-core/std", + "sp-arithmetic/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm/std", +] +runtime-benchmarks = [ + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "snowbridge-core/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", +] diff --git a/snowbridge/parachain/runtime/runtime-common/src/lib.rs b/snowbridge/parachain/runtime/runtime-common/src/lib.rs new file mode 100644 index 00000000000..b7f54d262bb --- /dev/null +++ b/snowbridge/parachain/runtime/runtime-common/src/lib.rs @@ -0,0 +1,129 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +//! # Runtime Common +//! +//! Common traits and types shared by runtimes. +#![cfg_attr(not(feature = "std"), no_std)] + +use core::marker::PhantomData; +use frame_support::traits::Get; +use snowbridge_core::{outbound::SendMessageFeeProvider, sibling_sovereign_account_raw}; +use sp_arithmetic::traits::{BaseArithmetic, Unsigned}; +use xcm::prelude::*; +use xcm_builder::{deposit_or_burn_fee, HandleFee}; +use xcm_executor::traits::{FeeReason, TransactAsset}; + +/// A `HandleFee` implementation that takes fees from `ExportMessage` XCM instructions +/// to Snowbridge and splits off the remote fee and deposits it to the origin +/// parachain sovereign account. The local fee is then returned back to be handled by +/// the next fee handler in the chain. Most likely the treasury account. +pub struct XcmExportFeeToSibling< + Balance, + AccountId, + FeeAssetLocation, + EthereumNetwork, + AssetTransactor, + FeeProvider, +>( + PhantomData<( + Balance, + AccountId, + FeeAssetLocation, + EthereumNetwork, + AssetTransactor, + FeeProvider, + )>, +); + +impl HandleFee + for XcmExportFeeToSibling< + Balance, + AccountId, + FeeAssetLocation, + EthereumNetwork, + AssetTransactor, + FeeProvider, + > where + Balance: BaseArithmetic + Unsigned + Copy + From + Into, + AccountId: Clone + Into<[u8; 32]> + From<[u8; 32]>, + FeeAssetLocation: Get, + EthereumNetwork: Get, + AssetTransactor: TransactAsset, + FeeProvider: SendMessageFeeProvider, +{ + fn handle_fee( + fees: MultiAssets, + context: Option<&XcmContext>, + reason: FeeReason, + ) -> MultiAssets { + let token_location = FeeAssetLocation::get(); + + // Check the reason to see if this export is for snowbridge. + if !matches!( + reason, + FeeReason::Export { network: bridged_network, destination } + if bridged_network == EthereumNetwork::get() && destination == Here + ) { + return fees + } + + // Get the parachain sovereign from the `context`. + let para_sovereign = if let Some(XcmContext { + origin: Some(MultiLocation { parents: 1, interior }), + .. + }) = context + { + if let Some(Parachain(sibling_para_id)) = interior.first() { + let account: AccountId = + sibling_sovereign_account_raw((*sibling_para_id).into()).into(); + account + } else { + return fees + } + } else { + return fees + }; + + // Get the total fee offered by export message. + let maybe_total_supplied_fee: Option<(usize, Balance)> = fees + .inner() + .iter() + .enumerate() + .filter_map(|(index, asset)| { + if let MultiAsset { id: Concrete(location), fun: Fungible(amount) } = asset { + if *location == token_location { + return Some((index, (*amount).into())) + } + } + None + }) + .next(); + + if let Some((fee_index, total_fee)) = maybe_total_supplied_fee { + let remote_fee = total_fee.saturating_sub(FeeProvider::local_fee()); + if remote_fee > (0u128).into() { + // Refund remote component of fee to physical origin + deposit_or_burn_fee::( + MultiAsset { id: Concrete(token_location), fun: Fungible(remote_fee.into()) } + .into(), + context, + para_sovereign, + ); + // Return remaining fee to the next fee handler in the chain. + let mut modified_fees = fees.inner().clone(); + modified_fees.remove(fee_index); + modified_fees.push(MultiAsset { + id: Concrete(token_location), + fun: Fungible((total_fee - remote_fee).into()), + }); + return modified_fees.into() + } + } + + log::info!( + target: "xcm::fees", + "XcmExportFeeToSibling skipped: {fees:?}, context: {context:?}, reason: {reason:?}", + ); + fees + } +} diff --git a/snowbridge/parachain/runtime/tests/Cargo.toml b/snowbridge/parachain/runtime/tests/Cargo.toml new file mode 100644 index 00000000000..da1fe878d93 --- /dev/null +++ b/snowbridge/parachain/runtime/tests/Cargo.toml @@ -0,0 +1,244 @@ +[package] +name = "snowbridge-runtime-tests" +description = "Snowbridge Runtime Tests" +version = "0.1.0" +authors = ["Snowfork "] +edition = "2021" +license = "Apache-2.0" + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } +hex-literal = { version = "0.4.1" } +log = { version = "0.4.20", default-features = false } +scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.188", optional = true, features = ["derive"] } +smallvec = "1.11.0" + +# Substrate +frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking", default-features = false, optional = true } +frame-executive = { path = "../../../../../substrate/frame/executive", default-features = false } +frame-support = { path = "../../../../../substrate/frame/support", default-features = false } +frame-system = { path = "../../../../../substrate/frame/system", default-features = false } +frame-system-benchmarking = { path = "../../../../../substrate/frame/system/benchmarking", default-features = false, optional = true } +frame-system-rpc-runtime-api = { path = "../../../../../substrate/frame/system/rpc/runtime-api", default-features = false } +frame-try-runtime = { path = "../../../../../substrate/frame/try-runtime", default-features = false, optional = true } +pallet-aura = { path = "../../../../../substrate/frame/aura", default-features = false } +pallet-authorship = { path = "../../../../../substrate/frame/authorship", default-features = false } +pallet-balances = { path = "../../../../../substrate/frame/balances", default-features = false } +pallet-session = { path = "../../../../../substrate/frame/session", default-features = false } +pallet-multisig = { path = "../../../../../substrate/frame/multisig", default-features = false } +pallet-message-queue = { path = "../../../../../substrate/frame/message-queue", default-features = false } +pallet-timestamp = { path = "../../../../../substrate/frame/timestamp", default-features = false } +pallet-transaction-payment = { path = "../../../../../substrate/frame/transaction-payment", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { path = "../../../../../substrate/frame/transaction-payment/rpc/runtime-api", default-features = false } +pallet-utility = { path = "../../../../../substrate/frame/utility", default-features = false } +sp-api = { path = "../../../../../substrate/primitives/api", default-features = false } +sp-block-builder = { path = "../../../../../substrate/primitives/block-builder", default-features = false } +sp-consensus-aura = { path = "../../../../../substrate/primitives/consensus/aura", default-features = false } +sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } +sp-genesis-builder = { path = "../../../../../substrate/primitives/genesis-builder", default-features = false } +sp-inherents = { path = "../../../../../substrate/primitives/inherents", default-features = false } +sp-io = { path = "../../../../../substrate/primitives/io", default-features = false } +sp-offchain = { path = "../../../../../substrate/primitives/offchain", default-features = false } +sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } +sp-session = { path = "../../../../../substrate/primitives/session", default-features = false } +sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } +sp-storage = { path = "../../../../../substrate/primitives/storage", default-features = false } +sp-transaction-pool = { path = "../../../../../substrate/primitives/transaction-pool", default-features = false } +sp-version = { path = "../../../../../substrate/primitives/version", default-features = false } + +# Polkadot +rococo-runtime-constants = { path = "../../../../../polkadot/runtime/rococo/constants", default-features = false } +pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false } +pallet-xcm-benchmarks = { path = "../../../../../polkadot/xcm/pallet-xcm-benchmarks", default-features = false, optional = true } +polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false } +polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false } +polkadot-runtime-common = { path = "../../../../../polkadot/runtime/common", default-features = false } +xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } +xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false } + +# Cumulus +cumulus-pallet-aura-ext = { path = "../../../../../cumulus/pallets/aura-ext", default-features = false } +cumulus-pallet-dmp-queue = { path = "../../../../../cumulus/pallets/dmp-queue", default-features = false } +cumulus-pallet-parachain-system = { path = "../../../../../cumulus/pallets/parachain-system", default-features = false, features = ["parameterized-consensus-hook"] } +cumulus-pallet-session-benchmarking = { path = "../../../../../cumulus/pallets/session-benchmarking", default-features = false } +cumulus-pallet-xcm = { path = "../../../../../cumulus/pallets/xcm", default-features = false } +cumulus-pallet-xcmp-queue = { path = "../../../../../cumulus/pallets/xcmp-queue", default-features = false, features = ["bridging"] } +cumulus-primitives-core = { path = "../../../../../cumulus/primitives/core", default-features = false } +cumulus-primitives-utility = { path = "../../../../../cumulus/primitives/utility", default-features = false } +pallet-collator-selection = { path = "../../../../../cumulus/pallets/collator-selection", default-features = false } +parachain-info = { package = "staging-parachain-info", path = "../../../../../cumulus/parachains/pallets/parachain-info", default-features = false } +parachains-common = { path = "../../../../../cumulus/parachains/common", default-features = false } +parachains-runtimes-test-utils = { path = "../../../../../cumulus/parachains/runtimes/test-utils", default-features = false } +bridge-hub-rococo-runtime = { path = "../../../../../cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo", default-features = false } +asset-hub-rococo-runtime = { path = "../../../../../cumulus/parachains/runtimes/assets/asset-hub-rococo", default-features = false } +assets-common = { path = "../../../../../cumulus/parachains/runtimes/assets/common", default-features = false } + +# Ethereum Bridge (Snowbridge) +snowbridge-core = { path = "../../primitives/core", default-features = false } +snowbridge-beacon-primitives = { path = "../../primitives/beacon", default-features = false } +snowbridge-router-primitives = { path = "../../primitives/router", default-features = false } +snowbridge-ethereum-beacon-client = { path = "../../pallets/ethereum-beacon-client", default-features = false } +snowbridge-inbound-queue = { path = "../../pallets/inbound-queue", default-features = false } +snowbridge-outbound-queue = { path = "../../pallets/outbound-queue", default-features = false } +snowbridge-outbound-queue-runtime-api = { path = "../../pallets/outbound-queue/runtime-api", default-features = false } +snowbridge-system = { path = "../../pallets/system", default-features = false } +snowbridge-system-runtime-api = { path = "../../pallets/system/runtime-api", default-features = false } + +[dev-dependencies] +static_assertions = "1.1" +bridge-hub-test-utils = { path = "../../../../../cumulus/parachains/runtimes/bridge-hubs/test-utils" } +bridge-runtime-common = { path = "../../../../../bridges/bin/runtime-common", features = ["integrity-test"] } +sp-keyring = { path = "../../../../../substrate/primitives/keyring" } + +[features] +default = ["std"] +std = [ + "asset-hub-rococo-runtime/std", + "assets-common/std", + "bridge-hub-rococo-runtime/std", + "codec/std", + "cumulus-pallet-aura-ext/std", + "cumulus-pallet-dmp-queue/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-session-benchmarking/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-core/std", + "cumulus-primitives-utility/std", + "frame-benchmarking/std", + "frame-executive/std", + "frame-support/std", + "frame-system-benchmarking?/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "frame-try-runtime?/std", + "log/std", + "pallet-aura/std", + "pallet-authorship/std", + "pallet-balances/std", + "pallet-collator-selection/std", + "pallet-message-queue/std", + "pallet-multisig/std", + "pallet-session/std", + "pallet-timestamp/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-utility/std", + "pallet-xcm-benchmarks?/std", + "pallet-xcm/std", + "parachain-info/std", + "parachains-common/std", + "parachains-runtimes-test-utils/std", + "polkadot-core-primitives/std", + "polkadot-parachain-primitives/std", + "polkadot-runtime-common/std", + "rococo-runtime-constants/std", + "scale-info/std", + "serde", + "snowbridge-beacon-primitives/std", + "snowbridge-core/std", + "snowbridge-ethereum-beacon-client/std", + "snowbridge-inbound-queue/std", + "snowbridge-outbound-queue-runtime-api/std", + "snowbridge-outbound-queue/std", + "snowbridge-router-primitives/std", + "snowbridge-system-runtime-api/std", + "snowbridge-system/std", + "sp-api/std", + "sp-block-builder/std", + "sp-consensus-aura/std", + "sp-core/std", + "sp-genesis-builder/std", + "sp-inherents/std", + "sp-io/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-std/std", + "sp-storage/std", + "sp-transaction-pool/std", + "sp-version/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm/std", +] + +runtime-benchmarks = [ + "asset-hub-rococo-runtime/runtime-benchmarks", + "assets-common/runtime-benchmarks", + "bridge-hub-rococo-runtime/runtime-benchmarks", + "bridge-runtime-common/runtime-benchmarks", + "cumulus-pallet-dmp-queue/runtime-benchmarks", + "cumulus-pallet-parachain-system/runtime-benchmarks", + "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "cumulus-primitives-core/runtime-benchmarks", + "cumulus-primitives-utility/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-collator-selection/runtime-benchmarks", + "pallet-message-queue/runtime-benchmarks", + "pallet-multisig/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "pallet-xcm-benchmarks/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "parachains-common/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", + "polkadot-runtime-common/runtime-benchmarks", + "snowbridge-core/runtime-benchmarks", + "snowbridge-ethereum-beacon-client/runtime-benchmarks", + "snowbridge-inbound-queue/runtime-benchmarks", + "snowbridge-outbound-queue/runtime-benchmarks", + "snowbridge-router-primitives/runtime-benchmarks", + "snowbridge-system/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", +] + +try-runtime = [ + "asset-hub-rococo-runtime/try-runtime", + "bridge-hub-rococo-runtime/try-runtime", + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", + "frame-executive/try-runtime", + "frame-support/try-runtime", + "frame-system/try-runtime", + "frame-try-runtime/try-runtime", + "pallet-aura/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-collator-selection/try-runtime", + "pallet-message-queue/try-runtime", + "pallet-multisig/try-runtime", + "pallet-session/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-utility/try-runtime", + "pallet-xcm/try-runtime", + "parachain-info/try-runtime", + "polkadot-runtime-common/try-runtime", + "snowbridge-ethereum-beacon-client/try-runtime", + "snowbridge-inbound-queue/try-runtime", + "snowbridge-outbound-queue/try-runtime", + "snowbridge-system/try-runtime", + "sp-runtime/try-runtime", +] +beacon-spec-mainnet = [ + "snowbridge-ethereum-beacon-client/beacon-spec-mainnet", +] +experimental = ["pallet-aura/experimental"] + +# A feature that should be enabled when the runtime should be built for on-chain +# deployment. This will disable stuff that shouldn't be part of the on-chain wasm +# to make it smaller like logging for example. +on-chain-release-build = ["sp-api/disable-logging"] diff --git a/snowbridge/parachain/runtime/tests/src/lib.rs b/snowbridge/parachain/runtime/tests/src/lib.rs new file mode 100644 index 00000000000..9a5d12e2892 --- /dev/null +++ b/snowbridge/parachain/runtime/tests/src/lib.rs @@ -0,0 +1,94 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork + +#![cfg(test)] + +mod test_cases; + +use asset_hub_rococo_runtime::xcm_config::bridging::to_ethereum::DefaultBridgeHubEthereumBaseFee; +use bridge_hub_rococo_runtime::{ + xcm_config::XcmConfig, MessageQueueServiceWeight, Runtime, RuntimeEvent, SessionKeys, +}; +use codec::Decode; +use cumulus_primitives_core::XcmError::{FailedToTransactAsset, NotHoldingFees}; +use parachains_common::{AccountId, AuraId}; +use snowbridge_ethereum_beacon_client::WeightInfo; +use sp_core::H160; +use sp_keyring::AccountKeyring::Alice; + +pub fn collator_session_keys() -> bridge_hub_test_utils::CollatorSessionKeys { + bridge_hub_test_utils::CollatorSessionKeys::new( + AccountId::from(Alice), + AccountId::from(Alice), + SessionKeys { aura: AuraId::from(Alice.public()) }, + ) +} + +#[test] +pub fn transfer_token_to_ethereum_works() { + test_cases::send_transfer_token_message_success::( + collator_session_keys(), + 1013, + 1000, + H160::random(), + H160::random(), + DefaultBridgeHubEthereumBaseFee::get(), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::EthereumOutboundQueue(event)) => Some(event), + _ => None, + } + }), + ) +} + +#[test] +pub fn unpaid_transfer_token_to_ethereum_fails_with_barrier() { + test_cases::send_unpaid_transfer_token_message::( + collator_session_keys(), + 1013, + 1000, + H160::random(), + H160::random(), + ) +} + +#[test] +pub fn transfer_token_to_ethereum_fee_not_enough() { + test_cases::send_transfer_token_message_failure::( + collator_session_keys(), + 1013, + 1000, + DefaultBridgeHubEthereumBaseFee::get() + 1_000_000_000, + H160::random(), + H160::random(), + // fee not enough + 1_000_000_000, + NotHoldingFees, + ) +} + +#[test] +pub fn transfer_token_to_ethereum_insufficient_fund() { + test_cases::send_transfer_token_message_failure::( + collator_session_keys(), + 1013, + 1000, + 1_000_000_000, + H160::random(), + H160::random(), + DefaultBridgeHubEthereumBaseFee::get(), + FailedToTransactAsset("InsufficientBalance"), + ) +} + +#[test] +fn max_message_queue_service_weight_is_more_than_beacon_extrinsic_weights() { + let max_message_queue_weight = MessageQueueServiceWeight::get(); + let force_checkpoint = + ::WeightInfo::force_checkpoint(); + let submit_checkpoint = + ::WeightInfo::submit(); + max_message_queue_weight.all_gt(force_checkpoint); + max_message_queue_weight.all_gt(submit_checkpoint); +} diff --git a/snowbridge/parachain/runtime/tests/src/test_cases.rs b/snowbridge/parachain/runtime/tests/src/test_cases.rs new file mode 100644 index 00000000000..19e45f7a15a --- /dev/null +++ b/snowbridge/parachain/runtime/tests/src/test_cases.rs @@ -0,0 +1,293 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork + +//! Module contains predefined test-case scenarios for `Runtime` with bridging capabilities. + +use asset_hub_rococo_runtime::xcm_config::bridging::to_ethereum::DefaultBridgeHubEthereumBaseFee; +use bridge_hub_rococo_runtime::EthereumSystem; +use codec::Encode; +use frame_support::{assert_err, assert_ok, traits::fungible::Mutate}; +use parachains_runtimes_test_utils::{ + AccountIdOf, BalanceOf, CollatorSessionKeys, ExtBuilder, ValidatorIdOf, XcmReceivedFrom, +}; +use sp_core::H160; +use sp_runtime::SaturatedConversion; +use xcm::latest::prelude::*; +use xcm_executor::XcmExecutor; +// Re-export test_case from `parachains-runtimes-test-utils` +pub use parachains_runtimes_test_utils::test_cases::change_storage_constant_by_governance_works; +use xcm::v3::Error::{self, Barrier}; + +type RuntimeHelper = + parachains_runtimes_test_utils::RuntimeHelper; + +pub fn initial_fund(assethub_parachain_id: u32, initial_amount: u128) +where + Runtime: frame_system::Config + pallet_balances::Config, +{ + // fund asset hub sovereign account enough so it can pay fees + let asset_hub_sovereign_account = + snowbridge_core::sibling_sovereign_account::(assethub_parachain_id.into()); + >::mint_into( + &asset_hub_sovereign_account, + initial_amount.saturated_into::>(), + ) + .unwrap(); +} + +pub fn send_transfer_token_message( + assethub_parachain_id: u32, + weth_contract_address: H160, + destination_address: H160, + fee_amount: u128, +) -> Outcome +where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_parachain_system::Config + + snowbridge_outbound_queue::Config, + XcmConfig: xcm_executor::Config, +{ + let assethub_parachain_location = MultiLocation::new(1, Parachain(assethub_parachain_id)); + let asset = MultiAsset { + id: Concrete(MultiLocation { + parents: 0, + interior: X1(AccountKey20 { network: None, key: weth_contract_address.into() }), + }), + fun: Fungible(1000000000), + }; + let assets = vec![asset.clone()]; + + let inner_xcm = Xcm(vec![ + WithdrawAsset(MultiAssets::from(assets.clone())), + ClearOrigin, + BuyExecution { fees: asset, weight_limit: Unlimited }, + DepositAsset { + assets: Wild(All), + beneficiary: MultiLocation { + parents: 0, + interior: X1(AccountKey20 { network: None, key: destination_address.into() }), + }, + }, + SetTopic([0; 32]), + ]); + + let fee = MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(fee_amount), + }; + + // prepare transfer token message + let xcm = Xcm(vec![ + WithdrawAsset(MultiAssets::from(vec![fee.clone()])), + BuyExecution { fees: fee, weight_limit: Unlimited }, + ExportMessage { + network: Ethereum { chain_id: 11155111 }, + destination: Here, + xcm: inner_xcm, + }, + ]); + + // execute XCM + let hash = xcm.using_encoded(sp_io::hashing::blake2_256); + XcmExecutor::::execute_xcm( + assethub_parachain_location, + xcm, + hash, + RuntimeHelper::::xcm_max_weight(XcmReceivedFrom::Sibling), + ) +} + +pub fn send_transfer_token_message_success( + collator_session_key: CollatorSessionKeys, + runtime_para_id: u32, + assethub_parachain_id: u32, + weth_contract_address: H160, + destination_address: H160, + fee_amount: u128, + snowbridge_outbound_queue: Box< + dyn Fn(Vec) -> Option>, + >, +) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_parachain_system::Config + + snowbridge_outbound_queue::Config + + snowbridge_system::Config, + XcmConfig: xcm_executor::Config, + ValidatorIdOf: From>, +{ + ExtBuilder::::default() + .with_collators(collator_session_key.collators()) + .with_session_keys(collator_session_key.session_keys()) + .with_para_id(runtime_para_id.into()) + .with_tracing() + .build() + .execute_with(|| { + EthereumSystem::initialize(runtime_para_id.into(), assethub_parachain_id.into()) + .unwrap(); + + // fund asset hub sovereign account enough so it can pay fees + initial_fund::( + assethub_parachain_id, + DefaultBridgeHubEthereumBaseFee::get() + 1_000_000_000, + ); + + let outcome = send_transfer_token_message::( + assethub_parachain_id, + weth_contract_address, + destination_address, + fee_amount, + ); + + assert_ok!(outcome.ensure_complete()); + + // check events + let mut events = >::events() + .into_iter() + .filter_map(|e| snowbridge_outbound_queue(e.event.encode())); + assert!( + events.any(|e| matches!(e, snowbridge_outbound_queue::Event::MessageQueued { .. })) + ); + }); +} + +pub fn send_unpaid_transfer_token_message( + collator_session_key: CollatorSessionKeys, + runtime_para_id: u32, + assethub_parachain_id: u32, + weth_contract_address: H160, + destination_contract: H160, +) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_parachain_system::Config + + snowbridge_outbound_queue::Config, + XcmConfig: xcm_executor::Config, + ValidatorIdOf: From>, +{ + let assethub_parachain_location = MultiLocation::new(1, Parachain(assethub_parachain_id)); + + ExtBuilder::::default() + .with_collators(collator_session_key.collators()) + .with_session_keys(collator_session_key.session_keys()) + .with_para_id(runtime_para_id.into()) + .with_tracing() + .build() + .execute_with(|| { + let asset_hub_sovereign_account = + snowbridge_core::sibling_sovereign_account::(assethub_parachain_id.into()); + + >::mint_into( + &asset_hub_sovereign_account, + 4000000000u32.into(), + ) + .unwrap(); + + let asset = MultiAsset { + id: Concrete(MultiLocation { + parents: 0, + interior: X1(AccountKey20 { network: None, key: weth_contract_address.into() }), + }), + fun: Fungible(1000000000), + }; + let assets = vec![asset.clone()]; + + let inner_xcm = Xcm(vec![ + WithdrawAsset(MultiAssets::from(assets.clone())), + ClearOrigin, + BuyExecution { fees: asset, weight_limit: Unlimited }, + DepositAsset { + assets: Wild(AllCounted(1)), + beneficiary: MultiLocation { + parents: 0, + interior: X1(AccountKey20 { + network: None, + key: destination_contract.into(), + }), + }, + }, + SetTopic([0; 32]), + ]); + + // prepare transfer token message + let xcm = Xcm(vec![ + UnpaidExecution { weight_limit: Unlimited, check_origin: None }, + ExportMessage { + network: Ethereum { chain_id: 11155111 }, + destination: Here, + xcm: inner_xcm, + }, + ]); + + // execute XCM + let hash = xcm.using_encoded(sp_io::hashing::blake2_256); + let outcome = XcmExecutor::::execute_xcm( + assethub_parachain_location, + xcm, + hash, + RuntimeHelper::::xcm_max_weight(XcmReceivedFrom::Sibling), + ); + // check error is barrier + assert_err!(outcome.ensure_complete(), Barrier); + }); +} + +#[allow(clippy::too_many_arguments)] +pub fn send_transfer_token_message_failure( + collator_session_key: CollatorSessionKeys, + runtime_para_id: u32, + assethub_parachain_id: u32, + initial_amount: u128, + weth_contract_address: H160, + destination_address: H160, + fee_amount: u128, + expected_error: Error, +) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_parachain_system::Config + + snowbridge_outbound_queue::Config + + snowbridge_system::Config, + XcmConfig: xcm_executor::Config, + ValidatorIdOf: From>, +{ + ExtBuilder::::default() + .with_collators(collator_session_key.collators()) + .with_session_keys(collator_session_key.session_keys()) + .with_para_id(runtime_para_id.into()) + .with_tracing() + .build() + .execute_with(|| { + EthereumSystem::initialize(runtime_para_id.into(), assethub_parachain_id.into()) + .unwrap(); + + // fund asset hub sovereign account enough so it can pay fees + initial_fund::(assethub_parachain_id, initial_amount); + + let outcome = send_transfer_token_message::( + assethub_parachain_id, + weth_contract_address, + destination_address, + fee_amount, + ); + // check err is NotHoldingFees + assert_err!(outcome.ensure_complete(), expected_error); + }); +} diff --git a/snowbridge/parachain/scripts/benchmark.sh b/snowbridge/parachain/scripts/benchmark.sh new file mode 100755 index 00000000000..c47649b2eeb --- /dev/null +++ b/snowbridge/parachain/scripts/benchmark.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# Example command for updating pallet benchmarking +pushd ../cumulus +cargo run --release --bin polkadot-parachain \ +--features runtime-benchmarks \ +-- \ +benchmark pallet \ +--chain=bridge-hub-rococo-dev \ +--pallet=snowbridge_ethereum_beacon_client \ +--extrinsic="*" \ +--execution=wasm --wasm-execution=compiled \ +--steps 50 --repeat 20 \ +--output ./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_ethereum_beacon_client.rs +popd diff --git a/snowbridge/parachain/scripts/hexliteral.sh b/snowbridge/parachain/scripts/hexliteral.sh new file mode 100755 index 00000000000..e34a2b9b515 --- /dev/null +++ b/snowbridge/parachain/scripts/hexliteral.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Creates a string constant from STDIN +echo "const DATA: &'static str = concat!(" +cat - | fold | sed 's/^.*/\t"&",/' +echo ");" \ No newline at end of file diff --git a/snowbridge/parachain/scripts/init.sh b/snowbridge/parachain/scripts/init.sh new file mode 100755 index 00000000000..1405a41ef33 --- /dev/null +++ b/snowbridge/parachain/scripts/init.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -e + +echo "*** Initializing WASM build environment" + +if [ -z $CI_PROJECT_NAME ] ; then + rustup update nightly + rustup update stable +fi + +rustup target add wasm32-unknown-unknown --toolchain nightly diff --git a/snowbridge/parachain/scripts/make-build-config.sh b/snowbridge/parachain/scripts/make-build-config.sh new file mode 100755 index 00000000000..a1b116a5dd0 --- /dev/null +++ b/snowbridge/parachain/scripts/make-build-config.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +cd ../ethereum + +truffle exec scripts/dumpParachainConfig.js | sed '/^Using/d;/^$/d' diff --git a/snowbridge/parachain/scripts/verify-pallets-build.sh b/snowbridge/parachain/scripts/verify-pallets-build.sh new file mode 100755 index 00000000000..f060cf958b7 --- /dev/null +++ b/snowbridge/parachain/scripts/verify-pallets-build.sh @@ -0,0 +1,113 @@ +#!/bin/bash + +# A script to remove everything from snowbridge repository/subtree, except: +# +# - parachain +# - readme +# - license + +set -eu + +# show CLI help +function show_help() { + set +x + echo " " + echo Error: $1 + echo "Usage:" + echo " ./scripts/verify-pallets-build.sh Exit with code 0 if pallets code is well decoupled from the other code in the repo" + echo "Options:" + echo " --no-revert Leaves only runtime code on exit" + echo " --ignore-git-state Ignores git actual state" + exit 1 +} + +# parse CLI args +NO_REVERT= +IGNORE_GIT_STATE= +for i in "$@" +do + case $i in + --no-revert) + NO_REVERT=true + shift + ;; + --ignore-git-state) + IGNORE_GIT_STATE=true + shift + ;; + *) + show_help "Unknown option: $i" + ;; + esac +done + +# the script is able to work only on clean git copy, unless we want to ignore this check +[[ ! -z "${IGNORE_GIT_STATE}" ]] || [[ -z "$(git status --porcelain)" ]] || { echo >&2 "The git copy must be clean"; exit 1; } + +# let's avoid any restrictions on where this script can be called for - snowbridge repo may be +# plugged into any other repo folder. So the script (and other stuff that needs to be removed) +# may be located either in call dir, or one of it subdirs. +SNOWBRIDGE_FOLDER="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/../.." + +# remove everything we think is not required for our needs +rm -rf $SNOWBRIDGE_FOLDER/.cargo +rm -rf $SNOWBRIDGE_FOLDER/.github +rm -rf $SNOWBRIDGE_FOLDER/contracts +rm -rf $SNOWBRIDGE_FOLDER/codecov.yml +rm -rf $SNOWBRIDGE_FOLDER/docs +rm -rf $SNOWBRIDGE_FOLDER/hooks +rm -rf $SNOWBRIDGE_FOLDER/relayer +rm -rf $SNOWBRIDGE_FOLDER/smoketest +rm -rf $SNOWBRIDGE_FOLDER/web +rm -rf $SNOWBRIDGE_FOLDER/.envrc-example +rm -rf $SNOWBRIDGE_FOLDER/.gitbook.yaml +rm -rf $SNOWBRIDGE_FOLDER/.gitignore +rm -rf $SNOWBRIDGE_FOLDER/.gitmodules +rm -rf $SNOWBRIDGE_FOLDER/_typos.toml +rm -rf $SNOWBRIDGE_FOLDER/_codecov.yml +rm -rf $SNOWBRIDGE_FOLDER/flake.lock +rm -rf $SNOWBRIDGE_FOLDER/flake.nix +rm -rf $SNOWBRIDGE_FOLDER/go.work +rm -rf $SNOWBRIDGE_FOLDER/go.work.sum +rm -rf $SNOWBRIDGE_FOLDER/polkadot-sdk +rm -rf $SNOWBRIDGE_FOLDER/rust-toolchain.toml +rm -rf $SNOWBRIDGE_FOLDER/parachain/rustfmt.toml +rm -rf $SNOWBRIDGE_FOLDER/parachain/.gitignore +rm -rf $SNOWBRIDGE_FOLDER/parachain/templates +rm -rf $SNOWBRIDGE_FOLDER/parachain/.config +rm -rf $SNOWBRIDGE_FOLDER/parachain/pallets/ethereum-beacon-client/fuzz + +cd bridges/snowbridge/parachain + +# fix polkadot-sdk paths in Cargo.toml files +find "." -name 'Cargo.toml' | while read -r file; do + replace=$(printf '../../' ) + if [[ "$(uname)" = "Darwin" ]] || [[ "$(uname)" = *BSD ]]; then + sed -i '' "s|polkadot-sdk/|$replace|g" "$file" + else + sed -i "s|polkadot-sdk/|$replace|g" "$file" + fi +done + +# let's test if everything we need compiles +cargo check -p snowbridge-ethereum-beacon-client +cargo check -p snowbridge-ethereum-beacon-client --features runtime-benchmarks +cargo check -p snowbridge-ethereum-beacon-client --features try-runtime +cargo check -p snowbridge-inbound-queue +cargo check -p snowbridge-inbound-queue --features runtime-benchmarks +cargo check -p snowbridge-inbound-queue --features try-runtime +cargo check -p snowbridge-outbound-queue +cargo check -p snowbridge-outbound-queue --features runtime-benchmarks +cargo check -p snowbridge-outbound-queue --features try-runtime +cargo check -p snowbridge-system +cargo check -p snowbridge-system --features runtime-benchmarks +cargo check -p snowbridge-system --features try-runtime + +cd - + +# we're removing lock file after all checks are done. Otherwise we may use different +# Substrate/Polkadot/Cumulus commits and our checks will fail +rm -f $SNOWBRIDGE_FOLDER/parachain/Cargo.toml +rm -f $SNOWBRIDGE_FOLDER/parachain/Cargo.lock + +echo "OK" From 19a30b55eaace8f26765067fe6bc192185403988 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Jan 2024 10:32:09 +0100 Subject: [PATCH 04/15] Bump the known_good_semver group with 4 updates (#2845) Bumps the known_good_semver group with 4 updates: [serde](https://github.com/serde-rs/serde), [serde_json](https://github.com/serde-rs/json), [clap](https://github.com/clap-rs/clap) and [serde_yaml](https://github.com/dtolnay/serde-yaml). Updates `serde` from 1.0.193 to 1.0.194
Commits
  • d2d977a Release 1.0.194
  • a9a6ee9 Pull in proc-macro2 sccache fix
  • 28c5d21 Merge pull request #2669 from dtolnay/optionifletelse
  • 3d6a789 Remove option_if_let_else clippy suppression
  • a0e6869 Work around doc_link_with_quotes pedantic clippy lint
  • See full diff in compare view

Updates `serde_json` from 1.0.108 to 1.0.110
Release notes

Sourced from serde_json's releases.

v1.0.109

  • Documentation improvements
Commits
  • df5cf21 Release 1.0.110
  • c35856a Pull in proc-macro2 sccache fix
  • f88bf1f Release 1.0.109
  • bb62c73 Merge pull request #1097 from serde-rs/doccfg
  • df36d10 Restore doc cfg on re-exports
  • c367091 Merge pull request #1095 from dtolnay/hashtest
  • b328ee7 Eliminate hash closure in favor of calling hash_one directly
  • b9bcbad Use BuildHasher::hash_one
  • 7ff6c9e Use random hasher state for number hashing test
  • fe031cd Delete trace_macros! functionality from test
  • Additional commits viewable in compare view

Updates `clap` from 4.4.11 to 4.4.12
Release notes

Sourced from clap's releases.

v4.4.12

[4.4.12] - 2023-12-28

Performance

  • Only ask TypedValueParser for possible values if needed
Changelog

Sourced from clap's changelog.

[4.4.12] - 2023-12-28

Performance

  • Only ask TypedValueParser for possible values if needed
Commits
  • 6d601e6 chore: Release
  • 048e7f0 docs: Update changelog
  • 53f5b82 Merge pull request #5267 from vermiculus/sa/avoid-pv-expansion-in-help
  • 05cd057 perf: Avoid retrieving possible_values unless used
  • 2920808 test: Update snapshots
  • 28763eb chore: Release
  • ace7bb5 docs(complete): Update changelog
  • 76beca4 docs(complete): Polish API reference for dynamic
  • 3630e58 Merge pull request #5273 from epage/docsrs
  • 3724b9e docs: Include more content on docs.rs
  • See full diff in compare view

Updates `serde_yaml` from 0.9.29 to 0.9.30
Release notes

Sourced from serde_yaml's releases.

0.9.30

  • Update proc-macro2 to fix caching issue when using a rustc-wrapper such as sccache
Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../parachain/pallets/ethereum-beacon-client/Cargo.toml | 8 ++++---- snowbridge/parachain/pallets/inbound-queue/Cargo.toml | 2 +- snowbridge/parachain/pallets/outbound-queue/Cargo.toml | 2 +- snowbridge/parachain/primitives/beacon/Cargo.toml | 2 +- snowbridge/parachain/primitives/core/Cargo.toml | 2 +- snowbridge/parachain/primitives/ethereum/Cargo.toml | 4 ++-- snowbridge/parachain/primitives/router/Cargo.toml | 2 +- snowbridge/parachain/runtime/tests/Cargo.toml | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml b/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml index 5c4acda13d8..2f6eb2c91c0 100644 --- a/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml @@ -11,8 +11,8 @@ license = "Apache-2.0" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -serde = { version = "1.0.188", optional = true } -serde_json = { version = "1.0.96", optional = true } +serde = { version = "1.0.194", optional = true } +serde_json = { version = "1.0.110", 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"] } ssz_rs = { version = "0.9.0", default-features = false } @@ -40,11 +40,11 @@ pallet-timestamp = { path = "../../../../../substrate/frame/timestamp", default- [dev-dependencies] rand = "0.8.5" sp-keyring = { path = "../../../../../substrate/primitives/keyring" } -serde_json = "1.0.96" +serde_json = "1.0.110" hex-literal = "0.4.1" pallet-timestamp = { path = "../../../../../substrate/frame/timestamp" } sp-io = { path = "../../../../../substrate/primitives/io" } -serde = "1.0.188" +serde = "1.0.194" [features] default = ["std"] diff --git a/snowbridge/parachain/pallets/inbound-queue/Cargo.toml b/snowbridge/parachain/pallets/inbound-queue/Cargo.toml index f9e4d20be0f..91a773f4471 100644 --- a/snowbridge/parachain/pallets/inbound-queue/Cargo.toml +++ b/snowbridge/parachain/pallets/inbound-queue/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -serde = { version = "1.0.188", optional = true } +serde = { version = "1.0.194", 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 } diff --git a/snowbridge/parachain/pallets/outbound-queue/Cargo.toml b/snowbridge/parachain/pallets/outbound-queue/Cargo.toml index 66dd1d838e7..90a45745f4a 100644 --- a/snowbridge/parachain/pallets/outbound-queue/Cargo.toml +++ b/snowbridge/parachain/pallets/outbound-queue/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -serde = { version = "1.0.188", features = ["alloc", "derive"], default-features = false } +serde = { version = "1.0.194", features = ["alloc", "derive"], default-features = false } 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 } diff --git a/snowbridge/parachain/primitives/beacon/Cargo.toml b/snowbridge/parachain/primitives/beacon/Cargo.toml index e81e0208ba1..f0a00f51229 100644 --- a/snowbridge/parachain/primitives/beacon/Cargo.toml +++ b/snowbridge/parachain/primitives/beacon/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" license = "Apache-2.0" [dependencies] -serde = { version = "1.0.188", optional = true, features = ["derive"] } +serde = { version = "1.0.194", optional = true, features = ["derive"] } hex = { version = "0.4", default-features = false } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } diff --git a/snowbridge/parachain/primitives/core/Cargo.toml b/snowbridge/parachain/primitives/core/Cargo.toml index 262fc60b0cb..f8cdfb1f1e9 100644 --- a/snowbridge/parachain/primitives/core/Cargo.toml +++ b/snowbridge/parachain/primitives/core/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" license = "Apache-2.0" [dependencies] -serde = { version = "1.0.188", optional = true, features = ["alloc", "derive"], default-features = false } +serde = { version = "1.0.194", optional = true, features = ["alloc", "derive"], default-features = false } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } hex-literal = { version = "0.4.1" } diff --git a/snowbridge/parachain/primitives/ethereum/Cargo.toml b/snowbridge/parachain/primitives/ethereum/Cargo.toml index 1eff2632b09..d957b589aca 100644 --- a/snowbridge/parachain/primitives/ethereum/Cargo.toml +++ b/snowbridge/parachain/primitives/ethereum/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" license = "Apache-2.0" [dependencies] -serde = { version = "1.0.188", optional = true, features = ["derive"] } +serde = { version = "1.0.194", optional = true, features = ["derive"] } serde-big-array = { version = "0.3.2", optional = true, features = ["const-generics"] } 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"] } @@ -28,7 +28,7 @@ ethabi = { git = "https://github.com/snowfork/ethabi-decode.git", package = "eth [dev-dependencies] wasm-bindgen-test = "0.3.19" rand = "0.8.5" -serde_json = "1.0.96" +serde_json = "1.0.110" [features] default = ["std"] diff --git a/snowbridge/parachain/primitives/router/Cargo.toml b/snowbridge/parachain/primitives/router/Cargo.toml index 7badfebb606..0ee6fd9bd3d 100644 --- a/snowbridge/parachain/primitives/router/Cargo.toml +++ b/snowbridge/parachain/primitives/router/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" license = "Apache-2.0" [dependencies] -serde = { version = "1.0.188", optional = true, features = ["derive"] } +serde = { version = "1.0.194", 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 } diff --git a/snowbridge/parachain/runtime/tests/Cargo.toml b/snowbridge/parachain/runtime/tests/Cargo.toml index da1fe878d93..7002feae24a 100644 --- a/snowbridge/parachain/runtime/tests/Cargo.toml +++ b/snowbridge/parachain/runtime/tests/Cargo.toml @@ -11,7 +11,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = hex-literal = { version = "0.4.1" } log = { version = "0.4.20", default-features = false } scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.188", optional = true, features = ["derive"] } +serde = { version = "1.0.194", optional = true, features = ["derive"] } smallvec = "1.11.0" # Substrate From 4500ab8148cb33f3ff388097847ca46df4b4850b Mon Sep 17 00:00:00 2001 From: Tsvetomir Dimitrov Date: Fri, 5 Jan 2024 21:31:56 +0200 Subject: [PATCH 05/15] Fix clippy warnings (#2861) Fix some issues reported by clippy --- snowbridge/parachain/pallets/outbound-queue/src/test.rs | 4 ++-- snowbridge/parachain/pallets/system/src/lib.rs | 2 -- snowbridge/parachain/runtime/tests/src/test_cases.rs | 8 ++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/snowbridge/parachain/pallets/outbound-queue/src/test.rs b/snowbridge/parachain/pallets/outbound-queue/src/test.rs index 0028d75e7b7..454a91d5df5 100644 --- a/snowbridge/parachain/pallets/outbound-queue/src/test.rs +++ b/snowbridge/parachain/pallets/outbound-queue/src/test.rs @@ -110,7 +110,7 @@ fn process_message_fails_on_max_nonce_reached() { channel_id, command: mock_message(sibling_id).command, }; - let versioned_queued_message: VersionedQueuedMessage = message.try_into().unwrap(); + let versioned_queued_message: VersionedQueuedMessage = message.into(); let encoded = versioned_queued_message.encode(); let mut meter = WeightMeter::with_limit(Weight::MAX); @@ -134,7 +134,7 @@ fn process_message_fails_on_overweight_message() { channel_id, command: mock_message(sibling_id).command, }; - let versioned_queued_message: VersionedQueuedMessage = message.try_into().unwrap(); + let versioned_queued_message: VersionedQueuedMessage = message.into(); let encoded = versioned_queued_message.encode(); let mut meter = WeightMeter::with_limit(Weight::from_parts(1, 1)); assert_noop!( diff --git a/snowbridge/parachain/pallets/system/src/lib.rs b/snowbridge/parachain/pallets/system/src/lib.rs index 0042093ee66..e5077abd921 100644 --- a/snowbridge/parachain/pallets/system/src/lib.rs +++ b/snowbridge/parachain/pallets/system/src/lib.rs @@ -79,8 +79,6 @@ use xcm_executor::traits::ConvertLocation; #[cfg(feature = "runtime-benchmarks")] use frame_support::traits::OriginTrait; -pub use pallet::*; - pub type BalanceOf = <::Token as Inspect<::AccountId>>::Balance; pub type AccountIdOf = ::AccountId; diff --git a/snowbridge/parachain/runtime/tests/src/test_cases.rs b/snowbridge/parachain/runtime/tests/src/test_cases.rs index 19e45f7a15a..e5a45cdc92b 100644 --- a/snowbridge/parachain/runtime/tests/src/test_cases.rs +++ b/snowbridge/parachain/runtime/tests/src/test_cases.rs @@ -12,11 +12,11 @@ use parachains_runtimes_test_utils::{ }; use sp_core::H160; use sp_runtime::SaturatedConversion; -use xcm::latest::prelude::*; +use xcm::{ + latest::prelude::*, + v3::Error::{self, Barrier}, +}; use xcm_executor::XcmExecutor; -// Re-export test_case from `parachains-runtimes-test-utils` -pub use parachains_runtimes_test_utils::test_cases::change_storage_constant_by_governance_works; -use xcm::v3::Error::{self, Barrier}; type RuntimeHelper = parachains_runtimes_test_utils::RuntimeHelper; From dc597991c54ad232fbcd01ffff88b99d1d834716 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 7 Jan 2024 11:42:37 +0100 Subject: [PATCH 06/15] Bump the known_good_semver group with 4 updates (#2865) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps the known_good_semver group with 4 updates: [serde](https://github.com/serde-rs/serde), [serde_json](https://github.com/serde-rs/json), [clap](https://github.com/clap-rs/clap) and [syn](https://github.com/dtolnay/syn). Updates `serde` from 1.0.194 to 1.0.195
Release notes

Sourced from serde's releases.

v1.0.195

  • Prevent remote definitions of tuple struct or tuple variant from triggering dead_code warning (#2671)
Commits
  • 03eec42 Release 1.0.195
  • 196f311 Merge pull request #2671 from dtolnay/deadremote
  • 38d9e0b Revert "Add FIXME to fix dead_code warning when using serde(remote)"
  • 6502b31 Fix new dead_code warning in tuple struct and tuple variant remote defs
  • 6f1a8c3 Add FIXME to fix dead_code warning when using serde(remote)
  • d883c94 Work around dead_code warning in tests
  • 961fa59 Merge pull request #2670 from serde-rs/exhaustive
  • 8bc71de Fill in omitted patterns for GenericArguments match
  • 7c65a9d Pick up changes to non_exhaustive_omitted_patterns lint
  • See full diff in compare view

Updates `serde_json` from 1.0.110 to 1.0.111
Release notes

Sourced from serde_json's releases.

v1.0.111

  • Improve floating point parsing performance on loongarch64 (#1100, thanks @​heiher)
Commits

Updates `clap` from 4.4.12 to 4.4.13
Release notes

Sourced from clap's releases.

v4.4.13

[4.4.13] - 2024-01-04

Documentation

  • Fix link to structopt migration guide
Changelog

Sourced from clap's changelog.

[4.4.13] - 2024-01-04

Documentation

  • Fix link to structopt migration guide
Commits
  • 2ab48b2 chore: Release
  • 7a06a8c docs: Update changelog
  • cca190e docs: Correct link to StructOpt migration guide
  • 5c31f45 Merge pull request #5281 from Manishearth/safety-docs
  • ddae7e6 Correct safety docs
  • 48d28aa chore: Release
  • 748ce18 docs: Update changelog
  • adbe6ec Merge pull request #5278 from henry-hsieh/fix-nosort
  • 2b48858 fix: Skip nosort option below bash 4.4
  • 777b744 Merge pull request #5277 from clap-rs/renovate/actions-setup-python-5.x
  • Additional commits viewable in compare view

Updates `syn` from 2.0.47 to 2.0.48
Release notes

Sourced from syn's releases.

2.0.48

  • Improve error message on unexpected token after else (#1578)
Commits
  • 5e16fc2 Release 2.0.48
  • dc40084 Merge pull request #1578 from dtolnay/elseblock
  • 82fcefc Fix error message on unexpected token after 'else'
  • e8a5c68 Merge pull request #1576 from dtolnay/exhaustive
  • 97b1df6 Pick up changes to non_exhaustive_omitted_patterns lint
  • See full diff in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../parachain/pallets/ethereum-beacon-client/Cargo.toml | 8 ++++---- snowbridge/parachain/pallets/inbound-queue/Cargo.toml | 2 +- snowbridge/parachain/pallets/outbound-queue/Cargo.toml | 2 +- snowbridge/parachain/primitives/beacon/Cargo.toml | 2 +- snowbridge/parachain/primitives/core/Cargo.toml | 2 +- snowbridge/parachain/primitives/ethereum/Cargo.toml | 4 ++-- snowbridge/parachain/primitives/router/Cargo.toml | 2 +- snowbridge/parachain/runtime/tests/Cargo.toml | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml b/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml index 2f6eb2c91c0..db3be5f91b8 100644 --- a/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml @@ -11,8 +11,8 @@ license = "Apache-2.0" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -serde = { version = "1.0.194", optional = true } -serde_json = { version = "1.0.110", optional = true } +serde = { version = "1.0.195", optional = true } +serde_json = { version = "1.0.111", 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"] } ssz_rs = { version = "0.9.0", default-features = false } @@ -40,11 +40,11 @@ pallet-timestamp = { path = "../../../../../substrate/frame/timestamp", default- [dev-dependencies] rand = "0.8.5" sp-keyring = { path = "../../../../../substrate/primitives/keyring" } -serde_json = "1.0.110" +serde_json = "1.0.111" hex-literal = "0.4.1" pallet-timestamp = { path = "../../../../../substrate/frame/timestamp" } sp-io = { path = "../../../../../substrate/primitives/io" } -serde = "1.0.194" +serde = "1.0.195" [features] default = ["std"] diff --git a/snowbridge/parachain/pallets/inbound-queue/Cargo.toml b/snowbridge/parachain/pallets/inbound-queue/Cargo.toml index 91a773f4471..6a5ea6f8222 100644 --- a/snowbridge/parachain/pallets/inbound-queue/Cargo.toml +++ b/snowbridge/parachain/pallets/inbound-queue/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -serde = { version = "1.0.194", optional = true } +serde = { version = "1.0.195", 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 } diff --git a/snowbridge/parachain/pallets/outbound-queue/Cargo.toml b/snowbridge/parachain/pallets/outbound-queue/Cargo.toml index 90a45745f4a..f99fcc72e19 100644 --- a/snowbridge/parachain/pallets/outbound-queue/Cargo.toml +++ b/snowbridge/parachain/pallets/outbound-queue/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -serde = { version = "1.0.194", features = ["alloc", "derive"], default-features = false } +serde = { version = "1.0.195", features = ["alloc", "derive"], default-features = false } 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 } diff --git a/snowbridge/parachain/primitives/beacon/Cargo.toml b/snowbridge/parachain/primitives/beacon/Cargo.toml index f0a00f51229..eb717325e8a 100644 --- a/snowbridge/parachain/primitives/beacon/Cargo.toml +++ b/snowbridge/parachain/primitives/beacon/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" license = "Apache-2.0" [dependencies] -serde = { version = "1.0.194", optional = true, features = ["derive"] } +serde = { version = "1.0.195", optional = true, features = ["derive"] } hex = { version = "0.4", default-features = false } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } diff --git a/snowbridge/parachain/primitives/core/Cargo.toml b/snowbridge/parachain/primitives/core/Cargo.toml index f8cdfb1f1e9..706c508363d 100644 --- a/snowbridge/parachain/primitives/core/Cargo.toml +++ b/snowbridge/parachain/primitives/core/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" license = "Apache-2.0" [dependencies] -serde = { version = "1.0.194", optional = true, features = ["alloc", "derive"], default-features = false } +serde = { version = "1.0.195", optional = true, features = ["alloc", "derive"], default-features = false } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } hex-literal = { version = "0.4.1" } diff --git a/snowbridge/parachain/primitives/ethereum/Cargo.toml b/snowbridge/parachain/primitives/ethereum/Cargo.toml index d957b589aca..3624044f86a 100644 --- a/snowbridge/parachain/primitives/ethereum/Cargo.toml +++ b/snowbridge/parachain/primitives/ethereum/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" license = "Apache-2.0" [dependencies] -serde = { version = "1.0.194", optional = true, features = ["derive"] } +serde = { version = "1.0.195", optional = true, features = ["derive"] } serde-big-array = { version = "0.3.2", optional = true, features = ["const-generics"] } 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"] } @@ -28,7 +28,7 @@ ethabi = { git = "https://github.com/snowfork/ethabi-decode.git", package = "eth [dev-dependencies] wasm-bindgen-test = "0.3.19" rand = "0.8.5" -serde_json = "1.0.110" +serde_json = "1.0.111" [features] default = ["std"] diff --git a/snowbridge/parachain/primitives/router/Cargo.toml b/snowbridge/parachain/primitives/router/Cargo.toml index 0ee6fd9bd3d..40ae12920e7 100644 --- a/snowbridge/parachain/primitives/router/Cargo.toml +++ b/snowbridge/parachain/primitives/router/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" license = "Apache-2.0" [dependencies] -serde = { version = "1.0.194", optional = true, features = ["derive"] } +serde = { version = "1.0.195", 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 } diff --git a/snowbridge/parachain/runtime/tests/Cargo.toml b/snowbridge/parachain/runtime/tests/Cargo.toml index 7002feae24a..9b5000b56cd 100644 --- a/snowbridge/parachain/runtime/tests/Cargo.toml +++ b/snowbridge/parachain/runtime/tests/Cargo.toml @@ -11,7 +11,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = hex-literal = { version = "0.4.1" } log = { version = "0.4.20", default-features = false } scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.194", optional = true, features = ["derive"] } +serde = { version = "1.0.195", optional = true, features = ["derive"] } smallvec = "1.11.0" # Substrate From e542f4b87ad558277788bbbaf594c7ab45d7378f Mon Sep 17 00:00:00 2001 From: Clara van Staden Date: Tue, 9 Jan 2024 17:37:46 +0200 Subject: [PATCH 07/15] Snowbridge Rococo deployment updates (#2792) - Includes the introduction of the `fast-runtime` feature, which cleans up our features - Updates beacon client fork versions config to Sepolia's versions - Cleanup of AgentIdOf --------- Co-authored-by: Ron Co-authored-by: claravanstaden --- snowbridge/parachain/README.md | 192 ++- .../pallets/ethereum-beacon-client/Cargo.toml | 4 +- .../src/benchmarking/fixtures.rs | 1215 ----------------- .../src/benchmarking/fixtures_mainnet.rs | 1215 +++++++++++++++++ .../src/benchmarking/fixtures_minimal.rs | 248 ++++ .../src/benchmarking/mod.rs | 22 +- .../ethereum-beacon-client/src/config/mod.rs | 4 +- .../pallets/ethereum-beacon-client/src/lib.rs | 2 +- .../ethereum-beacon-client/src/mock.rs | 216 +-- .../ethereum-beacon-client/src/tests.rs | 29 +- .../execution-header-update.mainnet.json | 50 + .../finalized-header-update.mainnet.json | 38 + .../fixtures/initial-checkpoint.mainnet.json | 542 ++++++++ .../next-finalized-header-update.mainnet.json | 38 + .../next-sync-committee-update.mainnet.json | 563 ++++++++ .../sync-committee-update.mainnet.json | 563 ++++++++ .../pallets/outbound-queue/src/lib.rs | 11 +- .../pallets/outbound-queue/src/types.rs | 46 +- snowbridge/parachain/runtime/tests/Cargo.toml | 4 +- .../parachain/scripts/verify-pallets-build.sh | 3 + 20 files changed, 3512 insertions(+), 1493 deletions(-) delete mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures.rs create mode 100644 snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures_mainnet.rs create mode 100755 snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures_minimal.rs create mode 100755 snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/execution-header-update.mainnet.json create mode 100755 snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/finalized-header-update.mainnet.json create mode 100755 snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/initial-checkpoint.mainnet.json create mode 100755 snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-finalized-header-update.mainnet.json create mode 100755 snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-sync-committee-update.mainnet.json create mode 100755 snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/sync-committee-update.mainnet.json diff --git a/snowbridge/parachain/README.md b/snowbridge/parachain/README.md index ddcbedab0c6..a38910da316 100644 --- a/snowbridge/parachain/README.md +++ b/snowbridge/parachain/README.md @@ -1,155 +1,127 @@ -# Parachain modules +# Snowbridge · +[![codecov](https://codecov.io/gh/Snowfork/snowbridge/branch/main/graph/badge.svg?token=9hvgSws4rN)] +(https://codecov.io/gh/Snowfork/snowbridge) +![GitHub](https://img.shields.io/github/license/Snowfork/snowbridge) -## Configuration +Snowbridge is a trustless bridge between Polkadot and Ethereum. For documentation, visit https://docs.snowbridge.network. -Note: This section is not necessary for local development, as there are scripts to auto-configure the parachain in the -[test directory](https://github.com/Snowfork/snowbridge/blob/main/web/packages/test). +## Components -For a fully operational chain, further configuration of the initial chain spec is required. The specific configuration will -depend heavily on your environment, so this guide will remain high-level. +### Parachain -After completing a release build of the parachain, build an initial spec for the snowbase runtime: +Polkadot parachain and our pallets. See [parachain/README.md](https://github.com/Snowfork/snowbridge/blob/main/parachain/README.md). -```bash -target/release/snowbridge build-spec --chain snowbase --disable-default-bootnode > spec.json -``` +### Contracts -Now edit the spec and configure the following: -1. Recently finalized ethereum header and difficulty for the ethereum light client -2. Contract addresses for the Ether, Erc20, and Dot apps. -3. Authorized principal for the basic channel +Ethereum contracts and unit tests. See [contracts/README.md](https://github.com/Snowfork/snowbridge/blob/main/contracts/README.md) -For an example configuration, consult the [setup script](https://github.com/Snowfork/snowbridge/blob/main/web/packages/test/scripts/start-services.sh) -for our local development stack. Specifically the `start_polkadot_launch` bash function. +### Relayer -## Tests +Off-chain relayer services for relaying messages between Polkadot and Ethereum. See +[relayer/README.md](https://github.com/Snowfork/snowbridge/blob/main/relayer/README.md) -To run the parachain tests locally, use `cargo test --workspace`. For the full suite of tests, use -`cargo test --workspace --features runtime-benchmarks`. +### Local Testnet -Optionally exclude the top-level and runtime crates: +Scripts to provision a local testnet, running the above services to bridge between local deployments of Polkadot and +Ethereum. See [web/packages/test/README.md](https://github.com/Snowfork/snowbridge/blob/main/web/packages/test/README.md). -```bash -cargo test --workspace \ - --features runtime-benchmarks \ - --exclude snowbridge \ - --exclude snowbridge-runtime \ - --exclude snowblink-runtime \ - --exclude snowbase-runtime -``` +### Smoke Tests -### Updating test data for inbound channel unit tests +Integration tests for our local testnet. See [smoketest/README.md](https://github.com/Snowfork/snowbridge/blob/main/smoketest/README.md). -To regenerate the test data, use a test with multiple `submit` calls in `ethereum/test/test_basic_outbound_channel.js`, eg. -"should increment nonces correctly". +## Development -Add the following preamble: +We use the Nix package manager to provide a reproducible and maintainable developer environment. -```javascript -const rlp = require("rlp"); -const contract = BasicOutboundChannel; -const signature = 'Message(address,address,uint64,uint64,bytes)'; -``` +After [installing nix](https://nixos.org/download.html) Nix, enable [flakes](https://nixos.wiki/wiki/Flakes): -For each encoded log you want to create, find a transaction object `tx` returned from a `submit` call and run this: - -```javascript -const rawLog = tx.receipt.rawLogs[0]; -const encodedLog = rlp.encode([rawLog.address, rawLog.topics, rawLog.data]).toString("hex"); -console.log(`encodedLog: ${encodedLog}`); -const iface = new ethers.utils.Interface(contract.abi); -const decodedEventLog = iface.decodeEventLog( - signature, - rawLog.data, - rawLog.topics, -); -console.log(`decoded rawLog.data: ${JSON.stringify(decodedEventLog)}`); +```sh +mkdir -p ~/.config/nix +echo 'experimental-features = nix-command flakes' >> ~/.config/nix/nix.conf ``` -Place the `encodedLog` string in the `message.data` field in the test data. Use the `decoded rawLog.data` field to -update the comments with the decoded log data. - -## Generating pallet weights from benchmarks +Then activate a developer shell in the root of our repo, where +[`flake.nix`](https://github.com/Snowfork/snowbridge/blob/main/flake.nix) is located: -Build the parachain with the runtime benchmark flags for the chosen runtime: +```sh +nix develop +``` -```bash -runtime=snowbase -cargo build \ - --release \ - --no-default-features \ - --features "$runtime-native,rococo-native,runtime-benchmarks,$runtime-runtime-benchmarks" \ - --bin snowbridge +Also make sure to run this initialization script once: +```sh +scripts/init.sh ``` -List available pallets and their benchmarks: +### Support for code editors -```bash -./target/release/snowbridge benchmark pallet --chain $runtime --list -``` +To ensure your code editor (such as VS Code) can execute tools in the nix shell, startup your editor within the +interactive shell. -Run a benchmark for a pallet, generating weights: - -```bash -target/release/snowbridge benchmark pallet \ - --chain=$runtime \ - --execution=wasm \ - --wasm-execution=compiled \ - --pallet=basic_channel_inbound \ - --extra \ - --extrinsic=* \ - --repeat=20 \ - --steps=50 \ - --output=pallets/basic-channel/src/inbound/weights.rs \ - --template=templates/module-weight-template.hbs -``` +Example for VS Code: -## Generating beacon test fixtures and benchmarking data +```sh +nix develop +code . +``` -### Minimal Spec +### Custom shells -To generate `minimal` test data and benchmarking data, make sure to start the local E2E setup to spin up a local beacon -node instance to connect to: +The developer shell is bash by default. To preserve your existing shell: -```bash -cd web/packages/test -./scripts/start-services.sh +```sh +nix develop --command $SHELL ``` -Wait for output `Testnet has been initialized`. +### Automatic developer shells -In a separate terminal, from the `snowbridge` directory, run: +To automatically enter the developer shell whenever you open the project, install +[`direnv`](https://direnv.net/docs/installation.html) and use the template `.envrc`: -```bash -mage -d relayer build && relayer/build/snowbridge-relay generate-beacon-data --spec "minimal" && cd parachain && -cargo +nightly fmt -- --config-path rustfmt.toml && cd - +```sh +cp .envrc.example .envrc +direnv allow ``` -### Mainnet Spec +### Upgrading the Rust toolchain + +Sometimes we would like to upgrade rust toolchain. First update `parachain/rust-toolchain.toml` as required and then +update `flake.lock` running +```sh +nix flake lock --update-input rust-overlay +``` -We only use the mainnet spec for generating fixtures for pallet weight benchmarks. +## Troubleshooting -To generate the data we can connect to the Lodestar Goerli public node. The script already connects to the Lodestar node, -so no need to start up additional services. In the event of the Lodestar node not being available, you can start up your -own stack with these commands: +Check the contents of all `.envrc` files. -```bash -cd web/packages/test -./scripts/start-goerli.sh +Remove untracked files: +```sh +git clean -idx ``` -From the `snowbridge` directory, run: +Ensure that the current Rust toolchain is the one selected in `scripts/init.sh`. -```bash -mage -d relayer build && relayer/build/snowbridge-relay generate-beacon-data --spec "mainnet" && cd parachain && -cargo +nightly fmt -- --config-path rustfmt.toml && cd - +Ensure submodules are up-to-date: +```sh +git submodule update ``` -### Benchmarking tests +Check untracked files & directories: +```sh +git clean -ndx | awk '{print $3}' +``` +After removing `node_modules` directories (eg. with `git clean above`), clear the pnpm cache: +```sh +pnpm store prune +``` -To run the benchmark tests +Check Nix config in `~/.config/nix/nix.conf`. -```bash -cd parachain/pallets/ethereum-beacon-client -cargo test --release --features runtime-benchmarks +Run a pure developer shell (note that this removes access to your local tools): +```sh +nix develop -i --pure-eval ``` + +## Security + +The security policy and procedures can be found in SECURITY.md. diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml b/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml index db3be5f91b8..9f8749c89da 100644 --- a/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml @@ -77,7 +77,6 @@ std = [ 'frame-benchmarking/std', ] runtime-benchmarks = [ - "beacon-spec-mainnet", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", @@ -92,4 +91,5 @@ try-runtime = [ "pallet-timestamp?/try-runtime", "sp-runtime/try-runtime", ] -beacon-spec-mainnet = [] +beacon-spec-minimal = [] +fast-runtime = ["beacon-spec-minimal"] diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures.rs deleted file mode 100644 index b50be81360a..00000000000 --- a/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures.rs +++ /dev/null @@ -1,1215 +0,0 @@ -// Generated, do not edit! -// See README.md for instructions to generate -use crate::{CheckpointUpdate, ExecutionHeaderUpdate, Update}; -use hex_literal::hex; -use primitives::{ - updates::AncestryProof, BeaconHeader, ExecutionPayloadHeader, NextSyncCommitteeUpdate, - SyncAggregate, SyncCommittee, -}; -use sp_core::U256; -use sp_std::{boxed::Box, vec}; - -pub fn make_checkpoint() -> Box { - Box::new(CheckpointUpdate { - header: BeaconHeader { - slot: 5809344, - proposer_index: 101696, - parent_root: hex!("ea7ce4ad810829cf37a2235b1126c82aecfc5955a1647ec83640cf3f7db91bd2").into(), - state_root: hex!("56f6363d3604e61a907c774edf0bddf6477a8d410f026414bc420f751de1f092").into(), - body_root: hex!("8c799aeef815cbc4499e0b46723623105afb177a5c522ecda3415ad9fb259e6c").into(), - }, - current_sync_committee: SyncCommittee { - pubkeys: [ - hex!("adf5a4907639db7bdcbecbc295b57d8950b0abe34ab17798686643427023c4f3983550d1496f81a27e52b070e4f4e6ee").into(), - hex!("91b036b30405531cacebf5d4f7e939b44438bb9942123ee55b44453e32febfbf2c846e0e4fb08190b01a000d072dcaa7").into(), - hex!("a86e70f00161ec6c4b780b4fc631c8dbae979f1e6c9ed037dd0745833ed6e3e18831478eb4753861f339293c0508f4d4").into(), - hex!("84196b1f39fba1fb7570074e7dd2768ed5c28db7f91a6374e413c8fc82f97738af771f90496526088bfa1ee2c01ee299").into(), - hex!("b9a230fc12d85281cbfcc7f5e6b13ab17b3dcbf0adf256d031c01acb30734d061683d40fd62175da73a621440bb04367").into(), - hex!("80b8be5a3d6f39aa7362c5feee9f89b75d1e5c2b485ea9a776c60fd60dba611e9bf5ca8b2528f42651b3dad212acfe77").into(), - hex!("ac8fcfc40028d04bdbea87b4b335781e35e10f881bfeb07b94c538eb37a43b18b1a04aad3dbe80bbff6e128017251f2e").into(), - hex!("b0b2136cc729b7de8868c02de6247ff2a68694296c78f088ce967219f08cfb7be9e1830e2630b10ca650c715d85d89f3").into(), - hex!("a70627c99777970eb9bf3268bac06bdc41c2ead41b1b76d30e7fd2aefe83319461d03aaf7ab93150343be9fbd2e48e7d").into(), - hex!("9599aae109d31ddc9028c428a148ea9ebffdb5ab6a684895dbd3772c1baf947c8a255e4c7ebaedae2a9e046219d80d76").into(), - hex!("8652e099adb88b2a25ab64fb01314e24cf26dbc4ae110d7fd73d74a0e0a4fea2ce2ce87cb1ddb7c0b9fb50cc6afa2153").into(), - hex!("83ba74c6e31073865eaed3c38a8e885ee715f03cfd6e36929655b6aa790d8f676c4ac4ae27f963e311d00923357eb087").into(), - hex!("86b05425d880027fbde9be3ea526283c5b958ccb31eff997d9d7b5e3b70e2d011ed95f891248082e870d55704a471deb").into(), - hex!("a4eeb958121bc5be5b1a68b73faa83b19272ef2f2cb627431be08e9844ef9d4548b4208670754d0954e5b012e3933859").into(), - hex!("87b0119e4c54aa2b4f8260f9ace7722788578bc6d822361d011e751caf13be5ca94b7d5842df5c16e52bfb4d658a405a").into(), - hex!("b696ec7f5dc82655cf027f5827fff3ce39195c1ee4ea9fba1808880cdea16d6086fb583edfbf66608e4f33211ddf9f27").into(), - hex!("a69bafcb3af59786acf009cc31e245009156a7e4fd2af98cdf2b7e63c39aff2baba08a338cdac93e94f6132b2cfe7a7c").into(), - hex!("8aa0aebb24b8c62168b255b6041474e8abf0d589a7467bc4712d910a9c2d470432d251e336a80dded27c0e9eea43aebd").into(), - hex!("a08d6976d3579411080957dfa2ca9487b1c4d8dbcdf640c1fea0a46f2c0228c2ddadf0553781c3e0dc5c7503b1bf29a0").into(), - hex!("a4abccfcfce6754e4d6c5c8bbad6668a55dc555ba99189936385e4dafa0435b323b813ce69f76e24299b5842c244139a").into(), - hex!("b89e4fd2dfb46c2af6df73f7185693ac535b67ab31f2805b1c24f400e0068cb32aff164b53668512f5895883189f7c02").into(), - hex!("b7c221a5884d10048bf9dd8611fb5231ce444fb756e59dd60d18a2332e889c014b27d739ed6012ff86056c04f36a87f1").into(), - hex!("a82875d66a4da52d6eac9dcd9ba9c728332253ad4b83acf1601a34efdd0c398eaad4acd1a948203d1bbd4a17d01a7b56").into(), - hex!("8c0a8ec162b3d48ee6a0f39620432cd67a1eb33a6d6f7bf1aada4f24c7498cf2e2b2476898f14c875f5efcf439aa0bce").into(), - hex!("a4b5d6451ae5baba3984bfbd5eef59543bf7c923662ea182cec6bb29aded9afd4c89e618ff756b5290506e0bf5a7e690").into(), - hex!("80664b43e3bd2f6e8eeb81a46cdca4f571499f3f0c77eb007ceb33c5b3dc18348a68cedc19d9967117f21a6c1ea29060").into(), - hex!("9174e46939c6915c757e793c9a02e46ed49d869216b720d0924b9697d94098182cad2cc6d4caf4cf140445377f1b4c80").into(), - hex!("b6e25cc134e089d306c648228d84aeee9516c8a276a2d37b54b458314b8f8980d49614550e821aac31000a5e7d518fca").into(), - hex!("ab1ab623a70f1e33cdbee356530a6f8fd9d00b2f9d8f94c0854816e5dd2bb8b258b5fb7a89ebc0725d8ebb74395847b6").into(), - hex!("8e75ea6f0678abfe1a7a9201c9fde992451327d61290fd803b3a1cdf2f7537fd7c23e0e06af5bb886a28928d0baba1c5").into(), - hex!("b41f4d4421de7b94eb9bc61602d08d77dc3f5f5d025e04f44c1426f14e8f707031b9e1d3a6e92c200f54166b2040f0a0").into(), - hex!("a8fa0c61435b851f9bda4da8dae0d544984ba5c0fef338eb6896b9c08306c3e2aec0a6c2028da319f210387320df4f73").into(), - hex!("a884af449df4cbd39e161de10f9d1f645eedfae0d259ddd84347733836fded047ca079916d365ef3d93fb354c8c795a6").into(), - hex!("936970bdeffc92f32915d141ccd8334df7966a3cafecb6d33fab9f477c389179f612cd6e368b615a98112d71756756aa").into(), - hex!("88dfe631c1e16ec3634e06a83a857ce9c909cb5b05d40490e6d02e553dd3bf213f0e178d31b4d913a4796b7226ab3ba2").into(), - hex!("a0c8357b4fb9c4431bc88e6336c2218590a7cb351ef4405a80aa6d352912f0b3110f3a09eef337bfe98da6b0841c6214").into(), - hex!("a7def54e08e2cea7def767d1108bc5c24d64e2dbdea9d07f0c8c63e60eec2db4e095b4a84bf6a4822103560b0497d1e7").into(), - hex!("80991c4f933985d9662d2e047187f244dcbb79606410aeb66ab250b2fdb9bd9daa392339e9b16d0d07648e847b02f942").into(), - hex!("b63fe559e2b4580238a0b0ce52ab8258838c2b64c1922c56b64cd65be2f88c140cb4e6ce96932e92f1ae06b20ee9e613").into(), - hex!("926ece3480c5c1f24f03d8289dcac7d3b202fcda277dd4453294dffc2953d91c842653a9e272b76fe2cebe1de3aba63d").into(), - hex!("930d29990821d26a748018bb6998488d5de811c8ed506c213c0ba346c8011e2d7c2235aa427a320129c1d016948eabf1").into(), - hex!("ae4e3fcd6c99a8f320dd4d160704db6baaae9aaa885f5d792212ea03cf06a459eb4a2730da9161ddd72a5e6544744e81").into(), - hex!("a01ae9d4f0008efdc5203abfdd0807ee7cc58c49cc5946d0b991ea2e069a224f0d99ea714b4d5cc464deb57372790660").into(), - hex!("ab17902ab255c575a133ed47fbafd62f898748ef6fc33455a2adcb2d4ea72c31255a9cd0c545d2ad8007a5a694f13371").into(), - hex!("86e2384e0469ab8ea9c5628d619d10336b3c0f334969dbc3335dfd72ed9899639fccfb5d1d9d6667a0dba20651584100").into(), - hex!("88ededd6ef3502be7c3c1b018cd814d4a8f98a7cf9521fe9cce6faaa6056315e22828397435b57d15e996fd15d7d700a").into(), - hex!("affa898a30a0dd2ccbe8d46c5a69dc1a8696b311094ac00e8ef6d398f6f132edb2d823004bc7895ac53bc09b6fb1059c").into(), - hex!("ac9f5bc3e2045a1eb356d88f2a62781fdb5775349c9bbdd9417b7bb7a9132a1cd42bf4986fcdc706eabbce45ab9f1cc9").into(), - hex!("986e3813ade7b9533ccfdcd76ea17490bc3dc62c8a596c8d07b246c28d7dea465c4dadda05111d2793d72d317c7c2833").into(), - hex!("ad4fbc51581cd520bcd0b88379ec0482c94b2ac344ce48a5facc1cf3e026edb088ce5cba5113f2c31f630a1fb37c5214").into(), - hex!("b499bfe19a22900c46bc0af1925887bfdd62455a3b85144e44b9a0a3756548c72b4f5c61f21c15f5e70b627d9f53a9c4").into(), - hex!("a5f40fcbe99b494c6acdd65ec3516d5a4a784ffc501e686764bf655c1f2f4bf784bac6b85e961d6a5ae513555a638323").into(), - hex!("a44c695e5490bca1cdc6b69fa80d6540239e42ae1765bff39285d1798696574c409e27c288b3b57196cf7c1753366969").into(), - hex!("a1ec5d9b8e55803477fbdc454d9c5cc605ead24147e5b04a03f80558a14f1e08bd6557f3fd11dab06a2816d32138cd43").into(), - hex!("98957c2e0a82210e2329b60dac05dd8b219ca00b18206227b725d011bb2f8b0dc1a79149a7d49a9a5505301b1b3847c5").into(), - hex!("ac8df8b1b596039c24c185108c89ef4da384e92c957c84bdefdab923e4be7c0e9480d837e1ff2e6269828b86b0b9f6c2").into(), - hex!("9358e3a48d4938b189059c3696169d31339851a1f4205dfe4de423ad4b96e7015c0dccb8bcebb64c1c357b65d5da6914").into(), - hex!("af1ab721df52d8b106449aaed05761b637c38f4c5513062afa55a09b94c8b088fe98cf430be4633b4f2f818da545b37e").into(), - hex!("8b8c063568a13f6522fc66285ab116a06d5e226a72f5a00fb321dd9b7d0bdb53a6b46ac17a1c9faf468c19b128c84488").into(), - hex!("b537f79bf008cd16711390c188c52d8dcf23cc41990c82005de2b0ff1fa09de85d3c34328ad9124e108ec252ec667f70").into(), - hex!("b9e8cf06d584197093d4b4b1e1f745786bb1f9772c0a771b321ae2dccac167ea79632138d60d8ed6dbbba2accd0a3c11").into(), - hex!("a674106b2c965c708b98a9f28a3f511f5dd8dfe7b2b9ca64a29152c7fd8de428316638d5091412e22e50406c372d9950").into(), - hex!("900a4953af5a28ca5b6f789a0dab9a03e3e5b9a0e866465d371b871fc59ecba31b524b0fc414eb7467d4384ca1e4ab5c").into(), - hex!("8b12a6114f8e0947995d72fee19e9204a4b552a85743d5320c1942bd2294d52a2d6d346f5e930ed788fc929069733297").into(), - hex!("a118f4b631a0bfc00df74a94930d69075b83be0bfec2affdf5e1ca4762d40592132108a7d2088891e7fe078c84ea9d9c").into(), - hex!("b074d18f84787d245018a2dabe2f0a51bf2f3786a802317122982a598f7f953339468e0392665c3f3a6b8fb17cd8f72c").into(), - hex!("8e6230b8186009b765ae6b176eb7dbcf503139472c0c2c5574e3d608a49932f0b852e744d2e215c58512ed2b4e8178da").into(), - hex!("98cd13f8400ecc9db458cb81840ed6467795f54f25680931881808909cc661230716fcf8b3fc2b18f4c12d30c32d9e20").into(), - hex!("b861f89275776bd640bc7d0d347df31e784292fa14ec468a6b0e8d64a9b077b6bdae1bdbc56385bf8f5676ba62002606").into(), - hex!("80ac9088ce82fd7a90c91b24e5e91636ed76844303a3b1105bc284b4e9a860acca3207d1804200a55eeb3ef45ba97558").into(), - hex!("940bc07a53373f075128b6c12f59120bc7368289d5a960c55d52abb68e8444f6f830b07850d31a9ed137f5357b38406c").into(), - hex!("b8c5919657811270976eb45b9f3f09be798fbcf6b34ce7443fb36207816b6a84d2b945a6e6522480c2feed12ca980df9").into(), - hex!("8294e6ce7d7d3b77bf48252eb97cca47a5b9dff1b8c97f8b7af8034b938864f38bad932bfe44a9bf4df81e394aee7ef2").into(), - hex!("8d9075a2c42c1cf51e082ab1a57a66670f0e81af2a651aacac5aaaf3876711aabbc0c96e44d883e6ad8a91a81be22940").into(), - hex!("882aea71e4512d5c41b5fd6509ede0fa35a49fff9648d277b531364613342711b2c7520a5f8d58ff31b7fc9407f968fc").into(), - hex!("8a34a824cbac06cd99fc68f36ae09c6adf2d472fcbd378cda61b838c29ca9750a7f7d63d9b61d1f30deda1ce048ffd42").into(), - hex!("a4f027b5466de4fd633cba98d2c8c78db10f91c8bee76c32ca5a80c5e87ffaf19df84e675f31bb6c14ee733ac3d4a33b").into(), - hex!("b990db2d743b389132d4d8281701b348bfc52f707e6553f309e4f59706871142e6b8e3d081057a5c43243911148318bc").into(), - hex!("a4500c88a58971460c33a404a65260a9e21c4a345601d1686ecc352ab088b2bd93d30930383901fd2d042dd037286761").into(), - hex!("a4de9078286cde237b4ff2da52a0fc1b8fe7b931ac35b3033dca0b87b5c86e58bec951a66a7308fc951ebb70fd0d0bfd").into(), - hex!("a9adb6dbff69b115be1cb37d5ee3a95d8c9f466f059128b6ab197d4119f6c0f87d1cf4d14d4beb2a43f7913700c1d909").into(), - hex!("a8a33f167e473eb2ace3bedc1cac2281bc9f522a0fdf6a9eb365859b9116067e07b7c380e8ea4dd33a4fbe23e2412be5").into(), - hex!("88c3785f853a192c50c38040ed52c413084dd069729cb14d806223f8a51aef40c21648d1e03bbbca031ce811e1b708ce").into(), - hex!("a7db446f88ef0d018675c0e7be0e9655d098529ce4b4c92ad809ed9f588c3f6c6dd98267ae0efb1659dc16a29e1feac0").into(), - hex!("916fb4b864ef46a2f8f570364cdf02c93d8432d8155e7ad1a15777d7f5d5fab94797257d0943aed5f16033528a4290b9").into(), - hex!("b9b7ae2ec02b0694d7828a69bbd1fd6e9070cc217319dc4e8fc854e48f5ce6e133fb0d5492e2f87e7cb8d3d557f17037").into(), - hex!("8cc36ade2b8039ffd41459272091d9cc4c46a49a187e18e9e3b283136831724313ee6eb5954c34acf9ecf7d79c30dcfe").into(), - hex!("b89a28db91eb06f191731a927445ca64cb685a206f4d77f335f510eab3a4973eb1d199525aa12df17f97cb4e079bc35a").into(), - hex!("87fb2881b92d5d9a2555080afe033512fd93306bd25f4a841d034c0fd9685ae09ecd29d27523e8f18664cdf2127ae6bc").into(), - hex!("aaf63cd83256de5b8558bdfd7f5fa44b3b3cd767983484ee482241286f82c6f51c1de99e2c03c8c99e6d4a27b7379cc1").into(), - hex!("89b52eb17e1c2868a3da6727e6f122046739c99cbb6aa7e30f65d7e649d09540b7ba77ea3efad77be597e48f7abe7643").into(), - hex!("88d097674b763a770872f17266f38200a4034347756c5ece6f11fb841e82447a75f6f3279ba8ab54e668b2072c6596ef").into(), - hex!("8de58933f07ac60ae919adb4be0becfb5e6f7330708a39cbc4c988c79033f0ffb365ae2a6308c234c218f0e45ec1ce6b").into(), - hex!("a4ec080db7716a0eae593b0ca91a16273abf534b8d153232e4b7d613c9fd21081bc8442d6e57a6e8e026c66c93bf0289").into(), - hex!("b680857b566466d1fb92d78a09b75d93753c275249dd05a17702e48560e4df5c7f9ca68370847250fd001433972c8b0e").into(), - hex!("84ec67623fc58128f4504b071b53e3c0fc60ed07318febc8d450035567691e2e58468b6799e5f3d93536100bb4b5f3f0").into(), - hex!("b22ce364b11e164d3df52050d59085c29c398556617277349637290b193727e3942064693ba1d7bda313905908a071d5").into(), - hex!("876198b5734f1ab5f7ec0231110e9cbe59d116ccc410678d5e0108fae42bab5dcc7cd15df200bc71f471ecbeb0e80d68").into(), - hex!("b081fc87056c34a8a78cc34f308502c5b6509adb0b344e83227b997aade90d6f0f1b8e5302601ca3217ecf9dcfa24ddb").into(), - hex!("8fe71e517db52831a0c4adb83fc6524817b9a358fc6bf58c03c91d4125482921936391e54c767ad2f13071e0e5ea266d").into(), - hex!("91212d83807ca11b030e5ab72ec85a8d13d468c714fc97c20b5d0569c382ee270d2ca486c88354994ee54f02dacbea50").into(), - hex!("b022bf24d2ea893125f3a89186f444aa5f301333f0667eb5862586a5eea8233c90202064eaf9363f7b367a6dda15d45b").into(), - hex!("b1f45fa596a32d3fe267c830eb042432eec6b79efcd5c84ea835d7108bd4290fb64749ebdf7e7e51e6138fedb3cd2eb8").into(), - hex!("8567d2366c584d975bea34d4f9e2ce62a62765125326c5e56b5cda08fd2f2e7f769db47eb514d2d9324b645879c82a66").into(), - hex!("b4816fa77c76e1f75e6fa903a4c0c031ac7a5f5ccb5f553b4eed83bb34067480804c0f6f308f8d0fd723dbe2198b0608").into(), - hex!("a9ceeea8878d799fbb6d52dc4112ae712429b9213f72b284698d68ea6827432f34e51daae1727b5402916a836567f611").into(), - hex!("984c8ca226df18ec574e0fabd6dc9ab3a2e1b319c4b6ab5b19872239833dcf447ee5d720305b2385d65facd297704809").into(), - hex!("b02fc16b3530532a2373776e2512421d6d2e42f3fd3c3e71393706d74ef9324571c8c1ba7b9caf65dedfff2bad946d71").into(), - hex!("849faa2060a75d08850b54e06376f252d9cb4add3e740225ee37d23e29f80cb9f98188a7eaf6a381af4b4bcc9874b792").into(), - hex!("b5331ab6646a8be3bc37c5fec56a597b914683402828dd4098b189f245c638e063c933a542c0122f063f98a9468687b7").into(), - hex!("868d8214f26e14e71ae0bd514275ae9442760af72269790228e733005293019984d3d463c2bb82936193dfae8c267fa3").into(), - hex!("a88c6c4af4b9d285997c9b5cca7e22ab9b8e5873ff36455bab6a6dd4518e966079524f8c35391811f16eca421f588694").into(), - hex!("a6f508524a938fb49a7da70251fc8300192882a3fe784f0bc51027ef2193d90c75d0d0720f2f5be634d81f38f3d85b8b").into(), - hex!("80a923acf2aa0349b4852f47edec37cd47bd74447f2f91c110ed092d015887a6625d5f1fd1f5d00c994edbff1435956c").into(), - hex!("84ed9f1ee0db4c9ae55492fd07fdd44851a6d0209da5b521435229b1b45d57c3b835af627122756ad0e63e915c15909c").into(), - hex!("b4c4c1e6fdc418bd29cbe8082fd774f678dc28a51896a51349c888ec98124b7a522baf70b820ae0729696624f3695af0").into(), - hex!("a8cdde029503aa3e23776a67952b2bc954fc0dc06f07a78bc94e6408edf381bdadc29efe4e5340a9b7efe99a3f3b3687").into(), - hex!("ab02a92f5ee21035e6e3e40a026d8d5680f98afdbf82dc037dfa30a87a1c101387a0085da8474989b24196ff494aa618").into(), - hex!("986c88a5d0bc6ff4127e34e0a5fefc1290936ec88d1765e776e199601f9660a8425c1fc6defff07fb81576461d0ed7bc").into(), - hex!("abe2259e880aa8b587ac9a31f794895bb18ff1bbed378a70fa09388e5a6a7343c072401c856bdd92fc2f60ca11056aea").into(), - hex!("8c04c98815c0c1f281c8783ff8098b0d806039a39fb2f4642a08f821c02506bc7c80ba7a1f4b225ecda9971ee3a22121").into(), - hex!("87b7bb0cce6244aa1a540941f0ff5ae4126fd4c62bd98d34993380a35e1c9a9f43b561506e5eafc1ddb8aef131403590").into(), - hex!("93cdf5f956e8b40ca0e31cf559937b997897c137a411930ca28075899abb6c08dd6aad5b2bfd5c09f07613a6854b3be5").into(), - hex!("83ebb284e03b4414694522caedabb391062ba9ec373e94427feff071644df91635ef498dcd9351ae259c5b15d6edbb38").into(), - hex!("80747223ba06d6465e26a354b79c42ec0624d33cdf015da7bcfb31f7009d92aaf6321f4a921f6b38e0a394a412edcefa").into(), - hex!("967b4b10a341abc5c01ffd413103c6468e3efa32c8ddc7e8622fd3ab2a765a420e0be3c81e1da05679becc5bd03e59f6").into(), - hex!("8a01b90d551f26c265b9987c67b641d15bd3b8e5af5c25472037645da05d9d54c0e59bab32578eeb3c1c5889f4fd9aa1").into(), - hex!("b6b38e40e3fbb31b257ecc18dcfff2fd850a41c2cfa5a642b0c383cc1a86b2b9adbcb22130665f544f1d9fdf87e92dd2").into(), - hex!("b490529e0da56e7e4d4cb2f79b704576c8b6569e9960dafef059dac0144b29ec337f4beb515465a57414d8965268a3dd").into(), - hex!("8a3b14616bb721543bfe007f1a042e76ef068a6e4f8964d68dbb7a733ea92dfe4e51f4008aabaa01a8a3566b00d083ae").into(), - hex!("8b82dbd0d0592d45d6309c795beb42274b74d844cfc393b34cb6992e3b25ea8f62f777124584eedf482949bb999ca5c3").into(), - hex!("918226266d7f02b2081edba64ca4b70339b7a63ef9194cd77a214620bc25618495cb4335c0c3621c75f821e685af3f1e").into(), - hex!("a61f56310689b9f383b45e8c8c647bd7150fc6dc3be96afb464b0c67c6f8c73ac9941bc8a5b0e2093255c204646c94af").into(), - hex!("abe204f55b8dd101bbd554561c1a7b50c01b31c967f6cea18dc898a10021eadca3c314f6b7afcc2251682717540d2100").into(), - hex!("a0cc3fbc4a05e3b5f93f4df85b92c1bed221f21700d8faaf84e99954cf6994d0052c8ba8ab894503b5515bdd1460ac5b").into(), - hex!("a5e5e175726b31163e13447e360f835ca64c3883901fb1fdc275b487106b39fdf43b83ee8f3985dc85157b94aaf8c389").into(), - hex!("b34106e71862b290f7bb47e5492417b07b541fdba23ed474f29d666cfb50bb5a3ea137ab717a41ff769af53ab385a3d6").into(), - hex!("aab726a0317c365aa15ef9527e5101b1a90cdd60888b733cdbd61dffac3374f995206abd154d099b2dfa03dbe666d503").into(), - hex!("b3fe9956454604b2aa1d51480ae96182ad1a8af64e80adbba1034619090c23d0d7ddb4163f400399d5946babada2f5a1").into(), - hex!("831a0d4008865576d9d0200dbe80eeafa7e6e6d442a46ebf949f39e32ad311995535a261795a7e27f2b23a6d506b7a33").into(), - hex!("8d7fe284c9ea1a2dce6ac70e3f225994f65ba9791520fecf5359b80f7c32c1e45e75b8b787ccf24b83c79301e046bb4d").into(), - hex!("b00df7ea640dcdaec66317924090f49380edc5c669ef1249ec8a24a3436b4bb41be0edd4cb0d04bc6ffd540ac8efad18").into(), - hex!("aa55d72470c024627edff24f9a19ae958d6b382bab6a24581183f762d736ac10f189ec3f34a7a41516f81696352f16c8").into(), - hex!("99e172cdb14a23161b5e8aa80121d98e69506ae0ab956912eb2ed959b73ee901852f263cb65798554ec0ee35089b4c03").into(), - hex!("84ce8ec6a7debf3cb2e53afff7d1f68bf75b7b209938192c7675286b17489d7996ecd9514c5233af0a17390b9982d805").into(), - hex!("943cddf3f5a6dc04f425aaca25be44438aabc7a661476761de596fcef5746f9d83c361da3fe1f21227ee5b9bf9a3ac76").into(), - hex!("aa81e66cb01e77c5db882792e9d896c83aa418b12c3b5201e1937ba5b74bf5fda974c82f6f40e3ca48bae72ed93437db").into(), - hex!("83bee12657fb462a5988ee26e2d0ef8b11e5fcec108724f6135e95913d7f4ec338031b697b24fd7a650cbeb088b26733").into(), - hex!("ac0070705c447e635b8df509de9ae03ea9b0314fc58b3befe14c316cb7b70ceaed081aad115a2126ecaef630c6bbab0f").into(), - hex!("a1c9c3b6f28c14ba91cf063153c50253d82440b81dd8ef938e181ef4116ede0b0ec62844e1d7e8b387668ddb8644852c").into(), - hex!("b41811ee8e385836fd709081a9a65a33ae1571bf943937615e97d49aeec3289624882915a5f5b6ee98601e752bac1212").into(), - hex!("a59cfa6d60f5c3b62197d3058a9b42c66bb841ee5d67ae34ad452dc70974de0a56a770c4ee5905c0d214c3d81a5269fd").into(), - hex!("ac47ff714d42056df3962cb4494019c977fb6200cdeabfa3ba85ec7d7d70c7d3ff4aa05e26aeae6ec6a3afa460244ea7").into(), - hex!("83c0ff348f1d018485c18417037016ec592c249830fa649b27754dfa70b94a549a42eada20ab1c4de2a5a513d742186c").into(), - hex!("ac5ddeddc94d18cbbad0e1889a2b64e91b3f927d3eb666ba018807f1e4e1451a43498ebacf12fd370b62c5386e36fedc").into(), - hex!("91606f0315fadbc42b1b27ff35b5601196a7a8beec3d5c76643e38ef28f0aef0aba9123bac7ceff0b297ca53727edbd5").into(), - hex!("af9cd077736f17c89ab4fd21fa2cee63b16f67277e9c5d54663f6d5a7abc3141f3045558899da70419b1e92ce88eba86").into(), - hex!("ab0757213aa3fcdc326925e0dadc2206f43c53f7abaf34a077f1cb29427261b4bd9981dbd1e33fedbd77fe00bbdaf8bd").into(), - hex!("8c97d256f9d4e0f309522f3899c5f74fd7e8c4dab6adf4886e7b058b323e294229fafce28871fd39e5c43f28c670b8a0").into(), - hex!("86eb85ad6fb7a3d5cd9aa5b22fd648fe9db688fe663c835abec75a6bfb67af0df0421d24203083aeb8ccda06dfb230c9").into(), - hex!("afa2dd3712eb94c9097135a69573c1f373ee0d7916f4ccec5a62445726aa4c1548bca45038e1a44ab7c8b7e3ea22dd6a").into(), - hex!("91e82407c442937af665ff8952d8b7ce3d68ebf807166aaf0fd710b76c65b39283e511b3314297ab0f2a9c8a2d76ffbe").into(), - hex!("a52cdd05f6e254c6da7a00c9210e33a49658f035b78bc7f15b527fce20c3893d3f7dc27a616eb3e107da060df251b082").into(), - hex!("81e6ddbaad6a18404832d2923697ea8df8dc3b39e53390269f197b976b5edbad074639e1e7bb25ae87b00681973fa021").into(), - hex!("a776979b38184661cc36ae9bf99b98cfb64babe37b16ed7e16e33e2187af71d9f62af4fab2bf0671baf3172727741d79").into(), - hex!("9395a004323f4ae604518224292a1fdb359fe9d4ec2a2262f13fb33d90a9dc50040d03fa6315a5ab2db043e7e16fb971").into(), - hex!("81bfad9e94c00fc810c4e63042fed6dc54c7c48637064376d5a4df8c8d6be3c2eed335640bf45bb8df99327a7e070d06").into(), - hex!("b6b38236ea973f91eff175206c4328cb97335bc8e498d9c9a2040468885f7d8464a8a1168929cdcc4c59513885e1589c").into(), - hex!("aa14a7baeb7b6d0048bdb8c772de512001174f764b37396c6481bff5aad30abd6143e4654a3d80406f8d08948ff8145f").into(), - hex!("a7297d6c09873e481c04f2e9e9a07567d78da504d2929c8b9d8ecae1c4d919611e061caa632776a8716b20e031cfd203").into(), - hex!("a0942935f58ef26a111d77b1c4598207eb6e3414c106b286f1c4dd344b3e70d3a46595ebb657e43f0e71dfff3b532382").into(), - hex!("95dca5de041e96f8c64f945817ab1ad62414b3002073b18331e288878c7a889774468d3c24f04e0714958ebd79ebe71c").into(), - hex!("b64f58f4eea309ea03c60f6ee66107fbe45c5ba81b8ea397a515435a179ee86bd098cb9acab4f374d29c8a388152fc6b").into(), - hex!("a70fe2ce7cfbdc22183a1a81c779c6071199768ad9b39ad0727ced4fcea5fc79e9833279ce93e1ef16cfc6dc0ef4f15a").into(), - hex!("8169d05ef0406b661022af53dde8ccd7315b3e35065c568673bfe5e59828480312a8ad418ad431beee12e7882d11142e").into(), - hex!("8148070a20eba3b61bd168e00ae8262d698263a8f22ee01ed6d46d154a08708a85533f54935bf92ee6ab0c04569eb3ac").into(), - hex!("b5e4f8b8a011c9cde6a9338d7c751ce2828fcf41b40e140ecf543150a5b4859f87836461d0ea2ed7cd0e6bfb8febdfc7").into(), - hex!("aab7b0022a1791339fbf567e771c43e9a2a46fcfed394b7216b556aacdebc259e5fc599eca66b12c23467b2443fa9c76").into(), - hex!("a843e5929fa14bbdb5f370d28547a7b585443f4d2fdf8e7237fcbb93a5220d62c8033665996f36288127a2bb4822f357").into(), - hex!("92a5abe1a8d508193c88827f93156e84199b14731a68b0b434663e5b9ce8e6e3005ccefb3ad8330c56fc0898eb9334d2").into(), - hex!("948c5a4bce25157f5f779fcdd89bfb4747a6178d464d15148742920aa2ab7fc63d6989b586152e1e79eced93f8686206").into(), - hex!("8702f3fccf470a294946970f8ecfed499f5ab3df799601f872d7be3d9227ff78a764550fd1a97ab25b7be96d366c82e5").into(), - hex!("85c5f99e913f1cb67a30807386b5292c841b51e959a13912fef2e0f4ba84ab3b1c483dd5fd33e80774de19695b622888").into(), - hex!("8a903e39b9b46dcaaca4fc968b298430b982ed3916f8ad533ceef5131dd507f1188fbe856c80bedc7bf34799743fa86c").into(), - hex!("a91ecd938c2a399b97576c43c5d1621fe748732090e360fa1e3ddd145438f9569d39a7be9d032b435a5d14ca4c905d15").into(), - hex!("aba9def4db5bbf2ba185c134f7734feeef976573e20d76aee476bfaa2af389ba5576a1476aae2d42d5470a46ca3f58ba").into(), - hex!("91d3529480d066817c0111bbd92714a40472ed6c877df358de98f0258f79fb8ccd54a4fa8bab3b9cc15bfabeb620c196").into(), - hex!("8cbce4e674d90185c47225c587dac654428427cef8a563cb89aee6fdc2ae6f12a8b11be46c779ed9afe38ea97d7d71ec").into(), - hex!("ac684cedfa58b2adbb6a13a94aa8398ef4a14970f5a43a344986cab68fff7fd48f7bcdc0506026eb0a2867efe86f283b").into(), - hex!("a21a2f8df2b811550d6e115c095d4d6781a84ba25b7f4017adb318776ba7452f48ed8b83a6a94aa68d83f2226a4c0549").into(), - hex!("a0d96e01d937144627c695aa4256f1d1a16c708894ce854f5ac656585e6852a43c39080909e7029b6611ef519d9983b2").into(), - hex!("a2f32ffa61e370d087058cd3ffc534da6a917f75ed5de568938885cf5220d474c930ba9bfdce91e031aab3b3167ad362").into(), - hex!("aa6a7c0162520c6706ab0f6188b718c1909a4aa12e71afc1c2d40e51fe44f667db0e7f1f0cdd81594447e267720f2dae").into(), - hex!("b4f16474ec3f37765e8750729f3245167b82472ec454329c9183a5d5ec939041d85b83523d11f2b895e2d15586f81422").into(), - hex!("917af7d2995b6466baaea2b3eaee5f76508d0c117d0452bca6a07ecb87c0cf595161abd5bd31a904e05684e55475a4ce").into(), - hex!("93dc25ff6a8ed93fa40d198a97955d40a5f29e50fc6fa6dbad34582478d3d1bbac0ec5789f11a92a738e533939c281ba").into(), - hex!("a41c824ff14ff5ee486a6130dc6cb01043e59f71e234390d464c95ac49ceda8b5400079ed4edecbb59be2083d8f06da7").into(), - hex!("850da042d678ac0aa31dfe0eca861ce17cc306188f260195fd10f940c67d42c9431cb68a64d27232e989c9c23a6e3d1a").into(), - hex!("a3e223f30d9782fa1fae634497c64fc58bc8289e48a67c8517621918e2b921cba1e90b2b01f838ea36071ed89bf64ed3").into(), - hex!("809001b01c33bf49a97ab6fbdf708fb224879c71679a2b335cfbb3cb4aba3201a32113de289878606c9feca057d9faea").into(), - hex!("a10ee1706f4c49a9cb2fee4ec6a0dbdc883fe40d4e1cd7a0388f49edf1f5f23a38e6075fa5fb54fd8e77ac3742266a6c").into(), - hex!("8c96e17529d7051f09f93faca150f5313e4d7f32235a4af6d12270780d6c14418749489a2674c728095a56585e0ed924").into(), - hex!("a9a7bf56eb25c9bda003a70128117adca9c33c6bb24bb4c381ac405e014d9c75aed0d704d801b9feacdf81c3b7f0040f").into(), - hex!("ad53d11d31bb9ea53bd23d673fb26211ee39ff4442e9efa1259bddae866e97bf07b0f9ca44e166b3b85d19b5865b1612").into(), - hex!("95e86d1427c8abd87e7f966c2ff9468d0bc3f76175bda677acea5113b5bd0d7631972c4172220e3a72e0dad1496bc14a").into(), - hex!("b8894228542dfbbc6eb65c9adf6549eb4ade838701356e7d672c095b1f997be5bbf3ff19474ee99e81320efeb04cd529").into(), - hex!("88bc36d6d90424e86374499e330ce5afeb63164fe81fcb4d56c5c997e07093a37df33437389879895c8b2cccac28ed0e").into(), - hex!("8ec1d43488aebb9544ae0a12ac7311bf873bee05caafca5176e26d681b881ef6b5e3ae5d9853b33577cc21d3acfa1e82").into(), - hex!("aec567db9a542eacf68cf4b7b9682ffe0b385dfd192296f8d8cd9e1db9d7da0b4a4a0d0ec2419825177413faad458cfa").into(), - hex!("ae242e9e2c7ff2c0898f92e7e9742ee5e19376ab97195c4eea0487490068199d0fd7ea08b832c43e208336b5c77d1947").into(), - hex!("93447c215479b68442636384d29fd5b4815cff904668e909c67fdcef1cf5d594219371f62edf189d6e54f04872705947").into(), - hex!("87f993a564e69e132c6cc4874fefd83bb5032b98bda5eaa8fe9e1713baaf08486aea21eac3231028715e846e33a3fa23").into(), - hex!("a9c4eade07d3d51bf733d8357005e08a5f86cb44c3dc6b66dccbdbb67cb5727bb456d6092418275f34b59063b3fd64eb").into(), - hex!("8939e3cc9c1dd203d8079aa4ac0d40d2e1b85bd876616bc6b589b0bd187701fcc36c52d79ec7f14b5e54fff459c99028").into(), - hex!("978122dfec6fabe4f737a3c9326f2f721cc212455001ca7e09b65b70ec1ada1ae26d451632f31f648cbc65a3337250c2").into(), - hex!("8d1eeed7fb1902deaf7d6dec7c86807c4aa8ea1d7130d6caf01d65e36f6a30e3442a97ad6918e67d2e17fff4ebe7a97c").into(), - hex!("a16203ba484b5b02a1b210d487a54c3da41b3815c307a30fdbcda0c3f5f2205e16bc7232e1b8d57d5f58718ed4941ec1").into(), - hex!("89b4e7bdd90323c53aa502a9839f57133ab0cbae1cb133fd0beb54f4d7785988eab89eb0bcdf61bf62a29b341befb883").into(), - hex!("b75550a71a4144a4f23ee27d86c10c44e8e57c118ff4f9a2685762a98a3770a6c2d1fd9229f9792dd4e784e8b2eb675c").into(), - hex!("9171ea1599ae47b04ffc307dfe5e49da0f48835cda926355606ddff47b18ce3c224828ddb942e63dd8153c273105125a").into(), - hex!("8e0e78d069f4d51b9b0c370100a9d10e395b8f88d009e33ed7fc4959bf140176cc316843c76d2a741a3471d56ced5db4").into(), - hex!("aad6b97330e76b22781e78ebb2fb2e92148d74546cddc7348e7a7f0563b986a7553907c8946258cc343a15a8918f7491").into(), - hex!("a9e8e436356d44c945d8248d249e20f5c50bd147de94418d4f04e1f67be2319e4d2a7291981378a1e457874dc91a9948").into(), - hex!("800b092bbe1f56e78d766c510dfe42f0d6670335f5931b3f821c77689fc11a502d7c82d2d887ab21caf312f8e5a037f7").into(), - hex!("aa8b05f90da0056b7659c26171df70c748d7a8fb52bfda42b7d129df386de331c1fef9d5ad1b19f0452cafbb813c3ec6").into(), - hex!("a6bb8153637b097a905342895ec1c927faa92ef8d59af86e43864ffeb6b8caa3f5b025079ccfa83214332aa4f6b71a9d").into(), - hex!("8244cab3e6f39492c8fda490a363dcbd8af265dd3a158c2af0e66182b48fc2b49f473b402bbf0951b42da5bb669504e8").into(), - hex!("8696508e20c144ef2cd954fe420c60f8432529b97a865a52de5292215c448984dd591170d88c286d7bf5a1cf8b94ae53").into(), - hex!("abb5b057c6b91d51df313b4690b15a218dfac6a30a05041c5cf451f515062eb02c54ee6cf6ff2df7640d15ddc7a95dc9").into(), - hex!("ada583911773366a4ca0b5d407520a590e4f3c6628c6d050f2641655d1654809b886807c1efeee9e9ca187b79b7676c8").into(), - hex!("9730edb86b7161715296bd5267bba55d3bd956dc9f4c640df92cc8aaeed8ab2dc1ff74988ec2122f6c3ea57b6e30dd91").into(), - hex!("8da42bb48c6f17c0e96b5edb71ed5e937c9aa65af142234e3ce61403df7f6ef05a4309e92469eaf68d83afc5bd800373").into(), - hex!("b3cb17866a99dfd048c4ad6024823841eb6602c7e4728340f1167b8af3c810926f0eb3e1a0f51ed6fba4a80743660db0").into(), - hex!("af121178dfa05ac08a2acd56f895f444e56968b703ec6b6cfae1e836d78afe6f51021d4a415aed89913df49bffe27ec6").into(), - hex!("958d5dad1aabe840881f29617dcd2f759f220974515507b0a63b3487b4cbfec69be7d22f4f7f45d693101177ab205303").into(), - hex!("ae6160e53c2c9ce5495bd0f0476703684d854048f2a8bdfeb6cd1e93fda36e44d879531f213feb1dce706d35f9fbb04d").into(), - hex!("8dca41a5808d3c75f41919cbe65a226355df9ebc7c1a2d2263d654bc66d1f5786ffba84a1670a7369258bc92d6bd68e6").into(), - hex!("81585a607df11d0a5dd778adfa1eca440a49e37b21677fe88709142243f5ffb2205e703366de53fbdbe3d7ded093e834").into(), - hex!("a80b1f358d284d3d8b18ef9f101d4f0d84c2ff99342e7150a55bb2f54ee231e333ffa930487a86e97f460696348e897b").into(), - hex!("a4a1f79af8ca4a5c5b44b05828449002c92c313c8bdc33465c099ce8f74c3d575ffcf0ac1ec5d29e80ff96b07f08636d").into(), - hex!("8797e455d44ad2721ce7de2fb8125af1bc4c0757d9c2fae25394e44b8952dc5fa597e0cf5d2b1c2ce996e380597a1db6").into(), - hex!("acd840fe9ed7f38ceb48d65c9f9f02fba4df0fd871efb58b35547c9b526e6e2416195d2c131a04408df7298db50a76aa").into(), - hex!("a9ae67c2d2bfe04d64bd4def66509c108f9ce85394da48d97407535c1aec05df39e3f7c66203f72bc65fa72c18bfa77d").into(), - hex!("abb785c66a7aa06200bec1960c572d61a9cf2c283404601259ba720a506b3831391e998346ee73392a3f7f12915b6f6b").into(), - hex!("8a453eb657c2a85bf93193d47ec26102c4d3adb666a7e1f05f1991782319bbfe104cea57ae1f4379cd115ff711be67fc").into(), - hex!("96c7151e34ed488a06946059722dd9d1b5a2ad2fec96b545ed662a3d0fc23bce6973d93dd2932128d95b0686f9208fc5").into(), - hex!("b5f39ed29d3f85e56e21ec2bce47b04ba16d72a9fad492815b485a93065f2a83dd46f92d74274f815c84792278a67cf0").into(), - hex!("ac9449a216a875c2f288e34443a94a521f8e9de28f70b729f393a483359ffd3ef8537b8a798b8c9a259ca390f9fa9751").into(), - hex!("b15584e841de0e25a301bc3378e89baee55989d9610c513b79748e7c51c484f7bb1d9adb33f3b63d52d36918514aed2a").into(), - hex!("b4dcbabb43cf694b024d36734baf824830304257d959f6300ce17f892a23000e036c4d3d59d7d1198bf4f6ad5ff07e57").into(), - hex!("b8a1f0a8ae246442517606f34ca4029deb727cab005c9952ee9858dd99497ba8a0e3311bd43aeee35275db74c7bbc52d").into(), - hex!("b1c443db1b5a00a87a399880ccbff4481f5742423c47d38b175527e84b32fd66110791c117fdb70782d75c476683f9fd").into(), - hex!("8e018c4b2b4cf1f1a417d00b13fc51ccebcd09a502bb14795b8274585d2e30d71c2c7a9b9f56a717f0676e685e65e907").into(), - hex!("871ea4444c7080995472fc8bc08f9091f9f706e9cfc49eeea5357867badd837649f059163835a7ad7263cf03fd13b198").into(), - hex!("88b67b5819119372e0fd7f97ba1eef877cc32d4be465001c35096adfa18e1811bec1620849a608de8420126fee9c37e5").into(), - hex!("9060dc7f55fdfc237799a2814a6bfe2d2f539ab76c38a9b1206890323bb4eb7b1ce011ea4fa552b412bbf6c67a95f025").into(), - hex!("8bd156a3a54bffe373fea65ecb2ffb12c96f04e07eee582200a0ade24d543bd6523ae5eb8a710c1de1912b2b4712fa0e").into(), - hex!("a8c3fb552f1a8c6cc2714b97d0cb8b2b6028bc3aa4571a7e3e33f46eb4c150771556c7884d575ce8fb7b62a5770ed2aa").into(), - hex!("a808f5a34beb7d62d23405a64d27ee5d7bf83cd880caf7bd4a615b84f22e1dbf11eab129d9cc9ad90d4e1dcd68613f0a").into(), - hex!("ae56febedf59fe99e79e87d7fe7aea5989493833a52f2e6012fd3400c69a6dde951fba50e0c280779d530d74452d63f3").into(), - hex!("8ed5f6de4a3ba85c6c857068bad6432e96c6054ea38ef07391b914c052c2262856d19403a590e8df63c6dec99da35b68").into(), - hex!("89c01fd1f37d826b9ef3b73e2b1aa5f4b4f86a263b2822cff0153fd2b945bbcf16eb3868ce66910073bf86b222becfc1").into(), - hex!("97b3ef6e0bfd3c399ec959d22d29fa9a79fe8746eec49e1675afbf7a955d02db2e89190ebf43118b65a7dc2db0c4d72d").into(), - hex!("a95700745f0ecbb1e794f4db9788af60df4772b5ffc8f5f693f213ce6230810df31716382dccd5a832ced7f34945d144").into(), - hex!("87d0a6a8cdc36fbd788bf744a443b632369fa0cd983d2b60e20856533ed6451d8476b9b3cff39ed0f75de94ad5c7aa48").into(), - hex!("a14c6f6463aadc8d1d2985b601bae8e74de54954ee7e3aa918837064a98efa5ab736628446582ccd13bd458ec2d50b1b").into(), - hex!("8b68ec274484c910f1a73a8cf8a8a149ff2942ac9de6e73641619fdd9e778e9c0fe6198745f049fa9fed9e56287da0b6").into(), - hex!("b77e981a03493852e7ebd6efecaa647c69ce6d46b2190bb2d08f0eede4addda776fda92e9d943ba57331bc985cc8e112").into(), - hex!("9870ea49ed03991dc1a4f47fc978618d549b4f0ddea01d91e7c409db775c91cb2a58c0c0c57eb73e7b6d3418f850b0e6").into(), - hex!("a518fea50400ae263ab9cea0180079d0d353bdb7cd440cb4d2156b9628e487b704630d931bcab742e0f3d7230821ae91").into(), - hex!("861ba1b761d0ce92972f28b7a65cbf6026bdf7427774fe78ff1f45c67f9083fe94fd2c42f47082b6fba722abb648c61c").into(), - hex!("83d257a40e8418407c80851e2f14d0bc47c3b9ce9e2de53b5c6cd99f31dd25dc200fa90c822060d47c4225d61560706e").into(), - hex!("881f7f674959e4176731ecaf6e2c9b490e70c07abceef15707dba8c9aa3cfa2293a96bc9d5455f769642c9717a4fe949").into(), - hex!("835116735f8e21064c497fb0dcfc929004ae5eea1f3e6863ad0b227c820d36255230090812da0800e03af9fde4354a13").into(), - hex!("98d9c12ede55af8067af5b62b89002c66e3b6556ee201ecbaf585fe5026f997fda75105068d62fe5d2403c6c64c314d8").into(), - hex!("ab359e8e0ef4cbaa9830e2aab892db7cd7ddaaea54cf455c2ca24f10ca337f989641ea33fdb1772ed90a988083405cb6").into(), - hex!("ae9ded9c9fc4e812dcab3d8a1c74ea264eab2df0715c7107ec1ec336c0bb5f3761ac9580ca18109278be5cff837f754e").into(), - hex!("b373013674404122f39dd6fc29abef1b2634e2bf650b42c15d5a2f7d762eed98166be26372e8dc6bddeaff84cc2aaf4b").into(), - hex!("b34adf4c3acadd7e11a9d61f7df20cb2520cdbf2d16c217f39e3afbdf2180abe59d37115910b77a504b81a6000b982c4").into(), - hex!("8161d446296d39d0c27a3db1bcbf0619e0c49739c655af49f49ea8403374afa4f98aaf530413848b7d4b53eabc16864a").into(), - hex!("8256cd8e3c9354ffbb59818f0b24db969a7765d64c2fcedf591ce65f619237d6eabd110293bff42b388c9965ff6d51a5").into(), - hex!("a1c562787d2ba1cb64dba278080fccb1c6538ccb00b94db34b62ed1cd863792f8acc4df78d181badc38dd9bda544e395").into(), - hex!("94ad66b4066f53ff299dc4bde2bdc23a891959903174e8ec08dd79f163c6f4661b3eb3458a786bd8f3fa153c806e793a").into(), - hex!("ad1a50bcfaa5641422c6f10d31316035eaf061ad1fc0a36c8835e078d3fa6efbe6dde4bdb28158d9b7aa74fd9241523d").into(), - hex!("a5952780f78fd6afd9c31226a23d307be72aefe0bd99c32a139c3909b1ff1769e2441dd2c03f33cf98df25c76178e492").into(), - hex!("954100f83b800dfb89721ac06728c3d5e8a8edb7e1b56513a63c2b49dd44b9930edd897fecd262984301cb6df23a338d").into(), - hex!("85de42b8de3cc88181a50e9aae696d92e66cabcc7b86425f846dfac138d26eda7cbc420cfd10f5d2681b63bcf411afcc").into(), - hex!("abeda3b142d621f94f829ed4174d042461e95d978be206fd31f8661263bb7a87c648aeff8bf640ec173a77ab0970a93c").into(), - hex!("af99434f06a13d9c5ee7195ce58beea07940949b686b4ce06727bbbdfa1621c608c891227e2f026bcb58c60a6e925533").into(), - hex!("96e97ce1ed97b8afbbf282bfbdbdb4f863a6931cc781e9d7938617310ded35dcf043c2320507e91e94f470f0cbb98621").into(), - hex!("8693fe1860981505e4540b79ee7a7ef33b26535cde6e9aa019bd1e0d26f359a2d26f0341b7c1634eff1f5859ed3a8625").into(), - hex!("a94e940bc2d8f826c23bcce8fc4e49e29c5f918180f566a67395d33cd573e6dfb149490de1ae75068feaedfe6cce0e40").into(), - hex!("9697d6be370d808a49563e062c2b3a0b347281e00839dc3dc0ed888c623f346a42094fbe2489d0487049f2fe47887cb5").into(), - hex!("b06d4cc8e83acc4121bd278784061f6fd391b3ac378fc6ef46ca2158207f5c0d33a51d3dcc4a499aa48e5b27539c4a16").into(), - hex!("972aa57628ce57381aef9710ebb7cb7a8db28b1b64d7db8be38936479f39772c60d766b0c5dcb79676e9330d0406761e").into(), - hex!("ad2164467404544aabb70605a56e9b0f7887491a1691302b2bedf271b50cb6f1bea1b9637214aa3624f5d8f854359607").into(), - hex!("a9da2595107e9db07c56a59d2af529b036c50033ff43c282e2da551bed8faa96eca744881e600b6406569675643046cf").into(), - hex!("8680660eb867978df2474b25e225fd7536b88e9e73f0188c0dbe835677de701fd402916d8e3d17fe652c7ac6d2fa0330").into(), - hex!("b721e239f50bbc7af5578b75c8befa439474bc4e6ea8d35d1006ed54c6d81c718fa675901df591a69b4cc30899974362").into(), - hex!("a8af30765f1b00ad51a32d856a2b2f97831843878a1668a43e66b65b8d0bd4a2e2826fef5ca5bf140050dd81eaa6174d").into(), - hex!("82baad156e89d7b3da9ded4516603ec9aec36e3a0a9bdd0ded604e4fcc0ba10179f9517fc8372d3743cce5e676c8cd17").into(), - hex!("b3392745016dfafca36a7af4be273c5fb4170b71938d6b93691d7a3bc8791bda537ef001d19ffcf7b393a89c898b8b14").into(), - hex!("92f83c901eccb742618313ee2f5ca571406bbfb1d077ebffb92d52ca962403d34a24f9d333c3a155bb9a72a0fc2eda34").into(), - hex!("9792598e2f303896010e35bf670dc2f3799cbe6f0c66379030b0ea01b44ebf24b9257841ab80d2d6a401fc56bb722e68").into(), - hex!("ad1a3c9c5d699ebe4f1b2727dc94b290c84f44c9ffb38d5498b14fcfc5914f4ef4d1d57853e036ca11e42396808556cb").into(), - hex!("90729c7ec4250613062a4ffbcba5829743ba7fd03a4e3407c2ae00b4513c21f3ebd68d10759ac4dfda5544e77b2ac306").into(), - hex!("840add692580be7aea866045826baa4a07804f8e3f56593a2af6fe317046d7d0fae181632f4009ae0d64dfacd4600c4a").into(), - hex!("b1be58941fe077aa8721b020f34d3ad94d1d5083244c276b7f3e6f4c918517f8c5c8d5c1376178bf27cb35ed76699e6f").into(), - hex!("97ba3e3be55d17113fb63abdc808d89fe205d75fc1ac808ebb78ea1b7570f7a014fae099cbc4b2a4b2ec884977405f80").into(), - hex!("a2c57bf9373db5382465ce924bf7dc4e62f406c187a39ab456a7387ed9231ce059d197f8701af9ce2d6cc772367ecfde").into(), - hex!("a62ba8b81b9f8d40fad7fa1d7e8e49ee547f170889b5d6a2be9e2ad2ab0b265b4197fbbfd3b17803a6e727d41cba83a1").into(), - hex!("a94559a51d438b194fea96975a4571a118105479fbb7a37abc7d676fc8b8d2ca30c66b25b7727dcd297384773ddca074").into(), - hex!("957f9be0f15d8eecf621eb0978267c3fc85607f31c501179d9c83864ed9a9e5d526aae278af3767632bf56a20eca62d1").into(), - hex!("b89928c19d1101486d4299c493db5bb72f56f8bc24b71bb54eedf84284452250427b179dddd7fcfc0f521fbba09d0c5e").into(), - hex!("97dda9cbf61015b296307e510295be258045a1de9de52117f0aa28de48e27ffd24ff711f9187936293babe89da226fa1").into(), - hex!("a66b4064c5b1ee95a35a93209c89206b352e0666abd1b5c95eed3c382210334fedad7d531b9939cdb2fc649c4369236c").into(), - hex!("89d85e413030dc45194b2676a1f2a76801920535ccd909277af1ac87fd9b0d16d94d8c62a421c9d95e7a053cc4c3e0bb").into(), - hex!("b8f0350e1ff988bf23846f2d64e40b35a370d1c5d1f9dca4021508205611f788fe5485e966ff2bb6fe8acc1540a2e751").into(), - hex!("aef9ed7229aaadb1ac4344e5b4d0eaf9b89b20d50d8ae8dae24294ec3c0f2f68dee3186dce35d46020d8d1b2626a29e3").into(), - hex!("b9362f34ead1b0cef1fa9b35b76b644a323ff71c48f375c27e22c6878cdf778b1a3125445cc8cffb6c8b9a3ed046c3d5").into(), - hex!("b69c578e2223f3727b7b5e99f3926eb7424869b356541feecda54a0882e4a009b182c358052d788c2a7e776768ce2b7f").into(), - hex!("a9ab536cca003598d88f76cd0d666b1738802c7452201f5d99ba4fd82b6d7da3c9ad8c4707445d6cb4b2c43de7ba06b8").into(), - hex!("a02648e465634db73fd49bbcdb23cb6feed9688eaf4c5678799734d49f2d4cec9cdddf598114896de961ebdc07436884").into(), - hex!("8253283df9690e171af958f2a3cc37e0b2cd67768f2362bd604ba5c5db8d3500c0d7d6cdee982165eaece63bd016f2c5").into(), - hex!("a06d8256d22ef3891a751716449f97d374e27bedbb9dbd0f1c9528307787e4d9ab9450002bead2922c31fd4ccab9abc9").into(), - hex!("a3bcf7d7c1f1c5a2bdde1e0f4cd3cc6dfa061156534aacd6318d8192c27218b6e34e734a118a282b0d5fdf639e704c21").into(), - hex!("b5577e876cb3de8196b485ae828362419c2f7f8ca9c8f38b1254059873fbe53b57110be543c864bbcf8b485f63925169").into(), - hex!("8410e1b1ab99cf1868fa4494dc75129f42a5e633448e64321cb379175cf6eb704ad6863e3a6475f9cd3cd3f1fcd4b49e").into(), - hex!("b6b21b346d709d4897da4c535556d599486878f5c574bca2823ff9d382fea2f45e8d03aa0fc5a5d623098f1b67c77a60").into(), - hex!("92951386b734171accd57b66afad7ddd0ffdebbd9da835e273b11f96639aefa6259a1387fe3947f9f7eacdcfcbb54b65").into(), - hex!("837cca28b3bb00034d619a3b667b06b66d7cd351ee2c161014b4c33692c705e0fca1352c1e5a7fe8ee00515f4b9c9658").into(), - hex!("95589319552ee815c1e1b053cc4452f9ba600142c37bd700feb3c27468c769e45e6307d7c0a3f366440cdb4d3b997d1c").into(), - hex!("87ed23d8d5fd6aa0922565367ab405e666996e7b918795da299c204cb6d1e51a9c6ff1760dc3fde555b0900e677a9b9a").into(), - hex!("88564f50eb215320ad93b979c617cafcda9122ea02f113029702df1f39116e00b35e0beb0c70bb7d7f2d9b4bf68a1419").into(), - hex!("adce6ad54e5d24a2da5a04751151034245184bd7e61998ddfed673fddbe4e3d069b580e833b3bd4509c30a2e6a81f528").into(), - hex!("80800ca4fa6d0f3ea555ac7d37e54e7776f640f76fe89cd7f172c74723cdb3324da01314c6f66c4fc404c393aa8c7841").into(), - hex!("a16f473cbc9070881b9dd63be9f99670ca571822a67520cba885b2636137731b440561f83e199713ecdd51d4dd542997").into(), - hex!("a08c0625cbaaaba847a63ab4a96206bbcc7bfeb659505d0b6b0e58d22f00aadec41f8cd62ceb116258b78063f26796ea").into(), - hex!("a358200c83ff15fe3fef7a1610bfacdf86d55452258e7f4701082f993c8bd5d234b4d86f96d444e96c01367503663886").into(), - hex!("97278525e5e590ab6cc4fa4a1bac4ed7164a65887b29e658bdb2146008b02907488565dcea09e761f6922118d9933ed3").into(), - hex!("b4e76e4cf2c711a7f3be5b404f076b9d2272e15ea7c61fa4b7a14c5608c352a92fe6674a25dc493a6bc9e864ff4b4a85").into(), - hex!("a4612d268cffd31d092892268e6b4f9f564f0036bfee4f200d270a61a8e5e239996d288d28d6f281d8446a88da56cb55").into(), - hex!("81a70c88fd7d99165b41ee12883ae529458758650fd13001c86f8fc6ce5f8f9b69ce3a133e310619692faa1580dd5d67").into(), - hex!("a87124cbaafc8ee5418639ff27795003a43ac18d07a60fb8a1c155c5fece0f8b25525166ba697e07a5f2d47af6cf0bec").into(), - hex!("90807f573a322aac9d1cd546100e49cb8c771f3d32c89da1890c1c819d90b1dc668c2374249a093c0863d5988c358d4d").into(), - hex!("90cb26b40d10f193da22975b0507f04de6cd9d002e33226852cb40d948d1814009a39332c75f1067e8192b0c9230ce63").into(), - hex!("aefbe25ad8bef226d434b970bda8a47bce8269ad69cf91e02e04208a74055ea79a3a7dbc988981b79bcb9298af467e62").into(), - hex!("b4932ab425f4abad270b32b6f66066cd01fd6f18cf8c84dde99d21c9c2676d58be4f9ea5ebbc454c9d9f921c0333cff5").into(), - hex!("ad19368c70cd241b1a90e5b46f34c44351d298e2fc9ee5906596b20f5aa9e592e878afe8924aea112be60c07648fef8c").into(), - hex!("8b2d2953b4603b73bfb1edda8313cf07f6d9d16b0272d90bc46816677b602b4a7e6fcb36c4f69335918f1ba4ec95dec3").into(), - hex!("ac64d362f730c790ee3f9311990d9ffa3b99d4952ea74f63d141360d2edb7fd0b70d94e5865504af3caa94b63e34ff4f").into(), - hex!("b71ad17d1cdf6be4b7f0bf7d3fca689d5a69a7426dbedfc137bb162142d26e079f49c99797316e2a577225d881e31a04").into(), - hex!("8dd692a01ecd819981ea31f39a5950bac2af0deafb35323358736bc59f8fc69f58c865ed9cfe239ee34d6f80bceb562b").into(), - hex!("b2ae1f2d871d48b6157aa9d74c24e3fa3f09d6c40f421de9c545de5ecdc44d44d6c4a7caff315694d8173974b92c6119").into(), - hex!("8c934a58d5d2c06221c10c14f08f17265e918c6f7f158f6989acca4b1bdf3db58952e5500f930af02ac3e6e44133669e").into(), - hex!("9466e7c328d12ad5439ac01c994825a94665091aa00e212a75c4ffd39f4473a62c160d63e568b534dd7d5577ad266544").into(), - hex!("8e35a84ca6f167c75f98728000b5df8d9c5611080d2dda8c49f8d4afd2196da349cda481fdad8a0e7dad1cebf4b82446").into(), - hex!("8ec436a9690744a1c6a31fa796bfc8f054ea5efb1c8d6a70e9094dbdc32bc199a7c1b29216d706616029525883a9e342").into(), - hex!("87cadc50459a643648f5995ff7ac751c24454040f788e218c4894854ac658fc64c2ea0a8cae4973056ea11f7bb0e5a26").into(), - hex!("aa5a2d8278dffefc43d598186f1119bf1a6d2343143f4874aee24d3869fd4b58401e8bb220f2a228416c89c1f5344af4").into(), - hex!("a36f48c232cba1daae013418421fac6278bca09ee3816eb46cc4059254f1e7672dcecd6eebc9bc0896e96cfa0d8b485b").into(), - hex!("937f8e28abdb3859575cff574517975b96ad41dddd4efb23af86429b01ecbfea553be6cce336d170116752118368e05b").into(), - hex!("aaeb4e5c7f67ee23b1976b2e86f2897ced033e79012532599d130cdbe29d8cd551d9451794741d2ede8564af9070f07c").into(), - hex!("884d9608b7556dbddd0ed13bbe04a5bd9f2bda0bd090d47550f7362bd769a3b3dfa890191c64e44378792d97ee4df5f3").into(), - hex!("a8276ce24aabe42cab32ba7d77c2ef2ca84b3a3e3d750f8d0385f9027f0e009365c78196638dadde186bf44b780fff53").into(), - hex!("9148c5c797b4a6438360072c463008df8b17978335f36d4972b4f826861e8a175265a9eb00c56f47d3892783dcbd080d").into(), - hex!("a7e5100f51c611f010b2601d340ad7aa65bab89c8aeecb181e76185f3a739892f8b172e5cd2c108d5aed8f5cc91cb6e7").into(), - hex!("87c46e67d6643c07e0e318dcb22032753c624e646e4871be4098005100b306f3cfb25b6d81c718e83b42b92841c577d3").into(), - hex!("8bf429c735133cb05edd9b8943b5d4040e83191553452e69b3a1fd06edf2a9eefe8e280cdda811795e1da33e41e58345").into(), - hex!("800ce4d6c257a365e5d8e1bcde67a38c04ff723e38b0926af8b9fc352545317beb40621497aaac8d0e5da291c0208630").into(), - hex!("a5c795afa0ce78cbc11de13c8f58d0bd9ca5b8665d5d8d28513a0d8666f9336b0dc3295557801ba253983fc99f45ce3c").into(), - hex!("99e3e4a8e16ed2ea44aae56b537ca9b159d57e987b0511b6d34767744b04700ff287d431dcc6c67d7cba5748b3580899").into(), - hex!("ac88e78183973e9730ff0c88dd62eb23e2794067ac2574a1c8deed85a4aa6229ee620668dd16084c8f168b2555f04cb9").into(), - hex!("a9c4fa68984527577c6da60dfff110163f35ab7393b852c053d73485155fa1536d9701f660a08b160bf49a647ce3cf92").into(), - hex!("902c3138ff660230158ff69c33911cbe958d29178a54cbd13480addd948b19b0b97f6b235df2beeadb7f7e1803b8cbad").into(), - hex!("a6169eabbed09e08a0d290f9075c62ca4b14e1f7adc53545abae49858b3d5d7fd6cf8d8ba2ee1bf13f36f79ee4092935").into(), - hex!("85a0d7387b1db5635f17899bbadddc0fe6b11976385e12ea4272a8f61d81004406604c8f04f10ce928fb6b547d3bc654").into(), - hex!("a39e5f2112944a7ee31fdccaca927e4f4bbefed1274a134e8a038307820c1d14a6260e25ca5a3af0589f8faa8f516c5c").into(), - hex!("b5c86d0482a417bc94b42f8478de06918b36c5f45d0695275da2a3e773088268cc127ac1380f912307b6455dd0b16d07").into(), - hex!("b8b5e32afc4cf0fb92251b422ef9b757130455150c49ce51f6d6d95d895dafa25649363660608bbe7507d787db9d643c").into(), - hex!("b11f3856f691d84d49fdbeb4f33c45c37dd401a2bb71bbf946f3ddc53a57ce5c4da583f76cf4467d43034a61e1dc88fe").into(), - hex!("a56d1de276b2d0a4482e17cd358455aa19a47bd25c7fc97af8457ebc37781358cbf8a7eec9427881550a8db1bbf51771").into(), - hex!("9508c85488f15d2772522dd1e991f41da1f3af7e3527e098d5408ea96f11f4150415ac68ba0a3031e95528664b261de3").into(), - hex!("a28e129c656bc44d0b6892103b7d7c0d15ef1f1ce583e90e2c644c3016ab348ae26a662652c953a3c447272e52b007a5").into(), - hex!("a68dcb67d0cb585cf22f753602c46c7ccffff246b106db9c56248ecc5e94a036009bde23864879af62a4ede81d040c56").into(), - hex!("b9725383c63b2a522f4d976ad6be14a35b9e80145e058baa622238500f1a2ffd6869cde87fdb984654b2e57615bde3ee").into(), - hex!("90248e4cf47ec8b00ee874ac98227759a3f7ce4819e44176dd9b1acaa6270d144d3d707a35e0cbdd7ae23b15537a20e2").into(), - hex!("81327abb95401fc2fe0b1c2d27d7d9972811a63e12be0173fe8311678ff1fb097d73fa32cb85f13935e1a4b7fc59113a").into(), - hex!("a31bd2dfc9ddfa9ac748968b532a41a26007b23cda258fdacb3b0abb751cd7ce2eccecab2d5e3781fedfe0d8da027481").into(), - hex!("809b28c11c1abbf53f2dc005d30403937d9826960b24f4de857a9470067add08d49345586d7e58bb1107d232b3b47bbf").into(), - hex!("b0597958b75e64fe5c6e56ef803284b3b7420fd537e5625c75af3aef814a87a5ff01951261c2c7b27e374466658711d8").into(), - hex!("ad8fdb91216db4fa779774324162fd5bd7ff9a999030c42d9f90248bc328221aae315ef8617c9ba623091adaa0556074").into(), - hex!("8668991c8bffca4cbfc06f3429961c595d85803a262105907361758d677920796be70d2cf820f0b1caaef708d924e676").into(), - hex!("ab22ff4c2ec9e683d2d1ecf57f7af9b3aab1cd289e22b1b66f37dc3779e83e35211f7d4919dc3ef0babf876d491e0bff").into(), - hex!("b8696c811af5d3360951d7bcc9ba4e82e17a125501e91ff74b915de28a8cc217c6fb05d90985fea7ee431e519e494d9e").into(), - hex!("845c0bc4769c428fb30e63c8e4631f22e69f934b0e6089431ddda2c232172a4980cdb6f650563992667a0790f1a3870d").into(), - hex!("b4113cfe79b6b198b517ab5d14900a7189ba78b7ef85d04551e18fe1ce6a69564377fb86a0e11627cb794d1f416fbeb1").into(), - hex!("aa6848837b26df24b04198b0b09b77d7b59d26dd3b20f7843352f2436c046e9975af2985e64fbd6267d897e728a9e721").into(), - hex!("861456839cb76a9490dbe055559e3dfe3bcdc41646aa656d8aaabeb4c0e39a1b370a4f0107b78f900614e3fa09b46bb5").into(), - hex!("ad6a8ca9a21b7874f8b115024a7f079f5a1dac3b165267b33a59d1c8de2065bce4552369c930e9a949d0b07110a71452").into(), - hex!("aa83179de1682892257c57774844b040299789430a262c8b44dcbd81f8062deaa731ff4bebab1a815d3148ec719f4cb0").into(), - hex!("895549691861582abd102fc19a4ed269b335010aeef45ae9ae6b0d9c6d26f26c31371086ddeda626e76f7f07dc622fc6").into(), - hex!("a94e590989e81d269b5246f22a9c97b604af58352c70100f8a20454fecf36d19e601dc1201342841ab231dcefc461f2a").into(), - hex!("82541b5b7a392456d1936373396012b086c370e6dde41f6d4409d35373d1586d3c7119f6f0d1e38bce9cae67c97fcdd8").into(), - hex!("8b89fecfe83adce613e75a52e785ffc90847c09ed779ebef4d29048bbac04b58e27311461c25d4e68cc0e6778228b037").into(), - hex!("b3eeb09bc9ace8a62b71747711bbfa308b746c86ca87297cf2a8e768765a86ed1add2e1acd2925cf05537dffd4dbec50").into(), - hex!("a5364dc8221a37d73250f8498d9b6e163babfcb01e1fdef8ae570538e128b562a0ed8b353235159c3781ada8506ada33").into(), - hex!("ad0d54f0f67d0231ca0ab54ae881386b055c169fd7415c12e511e5ddc5d4b1beba0e1a157211996c7ab61f6e94cacd64").into(), - hex!("b4b978f7f9b084c089923e73a593a24d5aa22600c879eb03645a19ffe8b36cb8ae040378a378ebcb4a5b73331a2064e5").into(), - hex!("b3d79038de0c62c667ab4213524679934b33de22111626c258bf8fd8e16134425549dc7e3dee15239c32bcf122f5bbcc").into(), - hex!("af7a243eb665d9b2c37033363b252c42bc2c202c266ee125b5676b6f9f94ee5d46d3e2ca217f107719051de511625dfd").into(), - hex!("9726a0d607674fbde3fa5c346806c4083e092921c303ec86bf5a16e4b760d031a24585ab407b9b1b0692d12276912961").into(), - hex!("85a8eb7ff82937e2ccddf2f049af9d871c653de4d71ab36b198bbc7bfef2e32eb3f22462dd01affbce13813332193262").into(), - hex!("a8889fa7291017a3363a5e14cee8cb24c273be4aeb74c4b0e1e375f70060dbc9ba296b291e154eaa56703b8e3f7e85a3").into(), - hex!("a789cbc52c5468bf404fc1b19651ef6a805d96ab8a8991407e149a68d10d1f67d1d4b380c08f8be1faea8d1b32bb8c1a").into(), - hex!("9535392a86b73ac66ff8ac1ee0549d266a9e25e1db542b077d136d26710282529f34c43dd94ee77aa97c647e0e05356a").into(), - hex!("a1ae9d5fd0ca16021e0a33fa116eb5b94991aae02efc6f116e073def47253fe2d1f2438275f09f204cec0610ad523ff3").into(), - hex!("b5c6c5b37943e99bed4e63c9215bea95fc365a576a9f8f0b9da8d5ceb5f9da881a273f5692b0913a3bb922772923c07e").into(), - hex!("b3b0144fb027e0c7f1a0c4c703cc5e1c09422be38de4e10010c28bfac358a6c834df6794e5007ecc4c8d866ffb9a8725").into(), - hex!("aaea409068fd2cb94a7c6fe031ed47c7c5b366a33905d12a107799aea57a052b9bfbb1c4f88b1b3775d5bef7d6204b73").into(), - hex!("a10cea5af8405d807b66ad492a1aab8618324ec3d9d01181ce29512e38f03bfaf556251dc490b3d1e80576bbecb27dbb").into(), - hex!("b700d4046b0be98b3cdfb8a2eeee52df68bcc1c5550d1c17205664b0d896028bddaf5dd38482645e76f643ad9d2ea9ae").into(), - hex!("ac9163d5f57a2d1def901e74c1b07f4d14b1e9a5c362d3b082c45389ae8add929a1dfb0baf14f64790f86cddbdcaa32d").into(), - hex!("8e3b79b19d49d77844e3401c01984af7211268bdf6609919c9867a83cbbea21870ff108143795a85fbdb2c15a2d127f1").into(), - hex!("b9db73eeeafbeee4edc52c1fcac7de6d8acd22a8d3d1c4cf760a81dfb6cc91ee454385044301fb2253588f23f3a24079").into(), - hex!("b268631698668059d8eb44d50d532c9d8c49953ea2029d6a2d0eaf69713afc85c42d989cdd3bc0a479ad77cbad24fc0a").into(), - hex!("95f74950a24d82ba9a9df5d839d17d7ff830a5dff38663630efad5abe9c58724802d5bef891ca2b3b81923b55a94c6f4").into(), - hex!("969297c612c35347019f5bc80d2887a3c95c8ffbb011f5cefac63a1f51e48dc84d961aed56afc353791589a45c871cfe").into(), - hex!("98743e9521e5fb6a643c086a00423fea51b8ad2e55bbeadf791ede16eae64f9fa45c41101c6cbe4a8e96c692fc57c030").into(), - hex!("9374001ac3a8673e337b078da1b72090bf2450a5f53f6a600f4cd43ea4b5fe86a73d14bd0103b110f23e417dcb4c2e47").into(), - hex!("a91bd42a87f28a6fed7fac68b5306e5382a93fde2bc9aa5c48b747ab774f9c557343cafb46dcd4e93df5aa95ed832410").into(), - hex!("8fcdec0a825737ee2c61401014287079e729a8b8e49337e99b34c25dd9da570a1fefc532a0cf6ce1bec80be2d9ff46e8").into(), - hex!("8197cd84016cb41e4287d29b3a0fe8d221868e5993aef8c15c1578e038f9c43e93bc26dfc67fbef919322178223d0b9e").into(), - hex!("a4607e2b6ff802a4e497c53b206972d35520c78f14f7d4d78514333e90b2a8852603bf223f1c9eee3793008f87cd8fc3").into(), - hex!("a72b6185e451b3be2c140fb3f48225927e7c052805682e3de9b2c826997419084bf1e2034aef0c5d364b0004b3b7807c").into(), - hex!("aa99a2cd46884d2ecae4257c1db8fe1ef6b0cc1a0c25dcefb53540ae91ea7bc8955b8acfc6d96ef47fc3a5733f2f28e0").into(), - hex!("878ea42dbda59fb6f839f0b65eec295f2d543541f4fd576a60d104b94b49b1a1ac6e9a15ed3274e6305de3f35ce1e3a1").into(), - hex!("ab2f77f6036200b4ffd3192b8d06dfdae4eaed4e1105b27e64ae2e120c909095e59f4dbbc44e818afdffc7f9ea1f42be").into(), - hex!("a37e3fd9b1337734cdaf34111762403db11b1aa0324937a17e053242a9099b3db0d396b485ca996f91117c64623915bd").into(), - hex!("97c65c28a6a81690d4d6ff17d5cd3be0e15ab9cafe66e6f7b8da66ead8beec561c3abbc79af52a8986d576363f14cd27").into(), - hex!("ae138b3020373ca238d5dd780862fa28a2c3e05903366cdc0fd7a142db3d18eda63b8d049abed37f1fcb25f6cdedbd67").into(), - hex!("a800bf90b4e7aa7b5b00fbe6b5f45067e0d7ef2b1ed9a626211e07b66b12ddaf90ed05d369f8da13ecfd8cb499f192a1").into(), - hex!("96565fc4ef721f754b6f53db97d32ef5e5c3cc0f55928eba3eb341f4962b815381178763ef05c21c1247124d592b4449").into(), - hex!("b4896f9e2f88c990fab764a4e006f3f39ba6bdd0e1c75fc8dab2973544e052ce63f8c61a6ab213c85f6799d988a6fd61").into(), - hex!("87aa22b60a13edcede78e629d54714436a8d7d1e6e232d4df6047213b4a91e61e5feb38216e0ebb209f1dd8d7e4f5f9d").into(), - hex!("ac4d5e8bb39a2564f3bff053e2058f261209cf14e65f7dc540070d40dad7ec4f5fa81efe6274aeab8691b85a774307c5").into(), - hex!("8b13673c306988222f09ad896a75a6232ef3bfd2f6c37c2d751668466d45511542fe982ca5720c6518891830674e2cfd").into(), - hex!("afeaafa07eaf14f248d2a34e4f86064c5bccd92d3a6c0ace1ae827dd59111e9b3cf2722a270234eb5aa633c12e140354").into(), - hex!("aa31119422a52a7a5ba90f4e0b5676434b4f05289ea3143e8a2162e32b1e19b582a586da796ad9876d0991274f3363a8").into(), - hex!("82c78ac9f2018540eea744c003a76cd7bc8984103e941c680a4a833a7c81defdd28165256890d534aaca2991dfd856b7").into(), - hex!("b4a99846af0ffe14d0f820a574d42571e0186cd078840ebdf0684c806c08eac1d6afb2f7f9f9dbfee19c2ea12af5307a").into(), - hex!("93cd10366714618a7e8d4edf3c93a9bd30a280f765cb93071a279eb5bc4fe8dcff8d91a1efe8fe697d1cb5e760a07fd0").into(), - hex!("b17dd2a8817471efd91b60ee31bb5f7c2848bb40251dafc0e2250cdeec3202cbfc7a8af6d7f5c3300a53a73bb4a11b54").into(), - hex!("b396d11ed53f287ecab591707ec5ecd0c5d34a67854783dbf263fe2614c707a2226231fd8dbd6bb1ca0760f06f2fe7d9").into(), - hex!("9982a0fbdde6ad91f35e64de34183e4e7f7df6cf422912f3dde0cd16394f0f172dc32c4f68f2a09647fed32894471fb6").into(), - hex!("ac5889086fbfd2f2570191b5d92659fd17283509477f442dae81a8491b8641a5f63e275659e6592ebd0e62a8c7a9bdb2").into(), - hex!("8fd6151866cc75461b69b4685ac4efb5a21c10d5b3291617bee4ff300d90fa2290319967faa2b7189c090d3b60994fbf").into(), - hex!("adb4459e4e6410606a74742d6e48f7b84f30ecc8e849b6af9b4b617236dedf1707ec388a97523f18ec7e047743fa7151").into(), - hex!("a9fd9329ea3b6fb77dc577e2c891eb66c61a575ab75a66dcd897f1127e8bd9ad8d3eb9059c7f6a8b08199913b83e5ba7").into(), - hex!("b94cfafbd3ef7673023ea37996084acb3109ffbccd210184aaf8ce8d29bf36390bdbbf2870b0970e66831d28e90b248b").into(), - hex!("922404dd76801113ba23df87ba689e5cb609c94930370576d0d16e99a489de0fb079fb273159b8b07fc58bfe4f787c70").into(), - hex!("8c6005451c02b18458c3f069a521aafb44fab40f4260a60da6b9bb5f920e91990a868aafa4b6b071a899d3bc51fac72e").into(), - hex!("b0cf68badbb39413649b3171281ebfbabbcda1123549a4c6c09dbd4dc0427b51d555056c79f38840c52cf920dfa2c8d5").into(), - hex!("a08a09c8dac1f7bbbff2b7ea96899b64fed53e971569171224e675399467daea6870e48fddcf47179d3c7eab4cfde3ad").into(), - hex!("881c89cfce577898ad367abc2cf5989c647bf8904be5e061e632256b3750b0aedaf4d30c17f994358aecd069b62cff09").into(), - hex!("81674253d6664d414f667b10f6e8edc32af0a67b2b99d3e4657991f8a8b1dbf260447871c1c680d92f99abdf3da2d035").into(), - hex!("92e34adb15141ea58b2b481f9dd69e2584f512531bab13779fe99e18d48b6ab039bb28d9f444d517298e11464ebde4da").into(), - hex!("81ee1554da84a0a487e52c57528b69cd79f1b6530418354095ab976207e368379ae2fe0a4a340d209f13ac9783cd6d5f").into(), - hex!("839c0316ca07242ab52b76f55049f2da3e83f021591b0bba295677d80d4b407f88b0d207f3ecbe7eb85f19eba5d152c2").into(), - hex!("88b0ad748a61db5eb96016d9bf16bb05ffc4cf5ef56569397e9395f454fc1f731b48dcd8b3368163c36a3fb41577286f").into(), - hex!("b94fac438903b1e6cd11135b8fd35b91b61a0354addf8ead5cae4fc853ebb5be68bfb9901d8b4d3bdf58224675b6d675").into(), - hex!("a015eb1a7e1b814625b13c1b1bca7f738e80be5972f3a3a27cd9b21b033f16e4b5934bab69e38a6edb8d03e84e8725ef").into(), - hex!("83ef4eb739353f7679b27d3679551b2a0eb1bd4d372def5c0e8e5922a9ce7138dae4b62d5c147e6439a551d3ebb1e1cd").into(), - hex!("95907a3b288f3d4199434590340293881b94322e82f7fe9c186da3fdad7881b9a92cdcc5fc29d4124b1d05886bc9ec2c").into(), - hex!("868078f74e35b72a894d72f93d45333e423b1aec6d7e3cd7550254ed6a156957d4c5919489a84986f6134be8334bdf4e").into(), - hex!("8f089ffa10d8ff27470b8f6fcff49a69bd06ef3f88faee54a6bc8ea0dca6bb799199bdcd9a9e7686c43302cbadb584a0").into(), - hex!("980f4614de867eed7571cb3100f9566542b90d2b4110806dbad64249944cf3e4e484d03543107fdff0e91634d5193530").into(), - hex!("abab8578ecc6096bf063da248b376bd9e76a8b9364000a98c85813ada835017ffe693f908aa789cf09ca3020f3bbb9b8").into(), - hex!("a2beaf5eb12232e44bd251aaef3e007989794ad1df7a5f41ce1e6d862ff0607db47cacd4b04d684dc22d3640f6b8aa16").into(), - hex!("8f57e3d8d68264b5a07c9fc2399db0dfdd079abac46e1023373c22377612d3b005053e0df490d2435110c9fc2791b8ec").into(), - hex!("af7d2c45de945cb09adeaa1898fe0b026b5a5c5de2ac21f3b2c298d82fe4ae253d859c47f71def164a77b542905bfc73").into(), - hex!("93b026c1b083d82b3bd52d0004985f374acc81f754f7dd4e563a9ca5b20780f7872925a03e48d2154c526723b6d3fa88").into(), - hex!("b8a11c00250f9e148086818aad4dda9d69480b378ef5ca9e2fe85dfbb709d2a919067d9abd2eafdb5202cd334081b5a2").into(), - hex!("a7026b1a57d9d64f2526bc42c771cacf43a718725c2d0dd889b1af12481e3112bb5357e6434b3e83754b067bd5d533f8").into(), - hex!("84771640879d9628fea0ae1106a45bb8a383ca0a9a110093355395968b4d5af9e4a34201024a187d3a31b78a839af6ea").into(), - hex!("b99e5eda7144057e439ae752c2d879345ebba19e83c35785743d6fc1646069b0258ebb1ef62fdd43493498ed08a8de15").into(), - hex!("b2a17e5253f695a61697469df96f3182a62faf0b5d10c150f833543e7b3f5979506a068ddaebf310fe86efaf3adf13e5").into(), - hex!("8ce51f0a8ffbcfdddead1a94f45a42ec4f9e8770c0ca33b58207b8db06f3004c05e88f5b31896e1b7d3c79ff571426b7").into(), - hex!("a775ae2c3c59968d0add4c446c5f20e92f92eebb704016ea45a47c5496945b7d0935b4d8ea315990e6f58ec33d00aa9c").into(), - hex!("93bac2d2038c87f111c8000e721e4637b04ff8c3b7b1e8a9f02cae40e465a1b2928aa226af73ed643a4c21f3fec436f2").into(), - hex!("ae050b3f4784f2c12c902fd1881f6bb940806c0a9d7cceeeafd194dcd49cfa48acb10a09c55ea47b508d5d16702800db").into(), - hex!("a8c6680208271473433781cafde59a4aca2496d58c85f48ebaf447a0c175e784c4a1351d94b5d1a64c78bcf8c84f8f2e").into(), - hex!("8f9f71c20844682e17bfc30d745ee2848bd8782b05572ea64f9b9bdb2c24b3d1953bae317d79e267982c42f3f3aa60f9").into(), - hex!("abc4ec57e1625bcf3c10754a07a2047d359e503b05e2524175b48d5844756ea21f626a65a08f4f7b32cfb0646cc68fc8").into(), - hex!("abaccbb39d4fc4c252997503604764731889f5bd66382c90477df2f2d413f86892f7efdbee0e3a908b3cd69321d3db78").into(), - hex!("906a87855cc2b3765774d3e8c7daa62630fa7ba761ee2a0bfc5594380dc1d9b62740d1190fb882ffaf17c0d869356261").into(), - hex!("afd0ed291ba237f8b626698e3c54b8a84341628a524b897e53aad5231aa01977990c55215a677e9adf4319a98e81bef2").into(), - hex!("89512dacd42d13f5618f1979d9afd93c06247de2e1e9ab6625b5bc9efe24439189a564ea220c4ce2795f059064f5f5d5").into(), - hex!("90238fe2ab6b623ecc990ef8d2849d26229db5f3c8587cf06501e459c7742d81653c7dee45da82f5946e041f129a8df3").into(), - hex!("a420b197f4863782fbd676bdf1808ff1c6f49a506d525952c575c10a32cf63afef22f977d4b7d6258334c498f36e7f95").into(), - hex!("b7d8fe926876d1d01529eb6e30a78db47b6693af3171b2014bd18180066609cca9036e35953ebad7355362fa671d903d").into(), - hex!("a4b7dc0ae7e7d8c8eb65081427f5d41a122bcad56456dbcf4a4e83e188af1e3d80dc7f450766b8e87ed8b28ca6c5c479").into(), - hex!("8d3e1060196b4e8e827052c2ed782aa554540f21690b67d39db46fcf088d10f67f2b6e0d98689e7497e8029bc8f355bc").into(), - hex!("861657c4e2a48891939b49706791a03f63d092643cb491adfefb3cfa7d86ecacccaf86e4a1382444e466a61e29a12bf4").into(), - hex!("92f1c5b122943341854ab7d5c4603e083019344e2252da5664c676ffdd564345d7e28e2a5692dcaadc4371a95ea2a142").into(), - hex!("86100ccc2ee10dedee28a3ffa0bbaccc1ecb19d36a99e6deef1f2373c1c1c3dcb8b8fbec5809304d883c5d60f617d875").into(), - hex!("97c06ca658fe3ec45a6573bde07b3a95d80cff213c9f4eb8933c8dbaf147262291a5ebd55b0e58a4686c4971cdc45671").into(), - hex!("b13e9055709868f723014736b1fde59c05899bbf2aa6d4591d724c35c15ebe6d215e37fcb1e7b8585abab0b2ba309c00").into(), - hex!("8ce0532b968d8d770eb611131978a253e7940ceb627b7364b3a4dd517f26c31bee51c134a5b1297362f6f9b6d714ef33").into(), - hex!("92edce89bea01fdb25da5d0f903de2fee626681cec3db418a9161286a2e95bbb90ef2ccd8dad434b51776f85d982700a").into(), - hex!("aefc7dea295547984ab42a64f2f59ba2ae8220712778a71530623351a44372ddd1018cd8d4951934ae0fa39653ad6aae").into(), - hex!("ab297f28266bd5ed104c1b55088f114592e80aa098a0865e5543e12c6392b0f94b5cd4e0b6f375d1a0d0809d80c1fca0").into(), - ], - aggregate_pubkey: hex!("81a5778df2e724c98b4ef79ff33b9c5fa3ea265de81d49de5c4ab3be2165d32fe15c59c982f758c3b9c522ca5e659fce").into(), - }, - current_sync_committee_branch: vec![ - hex!("1da42c54eb912009030c084b700d2e0031c0a0e5759b0cc593601b99764a725c").into(), - hex!("0c960bd59f4a61104153da676eb38ebae603e9cbb55b0f6677cc1df0d535d60e").into(), - hex!("1682c67e0936255e351f8be6ccbdf048db06a80749aa900bd4265af1c366bd52").into(), - hex!("d95bb6af7d6be07e5d7d27337ab9b54d5bf725ac37671b9483434d22d724bb92").into(), - hex!("3abb1af4e9c3acb052119a42c2d4222d99e8b5b958c520a03526a8177b921cf5").into(), - ], - validators_root: hex!("043db0d9a83813551ee2f33450d23797757d430911a9320530ad8a0eabc43efb").into(), - block_roots_root: hex!("ed6ca045637c1c7dd54fbef547b8b1aa3f5b9fa8f0bfa5df26142a0c4237e617").into(), - block_roots_branch: vec![ - hex!("620abd1a8757614facfd9d2fa43795281bccd4055bc9b12e5cb3742a16a9f9cb").into(), - hex!("14c793be544d5fe1993a1b25d39f4b69e832e914c3d470745276a25d982df4f5").into(), - hex!("46aea5f0a7d66cffbd55e676b915be97cbf3dc6281146cdf4952047214ff74bd").into(), - hex!("0ccefa47e43d03e26def9fa07bacd91a5a2a20c6c5dec2ea090f71f91ac99282").into(), - hex!("f03f3d7a52241ab959560beb9b748a8ab93e2b7221c8070561a12a5fba8d4434").into(), - ], - }) -} - -pub fn make_sync_committee_update() -> Box { - Box::new(Update { - attested_header: BeaconHeader { - slot: 5808573, - proposer_index: 430716, - parent_root: hex!("0be3932fbc9ebdf3220e2195d87653f283d9f999946e53f6a9f6172b6f532779").into(), - state_root: hex!("cdfacee5c92a351843fdc4591ccf16c4f040d0276add8421f08dbd5c71035a1f").into(), - body_root: hex!("3d248ca71ec98250b8dcdeab1207806406f1434c11874655af56925da6bd88da").into(), - }, - sync_aggregate: SyncAggregate{ - sync_committee_bits: hex!("ffabbff6fcdefbebaefffff9e37dfffebff57f7bffe3efbdfef1f7f987751dd176f3b3ff7bfa3fedff5fdf7f7afff7ff777bef5f9f7fe75f97fffe7dfdfffbdf"), - sync_committee_signature: hex!("b405701a0227b7c40805504a66069fb5ef99cdd84f1e295c9b4a4eccbe4d93718740efa9f8eca62f563dbc73021c00e914a69b00a9ebaa906e78f26c1cb8088af916096801c787f18f493b1479fd43f1f5b28d15af827a1e580713fa82bfa1d7").into(), - }, - signature_slot: 5808575, - next_sync_committee_update: Some(NextSyncCommitteeUpdate { - next_sync_committee: SyncCommittee { - pubkeys: [ - hex!("8e9fbd36b3cbaaefc176cf46336592e2b59a51e3035d095da9e1df9d2fb5aac5e47ad05d27784ca675442abb875a6559").into(), - hex!("b4c6164c5ea19f3da5a76a2435db598bb012ea34cc8fb6d749f1588463e5c39d29cb3d45ceae0543372246549b17deaa").into(), - hex!("a89c780da1a713e86b149d63312aa840e865dd926565f0ee9d9627d363eadadf5a4bd5f79d8039f2e2927ed7fa60209f").into(), - hex!("aeff2bd9faa0201abd7dd681ff97888c0ae71d84e71590f424facb2e37b5759f07d338dcbb695ad6ffd08d903c0f92ec").into(), - hex!("b89cfb61a59cdcb61e9f3ed76cb5cf13c907bdf6b2622e16d140743c5021d45cb6d91ee94331130b876efd984575948e").into(), - hex!("a2c889cc5195532bcb5c83d035cd6881b889ffb9d0536843d3fb6f7b1c093a927162add5ab6ca5f06e7c3ec4ca4522e5").into(), - hex!("b5966a6d047ef679a9613114149530facbfc7b4bee6ab23a60853f45de034435b624ad0126ac6c7d6a12b1be93177e0d").into(), - hex!("99249360fc064fc2778b37b107d834eecd5eae29e8f10a45d946f11fe358db065242482935224226e83f518fa6916962").into(), - hex!("8c3548aa879d974c5542e59ea43bb34db91f92c7d21eca5e3e4fb9d01364c21e8e2341eeaba1d22da67f1f455644afe6").into(), - hex!("828b95590a46cdc4756fc1a7b7d7c4031637494938521b74a3740a970ff532b88ffcb5333197088f6700925dcab5c42a").into(), - hex!("ae2e6ae80c16831c02170dd273ff6808e4379a8baf00e707d497eec6cb50b5a1f132eddf053f243765a54695ca35c443").into(), - hex!("a7bfac686f7b307d794fb1740a05cb1a6ef14b06150e64353a0b6544e7b0c5e3a7c8985d257c5bd74e411c0cc8424479").into(), - hex!("b3671a59e2d425ef0ed109932402ff7dfeec72cee39c1840cade48a13f3ff36bd0f9b3931d0651fddd214a2dcaf7bf89").into(), - hex!("b56c962ab20fae058c256e37ba4091d7a9e5d3c602e3eaa2d90df65fd5a11ab68f245a5a6e53262335c6dd4f3e0e51f6").into(), - hex!("a8be83de4b06ebd8c14bce332a1175a4c651fdddd4a58ec85bf4c68cbce83a50dfff8c26070d104556883af678693076").into(), - hex!("b4b33b7013c6af21797478b14b1dc81fb7c5661fa2471d8cb4eeaa62a62f795aa9be2cfb65ff6b957cb7f89487a587af").into(), - hex!("991a42351791da02bf6c1a9ca8248901657d6f2a95225e4827ac3171b5247cd31f9465c9ab1c2b78e268c82b61db1f36").into(), - hex!("88a38e70998cbed82ae7f9c192e06df8abdd35278efb25a1112246d46a3d3f0bddee41f5c492949f15e651ed7fdd6a15").into(), - hex!("87dcb7f13c6af7f7d102c643db0406ac7fb06fbe1fc647f436ea839e75561b27beabdd6133da332383bf22ed4f83fb9f").into(), - hex!("a441e2c51448b6b2ddb38dab213d9ae3d1fe70e91e1feb0f98590b5fb6f3c18ec0adccc221fc44ba027511c52e5fa626").into(), - hex!("ae5f4dc4266016943cbe1db6538619c430639a1179d246cb820adf8edcbe55e9f79471134d06365b0d459b280aa2282c").into(), - hex!("8165bbc59ef3b15f29379a7ef90d8b3610590c662207ea7c49267f36b5b62af3d48008d182ec3384ca7c1063bd25b284").into(), - hex!("8cdc4e6a238afc55406920620fa90f696403afc1797562b424c26e679096950e7f42b8d8327ab0d7573608056364fa4c").into(), - hex!("a1f4c958f7bd1182cd4ef88561eb534c9ea3563d149a276fc256645be0b2e86a3d642ac17261696ada39a04a866973fc").into(), - hex!("b19e5ca1ef1d4fbac5633cd29e9510116bafb3229749e0e4444caf9819fabf9c4c805b5966c02446c1eb0029b3c1293a").into(), - hex!("a4682af7e19328a145a1a5c43ad3e14648b90f664c6139eabe1a13da9b763ef23947dc3ea2054af7d0b7018f7498df51").into(), - hex!("999ae1a8f2e0cad6a0378e7e0a67c8a6ef4a824043b34e67074d05ceee93cb7b49d3c3acc961f1aab69b45f89d12180f").into(), - hex!("94a9f1686e91ec733799b569e3b0313db64f3a219b48482e2a56c21016e800d4373c2f8b876a923e0753a464e5fe4684").into(), - hex!("b4936942d807ad09cbaead9f56ca124617fd1fda2ff5cd94fffbbdf5ff2b295867acd1e41599928ae455d597ea45cfb0").into(), - hex!("a74166db86410c9722e657cdd0f4d1da86a4f83168e2bd9ac71850bbfd9471e1ed88a6476b75ae5ddb42afc62a9ac121").into(), - hex!("a97909c10241e046dc707ff9d822c385dd68be297d6b54c84fbdc18f5a1dbb3350e93496698d6304ad1d6bfd34b4a041").into(), - hex!("b6d9b775129b048a6c577656ac2de15135c2bf1a3c7c8140ce20a990274e42d7b602ebe932855c1d03373797ea0bec63").into(), - hex!("b59f975937cfc8eb510c1da0a7fff1960c46b9235550cd6decb514805439f08b8f18d88ae0373bbf50b028a08612d552").into(), - hex!("8af01facbaefb24cc4c11e13c64445600b1d716be66908964ef79e12c0eded04e1d23295444818f024e55df2aa911034").into(), - hex!("b79607bbe31f159b208a0d1b2f95cc5373631908292126b8b75fc44b22a8bcc9550de7b51ada33e5596d0f17d5f4e48a").into(), - hex!("a1a474a66940bbf6e601b6c6e63103de2d5eb76d7ad3d39dbd74149658a14e31143a9723327a73bf72eaa75dea42c3c8").into(), - hex!("ada18b62cf80098f36921cb0c2f85200fa362721c4673546f8554e2f5fc8639f2ffb2cac68e888af7ead8c660b0db13a").into(), - hex!("9198582e8aebc174dd168c6cf20836a21cbb6baeffacf9f933850d8e0fe0619ac1ebb99fa6fe902c75927531c108ee5f").into(), - hex!("b8a44b23d29cc5ae1f00d5384fd06f31b73ef1a7ffe334b59db668c924aef2cdf60c3070a44a12b52a14ba185198035f").into(), - hex!("a688064e0b3fb3baca87d711b29419a02c06e6a1dd764af31574dd84fe870c8ef614d4c2d42fc9508711dc05fe373776").into(), - hex!("b86c167a1c6738bfef1feb7eef8f553898f69a933876acf675596fc2e39f0a8c83ac37df69dffb669fcba4e3f1caab92").into(), - hex!("a32d52f3e9acea45dfe9ce6c577dea8200e68d6ca39eab5d6fd24c508d2028f533b8b04f1a4fca7965315ee5dc5e2809").into(), - hex!("8ec96bf235d5e9bf36382d79b4bd1be8a8e2b23a9f7f9e02ab6d708e96a1c12fa81eb236f02b0180a0cb9f3c1bc28cc4").into(), - hex!("a0261a76664fe2fcebe1501e18eac7bce32b947db7bccb7b746757ba51cabbc8bb385600a99b248887edeb84f82a6f49").into(), - hex!("a44313f945a1d462376e03fafe6d7a9659dd81046460f45ff8914732ed268b2430ff632aa0d368828c2076144bdc8595").into(), - hex!("a55fbee79559e1fa7b85718306185e3769a92052cceb600283d0236accc6ba2343799c1856609faeb7c685dd504384e5").into(), - hex!("8a3d4ea2eea81742fcbde7a1bea5ffda55c58b5e4618ace17773057932b7216b96ad4a117d9054de18f71b3345a0076d").into(), - hex!("aeaa0984232b1fd5607a1a67051d42df3ffe71363639e5130de243cea84c87554e6597f3f07952b7d40d19b6e18957ad").into(), - hex!("986c868f8f25db957f44a39bc209f1ff8e98e9bff52236b2473b8ba977d0b7e90d146ec86a518a581c5de796290d505d").into(), - hex!("b1cb0755c54e0619c8306636e926930605f15901c01e36822131dde1538b063d0dc485a97534ef1e12f2f0febd1092c5").into(), - hex!("93cf415d4d7ea309b85bfba7ebefc0d1ea91b8e93fa351262d9eb34b728c7a516ef0904cb2b3549db2b3b3f788b147af").into(), - hex!("97359ca81e9fa330f4c0a3b4de96ff45391c2f83247d1f73a6884bd123d34edc66a4d3f29718f5543350204488ee51f3").into(), - hex!("8348c9b229787630ce26a41e7c016adeef5dd3ec1f124081baf9db4ebc1a3f3a37b40d94183ea9eedf9a458a2e65fb41").into(), - hex!("a4c6b13c7dd27497917bc9a4c4a91b953b88c819e147087b125c93657ad082971152d384e8c512f48cfe07a69f54fd95").into(), - hex!("88008b395718646492ab944a9139b95251214c42e90720c703b19b99afc971824bb87c2a4d40202cfbb62bd2ee30c15c").into(), - hex!("946969ae721cdb08dab293a638387dca6045e230cd7c7b7237c75e123355db9b8e444089633d0977dbb6e42a729ab4ea").into(), - hex!("83435817ddeeb242c37d31877a55194f208f4cab406b10a4a0605a54a19745f3517a880dcab8a5a4422c0e19e2ea8a2f").into(), - hex!("94fd0a0f870a6ed2e6a4f53f5dff5b5adc1a6943203da6a34c73694702733c991e146f8c7108ff35d563fb67f55a106b").into(), - hex!("89bc609d5223c73afbca46a8c3cc271990a8bac5191f1ef6a2c88d7984adff00d67bcfcdb3958c259e17d5cba62beb28").into(), - hex!("b39077093900919b51e68f647d11e0f78359be69c405fde5735ce6839f739081437b899f33c6c9e6c86d4bcfed059186").into(), - hex!("a0a6f9f588e336c14b91a9c0c56085830611df85ce6e99d759c72a4dbae500b47dbe736287f6b2d65b448a2a0e6ca237").into(), - hex!("8222a17ad961ad325b819bd0625e079a471e597adb89f2170cb490c40f6b8b1a08b2e23a1abec02011452d589b183702").into(), - hex!("8b77ca7fa195450ab3399f88341a9d323e8b9b7b9b2ca30985d97ebb287e1f9b7e0279f22ab3a2dad682d7906f6c8d59").into(), - hex!("b6b8389382d3336bc5ffdc752bc699a6bb0057dda7879901c7633787a2b412fb7852fc896ce95cd09a9b98c76bef1b1b").into(), - hex!("970a20613047ad84b61ede90efc41a91ef7259a5fa79ba23964ea907fba1fd88d2710b69fe5bcb0d75ed9fb68d02e557").into(), - hex!("8843dcb71117b6044b1c7eccb5010d0a2f93775a98909bf23c1773ac9eb1c0f43aba26dad08ea7823da593c38a30598a").into(), - hex!("b5b147bf651ef9696ed3ebcfc3ce226b2748a4c4e7cbfbf12b3ff5f1f0b2ee1372477e1d7d8aef8d9ce3ec602a63d01d").into(), - hex!("95433edd328aa9223f521daf6d78ab272fb83150bac78ef6639cbc032de8834049d4992af0828946eca69f359987584d").into(), - hex!("b2f4d2154ac750245e966f62b92022a136ed0313964ddf534ff3e9b4456cf58bfe429ac83b718bb38db5a4fbafab23ab").into(), - hex!("b6b1f2a3a99496dab156c6159b8c98990501894b5b0cf200c792bc462263cb0aaac570f5a785aecf367a0531ac2a87e2").into(), - hex!("9985e3ae265653082f068b8ac4c09d10b2543f920a19911cddf18ac53a7f921da86f11836f51f2adfb26c7bf4ad51efe").into(), - hex!("90c31f4985c7481e5939766dd080f6ee01ac7a4fedb9954b9d1fa8fa1cb0e6e7185a1e31d8503542f1d409ed2f550e88").into(), - hex!("830736923cdcbf7de3ae650768482845ed9b45c4dc9928d66481c76ead9b27427a96989389c8583a153851ab957d67a9").into(), - hex!("82312631f5b301fd3ecd8b0a6e83b130b6e997a5a1e6255e883c590efa00b0ac3bee45c15308efe824aa665c8d7a365b").into(), - hex!("b8ed7b3c092f7bb05aca8cc4c2041161426908e8db349cdd2064e95044f9e7649cd569039e0ef0a94e006094113d0e22").into(), - hex!("b1d6e5344b74a67699cda807ad4883369a77d79335cb8eded6e0ad9b64c8661b7ddb47ce4308ff69f947fc173f496ac0").into(), - hex!("922f0a2f84e476e6fc00c196eb913ebfaa6b205fa8ce8c8453330a58956872eb2e4ec0087b398eb51819ea2d0aae6b21").into(), - hex!("8c729483a3d2ea34337d9c6260944da7e2ea8646de66d39617924681189c79672b0ccdb63525cb4635e3cce1d8f72f13").into(), - hex!("a00af936fe87caf17f5b365f59d019f8438a62b8f174510d863da59097986011a9e76319d4125ceb64f1d83defd822c4").into(), - hex!("96d33c3832bf0af5900a20c067bd45dbf3f0ecdc086eb065afea6c44f117eaf9ae8841848578d2915452e61bad014803").into(), - hex!("8a16c15a161a1e898bf06a23f62a9ec042c5b9e875cbd54d62e11be181647cf09e6a0bc65fd62017ae150525c16ee746").into(), - hex!("b4a0443c452085bb77b5790be42005178dec8f9085e2f1b963d55de6978cb608b7ebb42e4a84f24350c768c2e78d22c4").into(), - hex!("9168aa07b4e29c67723f4b87a025fbe6876f13c69505520b4dd6b387f16530a886bfae5e5304539564debabc059589fc").into(), - hex!("9504db9c5ece4ac0b703ccf751503665746bd580f11106df3c8a903ae7a5c9b0520dd16c89671967e2aa12775af4f67a").into(), - hex!("a776127d4e2e46c7dee8559ac56b266e7eaaa26eb8db0a7f4df0c66fa1564a349f414c9091d1e4c3e7ba96938916c769").into(), - hex!("a85785ed5832dfa8c9a5dd9d20523591f04536712c19a38c2c1496ce9c8787cf37964d739f83d9979db5574ed524d557").into(), - hex!("a4ba9a3312c2c253394891714719d2cb369eea993353b07f9a6efe3ecbd245f08d69f3e1302d6ee312e743c05ae85cf0").into(), - hex!("8329604134885c08173b14b7c68b74ceceb3694a0a3f7997f566ba94bb3fb2ad3f78ab3d02c496858bfc95655f072e7f").into(), - hex!("8e3f5485c98cc317653375ceb44636054a3202045bea6e9f6faac128e115de7a658a49a6432858db7b4b14fccbb93f7c").into(), - hex!("a706c82514d19152bc4097f8602f792a4917f5cb409c42dd42a5e4f2ebd1bec8318019934ed6d19cb43123293bf4ec98").into(), - hex!("ae14d5f32cb99bf3eb0d844157f12b836963be0d6f91b776f973a66701924c1ad9c3496540db4292580e6be871486486").into(), - hex!("a45ee325452d4bb2c60ef5be60b7d601158ca1cfeef0734727562b94ef8f72190005567e2007e8940f8cc538838f1147").into(), - hex!("b8f1fcdabf33ba011c86487a082b19fb146de932a469b19518cda2ac046c319059382cb8ab3715f8025573ab53c5cdd6").into(), - hex!("a613f3dd6c8361893be08f816c640cdea4d57d3207704774eeea8818edf102cba7ff7b06c4c5d0fcf0873b09f72d1ef4").into(), - hex!("aaeab877b1d16a4db6e47a8a864e073c4742e0a84e46ae8dea1a0eed0d2cc9f23adce9e0c8d88464ec0c059df99a9583").into(), - hex!("8fed26ca2cc519a44ae38398d856c3f75d1ea6cd02dd36dab004188f3ef2167cd67d279580f37176dd70c1a0ab08d72c").into(), - hex!("ae18905c02f96e110f40d3bd99ab26bf28e0af939c6945966fd5e3ff440e54bcee56d667a0a21d8326f88e5c22e42506").into(), - hex!("97d803614adb6571f4ea11833d0d9ca8221e7fc99a960c637d4990a72727ed2713da874bf156dbaa70bd4c2f668681fa").into(), - hex!("aa86c3bf79ebf46e1cee54f517b7bdced4c7a96d3ab27405e7d68dba92ee6fc7fc91a107f3cca85096f0d2581cb4039e").into(), - hex!("b75cdcde1702b5bd6be180dc8ea26e5534da77b1c7bf711c8447a565a63d073474f0270d78dcec78ecf5baaea1f75d1b").into(), - hex!("a36e810e50d283e8ef625cf684c1fd333a0373e5b0a9d81ba40cabb76299af93c536285c5d7239e86ec56905245ed2b8").into(), - hex!("a16b6b41e5c31901f3c0fc2a7dd8c084fb508947314c4bf4b6fb338d95ff2cf49fdc5de1d6b9acddb1b096b835df6ad0").into(), - hex!("8b580da99256b1d0d7a90dc46a98ce5132fb3928d416f2df5ed1769544692482ec8f2ad5f57871041d8c78d00c949a0f").into(), - hex!("945dc91cffe575f06b4b01fdcd580da57403469a21db6ffaa77ae06d31b8a2aa9957e26db1bf89554611f51f10c8f73e").into(), - hex!("8c55c4000195fd1155ea608f586a327cccd1221036ffd29eb9903f8f28009083203f18480b35cf82e0390a5ffef4bfb9").into(), - hex!("87cec982094c85f6c1e402b74b52f7c0495ab4a2d3f2309734aa0bd2bfdbc88b8bdd9556664015c7d9fe2f138dd7c807").into(), - hex!("8fc576e4f9057d82e2fd2270a787c596bce5fedbdb9f6d612c2caeb1a778450d8c1f6e86dd011a45f3fe7f201e520438").into(), - hex!("a43eb1acf0de695d478a661a71128ce9c58923e3adfb62728a2e9f185c9f46877db645398546a300b75f2c849f5ab14c").into(), - hex!("b57be020fd23d3fcd6057997099fdd648dae32cb750e8d058b62a5e902ee5ca27771d762020cba2985884ffcfded3500").into(), - hex!("ad3ad1089c8232280e9fa2f6c314ae57758cfbc3a0663ad9517e35b74b19e49345e03d1d33d0d7b69d736501ec5b3f4e").into(), - hex!("aed7faac2e65c10b52d7b3009eef010a624c7f57a5c76c55afd310345707bc8959ad619101b9c1ee4bde44152697c537").into(), - hex!("a6b177c7f945cde42c5389f7258689aefe1b6ee0b243f9901c6e60ef1bebbea9bc297689cda0c93aac9b28c7d70d0022").into(), - hex!("b079f925c29da333461adc949ff4daf19d0500f516d95e3a4c3dc2e2f5ce26ba0f08b2473c03b6974146b239532deade").into(), - hex!("8c573c73d603c8ed73ac3eedacd8ffef4c18425699e30d46be2dbbeb3590380b0fb713daf3ff3cf7544da502dcf35cfe").into(), - hex!("a39331c8acd40377f020611ac9f3a758832e0a644a5cca318c01e654696fc607e299b744c0cc2ecee2bca755c9aa3581").into(), - hex!("8e71e261664d5a6094ee912fa7e3e866ebb5c4c610062fb5fd733359d0e5a5d806a3370155ec3b04e83cf7a2d7c4a0d0").into(), - hex!("ab048af1200dfb67b4fb6bc8bbcd8344547e57942f7397c06988c9c42cce53784a0282fc13bc878635a3317b8f306a81").into(), - hex!("b32fc2da89d3a3541a61338e6b0c5a7f477a23bbb9a7c63b1087f36c49b6d9a42d4720708af496d82c56e1e6836f5cb4").into(), - hex!("97d0e8f961033e4aaf96a75f585d16eca691dd05f4a5477e8d3a0fd97d02555d67b29d314b5d150dc0de3b72810338fa").into(), - hex!("8223bb67c99eda58237a765c8fb426871a1a9e02e6e91d956b16e57b8dbc30c0edeb76abb30ecb2f4139a19922a4c62a").into(), - hex!("8d9ec5c0575500e433a4bc66d196d404b8619ea38b0dcaa036e1c1453eb23c6949509243531ce59318c22db6e33ee1ef").into(), - hex!("933ac0e3e6acc7a238fb5495835a591db77c39e27f4034dfaea20bce7c072ff6bb6f59a9823a07a76a431905afa2dbbc").into(), - hex!("99f3cab4e8005fdb6bb44900a4f166ef0c2c48dad85c0a127c4d854bca4ad32a2954a586734ee0e57f3317e5b81923cc").into(), - hex!("8f01dc4011ea394a9f7a73b7f246bb00472632fe715314525f1db2cc6158b22dad22d1371e7d0b2d5e72cc408f07cb25").into(), - hex!("96e702adba7420e819338f6f8740946289bca6f24a5f14a5bdc727d1cd66bb7d2a573cdec8ef1333ca39685c33f6e7b0").into(), - hex!("890ab24865a2652a8fb96ced381530192d072cad275c19539cd74e03c001321216a0999ba83c8f3a162bed003dcbaae1").into(), - hex!("96e2f1ed5f78c0b018cb388447bb85b33da331a5a306ce4e216d1070beb7c3900f979ef128e85180c56958c0d729ecdc").into(), - hex!("8ef642d5a1fa4b32fd69f7f57886d1d9447ddd9a8425a03f15633cd688e41054d5243ad6f352a5a3fea2be2f3cb7bede").into(), - hex!("84a3177be656623fe280f91e2acddba52c068cf8a37bd79b9b4186ef199bad65f52cf3e47b581f1964c9987f088fabd2").into(), - hex!("8b913725eb48feaaed46b2e3ddc0cc414aeb433dfa584155e2eaf29020f6f1fa0e801b85bee4bd28831b5cc66944f411").into(), - hex!("88d802c75d422a713c19a600cfc9cd843ca41e35722e21a0614c3195ea84752337ee30991d860fa75a57ce3f614e0a50").into(), - hex!("b43cf4b09d02b20073903bf152f569a43864095622a472656d8a96efebfe3a20dca86871268ffc528a194bd951662d71").into(), - hex!("ac1c65ef79ad0e56184bcdf0680dde5547bd01b95d7e9c3c71671c71683709cdf7fb988440c3bfcb847c26f198b94f81").into(), - hex!("abebe453b3f2430a9287d0d5fc043f7ee434b33feac6b7dab58d5deed7568e0730d59f94b1883e3d43f3c2934d3f40c8").into(), - hex!("84e0acddddd0c202eaabfca7cbf88774ae374e841899942a2353064f132c6205ee378277b2703744a8bea9bc16449537").into(), - hex!("a69865f8a3f66ff4e548ce29a212041bcacdc85410b8467f0515842062b3204fb1b7616e45fb5f46a5619808fb390dbb").into(), - hex!("a55b426b402e9b27fadf87b27cabe5375c6941b22597dea75586eb9dcb699d925db77250b1d755512aefbd4eab0a2e4d").into(), - hex!("8047da13f072c9e848d33a0f397ecf3e783e7dd507ded7a4de25327fe89c183c8dd1da3d419b48f53d93537bc2c1a8e3").into(), - hex!("94a9345e464b9b28798c608115438f1eaaa60a56abad028729dddea3c856f7f871031b4f100626f8bb7a06d88f7cc6c8").into(), - hex!("aac8cc93a4bf5b383080738021fc56cf732988622fe0d493540545b19a6a54cdfe9f8cd2d2dcbd572bdde0d1f8cbb101").into(), - hex!("80f24fae3c8d202e8072092342f8b046dc9edfa1234c86e9f06cdd7fd2a1dc0f81ad69886a8c219f53a94b9a75cf6b78").into(), - hex!("88ac9c1d5c036f14566203d8e18421cdd21b2305cbd20f9857e4edd09e002ba0bb5c89b039cba417b353c6f2f63c50de").into(), - hex!("a45c8ac231d0ddca06f1bf03eeed331e9b524ecafa74642e4c4591cead603d4228cbb0701af58770100964fc880ff85f").into(), - hex!("88767dcda5fc82e5ee515639992868790ad56d2a4fdf1bd1ba1c5be51b381c149fc9db23b93488b54adc89fd4c48dcf9").into(), - hex!("b23e34136c22ac73157c7c5cc8a9491b0b5bc968c95a9c104b402cad9de598e323ada4cc527555157cbecadf48faf87e").into(), - hex!("99910638bfe8b9974a1bb7efed279de750deb046bc21a9655da4ea81a1aa807f2b76aa2a64d773b1b23af283ba3878f0").into(), - hex!("a05869387ea3b4c8f7403d85ec788499a993482538e0e2078d016f00d67571d1342187ae088c788dea518bdf295da88d").into(), - hex!("a7dd1735f178d53908e29db85ba6166640da8c8bc6f717e0da9bf74c547bb98a512266cf737937201cbf6d14bd9420ca").into(), - hex!("87f5b096a1263b51df28417fb423604879b18c4d0a8a48630f70e0f95226bd51a252d8be362df801680344330857fb5c").into(), - hex!("b1a5a549e27b8256c388465be3017dd123a7d257fdb49b2bb409c6430b6056cb8125bf88b5f196bc9e02567a6728c7e8").into(), - hex!("b70862d190351d6bec9c618057e407b43864a0dcf860b31ab6617f75e1ea02de49ff338a45af53783cbf10400c878a32").into(), - hex!("b27a654ece8541b9bf9c6ae0047969ebb69c4687a43030b1c412991dfaf349e2d3caeb6b7ae3d72ff0e2d758a04510fc").into(), - hex!("81368aaa4489c992a6ef3b55df26ece993958df2e40f04a95ca514fda56c2fb98f11d61faedd31860b89e89eab965f0d").into(), - hex!("94e14e03de977732b7c7faa60ec8180e77233a43d513a37c443be4fa0bac64308d6a1929de075b5d51efaa9bbd6855f7").into(), - hex!("b2e26d7b979f93e8dd55eea5a0f4985bb254128963a939ca07fbc33bf83ad7796e9426660b2f35088d7aa5fa0cda2ec2").into(), - hex!("850aee846e93c5204c1906a2782da71c0ff9e2d1962a778dac77561846e6f9290ab10daf72f189df0a57c1548bd4e6cb").into(), - hex!("aabcd7f870c299cabe4dad1857b3b6cc3b9fde2b525e9d8ec0fc1f497cd199108971173e61cdd5937c45758cbf7b9403").into(), - hex!("ac069d7ff2633fc73bb0b7607d9c27305a4e15c189c8da396d6685798c12ef179bb44cffeeb7435667fb03a799eee5cc").into(), - hex!("99e3eb82b955b2411d1b81d946e5ef6b9c6957ae0e368f4a9c279a0541c3a46e289fbff526a1f9db4aa21b92d13bc9e9").into(), - hex!("b5bc3dd1e05a66a1d775ae0ad159df19c7188f2c73a8553525855ab34617c7f080e217732003e09b29a5b36b12ba564e").into(), - hex!("aa631a69aa4a9c14de2c49fde83453633d17bb258a2b7ada723bc8e71ef22c617ebdf8ba64c72675440b35d419d0f836").into(), - hex!("8f42bb48587cafbb3936adc495e82981d7fd81d8c0233a4e4d44f9df72f8439a9a0228d6cf9d156ea608caffab8d9eaa").into(), - hex!("94e079215b8d187d546f33d5384673215ee65c70d3bd0778f67c11665af5fb025b4302518a0db6266996c136ee90d4e8").into(), - hex!("b3dcb504b50dc58ee7f2e2f78ca884d5fc081b570d1177b884c92bd34272ececf2a9319cb1cfb9df011d4db3ad266e42").into(), - hex!("a5e5b55940e379e6c0fe7c6ac9ab86f3836f261942e3933087f1e1deecd280af9afd95d1bfb384976d5947d5069531e9").into(), - hex!("b1a36c3a0a79836817a2890ac53c6768ed3965bf5d1663e2df69b1bba60910e84dcd4f917991812b305367786edfa288").into(), - hex!("a8d07cbfbbf31d113b80d3a1f82ec7c29c4d78007efb66b5592255acebbd8e1b0c8b927a866c79211d5d4994648153ca").into(), - hex!("acad1228fd1ffbc118ada45a27f33ea02a09455d0c295510da693d741ca3b5725af41b99967ea6d429f604736a4fac81").into(), - hex!("b201ad414928e315aa00dc60b89c7a15464d5e97c30b551a462d02c35e327d2ef3244a98a402f9e055a2f9af6e970733").into(), - hex!("861689f35fb72780dc0be92c140dec07857290495baf3137bd2e83ace2f268f205ffc58edfb0e09f323ea5f14d0ce10d").into(), - hex!("89138730c80c30dea01abfebbed79bbe6016b4924193d9c2e8bfaeef30616bcd92f0eb24d5345bfb005bcfea989fd8d3").into(), - hex!("b78092afc3f16397d2eaeb5bdd7fc6c01ef516a71102124febc0cb443f4446c18037ae75c7c1d0c8177454b092922ace").into(), - hex!("a739cb664cdefe7a2f38333fff13bacaca129d718a043fae1a1b7c4251a77319b44589429dcb9ad113f24e11d3b75024").into(), - hex!("879996d4bed3d3235c0f73ac8f3f612eecb6aef6756896920e0229f5deb1d91feff95734e6b4143ba89badb5cc1f0cf2").into(), - hex!("a213d854a0496d74526b3c37a48d6f610452b44202424a419acf206df1cf76f7357ff5c0899e45adb565535bb09c29c1").into(), - hex!("8afa04d66a3e8a2759ff088395cd98597883b3ca6d8811703f5fc74b822ce4e56e1dddeea2c099fb3e0f6648f990f1e9").into(), - hex!("8a2e7ca192972af2b77660b07aa612811fff94c951532e3fb6829e8031355363f4aeed0f9e02b845f00cc9ad4b744c4c").into(), - hex!("8f0757fa7ab1eabf429802c3811caad65833e763029c3aaaa43ce921abeb277d7dfd06e0e58d36e494871ab9bb090668").into(), - hex!("91c0c0b0564fd95db51c73637fad622e6769206bfa03e41474a4e68369d10de7da5d1bd2b5d226f0564cc1ee8c3e9074").into(), - hex!("82b35466d835a6f13080628ce407cfe495cbeee26a5168de9e595a122ae3757f2eb0a64a71ff1ef6ef26c8cc97ec1f52").into(), - hex!("80d11c7a711fd2dbfedc76fe018fca09295d5a3146df92496ba01063e5e098198cd9c52d3802e6cd033f64b3c651b67e").into(), - hex!("8607de2cda6838c70f262dadb21409649900c27a5bf3505ce2166ef6f616f4b7119aa3e3f3c62c1a508662d7d68e8f0e").into(), - hex!("a1c14cbb653115b6225f53e3e6ef8e25f87cf47315b25dea5e658493121ca22733d3fd2781920dfa3a04271d58970749").into(), - hex!("aa876cfb3d572bc1f84a5579dfe8df82a9177b441492382e8ef6528e28e46ce59fce9a82d42c1c2000b28cff06596d18").into(), - hex!("8742ee128452ee98f21360f903c0a57e600d622d4ac793f32d6732f5fc315f757bac89b0f39a4ddcf4b8668cd02f3e78").into(), - hex!("a2e04418db55c0d9163a1bc242e6d43230a943ead121bf8a5f50c109e4ecf0fd99e5b126a4fe2ae9b0a248e613b54f7e").into(), - hex!("841b7c0ab57c2cfb1a180a9b0a2875a7675624f0e5c779f01f3f92a1ea547cd1164485f54bc433d71c7b054a6fdfff15").into(), - hex!("9855f3506dabfea5a133ad49557c3c9e1c7b6965215cd940bce4bfa90e98d9c62999feb29da0af8768b99f5f82c64489").into(), - hex!("a65939fb29f1d913e36be1f877c8b9a3549ec17313c4354b1834cf7ca9ae220af26a72cdfdbc59567bcd7e4152d90930").into(), - hex!("b64edc36e0bcd48cb350350fce955609ae51f5bd197cb7d42b04a2ec7f8dbf236b2a3b23a6e0778d57796433f0e6e9df").into(), - hex!("9379a72a722c1a5c8399acf72ebadb7ab1c5a2e18137cd3850b211dfef907850399b6151ae7bdb590a6eb04387ce0c31").into(), - hex!("b621023f0d3c731f49a48378c3709a0c051fa1e3f8788d27169a76dc35d46cd6095b32d7e91794c35f4af8d75f950411").into(), - hex!("a82421a53687a444a065ff1e11c439cb7342a3edf496f2ccc04f56fc6630bcd79ccce1437479a6e7d6dce918d3d45181").into(), - hex!("857fb59242e6687e940fc114df3c06af5a89d85c762140b1e4b0f8cbcae9d604f435377d7a2d153a65e0dec099e3e8f3").into(), - hex!("95e6a571cbd7c7a58c1c599cb4c837c9f31757a6ee4ed6740e9d55c350baa847ce6d081023b43b397a3798c6843baf13").into(), - hex!("adc1e1f8523fc6e3d683dc0ca15ebdbf471de635f25fa7be6fde9907bd3fad130baafd7d21b43fa04738d4c19448d788").into(), - hex!("85f8ff5b661f9e529421f7e5f831db1919ba3170a59673546db695c3af8a82cb1ca352e07e6c801ef9fe6f501d5896ad").into(), - hex!("937b374871e35266c2815e4d0ad72dc2b6c756e840ec36fdb90a71ecdd4afe13f6064ef36b9d1590a39a7be2156fd728").into(), - hex!("ad4aa9b451187905652222dedfe6135111ce4eeebcca74ecc74f3464a07831754eb0072abfb96adc23d0c5c33a1d9f16").into(), - hex!("815bc7c9c7c84396bd0de5c71b78f2be5fddbbca3f600f341a21533ae6dcfef8bb94f4340ec2a90f40ab091efe4cc6e7").into(), - hex!("90bef1fc273005610cd79161686b25d88ed2ff2abe18f16a4054fa05dbcbaa339825616c117f55ab26d12bdf2e414f70").into(), - hex!("b96e51c2d2bd0fd78c4d3b9873d217eb76642c329a9ef293010fcadb45ef2f9ee3a9c34b0365e344d33c464c08a0f51c").into(), - hex!("94c4048c3fe7dfe736458ee16566027290f93b1f052c3cfaf28f5c33c32af6b9cc960d86181d54361dcc10aca9f81a58").into(), - hex!("aeaad402961126722aa5033c6bc7735d4cddf35ededaa08073ab1a8412e5d1d06e95c58c7a95409edf1566ae904d795d").into(), - hex!("93d019b814d00d5eb6e7545e6480da089fa48ba34f0a961c704db12e34a144818c306cdc4f31320e542c75eb0f1ca96a").into(), - hex!("a3c21f7864512c38a58f02c0c83993ce6294329b074b801404e4f941d21e4e7e5eaeccd41da8ac423c967b7230b2a505").into(), - hex!("80c26a2aff26da9d8d739496b5a63da6d8d35544c71b7b05b41ce4cbda89e6d32e85fb1e38a215aa01dc64cb43e089e0").into(), - hex!("8c5e66d7668ab7e0de06ebab4a4ffd13f24e4458610e64a972a1e1f15356f6e745cf36b8cde658d03817f2749616fe84").into(), - hex!("a1260c9a6727d6d4a4c147e0c7ba91c5e2a47b5a08a07a3ba0eaf9b50360b6919495b4aca5f85e8fb2e4ef1c307286c2").into(), - hex!("9150fbf49242afc6ab7f865d4a92e7013eabab432b341710232e0fd971eb2b214a3da5b82617a8b7defacbe060538ea6").into(), - hex!("ab44ddafebcba5a0fc1002f3bedf595f3245ae07c9184d640154968e4993d85087efa8a173a670d07eba1c00d3ed1c5f").into(), - hex!("91580bd78343a09b62e31bdef63dfa9e0c874d7b39eb8a4300388ab053f262e118f790392f73d4fcf7714b521690d94a").into(), - hex!("ad4b8eb477ff8e573a911a1a4c1ba027088828cde7907e193ccc4b853aea74c66d19ea99c3779f6ce4d505ad83f2174e").into(), - hex!("a5791ba6dd8534607100f405b2f104c987336d5c47a544ed571d0babc6dd88a634296773faacfc3fdc13a5f7ab0f0cc6").into(), - hex!("ada0d1c948bd8f66442cb4b9cdc3a5368ab6c585cd8be766b468864a8fbd60535e454943731d4121ca134743d05221d8").into(), - hex!("a83556f376d8cc4a26b53223b11426da96bdad5351c2fd451ea053346b334eafef9773e3486928b9d407d3e13d5dcdd0").into(), - hex!("83be01b65302a31c5ba09c8329f683904943cc8017cc8975272d7d284b6a15a3313e27887e4de9110f64445581747ec9").into(), - hex!("8acd831b27588a99743c5d4f61e6f0610faa530d6259f187aeade29f1c9d5956f1c01a5faed8be8924fe1e8d9de03571").into(), - hex!("b17e88d1fc760f3d6633f5b48411b7237e276e2fca621d3db4619da62993bdeb3c12cfe7d130a92e4d3a14693d1b87eb").into(), - hex!("b769850bf9b77a1958d5eb932f99807cb695eedafd476d99131e3d7340cb845a33cb2cc7b640a0f3b14901b506802ff8").into(), - hex!("89e7eb7cc852326b6e18cf5c720c4e44c474d254de9e912d22510aa4cc1952b5e5c40b46a4907be375b89bd57d9f1152").into(), - hex!("af7ec9a4b836709701fb497f69dbcd0d94bf986fb6894f48c67014bc8b0ca947da71722d87de0371923f5bf2ec82ec64").into(), - hex!("8d3ff45719a7fc5254e91c710d956a16b8e8435fc4c8f68d1a47672335246bba9627d7058510d25417b7eed5ece5c110").into(), - hex!("a99a7b987f7050c230ab1adfa50a30b4f3782cd31467ff9c2a749182a1974a36a6a375ed5b0909d1e627b32ce0245ef5").into(), - hex!("a0bea35f339b54d82e345204fd4b75d41af3bd08d33b223211e496ef7fcdd8e327dc5a9ecb6fcb7de134b3eaa43d30f5").into(), - hex!("9419df6b2bd022fb6c79566f932c37828ca7a5a1a9efb64f470d7ec06e0d6b0b0147cba88814581a0773c80cf3d21033").into(), - hex!("948b0cd553cafa57de03279b83fa4f28cdbd0ec4e2219e25fad53c9d3d28c619ede568ad6e095a155d117caadfa87551").into(), - hex!("b21383b264f67c8c66011a79e20a4d739d1f8fc258562e6351eb1e1c5b83e42090f1525886ff4b65875868ae17a8faa1").into(), - hex!("aca93939c30eeac8fc83c82ff6ba3549ff38121115a60b7fc94b7d64e1f36f65e932bd8f3bbf2bcba986c9309861fcfa").into(), - hex!("a728507043b7e86c0bf19cbd81a45e1ac98d2edcea4c7faa3381df13f6352232b711b03829e3eddb7770213866dde7ff").into(), - hex!("ae0bafa42eece82975171e94b14e7063a09bbcd44cea6b7da4b820cd5d984be4c00a2e9e5137b0d34603e1ac914f889b").into(), - hex!("b63cf4b55c4a62c50c356cc2721ae5a89244ba9aef2c9f5c93762837fb14197479435f593947c8943ac77e6a2ade0208").into(), - hex!("acb5cdbe2cc7c44ad3980f9ba74b0a97f36add3fbb4e9b513c62157c14812aa73fac68be8c30170c39d1aee626f5a1b8").into(), - hex!("b14ddfe1c42321feb8ffd76ac041814f3d690fc16ff47b23ffcc247e8722d50ae001b6df4e1af6cd7c67c8799c8a1907").into(), - hex!("abe60d6024a9d6874df7e59b4bbd7e1e55da22adba1d16320fbfa2b68e8db995997ce6f81f8809e96c40f548ba005787").into(), - hex!("a23307e2ee6d96561452294a9265cf0eb1d6f86b30c7ec48066cbbe889eb7f0d64819225293496db709a1fd60dde7e5f").into(), - hex!("8bbd00e149a9fd5eaca24581821c3dca114e008c3e92a36db536944f6b5e5e983628f155c2319cba9a8a2a26d3885add").into(), - hex!("954fcbe0655b82bfc15679237d98c3759a49ffd0eb7f5da1827711814b92e0a4be2c0b7a96fc16ee3e31099c993ce6ef").into(), - hex!("a9bb0a14061ab4de136605e94899a41c3585ed190b2a97f529e911f02ff389652049616b408aaaea81d38f08a8f6c533").into(), - hex!("b58fa12cd0b69ac2e5c50b543bb15abcc3a0c96cc9cebfff34c4f7dc83bb5ece69d881348860385456eb6198ecc640ad").into(), - hex!("b73597c5ffd3a812e8a553bd3ad2216282fe7c1203120624b86cacb8a7421ea6807e29fac3383cfd61d632db8e3af5d8").into(), - hex!("ad153b873be0eaa71ad3b0191067874e085164f8428b89c7d2e01af0802169a9afa1775ca0f9491350db9e6c7c6581e9").into(), - hex!("8a7fcbfc564fd1af76df52ac5802a7342aff25d745307d2b9cf29c4470273686d9877b4588754af0e1bbbbe0310c3fdb").into(), - hex!("84553c8b77c7e5c81bfb1413cfcda7f8fd95c78c011c19189784be6a5e7352248b3b30cf5c80d9262de6c35ae6d4f1a5").into(), - hex!("8866da76cc8ca6522c3d41c950ea7fd67d448e1d567ecfd0cb916912d597b754807f7489f5e3bea7b4110cc8088ded24").into(), - hex!("84adaf9a79d5c3bc8dc7e669ccc5d4964254d0fc32bc535e54c5e4a4f45aa3c409c11eadd4fb21f4c831329087adef06").into(), - hex!("a77ce1ee4f8feed6ffa0c5cb8fb7fe0f95a03117e746b56b5e8178d27a1582804e84a86aac1cbab53aadffd9f84c0bd4").into(), - hex!("863321bf40995482cff032854ad5017bd885baaa6ec4ef47ab6bc713640b1e258eb40797ba049fe677937e3ff7a2ba2b").into(), - hex!("a46fb6fad471bb923cc38748253f887b53153ccad475240bf7244c1f9f568ade931b0522911348d64460021639bd831a").into(), - hex!("86604e383195be9c40ab728db426af87698d0e34157edaecc357544037d66d40e558cbfef7b005f8db3c9faf541f2c6d").into(), - hex!("abb7d323687c1d0ecfe89d411d9a81d05d009b84e652af437cee40e89bd2657641cbacf28120fe93deb0a1d3b410fbd4").into(), - hex!("a8d2488d99e04b79057739e6e0522b38a0f68a21bc190696c38d96f0e58a9395e3b9011e54d2cf7e8fd0b380e753f2ea").into(), - hex!("a36fd6a64f64f40ece0babcca8926dfc005cb1d90e4adcaa9c01ff3bff8d73cc0f95bdcb4f09d7e3b5d761ad5c3c065a").into(), - hex!("9699c0c5b1695416470c302f3097e93b94004f42369be26afdf04aad49bed67851d50f14c44efc0a90e311ecb27b3387").into(), - hex!("929e6ba1338579c1cbe76f1b075c0fd9725adfa97ab8b821aeee75133a874426414fbfb5cde7f7f8b74fbd8b27bbf7db").into(), - hex!("ae874a087a61c3ba4bdc2a582cdeace6d321f81683636440943dd860c783344d4133196197a108f6f473bb1e75c597ae").into(), - hex!("95bb2da076a9fc25e96affc7e4adf71496dd5802d7443cb5a77e3d52ef544aaf939c0884169df547000b3afc55cc208d").into(), - hex!("b0b63d1993f601c8aa96448183ff560f291903e649192e2e34e796bb66a31f9d0edd0f03ba4f1d299fcfb1e931abbf39").into(), - hex!("84cc92f8897d0bc0efee72d62ec3a8c07b7c72e00913860623982bba412307c2c42069ed90dd996bc56ffd0573b607f4").into(), - hex!("8ae9804b99addebafd3672785d4402a583c97821087589b7a129961b6131fb18c2fa60d606cef4f636b6cbe46b5d6415").into(), - hex!("8f4c85506e99d383b103217077c70571ad8b9046d039174df6d9f1902f8b85143754969bcec37519a1340c79046f1c32").into(), - hex!("81a5a0214a381d72657e1142a781fa8db0d849e1e012babe4c912a1edebc5dbfc265bc7fbfdf8b6ccbefb55eb0fcbf86").into(), - hex!("82c0e11c9016d95501a97e551b8b926fa317f02fb6764cdf0981796e6e23cbf13e48d46bacc875681900fe8c1741cd27").into(), - hex!("a00912f7bf9abb33f1624dbeb5a960ed32addb4d6bbf9770b6d82d514eabdc339f751e41c8f4461e560141b53f086f8c").into(), - hex!("8d905bcf245556e52587f92957459a41b9974b5d8b8d2baf2d8a98edcac2a77fc8b1eb70024e1e28d5c7a190d9f2a77c").into(), - hex!("b8e19d883289d97b0174cebb92d12a8c6ab16e4a8f0db9d7b67ccb9bdf97f070352e6b24c2decd89e7894099445d8b96").into(), - hex!("89cee93ceec6e742aff71ff60085f04e9550ef5568012b4ef0aceec9928c677f9711ea553499db812bf80eb5df021396").into(), - hex!("89d58564c0215295070329974e51e528ee4d9cb197b089755a86451098bc2f347be8be5b0cc06240315f75222ba2e9a7").into(), - hex!("a312cf33dd49ba6488ee13200193f06a5801407a15fc79956f977586a27a4b2d4cebf0da22f6c1100ce2a0d08730a383").into(), - hex!("acb541c487eb8fb4034ca6208f542c5adec863f1346dfd50fcc0ba1c6866e43f0071c8cbdd62ce6a2498e16e80855fff").into(), - hex!("98022eb774377f49b90f41439cc6703fa152d1d38c0e0c78eed49cbc54670369cb2b7acbbc37dac6617e57e527e41b83").into(), - hex!("8f00d44e73473d7b96a686d1d3b0848095d0514b70128c22ccc4141219dc3f5d2ddc3345cc506ce0e747ba358289bcc6").into(), - hex!("911e37896367a3e8603eaf995480bbb62229a3758a608c4822410e46de45a1048ee6f67c2039aba9fc95281ba5476623").into(), - hex!("80a349a605d2968fbe362e40672b33eface969c975ef75a8fe82ee7ace1d0b5034b7af8667650e813876a8a7484414c8").into(), - hex!("8b00779d873c6976d8b01afc94734fcf943c1819ab1c46e512e0c43469cd08b93158caea1cde84d13a48f27407048748").into(), - hex!("99030a66c4afac7e3753abb669cdf576cf96e21b1d698135148ba133e2d8fe97b4875d770e6246597461958224f653c7").into(), - hex!("8766f592d757c09f617090eb8f226016073a992990e16fd64a705c0c3104b202d36de18ccadcdb3dac5d68afc2495b4c").into(), - hex!("961cce69a7a39c20500c96332d2ce4cdeb3d844082edd527fd1694cf499b30bd33f06da66047d3849b49f4c2ccc8bcf3").into(), - hex!("8bd5dee639c3ef32712931295cc5bd0a8820192aafd35d1f1f9a24130bf208b7cc3f2ae99d6fce02dcac4c8225564d5f").into(), - hex!("a89ba310a62330e7396ae361da7a74a596e4a8be02496c8f4b3c860ac5c3cacdfcf4790d00b2ffa75fa900db2bdb15fe").into(), - hex!("89bebf6f59151404989f282a567c378f2f5a04d85225e23e22e0963da27673f3c7e8990dfb526a1133a988811cd03f45").into(), - hex!("81e9ec6ed189c12ca8d4fe32e21c60834d7938f739545c7dd76303ce347b69beba9eb14ab780c00cfe3804c5756417ba").into(), - hex!("8bbbd7b584948e34852a26d18b9dbb46f2974fb68bc8317ba5a168094a74bbe2304e1dc438777ccf92117831f7986c84").into(), - hex!("8ffbf94991bddefde2bf0ccb115b00d7b19a6a448f093816b9db0c65a43a27519a52ac7b88e6e37a7f33d384d42b05e7").into(), - hex!("b62267be83a54451ace1b8e2b54994990d2e1d619e040c2075cf1906c25089dcbc08ed8c2f2f8f62953b822f163324fd").into(), - hex!("af6d55c342e0e7f0bc3ec547ebb4688a884b59410aca90ad6d8730b4fd3543952fe2476e2db871618d12901fbbd2b91b").into(), - hex!("9027b69f6e5d550acb459f8b4b9e3f05cf291c104594cd244b224eeb8cac419800ebfd5255d87e0dde31bba662e20134").into(), - hex!("8bd160918bfd8049878826f443fa416fe32bd018262b1b4802e015ffb0049197c34d730c5ecba951a93986cca1e23825").into(), - hex!("b82f2bf2bea66697c4b5ed6d340ba74bbe0dce84b2d23904270f3500507318ccca0dbc967a69c4379bd12766708dcbd8").into(), - hex!("b4d00a38be54fe5ba5984af648c9092b133f21b22e56ea106442421c03c26d282b81d31ef8d22ebf92c0c26f86d27512").into(), - hex!("857d95d8aab25f91e7cbe0ea70a3159723566192c1d6dc0e68c2b19565a865a0daeceb4b1c733f75b0dc9cbfe246d870").into(), - hex!("b222a1f3f2d05912987902a861796f43cde8124f7dc398170beb76b6434e7095a8e2d5de54b2692490cb0c325cef8956").into(), - hex!("b016f69dc65c3e72e77d43334863db2c364f3697c552d4bc0730f45cc32fab5f60a5dc0f9f2f6df409fe3e2ba3f2f3a2").into(), - hex!("931b966d70e048570c463bfe7ce7decaea3ad80d0540ca079ddb10958398ea27df85de2fb2b7c238d0763d6293d34b4c").into(), - hex!("aaa3cacaf65a90a6a8e8fcbb98b673160e5f410b28b08a8733444cd71de9e807e00b146ae35fff05160a786eba6793c7").into(), - hex!("8effa24ae2c3cc12aef32e737faf7985c03e2ccd984cdf740f31aac7a93ac295be7fafa3a4d47812d9e0fa5bc2b3472c").into(), - hex!("ae8f1044330885e22c376ba50926ca10177799628b1c3f6b731113126ace5faa7756ca80fda0c535ddc77d051632266e").into(), - hex!("8a6613706dce5417736438d9bc779e29646a0b12fb1c5b5e118aeffbe72d37ce71ef78d3da4f2cc8c1f3bb47f8721cd8").into(), - hex!("8a435b4d265a01f7de575ee8893105de8be608a370c2f1870b7b097bf3635abbdfaf164ac1c704a6c9b31d7baf48028a").into(), - hex!("ab842c0851dc81e247a42806ff83a2e23b86147d884cfc828cbd1f3abc7fee929657bb49a2910975be746f97d0bb7c7b").into(), - hex!("81966af3ed4bba12f6895bcc1e2d4af8a0b313f45446f4f2e966494460f77015d2c9e65eaf396653f8f55e50413e7986").into(), - hex!("b61357419b1d65649e79ccef51d68d1e7c746d77c7f32692b6ff315d9dacefdee2a527816ac3118e5c80e00212725c87").into(), - hex!("b3a0c1e36006ab666e4d4e98c78df5630abcc76e86b3c13c342efbb64c2f669d12a98e797429871c12a7171f7a751422").into(), - hex!("93601527015bc30178505d37cea121f19145e366be178e42c9ea7380ae34053c45938a3b4d8ef852ff8701764bf74a52").into(), - hex!("998a446e7b4dbd7a7a2055f437859dd3ddb44c52d3dad9250f085d797c821ed91a17dd13d00f532c5f0f2321c5b3eb9e").into(), - hex!("af35c5f4bb11a87ee3f626007cacfee4ca892851459cb9cb2e127e92c9c274f9082c905165758976f9c7bbaeb984acf6").into(), - hex!("a0df73b065667fa0f6a4894aba39b3e4aac620fb1a8a3be96c94423231917c3a7d75f04383b40cd802909d9cf018b0d1").into(), - hex!("85c9c5a5302b706af5af436c07d1a1a952ee1cf4a0cccf002f514473fcf85d05bc4c23b5da2d6d0b5d0aa503f7e41a65").into(), - hex!("abd1ffa853de61d8b26e6eb6c7eba5636967c155233a6d73fdddd361379ec51a74c242715b6ad0033a6343157aee7ebb").into(), - hex!("ae45b130af61f3e76012da75b19d46a786e0c21ca7c6b5bde193b2203d6d8b7b8afad25a198e8c920c69954d3d6bdc14").into(), - hex!("93729120899ef573f6f276a1ba861a400a35efff7a2074400bb6b5df818e3fc1f353cd5a8e4ce122a2bbd8f5b30126dc").into(), - hex!("b34615b2cf8912c51c02264008e0cd78b79c87b87d56db810d899490bc438d446f734ca958c7c291aff68e3211ec8c5c").into(), - hex!("a1ca372d158fd7eee15091582c6c1b9ac9854959677ee25e5786a94cf8c1d15b64f0019aef20331d9675e1f1ce41fd6c").into(), - hex!("a4bd66cf90f38233b579b8698f5655f077bdb1d626e1d36ceebc67cf7ab8ee8e129cbdc307895bf0fb6e34a4aeeffc68").into(), - hex!("ae06f6db3a3ea3a21193f6c6231db42d18fa3aa06a8295741bab35589dcb1d51256838dca01356d580e8c423c45ddbe9").into(), - hex!("b70b5f0cf21cb98c70996a9eb6e4b3562732505299149bbebef821477ff406dba3979a2526b9969213b9ba75e35de3f8").into(), - hex!("95cf5980f21a58f4604ffb99c8651752f724faacaa216f8c7cbe400774deda53f26aaa15fc6415e936f52ce13cec6ecb").into(), - hex!("933c0e5bbb358f5f83cf9e60c67ea8fdcc0b7a203fe5b07131e3bd69295c507880a1e542ab2a6a8d182866f7c6b14a8e").into(), - hex!("a8baa60ce583afcf85e4756dbb0a4871b330ee70f7872c3e36ac4d43f2587fbbdfa2a13162ceb7efdf897bb96fd2d97f").into(), - hex!("a127b3828c422ff51a067d482fb67074d45fd0a86bea5066c7f6dfa83f4b82b4584646518e898ff725cf5de055c6b236").into(), - hex!("871ef5a7f50e5ae528eb16bc30ceb64b97d111896d34fb4a65c93c8d0498eb7032033eb663f7b169a8af4b96e7acbe21").into(), - hex!("80d0bb10037029f0d8f8c9b9b46f0d0ff32b2198af44a4f84c8c0ace60f2b39f8f8d284308769c6075e9425d6229905b").into(), - hex!("b882ecbb78c758c951fe53b434af25b594e602dd783787f09ed077b79f7dd7851fed769a1593f5a5b938ea2171987d3c").into(), - hex!("ad41cb47b16077f73cbbc157527a17c936efa78a59d1f36e3c0dad67cd19fdc60cb772556018029611aa46643084f024").into(), - hex!("82ad3ad7a706ec19b39b0c8cf75d061ea3a1966dab04643f5b9d711e6651b45f0cd22ce5048cb51e4e118b305bdf231b").into(), - hex!("8286a4970b8db361abd04e5d197849dd335b7074f9c3fb91dfd19b7f43d2a3ae9e114b0cb6342463986d32d262c34d79").into(), - hex!("a844f14ffc4c99989a6c666dcdcc135c2fda96914220b1c565215d5c2c3102f5413b7edf9b25882a02a19aa78c2bc545").into(), - hex!("8e758f3b03fab7f5d0993e78674efe3f9cc211e268c12d23911fc01ae7a4c8f879a393e3fcde0c05c10106a59b59ab72").into(), - hex!("a973caa021aca6f0470460b84df9324ed894a441435a53c4f0c48fed4359242ee71fb3a0e4cf438839ed838f37e5c02e").into(), - hex!("ae17c713f10747282798487f02d25d2d8e7459ed436d90a895617afb9299ee81994ed68ef87ecdc0660b7565c323f0e8").into(), - hex!("978e68aa5f44daf9cfb9220147ff509ffde89d121d08d982a0fabae9f07cb3145c2312ad200f2f0dc051820fc54d07c0").into(), - hex!("844e58a9e35ce1005fd5785f56fdc9b3f7e8e073f48fa40da19a5e9e84aca00b8743c5407920cb554e926873092015c8").into(), - hex!("b296da231b6ca9d5535432c81f7d0c20a71cbd32d357740d1543e1e3910ea5d32b005938f9273af96e401637180f4606").into(), - hex!("8aee25d881e7ba99fa6aa2fc65ebd44aa498d31ecffc595ac8cab010f6cfdaca308f56e616ae51d7e2c2e15864eda0bc").into(), - hex!("a04298e32052d7f91096285c73d67cfb3f3f5463abb3d7caf3108d8d77aedf9896c359986ae598bf9602dc90e6eb3178").into(), - hex!("8c336e463dd98ecccefc55fa366ac70a2fcaf60acba2f2171490642a6f616a1c6b72601bfc3533a5f49ba02dd1e39fa1").into(), - hex!("b00b383ef5d68f0939c0538c7564614401283c6923dab4db4c72a05a88e05bb576ac374eda61c024345227bf45161e05").into(), - hex!("9273a1a6c9cbbc8d5a46498b7658f6125e955cbf19f0461d1372ea9de200688e4f7376b23b132b41cfd672fb42ec48b1").into(), - hex!("a7f04c0377207a6bb5d96e2e6cb9f7696d5dba2acc3dcd6021ecdb3d121a558999b2b3d92497f72f28f39a551b2fbfcb").into(), - hex!("8d530cf98af85dbd0bb7b1f2fdc24d499b19a941ef431bc7f37ca9328a4f6ceb0660eb87edbb1a5d868d3141fe6c51f5").into(), - hex!("ae88acd7fddf35c72c3ad1c507f8dc185546d8acdd92d70f00991f50afd67809167ad3171c7e45976456fca033f0a95b").into(), - hex!("8df71ffbc265a4bf475ac7ebdd5eba137f4c3b585075ea8957757661b3f11e7a92888094e85c8863ed53d91df45e37a7").into(), - hex!("917737cb24287f30c899dd88853ee3b9be54ea707ef38f1545ef9e436865be1399fd2de4d2c04e3fa5b4a3205f4305ac").into(), - hex!("837e57594b1b71fd9f25f27967b721df500e3d7c72f22e90f4315e10fabbef027ec1db0dd9863b817071fe3c9413a5af").into(), - hex!("94b9c2155509b2189883d2237cd37c9ed19c3a22203e9e2b045184aed072e406e93eb7b5c3fbfb85eeca4c5e630e4ed7").into(), - hex!("b022c75923080450ffe5ecb8e01972785628ec2027b6bf3dc2b09c92ba8ba55222965767c21a240705ed5af6e9d92695").into(), - hex!("b993e15339e28a472b3c98bec723ddeb7728822571ef1fb1c2a1607a4023f37d663b615c7855426170d9ad8f6a971617").into(), - hex!("b34db4df6a97056021b088c53cfa7cedc8e585f907a67d1ee8412a50d84e5e3d347011fb99d5d71b111c88f5efd44610").into(), - hex!("b582bbdd7e0d2ccabe94e6d193d1b8dcad1932d1e96ae8e1a295cc05b381646f682f1f66cb90ddcfcd7735b335ea0242").into(), - hex!("b289c068f7c988a69173d347361047211c302abfafbac1d87259388b5197274f5ee90d56228093a42eec32039e490868").into(), - hex!("88e84114e8e536051ef5197ad181f96ce13fcd5627f18964bf4bb2f461c6638033ba363800326e494e43aeee94c62125").into(), - hex!("80d16c3e8717274533ff3b764984479b3bc709f11ef5129644dfcbb5d8bdedc7a8cb2e539a4524bb0fd4d977ffd25fb0").into(), - hex!("9405d059e30017152eca6d6d86366a7a5570501d78c3869d638a2b8a0bdc8c5bce9f0b46764e78680e2fd41697af9d52").into(), - hex!("ae23483a1d25f8b9a5adea9527560cce5552994b3964ffde2fdda0ce7b6156e1d76e698d7314b0820976776baee37b63").into(), - hex!("8d8395fa4ff7ad0ae3be3d3c446cab058890cf7a07d0a2825e22396cc938cf2d7a986745be5e3c1758c5ca0dc29c0ea3").into(), - hex!("8c5899cfb437a72d99085d8abf54eeb345d7da59ef93978b0cd9207853dc491451939f4b1a7bf317c87504ce949713b2").into(), - hex!("816ca0740bce43365bb20e41c3d0c88cad587e4c743b2c0cac9dc966aa8de220da347d65392a9b750a2001499027e3c5").into(), - hex!("b3d23c55cec1d18bedd276d1454f93ad28c72d921dd6600d8102710770f52b79ee8cf445f6781c2ca095c9a25d41489f").into(), - hex!("95d541d6196c1221dfa5ff213dc3e658649a3cd4afc8e738631fc7b6914bf0dca74f41cf382fab364dcb0d2d6ed489ae").into(), - hex!("a1ab2fd361b973027f6ee6a9f8f2c081cb5d7199d69e36c280c7f9c3e99b1cfc994ad7f68ac0cd78c61bb419251fa14e").into(), - hex!("ad36ebc0cf82369457b665dfb2f8444fd2add0b49658cef2c800ab0297bade2c0249bb124f3d321536933128c1149c92").into(), - hex!("8f917e000d7688a0f508777b8db7c0ace39677c4458d7e50d8c9dc59d32faba4abdedfce3af26cf3d04c020e526ab597").into(), - hex!("aa994238e432c51896efdfa240f75fe40f1b1a7b624ff0aba66a35f827b9bf1197de3cdc0bbd9d0147304061ced0325f").into(), - hex!("943da065ec673dd41351270747e40c1f5a8dbd7ba259c501349ed754ffb91c56747a78c392cb4b78a796d748044798d7").into(), - hex!("b0c45ed1457710daa48edf2e61ba59988a8257ddf902318c6bb00be7a4ad8235b46180f7353d9f0c0f747a4cf219d1fc").into(), - hex!("81b56da0943d2940fc8041a51c74dd03f6dcd8a705ef2ec3b685395e313224861f29de31205d45e944e437179f19398d").into(), - hex!("aadd5eb1be98f3fc7e93925e46062353576ef2ee81421fe3f6850701728b8f74637d66cbcd344364565b0893d8bdcc9f").into(), - hex!("a5dd3dc1e172c899f4ed17fbdb842bea7d7f3f0d6b284af9749e25acbfbb2f9c1afb1848490bb22da9ddfeef30232323").into(), - hex!("84ba149e940db1663271eb16e920442bfeb035fc601a7389f85c78ce7bf27b13b5c1a5625d8b45dbbf199caf2d753bf9").into(), - hex!("b5634eb31a68f45a2aa17e8eae7752d8a58673fcc9efad34118b0f3db7415edfdc27166e6d809406da0bd26a0ae1371c").into(), - hex!("a2ad4aa94a40f1c159c7588ebdd77b80edbcfd95e867ec6991f711d39b4dc911cfb6da6075db23bc090218976e9ffa38").into(), - hex!("8de6002f3e789b014254b32161b5595257eb01ace67a8cd9657235e2d04f7ffce6ae0d059488bd9dc070c32b5b7b3fb3").into(), - hex!("a5f659b41f35fe6a9f43d1f72c803da876ee4aa5b879fbe5d5e93be38dcd5f10716122d83afd003b79b8120d83358884").into(), - hex!("a64e6b71dc6ab9eeb17d50e1d2516c5ae63680b50a6077fd870780aebffca70a8b7f8627e23731b79b3866813a20af0d").into(), - hex!("b0003260e70f86eeba286d3d9f6d73bf15f084e7240d9aeee38a1173ea5c47fd9a9637384204001873732e6a407edadf").into(), - hex!("8d4df6703cc9f1d0760c67ae6b20928ffeb6b13d67bc406b8a534ecb07d6ef415a106ed992b50267677f7d114f9d69c3").into(), - hex!("8cb982f382ac327918387c16c73de1ec5ff979923f1110b9660836ddc2f5f742aaf970700f7b27fb2fdacb126d341353").into(), - hex!("b6988aa5e4043e278c01c83a9774175b1188bc2d78b96817a7fb406f86aa4395b7eb666267e819a5a0615803f840171c").into(), - hex!("b69c70007de643e3fbaf7b557bcaaacb67288ef6ff616c9c89dee0cedd33a76396a90cb44207225568870c7c5601438c").into(), - hex!("971102768c0dba73925cfff2053b1cd8fa88f5c21aeba2cf3a78ac853818bb4a85cff714134879e5c7d7c7994cff20a7").into(), - hex!("b00b8d49b1f1fc0e792e257b0c3c33ab554fe231aaa6366f5aac11ff35051ae23cd2a5c6b9eecb3ad00e840c78d6a587").into(), - hex!("a34bf3b6d9659f1a89e40e3b35afe741a670a3a9305278a52d479535f4b5973b23b10ccdfa194cb2937f150beca3535f").into(), - hex!("a84c4fd757d86613a4bfe72cc9d7864c2c236b9463e365441360686e19f7f772ebb6c07a24c680462ffb1f3939c870d9").into(), - hex!("b3c34a2470e32395bd9c8789905166ba77b7b7d27cb504b8647dfb4fa6d65884afb2f120d83afd876b4a00cb104347a5").into(), - hex!("b9d18f57a669686eb8ec08555972e54505b7d487dfea7105afc76333138d5f934b9b5f9a3a7896481782fad5328bdbda").into(), - hex!("a23f65babfef6a2442833441200291028ebf56031d7154a4d7d0fa18acd4b7bd78dc34b85924c3073eb5be7733ac10f5").into(), - hex!("80948f3e12ffccd88605cd4d67abb83014c35d8d1a3254f6c546aa7197f810cdd06eb49b99f424187df218c8e8d7254e").into(), - hex!("b24ac23a86e23a16f4f04ed683ebaa51ccc6d2d038674e36d00a14fb71d46c433373a8a0bb75a0afd3c2f9605dd4867f").into(), - hex!("b002aef96f1702f4e3c92b00aa2976b57b77ed97a4d64619c6db676b286c6e633eca63fb232cec0d533a803660c20147").into(), - hex!("9867492f550c1f12276a201717bb4c420bffe904d55008655f929368b664e0293c1dabe9b5a5a71ad884a12686c1d9de").into(), - hex!("96b702733a7ef38b23e45999a04bacebe414a01bb41792cd9aff566fc23610d02e069c85c6fd4173846a40657a958e78").into(), - hex!("8e588db21f84245d034d7427055996f109133b9b3aa095472b879bd180052657da20a48513c1f625c339be90a64878e8").into(), - hex!("b6821bb1a130460ed1936d34cc189980d8fae8c5debc5149d47e90aad69ed3b143a3a00de5959e21ada73a06b3e8c9d1").into(), - hex!("a751ae06c6d699b5593f5928910e1ef3634dedd460ccd3f23d74f5f61a3950392aa66149ae366c048c6c7ece968c2d9c").into(), - hex!("86835cbe686b81fe7e096af5ac8c24f7cfffe2ce2b993626a606e42f6356c0d7c3d4ea19d110aa1a7b7f7ec5e68808f1").into(), - hex!("93719cea4911ce7e436f7b3ea77b9cfb83a1db903cb38f1de3b04d0a69a0f06bbc4f9acd3b313d46113009a917dd5996").into(), - hex!("b0d240c09c137a742d77edf11a7257030ef8b1a785b810de104fb24b22535cf0d62bc54f544b027d532f16b43a2df7e9").into(), - hex!("9376f46ab931f5c58b1be49c529ace24fade089af1af43b339721321a273169c5bb668250b2c2b0aa16aa522e6675bdd").into(), - hex!("82636e68d0d59d20dafd7486176b62ca2d5dd0275c8fff552fbb974565ef2406ff56cff5c43a5b9e383e0b09737de446").into(), - hex!("8f300fd7f29640aeb759d09735f9ac36d1035248c35ff38a165d2d931058268a055971b4fd4dd9d467960180cd255dba").into(), - hex!("a7d5f4e2b01dccd9cd7cbf566b5ab604efdaf9b682bb4ecae1b7801c2f93425350620e91ec807b0a110971c316e68cc1").into(), - hex!("8952700221cb45e3ab933ec20978d9c9c7b873784299b86d0c2d9998bb6b1d1efc1ee3bcd00c5148b2fd9473838ce067").into(), - hex!("b787e77d194e4dfb89968f4e289e97195c2674adba0a3e7d5582cefacdedf93a0e5f27d9d144aab68aaba878fd640414").into(), - hex!("8466c67bed3fbc30e46639de92c422f06bc80df658340a47299ad7798cae412c976fa6ae6bc0a32ce655b93b08cbeaf5").into(), - hex!("ab5d78cf76e16fcfc0491886fc1c95a492ccc67fd31060eb183b89bf59ed6e2d349324f9734c504e74c360272a22f369").into(), - hex!("a4f9f8539f9f89dc5a2c8296af591277c2d308275234729dee23e35e3d541919d1aa9a260780899615e2a895ad8fe703").into(), - hex!("94ed2cf23c5d28497b506515597ab71120f4ca42f7ebc5a4e87b798353eb70590923eaaf163bc550bf312bd6bb2c0b05").into(), - hex!("a78f064aa69402af33f1c9c1bcf04634384ad8528aaf8d28ce1d1a04804bdf93a8b49baddd6870eedf642e566d091af7").into(), - hex!("86796909d2dd3010e8d46c3d99a3c0efcbd4e986e581ef5be4c7810ed8b92268bbdac1dbf1b24d6805df6642f53f0b58").into(), - hex!("a6b555b50ec3b60e9768f407b84c5fd8a055150c17f78f2d5a3b0daa13f2c692e5041184bfc8919280c230c57adc9ddd").into(), - hex!("b4f9b0a0242ded4dc0a4903f16d270f21f2e15668b3abd45f79e1b465bf50074d232f905c6de6f2727a0a9ef039f7681").into(), - hex!("930b7dd8666a35358c6a0a42c600dbe8ad5d9682dfc641474fbd8fba90ddaac7d3ed5f5395f297dd571051ac2d603333").into(), - hex!("abba3bdcee368688a8e53d56627b915148fcab59717174fe8136c85bc24e8d15046da09b31c0c7c9a5bac1016bbfafb5").into(), - hex!("ac199e71110e15ebfb3e58b8ac14f1de8ebd3e0894f273f84783ef3fa4fd16ce6bfa5d41421e884e258fe8e2dce68075").into(), - hex!("a53eaed94fe550c07375ff5ed9706d69563bdba724a4022cf7c639737c97683f036400dcb87268184a9877eb116bd479").into(), - hex!("86e8269c1b368228438de5aa4065ab9d2888de7599b00d5382ebba8fb0600cf357de27e20edaa50127e213c7f6be1f6f").into(), - hex!("8f8d9b9b03b178d370a9e918dd54264f83c4ed20824be79427cbc973a9acf3d74637e5c35080192bb67e64390299c19a").into(), - hex!("a230cbc17aa669c2a9b02e736d20519d93a6fa1b6ed452e065fa78a0fb4b3a0f55fcbc5e719db6417353ef0798f70b43").into(), - hex!("b4e28c30e57cd33fdeb257cee66389365f4a1b9847f94e8b0552c65adff5719e51d50ec8bba36a71ec24641ce4fc6338").into(), - hex!("91799f066e16f9a07a419d3e425c959052f8ad1aee0e2f613d3b023829fb1946c81b16e8b733ed03ca924d03481bafcb").into(), - hex!("8ad935420f026b166233ad387c58857eafdd2fcd4efe55ce1bce9ffd668b8997555927fcec88b04de795129a10263d1e").into(), - hex!("a098f20bf1ae2510f1955c586c7115a29c64bd22a086a2f2a7ff5e08349bf24086504a1e5e1fa82b3aa73a097bcd948f").into(), - hex!("909a3d2e7bb5538bd89c446aa53f1f05a1ec17c88d793a310866cdda6e5d836d53fbb80afbf8baa8aa49db3836c912e8").into(), - hex!("89e64879667f34f1127cfacbd9a3337fa28c0227bac5c5ac907d6ad9c3a853472f4f7cf093e3b735968229398bc7c94b").into(), - hex!("b6ea32c4d640f9b7de841575a00003c1b25d0a845eb54b065129c271790bf602cc39761316c4e9dfc1644ae3ff4b05e1").into(), - hex!("80ef23a1cf6f50f96d5b4645bc79ed4c958f1394da9e5cda0cdaca3815ac8435a8d3a690ed19665b7cd1bef8bf7b0366").into(), - hex!("8b7346d1f30de7e50e3d3b32b441ba5681335d25ae6025623e1469466addc5515415a29ecfed987e07bd6a85ec1eabbc").into(), - hex!("99277ae52f7f2f193549739a704aa2f756c2ddff68b9848040ccacc675fa12d62c9fc1318daecba514089537a4e7b83a").into(), - hex!("94d392e29a3a1b8ce63c52288fdcd3f95f80bdd2a600626e2ce3517162e69b9c0eb36bae6786701ba12e23a33b8f90b4").into(), - hex!("8f270be40047911a4cd5997668bd6d62c90780882451c544ea4bdebe061a9e61bafa1d8bb8af62e0ce4fd73611a7f34d").into(), - hex!("a841f7229fd0490a853523edbd12a5dc6772bd607afd0516c582a813a10fd74d19f480d02b3e7b7b6256896620905976").into(), - hex!("aaf65a2e4e6a3d903ccb51a063d64688590a3ae54c7df3c5e8820d88533a6f10b81b130ab476c9f16c660a81f66dd3bf").into(), - hex!("b3683ebb70696339844ccac03925ec85c8dc06959608527a1744c23a67a805e71b5a91610fc6fbe0f667d054b4087e37").into(), - hex!("b042a5614245184e5a4620cd3a67c51811fcc0a0dff63ac06dc8030f01d8343ff0bd39ab3cdc3c09e4f3c1503ed35e62").into(), - hex!("8a343ff96dfae2c2e62558db3cc424b3c055e2cf84b53f63bf49c95d98ad0b372517df7afdb189007b7db725a3fbd567").into(), - hex!("a3a81a2b37160a371ceee3d07194a70e58041a3e6f75f47c4d8e2c619cae3f44b2de5703e3b80fbae9778e284927170a").into(), - hex!("b9554f94b7c611c2b3f63df5ac0f920d1eaff7b424bc8e857b94c354aa1d3c02a4348510099750e0af3e16dcd0f9a245").into(), - hex!("8678aae32f5bfb9dc249a39eb5d0638bd45d48d2b5b7be32b5e1c2be7b8d29d7198a15e2c24fa7813f060309f2493843").into(), - hex!("85f020a228f8952986c979028dbf2c2e8e59191970ea5e4cff6e6bb46251138d9edd90a211ccd53fd395db8addfb6d71").into(), - hex!("8b0801e8ea30467063d68caa5d3315809b3f21c7429f256fc2a10f7e173f0e1d1bbcf59e025b9e44238a53ef1b8318d9").into(), - hex!("a4d3fbad305853d8057c09bb10fdea9234ff90d51ad0c21342248895d77ead5a8c104c554e6008677e396b55d4efdea5").into(), - hex!("a7f12f870c5a3e2332f10cc2db7dc26ce58a94ff60ebc28f3ae06e820e6514d80c5133563225011213e53f51f748413e").into(), - hex!("a94ed25fba32b4302fff40e2c55e06b6fa4b9820635beb0b43df61010ab5cdaf944199bc73c4827214ae1f57bd75e70a").into(), - hex!("8607e973bc67d217ea67104eb538fcaabdcefcaa7da981ae0322916f7a74229b47f18820458823e7ef160f69f5363dbe").into(), - hex!("a83206fcc995ca57583c5952bef2027503308472bd712c536050217a391bf0fa9617d956ff6c913c2566cbc515cb291a").into(), - hex!("b9110bd697c294a0905503490d17d5536ac1782514bcbdd6f67e8fbb75c0922b39cb7f742d28cbf5356e4f1885b060c2").into(), - hex!("96e1d2b723a458f6b8cd4a8b2a83f33fc7931901cac1fe2169ffbf7c1ac8b4d8547165af3dc61c2b37ab88d3e81f940b").into(), - hex!("92cddef13af28962b7e281d5c0552ee5135b7a401944c9ab31d617b072cf00365e24dd87f86f6618b202d51c25f63fd6").into(), - hex!("a751e27a646ac1f3c828cb88585aeae6899d0940252973329b0589b05714bdc1cd271bf745d482f670f4ccbcd9a60d98").into(), - hex!("861fc00a2edf468353c6012a89ab7cddeaf964ee387e5eac48037eddc536df3d097c69a689f09bdad189384719d50e0e").into(), - hex!("a7dda298ac153aaa6a59785ed7b6900362b1220588a29b44764cc45834859bba0f5b9f8f17bba97fb49fa2c7ed4eb65f").into(), - hex!("a6b679d47e1ea1469e5dc14e1eba97ba2a0f2cec0a9a0983ca086f917298c93af45de60765aa2cb3759ed62c9eb5e4dc").into(), - hex!("b95b1f4472f8f69ee010d36db46c268c59cbd13864c63ce9e6a4755ad00c2db04c951e312b88060e8411018cf655e76a").into(), - hex!("935883b9eca730ef868329a67fe99ed5363b0384e7e6f97147d4c80a76d9b2d8ae6783e80d103149a8a3fbfd51f9f6be").into(), - hex!("ace980d1e3c76dcf78bbb87f3ca9bd0bba7897fcf9e24b27e00fa22855b1b4ac224137361ef6817c94fcc81fc3d3a3de").into(), - hex!("a614b6f113d74d4dd6dea66125b11195212031fd7d3da825b24739e5107cae653fb89c34527b399c43340064a9744a6e").into(), - hex!("83c27783856f9af7491ec9fd34be730600afa59484cae9d3981685cadb869dbd05555a07b93db7d0f361c9ae8e0bfe73").into(), - hex!("850f1389e21bec1c8785d17316a09af9355d32b75d02d9ad72791cfc5a411595a367ba9eb641c5b7acd6be1ee21579ea").into(), - hex!("b810405c7415c49bce0f7893aecde90da33b71684668877c5d6cdbe82161f9cd7eaa2d68597140e39fff8b9cd67424e5").into(), - hex!("a5923930d34526d70e083f4633de4766f04df901ca3adba4a462d03423b609d9813b78a2fcaa2d770a5abc27c260c39e").into(), - hex!("a6ec439bff50a4bef8d0cd47c52e92cf00846ca3fe97cf88e5b6d7800ea22d0ebcac49d9ecd123d4c156642f8bb4389f").into(), - hex!("97b7d3fbd11886976291a24e9e7d6f4974345e06024121eaf57097057c103b6f548d1f523416cd6b465e8109aa0be911").into(), - hex!("b45f04e0d4c17df2815a6fea2b04fd7cc2cbb8e6789084e224db3c1d00db1c6f1d325a63df25ee4a9a992553dab420b2").into(), - hex!("a91dc563b48b4cc210119ff55bec2957e8be50aa25928147d0434a9ea4088e98ba1f17c2050e713d2891a3c741ea6c6c").into(), - hex!("a12256c39f3b17c0540d2d3442b732b2485ae9da240a1ef47782549dc7e84f7a9c9240ff59a73fad228a3c01fe953169").into(), - hex!("aebc98b50533d844fe3149735750c10eab861e765aa7820e3d54fb66089ce15409206bb58d3aae5ef22a29ac5207c702").into(), - hex!("b023d0e4fc2eba4c60cedae9d2ffa79cdcd5c79279fa41baa94f536c17d746a6aa76e8fe203fb1678da126c4343eed8b").into(), - hex!("a673262367bde5d1775961c7d9aa26d9859c59600536130f9adc8f99f81f0106d2eab2c5ac3912476affcab3821fecdd").into(), - hex!("8008298954370c0c3026fd71fb48fc619caa394c9ea17273284a903b07de1d385336fad69c8ab6fe6692774d5fabcfc1").into(), - hex!("a98a824454bc0fba41a6543ba11ec6879c979e97c87e3f7f3a228ba995e33bcae9378740f925800b81d3627f2af36c51").into(), - hex!("a29c667540db41eb7ce06d74ad91c7ddeb3e1f019a028b8ed4ee705d8d079d6f7d36f1b64fd4b9b807f0dc1ab3d65d2d").into(), - hex!("86c32be8a7155f26696c1e541096ab43b3836315490a4bdad867b973ebfa8ac414e4074819b9639348a048bd6fc4bdee").into(), - hex!("a0de748319bb0c53c03f172c9aebc4f7538dfce6ffdd362d24ffdd111448277a8a705832e94f65c61aa635a5f40b6f0b").into(), - hex!("970de7621ef90cb3921f747ce1cf9d389f322cebc286c339395714a6d40167fe26e04e1fc3116d3b7bea1c99bfedf0fb").into(), - hex!("841ae6b0bdd22718fd917ca4a871d39cf6811b9a460b99422fb324235b2c51b460e48159d7e1bc1778de3513b7ab1f29").into(), - hex!("86764a78587892407b311892c4c4e70890bd757d3f72a832257f411646e9298eb4f042ec1c929cc6ffcf539dda90fe7e").into(), - hex!("b33008c5025d35243e91b6749e7d7934bd8334e5f58e88db907715435a28f02d018b09127fb0302d1ee68d7f97391040").into(), - hex!("b5ea29ebc8107525894d9872ac88b4c9662fd18d87316565a8b013529b478f17f6c1c0ddf6482db6ede54d27c0e80782").into(), - hex!("9576def9e5dd8673d3dec2090536672d44368b78b2c2f70dd9e36a9d0e5889cd9e2a47b77ebda94388ac75679257b829").into(), - hex!("823dd44b4635bf095786e47f836c4af02d4dea848bc1cd823876266341d56496e09bec8612413c302fb34c3383a55e0e").into(), - hex!("b6a32b13f8b1339b0591b9db343696aab77a0c2ff181d2069ff39581da8904499d619c26e6e44209b7791c3aa2fb7aa2").into(), - hex!("b9b3262a97049e236e29afc4a7c6d2e2253f437e013b90bd0882d35d46d7a67e1344b3dc822fcae27717a9887d842a81").into(), - hex!("8a94e08cda133175049eb2cddae936b16c477db54a749b8d3378233034f56fdea99520755ec8eb355b738af61138d9a2").into(), - hex!("a55933f63c4cce4d99d8df4fe6dc9d9a3054379ed2560bb2a9147f9e456925ab29f7b1f14321ab2501d67dd759f5ef36").into(), - hex!("8b5a713fb50a2aa0671f1405876b0a829a5c1f7c9915906bcad26de7e2011f8eb2e2b7a1cbf94c19685edf8b364f242d").into(), - hex!("97cd2419d4aaabe457b1efa6d2e557a0c4d8725e57e33018626fb31395ed78555b79cf90da49975360a497049004b20c").into(), - hex!("90d640d0c949a73543b476e0b634d442c0bbe0f4d3f1f4f99d19fd8d37d3b99c4bb3c5c08ee77c24f0af6dc7c29ce658").into(), - hex!("8f65263c9ac0026d9a536360c8b01b40243cc27a7896fada367372ba82ffcf2c758bba9f92c96fdd66956b25d7162903").into(), - hex!("ac50c7c4b3201f2c98e812e83452ded2e2dfbeb4c1910b873978c4b5b443b34dde042b13cb4943759cefe1a546bd8197").into(), - hex!("a07a157ebb964282729ab09205f5a2df132b5a0103233dca67dd55215b84e66423c576c6e0b055bf85c6a27025fe1aba").into(), - hex!("b89462ff76b35af9a1f23bbeb7f3b6e2f72f4d96aaa30fcce820573654895c76d813f27dea9251c96ea9e3f1726da99e").into(), - hex!("a81866a83434f91d464a93a50c4906224f3108777f731a1d363d16f769795be8ffd23c25f0e051d8c43a55b665c15bda").into(), - hex!("a974e15a6315d56d612f5e8d70171b01baba976ae1602265cdb74e1f5cf3a48c94e8b90bf1d343f3f56f8f9ece604ecb").into(), - hex!("97ad199e4ba05c97c5aa90cc6e63ed86f78fbea35b9f56f5107df643efe40647d1ac7e50cf6e1de8b4ede8e2225e090c").into(), - hex!("a67c3822c0e5902355fe053c3c41765146018dd90de0df89c6ae230826056e91cad2a28f06859b8ea899486ddbdbe6fa").into(), - hex!("a5dd8329edde8fdb8f82fb71637c7a4d1e13c51ab2b24cc98b80952575e821fe31c3e7de5a566f8a98e0243cebc6d1d5").into(), - hex!("b7070e8349dbd4359414c0d909de10a472c4a7fc4827804b3e1980b1cd8f468d21d4c6163c234c05f05534e423f6199b").into(), - hex!("a1acc31ccbb89ba6ba5be3ffc26ef83a28c3b0f76be71f87ef618f9f8171c8afdbc5f05c521c67171ea9fde1bad7a9dc").into(), - hex!("a86d620245d119b34f55c6145a65937e5ed5281803675e120d8c2de05eabc08f85eb8d8c877aebf535663518c4fe2f88").into(), - hex!("885317798c5b49430d50d5c5eb527540b0b704794d88d510b2511e9fea2de299d8f2cf2ae2e96196a9c0925ab1f30da1").into(), - hex!("8a5c37ad34f1867fc9fdd3303ffb86fb0d98ce27fd6739078949c070b44081349368302d7c910fd3d886165b5fbd3304").into(), - hex!("a1935e801664a3f51c22e616d25fbecb3f3be76b936e4d2dc28a4bbe79d002ddf01b94cdf9e18d07f2e2c4bccdfd76a9").into(), - hex!("b3d13a611ada38fb6c802e6f7e09d03703e9e7bf82424ded2774d6493dc0c7d8965e7839ff4d3f9fe00a1e8fb20bf13c").into(), - hex!("84f6edb320cf92e147ba3ba8b2470c57dd107b80ea8083219d3c91b77fba7b20b6774ae7ace26924c02c9a2247842bcc").into(), - hex!("86546f16627c3b875790b604aeb19c925f6d32db27c2ebf405df0324095fab1f8b748fd94b6c2b5a2dfeaf748a565b3f").into(), - hex!("b95563cebc351d8237e5f9b8ab984976e84ebf7e16c62102629cbda06c86b013c6a973d007d72a870883408b8343fd1f").into(), - hex!("8d5eff4d3238446be0f805b8f387fd57f298dfcadba88a0d87234bbede46d0ef833beb0f2ede7a51fa84a808393757b4").into(), - hex!("862179dd50e7a0fa7906248c0f3671d8d3b25504e30276da74a36edfebc8c92a04abc9dc3cba8c1b34005beb06cceca3").into(), - hex!("b12bf5775e3f9ae29da6b127ffe2892d5dec12f9c1bc21426c225220cb0d5fca5c6376afb5bf5f112f79c6563694007d").into(), - hex!("957cd40aa0864b86bc64420a184988be4489c0f0a3363f39571e71a7443ac6815a1b8ce4862c736be8441108dd78101b").into(), - hex!("8f31cdb655b66e1f8ad877639f71524aa78c09acc24aa493bd6f6be383c295f51a6e70f2573081cf87cd41ef55f5428d").into(), - hex!("a8f304c1f2faa78683d409dbb0c11e26583fdfe845f2557e378c56acc9baaa88cce25442733edcdd0da70f3e5557e53b").into(), - ], - aggregate_pubkey: hex!("870e9dfe2c909b7116a9a4180da4fb6ac4865f9304adc4c36dde6f82338c43352b58dfb494e6095bfade1dbf86e7f939").into(), - }, - next_sync_committee_branch: vec![ - hex!("d138fae7ec85d4d5ebd8d7375b3f39f4bf0d05439e6920a44bcc977e62ee0dfa").into(), - hex!("a6baa91932e6f9d9fec678e9fd75a140c8e74bd87f11d37093839826b95ceeec").into(), - hex!("926c0348ccc4c44119ca84e50911ac22078ab704b0784ebc593155da5c5adb53").into(), - hex!("c4a04575645ebf0cf5b3317a092e595adf49dd93669424c2a5efef700ed082a1").into(), - hex!("81a062566009887529ffc6350f713cd2aa30460c13173fe9ffcdbde71fd69f8b").into(), - ], - }), - finalized_header: BeaconHeader{ - slot: 5808479, - proposer_index: 218610, - parent_root: hex!("ac0c3b35e7e21d11d0563f98fb16bbfb0460aef2ee5fe39ea209aed66694601e").into(), - state_root: hex!("c66e3a4f1718ce82f35c898e8df8080c540aca493a535a2f6170a13b550faef3").into(), - body_root: hex!("207806f82ac8c5bdb6793dc61f31ce91dd06a7fe3a143d29b6579975c64d1d9c").into(), - }, - finality_branch: vec![ - hex!("0bc5020000000000000000000000000000000000000000000000000000000000").into(), - hex!("8c04962a994aadff4d3042da73e167e666323757db5b0234a497c7ddba058ded").into(), - hex!("95901d6dae3edaab0f29f2c6155edbc4eb3980b6816339a464fb51b91fafdb7a").into(), - hex!("926c0348ccc4c44119ca84e50911ac22078ab704b0784ebc593155da5c5adb53").into(), - hex!("c4a04575645ebf0cf5b3317a092e595adf49dd93669424c2a5efef700ed082a1").into(), - hex!("81a062566009887529ffc6350f713cd2aa30460c13173fe9ffcdbde71fd69f8b").into(), - ], - block_roots_root: hex!("93a5736680a9dfe23df1f8a6098c0671c583dae469847e25da3532b3649ae11b").into(), - block_roots_branch: vec![ - hex!("31a647639bd26edd8e3976b4475933d18d7d238210881f57570b7b4030133da0").into(), - hex!("0a3392c5febec2f099f93c5465c68f4f1630927d0326ad84c8d0b318364dcd82").into(), - hex!("986071ec073d43597d67a6595f7f6fc807ef1042c6821fda41ff80aa2717536f").into(), - hex!("732f545955de627e65c46201f053569dceab609948147690136bc64e060f38b4").into(), - hex!("2e7c74db495877af1e95da27113e89757ea475e8d672d319e655810ec64d4ba2").into(), - ], - }) -} - -pub fn make_finalized_header_update() -> Box { - Box::new(Update { - attested_header: BeaconHeader { - slot: 5809441, - proposer_index: 169069, - parent_root: hex!("a4d2fbf3ee62f32589738f386559a1e2358f4f54aff5f7eaea61144d3d9c00d1").into(), - state_root: hex!("4aad4183bc21fc96c90f8e043049f8c1d5ed205c6880c89cd99f2e080ef85138").into(), - body_root: hex!("406c96c6adad01df901df3625cbd622f1d541249b05c768ccc4db5643d973141").into(), - }, - sync_aggregate: SyncAggregate{ - sync_committee_bits: hex!("7fabbff6fcdefbebaefffff9e37dfffebff57f7bf3e3efbcfef1f7f987551dd176f3b3ff7bfa3fedff5fdf7f7afff5ff777bef5f9f7fe65f97fffe7dfdfffbdd"), - sync_committee_signature: hex!("84dc756c452ec9a3ba01cc98d03cf5471b871e9f3f77ddfe72ddf6d5d318ec3de9e5c1508e47ed362300cd45a144655a076d50073c24a67591b0454d2a4632bc01e97eab80f937a8288131a31ab76f400ba9c26a19df176c7e67b724f70407c3").into(), - }, - signature_slot: 5809445, - next_sync_committee_update: None, - finalized_header: BeaconHeader { - slot: 5809375, - proposer_index: 170923, - parent_root: hex!("87fed31787712fa6e802b9f296c1eb0b0ac5bc77f6945d4478c4d25bd7160d1a").into(), - state_root: hex!("246ac89e1854bada03be1da64081954e008238de219088609ddf45efc8000346").into(), - body_root: hex!("ffe0fdbdc2bf57bebdd084fce3820a13801095d236a2fb8f3a64c9d7cf94f8b9").into(), - }, - finality_branch: vec![ - hex!("27c5020000000000000000000000000000000000000000000000000000000000").into(), - hex!("8c04962a994aadff4d3042da73e167e666323757db5b0234a497c7ddba058ded").into(), - hex!("95901d6dae3edaab0f29f2c6155edbc4eb3980b6816339a464fb51b91fafdb7a").into(), - hex!("34e68ed57efdf18c5d2f455e77fa8b2a5be95bb827bdf7f7f6648103688d84b7").into(), - hex!("fc1d45f882aa66020a92c55da663ab9758581a020eb7336173fe84ef861bbdf9").into(), - hex!("7d1745c42ec44d4b2493a55dafdb770f6d38eb4a7ad68ae0264949cb7432e4a7").into(), - ], - block_roots_root: hex!("9e5aeee5467301f3a44d1ab664cebd198519423e73e2118ad046d9bae217f497").into(), - block_roots_branch: vec![ - hex!("ef671e41918c36e23a3673407050b420366022886dcce1b707622de97a695121").into(), - hex!("707cb79caeaf310c10ce1c177312e48b2331164c8327d2635203148c4d974f09").into(), - hex!("1fd802c27384482fdaacfa7406072f6f96ff5428f003af748068d1965cc36981").into(), - hex!("8a31cc13bddabda4f79d948e5e3d70806f638b61d89c87b40aa7131af43c18a8").into(), - hex!("70eb43218a3a6f619f1d0dc7f173fc9c3323fa7e3824ae6cd79af2f7d19634ad").into(), - ] - }) -} - -pub fn make_execution_header_update() -> Box { - Box::new(ExecutionHeaderUpdate { - header: BeaconHeader { - slot: 5809374, - proposer_index: 130336, - parent_root: hex!("2bb54c61560a80d1cfb0528e8ea207dfb9d55ab49238523e21609a9ee3b8a9b5").into(), - state_root: hex!("0116ea76f5c36373dfc8e039811eba86c8e8e16cfe9f0614376559b6585741a7").into(), - body_root: hex!("9a10b47e30bc11fc2ee1e21943a8382d727444f646f09664192236458b555ffe").into(), - }, - ancestry_proof: Some(AncestryProof { - header_branch: vec![ - hex!("eca009f3262f75b055e6c919e2c0a2c017f017e581a825a2618a2a76926a264e").into(), - hex!("a647371a5590630186dd47b9b8571f27e39a77b4aac1f763fabefe104bf94985").into(), - hex!("9a414690540e4c87ff5171b619b3ab6ff1115c21f247196989f5a0a9085b59a1").into(), - hex!("1bf7ae16fcde0833c6e97a83b72aef31a0b5ca055b87f86602b9b4aa193f557c").into(), - hex!("588d993d05b59bf3352f0f5ebb4cd3ec97ca3e41800da675996741e8fca374c0").into(), - hex!("fdfc6280944bb0a18c9cd0afa9f4a255719a4650233f19de478399276f198c92").into(), - hex!("1d96235b47c604f029b9ab7eb913b13b3c0c2df7f79e3301341b1ec38ea44e4c").into(), - hex!("3ee3af17ce8f5a4946d30b6bce7d6e7580b3981cd2af92246401e2326224f6d1").into(), - hex!("b53b5450e070adf02f4bb9d7c65dd131d07ae2218340eec95ac8aa5e5cdd82aa").into(), - hex!("4d7c09715a1f25574afa1dc3dd7bb44e4c1a723b9360c893b8510f675f85227a").into(), - hex!("38c159fc38dedc1e4f399a3f773ab4376fc40b126634b40d172d5daa6602cf94").into(), - hex!("9faac6fa44ed19fcf530f77b7090dd50dd17aeedabe763931ab7567276025a75").into(), - hex!("c6549c1b0f0027ac373164437e7010b955fbae1a0e78485408ec33ca906beb2d").into(), - ], - finalized_block_root: hex!("f6e721e4e65d9565091a557705285ec6db0a3a3072317317719ec8ad563859a3").into(), - }), - execution_header: ExecutionPayloadHeader { - parent_hash: hex!("6d51d7c94763813ffefa234097a51c6fd7009424d2991695f7bd6203157c86f9").into(), - fee_recipient: hex!("000095e79eac4d76aab57cb2c1f091d553b36ca0").into(), - state_root: hex!("fe9f753520a7b5c0263bbf4fdba728f69e9cf861ce1883aa13de5da30ff75d74").into(), - receipts_root: hex!("cf6ab47d8fc336155b18abfa2d965aae57d9d35a2fcf5cfc992b8dcd136958cb").into(), - logs_bloom: hex!("8427414fce71480d7e70cdbac68dd6f77608c05cf349c34c87ad3256e8dde9e3f9c52131945876c03b6e83ea5970536428283a180eb40efcc5fd834ce424f0dbf622dbba6cfda7945cc1f93a1b6e7ae448c598b4f45f7cfa933fe9808d835cb86e8a38261a031448e262f8e4f2dc4c3254c460e5faae4b518438c1330012154a1ba33ab7d85c8acaa9c47dc582fd003a771c9b09aa16c34d4f0c01fbb3f8c0a28e11d2eafb4e73b75a18e182eac7c021706832a9a785836d31f651efacf88a329334e5b3def3bf1871573dc3553f415f298a9457f7837a31302937a4178be1339cdbb83af329ae7e88d8ab6cba62f018be139896ecbc7ac11ef24b0b4ae343e9").into(), - prev_randao: hex!("5a76eff974d26bf74dc3003fac473ab4abc541be26bd61f124a1818a70ea0b3e").into(), - block_number: 9143323, - gas_limit: 30000000, - gas_used: 28165724, - timestamp: 1686220488, - extra_data: hex!("").into(), - base_fee_per_gas: U256::from(2267_u64), - block_hash: hex!("e4a67cdb1512f29ad9b331e7a37cf8e376222eafa58e72cee7771ad582cc0610").into(), - transactions_root: hex!("bd7eaeb676c14c37bbf0b6f3db2ce021a04a41dbf002f6c7df3bb61639ac7287").into(), - withdrawals_root: hex!("8647d3ecaaf62e1d087c5ab54a23f1d64f477b7ddd16fff458847181d89fc432").into(), - }, - execution_branch: vec![ - hex!("795608ac1294bcc663127b8428513ba4a5ffe952ff72f8322dca23628f13d716").into(), - hex!("336488033fe5f3ef4ccc12af07b9370b92e553e35ecb4a337a1b1c0e4afe1e0e").into(), - hex!("db56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71").into(), - hex!("2a8f5c65655edeb2800f248f2e14044fc651061d0c00c8e8b627cb21ba421fb4").into(), - ], - }) -} diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures_mainnet.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures_mainnet.rs new file mode 100644 index 00000000000..4b88d887091 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures_mainnet.rs @@ -0,0 +1,1215 @@ +// Generated, do not edit! +// See README.md for instructions to generate +use crate::{CheckpointUpdate, ExecutionHeaderUpdate, Update}; +use hex_literal::hex; +use primitives::{ + updates::AncestryProof, BeaconHeader, ExecutionPayloadHeader, NextSyncCommitteeUpdate, + SyncAggregate, SyncCommittee, +}; +use sp_core::U256; +use sp_std::{boxed::Box, vec}; + +pub fn make_checkpoint() -> Box { + Box::new(CheckpointUpdate { + header: BeaconHeader { + slot: 4058624, + proposer_index: 631, + parent_root: hex!("4abadda13b61df8d40fcb061d1ec15d0fb7bc5144252bb54c57b41893b642bf3").into(), + state_root: hex!("6fe9fa01a04dcdeaa64eba04a72fa6dbadc8596dc5ec1fff2ef343520fe722e1").into(), + body_root: hex!("6cd83df0ee7669e06e64496a1d2be083bc3bb9f2da17e9b1e62979d200328106").into(), + }, + current_sync_committee: SyncCommittee { + pubkeys: [ + hex!("a13bf1fc1826b61cceefcc941c5a4865cefdfa6c91e5223308fa6a0aa6e7b13a0499a63edf5d9fff48fdeae83e38dcbf").into(), + hex!("b3285148b91dab139b053442bdd14d627ba1e1250fe469f0f2df854b6e6ff4a18671ae3879ec9f7d8091f99f092162e9").into(), + hex!("b00d95908e72c6051478a422eb2231b5f797c2fa5c696ed1e6b9c9996ba1d8236f512443f18c01ce63312c38fa383fd4").into(), + hex!("a866633b4293e726accf6e97ac90c1898cac83e8531a25b50ae99f0ecb477a692e6a5f2488447ccd83ed869ab5abc406").into(), + hex!("a308ed8737b3a9346ff20dc9f112efccc193472e6fde6aa218ceae11e288bbd2c35fa45c1d8bb238696a96767cd68b46").into(), + hex!("81534e2a182da0c6831479c7e722953d267ba9c63a204ac96a178b1dc90d0a6ba8737002688ba5f102eda5669249f114").into(), + hex!("87c5670e16a84e27529677881dbedc5c1d6ebb4e4ff58c13ece43d21d5b42dc89470f41059bfa6ebcf18167f97ddacaa").into(), + hex!("b37334c41a3456b73b61d0eb0777260af9c2e400bbec0e0c0fdb45c39ce0dd19f021d9760f35da801f20486c6be30e9e").into(), + hex!("ab73a043ccdfe63437a339e6ee96ef1241264e04dd4d917f6d6bc99396006de54e1e156d38596ba3d15cb1aaa329f8f5").into(), + hex!("8983fdebbeba6e3cc3ee1c9feb24faaeee712356975e359b0ddca3f7c9c7448132d665f54a4629002252d3fcf375f7b0").into(), + hex!("a03c1e287ccc4d457f5e71e9dc769294835945561e6f236ac7de210d2e614eee8a85e21dfb46e2143c68de22ccee8660").into(), + hex!("8e6b888197010ebadd216da35b9716daa8675d93b3c33a96a19fd9ca42624f6b430b2ff115cd0f5b717341605dda24bf").into(), + hex!("8fb51e3ef3c1047ae7c527dc24dc8824b2655faff2c4c78da1fcedde48b531d19abaf517363bf30605a87336b8642073").into(), + hex!("893272a63650b08e5b8f9b3f17f8547b456192ad649c168bafd7166b4c08c5adf795c508b88fd2425f7be8334592afb2").into(), + hex!("a90c42266ca0a65976fb4dc18465b0a44a63ed3b2747cae74e46e3ccf158f98384e2e86c852e7c5556b083b3ded9d243").into(), + hex!("b67c621d9b6313a9f6744dfcdd77d4e9cb4bd413fb5e3199cdcd7f675fc39f1ba492860749bfddf98f4088756e844a98").into(), + hex!("a9760afaa51002be0948acf7aebd90ec4e60e0dba8456e445aea93408a0468b62bb6da4984b92f8f6061561c9d56f4c4").into(), + hex!("981b2d7c56ff38f1d02c5d7a7f8bfe71daaf94d48c3bc93e8083a0a23c1ae1ff05f90312deb09b35d4513c1ffa573d86").into(), + hex!("9515dedf061e654d58a43e4e525a63ad2a6274ea6f20b1d624a6ba7d3062ed68a0226eee6951ab8464906c52ba5556b0").into(), + hex!("901f724ee1891ca876e5551bd8f4ad4da422576c618465f63d65700c2dd7953496d83abe148c6a4875a46a5a36c218cf").into(), + hex!("a8d152e5d94b75cb9e249230db21af31de4d4f3d4ef60ccbf2212babf69aed2a38435a993ee2f13cca410ad55a4875ab").into(), + hex!("875ebfe737cea438e967d70ceaffb4360cce28ecc76c8c4ee612c47fb6b3e89af03c66981571066107323f49a6242772").into(), + hex!("a798a0371e8cc4dc42ccd79934b0db5a3a59f18a0ae09f2eb172596428fcb3f00312e783d6fd21cbc1610317f44e08cb").into(), + hex!("99c629c9cd603a9344b04d22d2bcc06cf45ebf62d97f968df19c73c7a50f4f6a2a2cc7fb633f509f961edfb94fbab94e").into(), + hex!("854410e6fb856da8b997ebf28ae2415ce6e1f9f6a4579fad15b5df61709c924a925397b33fe67c89ffad6143a39d756a").into(), + hex!("a3969926aa2e52f1a48ac53074b764648b4c71bd43430944679628463cd68398f700d874c14503b53756be451c8ba284").into(), + hex!("8ee8873de7cd28a54ba2c63a80b63399effed76b154e96ed26e7c0668b9f2476e298688b6a00c4b2ab9d020a897695d7").into(), + hex!("ad54241ba3de6a4426c788690d3f78d2eb678814edc49d3fb988d7fc752e43512972567bb384bcc1b18d083d15e376da").into(), + hex!("942bee9ee880ac5e2f8ba35518b60890a211974d273b2ae415d34ce842803de7d29a4d26f6ee79c09e910559bdcac6d3").into(), + hex!("96b478b1e5e49d4ea3fd97c4846ae0f781dcc9f9ff61ee022ca92c3d8dfba89c513c46e8bb38b73e6b678a79b9b12177").into(), + hex!("aad9577501d7f3a5dbac329f2c1fe711710869cc825740f365488fc55a278d687bb72423560f7cb2cbd60546a82ea1e6").into(), + hex!("8aa3d9dad1c122b9aed75e3cc94b3a9dab160fa4cad92ebab68a58c0151a5d93f0f6b40b86fba00e63d45bd29a93b982").into(), + hex!("a12fc78b8d3334a3eb7b535cd5e648bb030df645cda4e90272a1fc3b368ee43975051bbecc3275d6b1e4600cc07239b0").into(), + hex!("ab01a7b13c967620d98de736b8ff23d856daa26d5cd8576993ee02a5d694332c0464ed018ebffcd5c71bab5cada850ce").into(), + hex!("96cf5760c79cfc830d1d5bd6df6cfd67596bef24e22eed52cee04c290ad418add74e77965ea5748b7f0fb34ee4f43232").into(), + hex!("9443e6ba4400fb3370c573cd7e33f05e1475f9cf1d6adb905bee3aff8f1452d8d384c8a72c9110070f35c6aad940bba6").into(), + hex!("95c60b5561e53cfc26d620be90f84199ffd6dd9687c1be3a547048e7cba10a0be9bb6da000e7521cbd488d0901d48ee9").into(), + hex!("ab69cf79750436d310dc3c5e96c2b97003f4394f31dfa8a9ac420595dc7b4d96dad5787d93347ba2bc6f196c241a3dbf").into(), + hex!("9145ee1fb6e84114c903819db94fa5a72bcbc15fcb8a7fd8eefba23b156cc46309281dcf78b48a2847b3754f7d7d7a79").into(), + hex!("b118f77f99ac947df97e7682f0fb446175185b842380af4ee7394531e4f93002c72b41a57a7c1b923a4f24b10924c84f").into(), + hex!("a4aabd1890ebf35423565dbff3477a09eea4e35f5a26ed449eab38e0a21fb89e9ddfe3a2003cddc457db648a1b5891a3").into(), + hex!("8ff5d2e6c98b1fea70cb36ea8ed497fd1233b9418948ac58c6c379ed35fb10f8253ef188c909d5e77e81b5b8e2a4ad17").into(), + hex!("a23f076306c120dccf69d7d2ac7f83a377a72d35bf448f88feff8b6dba9307fdabf34452e30b87407b2258b9edfd1174").into(), + hex!("87d2217eb05d657aba7b048cf3c661b463e78e51135a5b937e71975ff5102e596434720f02349c73415decb88418cb0d").into(), + hex!("8bb51b380a8a52d61a94e7b382ff6ce601260fa9b8c5d616764a3df719b382ec43aec9266444a16951e102d8b1fb2f38").into(), + hex!("b0053550040ab3a3996cba5caf9ad5718867b5f5df273ed8c6520761571f03a94e50b5f8a6a8c42d725383cce97d3cae").into(), + hex!("ae50f93230983a82e732903d6ed50a506d678f35b6b4a4b3686a92b12aeb9d34cb095e8562b0900125bbced0359b37de").into(), + hex!("8bfa106ada4914419bf1d8900c5981dd5b90c3023196d7e918d62879fc3a575bd0a25f939366f7fd2240df6108b069ec").into(), + hex!("b3a5497365bd40a81202b8a94a5e28a8a039cc2e639d73de289294cbda2c0e987c1f9468daba09ea4390f8e4e806f3c8").into(), + hex!("b4f583e10aa9af79b4ebd647e0fffe1c720112727e5ffac4313f236737491fceeee194537786c561cd5777b453e5b03c").into(), + hex!("826be957cf66db958028fa95655b54b2337f78fb6ef26bd29e2e3a64b130b90521333f31d132c04779e4b23a6b6cd951").into(), + hex!("aace45334070c51cc8b3579598d4cd8cda2153bba51f56e3b1fe5e135c83ef70503c322756b9cad9d3cd28f1ecfc8227").into(), + hex!("94bb68c8180496472262455fd6ab338697810825fa4e82fc673f3ac2dacfd29ee539ac0bfe97eb39d4ef118db875bab6").into(), + hex!("b560c33950a355119845f63defb355807e56773f636fb836f7746155fad070e384fc1091b8e5c057e4cbc7da9275ecf7").into(), + hex!("820cc2ac3eed5bce7dc72df2aa3214e71690b91445d8bb1634c0488a671e3669028efbe1eae52f7132bde29b16a020b7").into(), + hex!("9244703338879e3ea00663dcde8f11095de3e38df9277d8c2acc26e72021c222ae40bcc91228789fdf0b69acc3144783").into(), + hex!("8d474636a638e7b398566a39b3f939a314f1cf88e64d81db0f556ca60951ec1dca1b93e3906a6654ed9ba06f2c31d4ea").into(), + hex!("889a5cf9315383bf64dfe88e562d772213c256b0eed15ce27c41c3767c048afe06410d7675e5d59a2302993e7dc45d83").into(), + hex!("b544c692b046aad8b6f5c2e3493bc8f638659795f06327fff1e9f4ffc8e9f7abdbf4b7f6fcdfb8fe19654d8fa7d68170").into(), + hex!("aefc682f8784b18d36202a069269be7dba8ab67ae3543838e6d473fbc5713d103abcc8da1729a288503b786baac182d3").into(), + hex!("a0f2092ac34d2363614fb2f57fc7b72db247eb1fa53f395881ce6b4aacd6fb920d6dc59507701d487288102e4c4fa389").into(), + hex!("b33de3de106be61481ccb7f07a7a63cf4d1674010e462388fb8ab5ea08f444ed7a277905207e0b3aa2f00bb9efca984f").into(), + hex!("84173aeaf3d96368dc7ca1ad5e5575da279113567e5815a364a0356a720c5e08cb58ca1fdd891924f4871d3eaae5de40").into(), + hex!("b6d6482ad7b9b412ffbefbbdcc28eb3d091b1291f54f77bdd53c4ac85f705c454940f466dc272dde7b03c26f0cd6ecb3").into(), + hex!("a2053719da2b7501dab42011ae144b3c8d72bd17493181bf3ae79a678068dc3ee2f19d29a60b5a323692c3f684f96392").into(), + hex!("8296f8caf58316af535def398a43357e48cb3b1e674b857eba1bd1b970da3dd045e22fe6d17dee4e9117f62ece3ec31c").into(), + hex!("84faf4d90edaa6cc837e5e04dc67761084ae24e410345f21923327c9cb5494ffa51b504c89bee168c11250edbdcbe194").into(), + hex!("879aea8f09dec92f354e31aa479d00cb77457d363de2d9a51ddf7d734061b6f83d6345cf33dbef22004cd23dd6c4b760").into(), + hex!("b8fca0f7bc276f03c526d42df9f88c19b8dc630ad1299689e2d52cd4717bbe5425479b13bdf6e6337c48832e4cd34bb5").into(), + hex!("b2a01dc47dd98f089f28eee67ba2f789153516b7d3b47127f430f542869ec42dd8fd4dc83cfbe625c5c40a2d2d0633ea").into(), + hex!("a19f2ce14e09ece5972fe5af1c1778b86d2ab6e825eccdb0ac368bb246cfe53433327abfe0c6fa00e0553863d0a8128e").into(), + hex!("95d1f944b0c53eb3e9fcd5632713602bbb9195b87a172a370ae2df98504612a55f3968615a39b569ce6a0fe9fb559be7").into(), + hex!("ae36ab11be96f8c8fcfd75382bb7f4727511596bc08c25814d22f2b894952489d08396b458f7884d6b3c0adb69856a6d").into(), + hex!("824d0dc002e158adef06fc38d79b01553be5a3903566029cf0beddb2248b11da40e66feb168e8e3e2a63ea033a75f382").into(), + hex!("8f9f85ae6377414fcf8297ed45a736210cd3803f54f33116b0f290b853dc61e99ea08f3c422ed9bc6bdc2f42ab4f56ba").into(), + hex!("86c53fc078846c3d9bc47682506f8285ba4551475921fd388b96291741970c34b8de4210202e40d2de4acb6e2892072b").into(), + hex!("853184f246d098139230962e511585368b44d46a115c5f06ccaeef746773951bead595fb6246c69975496bac61b42a4f").into(), + hex!("b91b4260e2884bae9778fe29a2c1e4525e4663ec004159def5d47320de304c96d2a33ad7a670e05acf90cbba3efdd4d9").into(), + hex!("83492e27e07e35c0836aee6bee95d040b8d3e82db6f94a3917d07797800f7200f5dbc6c9596c6c3c70f8f470b65a9b6e").into(), + hex!("b1bb33607d10ea8c954064ecb00c1f02b446355ef73763a122f43b9ea42cd5650b54c5c9d1cfa81d4a421d17a0a451aa").into(), + hex!("99cb1728157a1b7cdd9607cf15911bbcb56b64d52fb0d0117b457853a81ec55913f977850f26e188fa2652579efe9ddf").into(), + hex!("8b7cb5b8de09a6dfceddcbaa498bc65f86297bcf95d107880c08854ed2289441a67721340285cfe1749c62e8ef0f3c58").into(), + hex!("b97447233c8b97a8654749a840f12dab6764209c3a033154e045c76e0c8ed93b89788aac5cd1e24ed4a18c36de3fbf60").into(), + hex!("b4790910e2cbef848448f24f63e9dd4a1b122cf65feecf152d5fde282ad6fcc6ea3f9cc23178baf85612020795e4b13a").into(), + hex!("81fc724846b5781f3736795c32b217458bb29972af36cc4483dd98ab91680d3d9bc18842db2661487d3a85430dc9e326").into(), + hex!("a154892ff23b284040e623bba940a6a1ef1207b8b089fc699cb152b00bcce220464502cfa1dfb5a2f62e6f3960cdf349").into(), + hex!("af3f765fd293c253072b33a780ed68933f78d7e079d9a2079b6232755bedf6ebcbce9ba65c01f695602fa8ee17899867").into(), + hex!("97578474be98726192cb0eac3cb9195a54c7315e9c619d5c44c56b3f98671636c383416f73605d4ea7ca9fbeff8dd699").into(), + hex!("917c4fd52538d34c26ccdd816e54ebea09517712aa74cec68a2e3d759c6a69b5ccb4089ad1e0b988e916b2ce9f5c8918").into(), + hex!("8cf3c29531a17489a5f8232d56c5251ffddc95be3ff7ff61472e19fb38c5eaec841ef3b1ee36756b3dd8ff71ae199982").into(), + hex!("96d4b9b411319e531bab6af55c13f0adb1dd6b4286784ff807f283e7990dc368c16d536fc5db3d992deb4b0278914e6f").into(), + hex!("8903f7e0c9764ce844b15d84feea04406dc66b195a5f82ff4027f27361e11cf368538137d139368f5a6f42876b04f056").into(), + hex!("a4047173b5906c9b4292aaee1e91d9080ae74b1d3eb990449ed1f96bf22c3ee80f4915361e5bf7dccce24ae1618dae77").into(), + hex!("a4c4b96071e7bc92e41defba3507ddf423d93f3a94271b1f9812dfc4660e4c9fd24e0dd7aef324c46deb8d7a7c97eaa4").into(), + hex!("8289b65d6245fde8a768ce48d7c4cc7d861880ff5ff1b110db6b7e1ffbfdc5eadff0b172ba79fd426458811f2b7095eb").into(), + hex!("ab4119eef94133198adb684b81f5e90070d3ca8f578c4c6c3d07de592a9af4e9fa18314db825f4c31cea1e2c7c62ed87").into(), + hex!("a3ffc3dad920d41ec3f4c39743ef571bcabb4430465d9aa811d0f0a7daa12bee4ed256527d16a6e937bf709ebb560ebd").into(), + hex!("8553748da4e0b695967e843277d0f6efeb8ba24b44aa9fa3230f4b731caec6ed5e87d3a2fcd31d8ee206e2e4414d6cf4").into(), + hex!("b15e1b4ac64bafbc4fdfead9aeff126bf102fdd125c1c914f7979680ec1715fbeccf3dc35c77d284421ec1371ed8bc32").into(), + hex!("9377aab082c8ae33b26519d6a8c3f586c7c7fccc96ec29a6f698b67d72d9266ad07378ba90d18e8c86a2ec77ecc7f137").into(), + hex!("b71c11828ecad7731136cb1f5b80392a4add8d62f8866a781fdde797a201ebf6d483b2348aacbea2061a5108933b757d").into(), + hex!("86793899ef71740ab2ec221d0085701f7909251b1cf59a276c8d629492f9ef15fc0b471beedc446a25b777391ab00718").into(), + hex!("8100b48ac2785477a123a7967bfcea8bacef59391680a411692880098a08771ff9786bd3b8dfb034cae00d5a7665621c").into(), + hex!("8b027c14affe47f83ee59b504d83b2fd2d9303de2c03ee59d169bb199d9f4bd6533d7f8c812dd7a6f1e8155e3e185689").into(), + hex!("9615800f8c95f95bf25055ae079b964e0a64fa0176cc98da272662014f57e7cd2745929daf838df0094b9f54be18b415").into(), + hex!("951aa38464912a29df2101c60771d6de7fadb63f2db3f13527f8bdacb66e9e8a97aaac7b81b19e3d1025b54e2c8facff").into(), + hex!("a0e68d24f784fcb2b71acc2d5871285623c829d0e939146b145e04908b904468a67c07a2f156e6b17bf531adc5777c4b").into(), + hex!("86a533b02ae929f67c301649a2d58651b98cdffe731b63fa32aa1013c271634bbb088c0d02865913c11bbb1bf57c0e12").into(), + hex!("81f145ebb9a5674a5b052d0e9059acc8f8ab612dd9f54d43ff620202606e19a86a9b284dc6480d555a030e5fefee8c50").into(), + hex!("a698b04227e8593a6fed6a1f6f6d1eafe186b9e73f87e42e7997f264d97225165c3f76e929a3c562ec93ee2babe953ed").into(), + hex!("b3180ded54610b1b3a2db7db539197ced6a75e9bb381d1f4b802ca7cd450f5418522ad2bee3df1956ed63ff1ffe95dc1").into(), + hex!("86fa3d4b60e8282827115c50b1b49b29a371b52aa9c9b8f83cd5268b535859f86e1a60aade6bf4f52e234777bea30bda").into(), + hex!("97d076617cf0a64ab3d1f030cfd72a303b6b252c0a7b96157ff7fc8af5970f00d14492c46e8f6f37caafe837d0dc95c7").into(), + hex!("ac2c98a0ab3f9d041fc115d9be4a6c77bd2219bb4b851cbee0d9257a4de5791251735b5b8fad09c55d16eb0d97080eff").into(), + hex!("ace7fda25c2fb7c18710603c16a0ff0f963352d1582a42a20c9f5603c66f485df8383465c35c31e8379b4cb2ec15b4c4").into(), + hex!("a07b35ec8d6849e95cbd89645283050882209617a3bb53eae0149d78a60dbf8c1626d7af498e363025896febdba86ee7").into(), + hex!("b2fc4478830f2ae4234569346d80b59899247c609b75bd2190a896498539e1f30dca5edbad69f0224918d09f0d7eb332").into(), + hex!("84926cf2265981e5531d90d8f2da1041cb73bdb1a7e11eb8ab21dbe94fefad5bbd674f6cafbcaa597480567edf0b2029").into(), + hex!("b5f32034d0f66bcbccefe2a177a60f31132d98c0899aa1ffff5ebf807546ff3104103077b1435fa6587bfe3e67ac0266").into(), + hex!("938206740a33d82ffda3e01598216324731335d367965aa0b740486d60ba2e86a4ecd546851046a61a4b0fc88295b5cb").into(), + hex!("ad2b1ab32161e37ee553e3787f05f9281073d7ef7d0ae035daa353bc83da8ef8c76c99ad2928463c7c708f7404020476").into(), + hex!("94f4720c194e7ea4232048b0af18b8a920fde7b82869e2abcc7e14a9906530be1ef61132884bb159df019e66d83a0315").into(), + hex!("a26dd9b28564c3d95679aca03e3432ac26e287f80e870714c5946b05538b3cb43bba7b85c16bceb5430e81b7a04c1b1d").into(), + hex!("8ef0930db046c45ca5c69d565d54681d2b6d249e27092736aee582b29de3aac3fd96e1066a57cadd851b4e5334261594").into(), + hex!("92096ebf98ebac5c82345d3ef0db0f5a14af23ceea73279087426b281d6701997fe131fe65a7df7d624b4ff91d997ae8").into(), + hex!("81c850f419cf426223fc976032883d87daed6d8a505f652e363a10c7387c8946abee55cf9f71a9181b066f1cde353993").into(), + hex!("97070a33393a7c9ce99c51a7811b41d477d57086e7255f7647fd369de9d40baed63ce1ea23ad82b6412e79f364c2d9a3").into(), + hex!("a99cde5c7c85ae291c74c893e598cc0e6eb2dda2a81dbb504a638eb21dd2c41d6e5caf7baa29e3c1c32e94dca0d791f1").into(), + hex!("937ccbf8cd19b82af2755b4856cfcca3d791e33ae37e4881982ea89d3b21d205a9402d754fac63037243e699484d21f6").into(), + hex!("ad7dca7640444f1268f03b67544815d4366c6a4a2f0d25ee78f3361c63095416216fd31aa0bcce7448cdd7ba73a6344e").into(), + hex!("84991ca8ef255610ebc6aff6d66ea413a768e4d3a7764750fd02b5cd4735d41df399b36e87647fc83cf73421a39d09e9").into(), + hex!("91215fc3f7243638733fe293dab7029e0c4275550102acf5f1638773cf8f8ef2c53ffa5bdfc1b602c269a2b5ab164b7a").into(), + hex!("aa6cfb3a25f4d06c3ce1e8fd87496a74a5b951ab72557472a181a2e278c5e982d290dd4facf40bd2f4f8be62263dadb0").into(), + hex!("ac9f29ad08aaf27581fe1f12e210ad4ac6011507fe3100763a4120f9e439f3c6d191f3fb55aadf58bd865cfd4406c68e").into(), + hex!("87c6cb9ca628d4081000bc6c71425b95570291eb32ef2cf62416bd1ce3666eb2ce54accd69f79d506cefbfe6feb5a1da").into(), + hex!("93042dd42e56671155bb40d85d9d56f42caf27bd965c6a7a7948b39089dba8487d4d5fd30522dba6ba392964e3ffd590").into(), + hex!("a76adeddf2454d131c91d5e2e3a464ef5d3c40ee6a2ab95e70ef2e49e0920d24f9b09276250ed7b29851affbdbc7885a").into(), + hex!("92a488068e1b70bf01e6e417f81e1dc3bcec71d51e7eabbc53b6736e8afdb8b67d191940fe09c55783be9210e1cbd73c").into(), + hex!("8180ffffb5abe78c38f2a42a3b7f1a408a6d70d3f698d047d5f1eef3018068256110fcb9fb028c8bdccbc22c0a4c3a20").into(), + hex!("a50ab79cf3f6777a45f28d1b5cdad2c7ea718c60efeeb4c828d6307b29ef319445e6a9f98aa90f351c78b496575150c1").into(), + hex!("a4632399c1a813e41fb2055ef293466098ea7752a9d3722d019aa01620f8c5ecdc5954f176c6c0901a770cbe6990eb11").into(), + hex!("83bf5055d6332009c060fd50b8dc698d42b764b079c90a1fad8a83101f8dd1cc27acb27dc9d1c25ac8d3db4107471b4a").into(), + hex!("8c432e044af778fb5e5e5677dbd29cd52d6574a66b09b0cd6e2a5812e71c91559c3f257587bfc557b4b072a822973a60").into(), + hex!("8368a0f17c8427beb71dbf11a09a2fe8495a33f08c29c74a9a996a88aa01c0a09f9555abeb1ef1592cab99a9e05875cf").into(), + hex!("a8795e7f4c4c5d025ead0077c3aa374daaf9858f1025c0d3024d72f5d6c03355ae6ac7418bf0757fe49c220acff89f7f").into(), + hex!("a6d9f67ca319ea9de50c3fed513269b83fa067977adfd1e9d9ee07ad61b2ac1de64a39d7b6897ab55870cf982fe481dd").into(), + hex!("86b3a4ea9b1fde00cce79d5ae480353d60cb6ddce363c535bbbc3e41a4b8e39fcf2978eb430091ae1b10420d43193971").into(), + hex!("90fb5cac22a22fb8a6b619f1eacd95873be974d4d5d1f7080e523bb9b4b2644eda7340d780bd1ea8ce36407ca0410fea").into(), + hex!("b5036d4c241685bcd67156e4ab0eba42b97f639947d54b17af2c88fbcc5fc57359c7df4bc7f8df955a524fb1501a6fda").into(), + hex!("b1c56f028f31f0ff86bdf55788703b4d809becaf3e4d9d349f1b660a07d2f15e127eb72a0e2a5a2742313785a3de43a5").into(), + hex!("a3e909196f447e492200cc67000c5d7f0f585fb98e966cf9bf08257597fea8d92a90ceb054d4b5553d561330b5d0c89a").into(), + hex!("87cac423d0847ee3547f45ac5babf53bddb154814e291f368cbb62ddd4f2c6f18d77a1c39fddb482befe1a0e77d5b7fd").into(), + hex!("8605b88ce23190b1fa9d389b15e6907417239a72b97673d1479c4ccb8f4515c7921d14537775c74e738a9c3f122b1443").into(), + hex!("87587504e819bc7f0349705a05c15e8504fd6b2c25c3fd264096cdb7aaa22d8078da776215925d9d775a7f9355b6f0c0").into(), + hex!("afba279768f0f928b864645aa4e491e9c949bf3dab57efa24eeaa1a9a7d4d5a53c840019354068e64c65a2f5889b8f3c").into(), + hex!("86b1cdd26ea9a3ae04d31a0b34aa3edc9e8d038437152214d195381173e79e4ccf7f8f0ce9801086724a1c927c20e4c8").into(), + hex!("812d3ded3a3c9e58eecf13a29bb4cc13b01b2a0af322423a29bb0e4f6d9021d1d87ac4af7a2a6b88d34f44a8bc1b3c55").into(), + hex!("a988cfed9f481bc98beb5fc188ed3f6893a3ebba27c3ebace669792f6abf0997727023c3b6930a6421224f5b257b8b49").into(), + hex!("a38c974b57da968f0c4611f5d85d8014fd48594c8cd763ef2f721cfd2c738e828d41ff029e3591d7447e3125641db8ef").into(), + hex!("880b4ef2b278e1b2cccf36a3b5b7fbce94f106ed9fa2820cb9099a7a540a57e9fdeef5c0fb0a743049828fc2b8c46163").into(), + hex!("96e7d1bbd42195360267c2a324b4d9bccad3231ed8a7f070278472a90371867e2ef2c29c9979a1ec6e194893afd992df").into(), + hex!("a92beb343caf6a945990adcf84302c55d1fccdef96c34a21f2c00d3e206a9b2c6c6b412f66e5d4fafe26ef6446cde705").into(), + hex!("aa48afa77d5a81cd967b285c0035e941ca6d783493e1840d7cbc0f2829a114ace9146a8fbe31ecbd8e63e9b3c216a8c5").into(), + hex!("893a2d97ae067202c8401f626ab3938b135110105b719b94b8d54b56e9158665e96d8096effe9b15c5a40c6701b83c41").into(), + hex!("b614910b247c6ade31001b0435686c3026b425b9bff80b6c23df81c55968633349e1408a9a5a9398a7d5d6ed5d9d3835").into(), + hex!("991c660e4d476ad92aa32ef2c5b27669ab84026eeb5ca70af69bbbcd8ebc0a8fec17843423306edc78b4436629d55c25").into(), + hex!("b926a21f555c296603dc9e24e176243199a533914f48994b20abca16f19c30cfd0baf319268139fe3f83ce69afdc324d").into(), + hex!("8e70e4867d2731901d603928d72bbeb34b2e0339a4f5cf06e7a771640717421b4ea039c61dde951582a28c2ff152ff70").into(), + hex!("95aafa379cc6a2b4bdd0cad30b7f0a47839952af41f584219ec201c6c4d54610eb2c04b67b29080acb8cecc5e7543fbc").into(), + hex!("8465bd8be9bd9c2c6116d4ae44ec6618c109cb9aaee2d241e7a6ed906d398ef15a6fc18bc8b1d3398184241405954bba").into(), + hex!("b455f751232de0a48440d09983f4f4718b6169907979c9f282acf7177ab5b1f338fe1f2acd8d0bee4b4aad61d0340839").into(), + hex!("970df2314849c27daa16c6845f95b7be178c034d795b00a5b6757cc2f43c4c8d8c2e4d082bec28d58dd4de0cb5718d61").into(), + hex!("8d52413f981bc611427ad0534d25e914113d0ebcd6960aab6421608bec6648b89ae4b2ca2153c57d3cf4f1f37212aa5c").into(), + hex!("b7ac87da14b783914ab2e914fb7b536893b7a650cdc5baa1f3b4aca9da77b93a3336671335250e6467a8cd4aa8dc61e9").into(), + hex!("b37a2ec9dec3d7d9cbc911fa1e5310a47d23a841d02c8b99a923991c73fc0185d130a494748c64f2b5a4c07bcd06920e").into(), + hex!("86108b661fb2c363adcca84c114c83346413df748b959015c018452cfac14890bf585dc0a646d68727cc3cdfd2b61897").into(), + hex!("8421044f794a1bcb497de6d8705f57faaba7f70632f99982e1c66b7e7403a4fb10d9ef5fb2877b66da72fd556fd6ffb0").into(), + hex!("84d2eb008578aebd6f01254b7e46584c1524e6fd7a5a2ae5fa0ea560865ca50d52290cf2d12dd20b042f402e62181b4d").into(), + hex!("8d6bed5f6b3f47b1428f00c306df550784cd24212ebac7e6384a0b1226ab50129c0341d0a10d990bd59b229869e7665a").into(), + hex!("80e30cabe1b6b4c3454bc8632b9ba068a0bcfd20ce5b6d44c8b1e2e39cbe84792fd96c51cf45cf9855c847dc92ce9437").into(), + hex!("b7e74ab2b379ceb9e660087ee2160dafe1e36926dfab1d321a001a9c5adde6c60cd48c6da146d8adfa2bd33162eeaf1a").into(), + hex!("a2b1ea43f51460b3cb83657b4e296944658945d3ad6ae7b392e60f40829ba1da6a812d89f0380474578cbd0ab09801ac").into(), + hex!("91ead7dacf43905eb5d4b179af29f945479ed074126bad3b5a2bbc1663af5f664fe53a36684e9389ab5819e53f1344fc").into(), + hex!("927c030d5a69f0908c08f95715f7a8d1e33bed5e95fc4cfb17f7743cb0262755b1e6b56d409adcfb7351b2706c964d3b").into(), + hex!("883f38af3b2c1d50f6e7c515a5e02468d76890f6e669f7acd2df89365862fa65877095deb001b4e2868bc5b59439dbb1").into(), + hex!("a0ebae60a998907a19baa396ae5a82bfe6aa22cf71bfca4e1b4df7d297bd9367bbeb2463bda37aa852ad8fd51803e482").into(), + hex!("8ae80eeaed3fc456f8a25c2176bd09f52a2546d45d77a70f48a9e30aa29e35ff561c510ae1f64e476e4a0f330b9fdbdd").into(), + hex!("a7be457b8bc1bfde4865a35b7b1826118edba213b0f0d3cf5d877267cc1559cabe61cefb1e300142a978c29676036179").into(), + hex!("af51da717d2a45ab96fad5d9317ea867ec4c6a411af6fabd72e568230099a04c036a0f114158815b1a75da6474dc892a").into(), + hex!("b549cef11bf7c8bcf4bb11e5cdf5a289fc4bf145826e96a446fb4c729a2c839a4d8d38629cc599eda7efa05f3cf3425b").into(), + hex!("8d264fbfeeebb6c4df37ff02224e75e245e508f53fb3446192cd786ecf10d0f704c4fc2e53e7f7318ae1407e46fc0fb8").into(), + hex!("ac3195143035cdb4ddcd5f93c150035d327addee5503ea2087b1a10b2f73b02453ddd1a94d8e7d883e365f9f0e3c38c9").into(), + hex!("acbb398ea9d782388c834cf7b3d95b9ff80ee2a8d072acae8f9979595910849e657889b994531c949d2601b3ce7b235d").into(), + hex!("811e6a5478f708495addbb1445a2ef23e39ee90287f3a23ecd3d57d4b844e4f85b828bae8fa0f1893dfcc456f86f7889").into(), + hex!("8cde690247d4831dfe312145ae879f4e53cb26641b3a3bb9eb4d590c56c11ece3cfe77180bd809468df5cddaea4f5ab1").into(), + hex!("b42578df29a9eb23bed91db6a1698df49654d2bc1b0d7973b2a7e300e9cf32e0e6ac464d463d4d26e394e7598239c4bf").into(), + hex!("97ffcbf88b668cde86b2839c7f14d19cb7f634a4cf05d977e65f3cd0e8051b2670e521ae74edc572d88201cff225e38a").into(), + hex!("a322b5d2a6e3cb98b8aaa4c068e097188affef5dec2f08c3e9ce29e73687340d4e5a743a8be5f10e138f9cabbe0c7211").into(), + hex!("a076ea1084b7a1a33115ef62d6524f36e7820579868763a6ed1f8bce468f150cbfbf0ed04be2487aaa34100d828b0db6").into(), + hex!("944259a56e3b4f745996289912740281bde47e22705f142c2a483ffd701e780f51a01b177d2494dc8db9e69157f45d44").into(), + hex!("91cb79d52951d1b901e4a686bf4ad587e31db57ea5af6ffeb93eeafae3929879c386ddec860f803c2dc61055437e6bee").into(), + hex!("91efdbcaad9931312d7c41d24de977f94d7f3f7b88090a1f72d9a097a1e30cc805c5ea16180f463022d9b26b8863f958").into(), + hex!("b26f5ed09f7d5bb640ec94ddd1df0b76466f69a943b4699f53d45296d5d6b8010bb61477539bc377d1a673d89074d22f").into(), + hex!("80822499f96a1a8c0048f01f389dfcaaa5d8269c332dbb507fe46f270bcfd5f67c53f827fd867221592dbde77b6b37ab").into(), + hex!("8860ba25d5530cb8585975d8013a1c2d5b0f0f96066044fdc43ed13488ae44e379c624ff6993a18cb6e037809d7985e7").into(), + hex!("999d1c44e14184349064415ae28a149b3b11aba5baab6792744378d14df554a3625fac82038eaca920064822294dd513").into(), + hex!("a62c2e7c692403e874a16e08e46a067e19dd561993ca07ff79cecb53c753763b3e49d372638c96c0a8c921bfa0798a0c").into(), + hex!("a1c84730a5c41dcab9a5ef9e1508a48213dbc69b00c8f814baf3f5e676355fc0b432d58a23ad542b55b527a3909b3af6").into(), + hex!("a1c0c317e6e352e16e25c140820b927161ce5d2c4c2e10bca3057ba4d46b4f42ad7aba20de86dad9fc6368ea92695268").into(), + hex!("85c216e314eb7bd8ba02e092c90e132bc4bafb21c6a0fbe058b0dd4272cb76f183b83c6783fc321786065ff78c95f952").into(), + hex!("8e8f63ec8f4f1f7fcc61f893b671710c3c17f9d2d26c5c6ca40e671bd4b252bc0cc1655e6780d2ddcf2915d8f623b9a4").into(), + hex!("aaeb0005d77e120ef764f1764967833cba61f2b30b0e9fed1d3f0c90b5ad6588646b8153bdf1d66707ac2e59fd4a2671").into(), + hex!("92ff79402d5005d463006e0a6991eaacc3136c4823487d912cc7eec1fe9f61caf24cd10022afdab5f6b4f85bfb3eee4f").into(), + hex!("a32a5bd9b7bec31dd138c44d8365186b9323afbba359550414a01e1cdb529426bfa0b6f7daaf3536e9402821faa80003").into(), + hex!("845982c2672fdd44b33d2e56ad676e704c02f756b09e8765bea42b924c14724484567b55f0db42ac20cb70a7f5201c14").into(), + hex!("89cd9f6ae7d9a9ff2b4db916ba3af9fe700fcfbd16577bf73a965af938e8cf633020466b0298d3c31300360aa6851af2").into(), + hex!("8fa2d7b22af8e6b82679ebdfa13efdcb34289a554653ea6c1b16efb9f957f7fe64df787e7b03d8cdc8a732b91c916bd1").into(), + hex!("94f327bc57ed1ce88ce4504b4810cc8af5bd21a7e07b280a7866ce08e39b6cf7a6560bf73a5f10671271624cd7893970").into(), + hex!("90f4476224b64c2a5333198a4300ece8b3a59ae315469b23fd98dadcdceaaf38642d2076e9cd0bfacc515306f807819f").into(), + hex!("ae0db78548261216ad7d6a7ed4e6089ee17b3fa311494b2f2c559e215cd3de7e5f3a781a49dcff428a8a61c2a4f49a19").into(), + hex!("a83371f44e007c708dc4bcafa7bd3581f9080a4583c9be88624265014fd92f060127e628de5af3c442a25f049c7e7766").into(), + hex!("b471c72bd2971353f4b44248b8e6cf5316812861a88ccfc20fd0d89a5e010428c387228b2f6f14c12f79e31afc9d0753").into(), + hex!("8962afddcb1a26cc8ccd3c993109e79a4dd747ca473b8b5ef93d9c2e71d29623b834ac945074acf118248e3ae7878a6c").into(), + hex!("aa0940e4e5586e79a3d97397c8aff3d112c6f759d2efac29366acc5b5c6a7cfef8d50516bf309da8b787de265dc8deda").into(), + hex!("a211120e1bb3b10138df1fa58efb009a298b8771f884b82bb3de15822b1252124a68f3980f96122a775fb96f05ddc3d5").into(), + hex!("a1047401598b1e6e2613d746bb4689e0406eccdbadf319a6609a3261cd09deec215d90eba6d0ddc50dd3787d60104e7f").into(), + hex!("96791b2b8066b155de0b57a2e4b814bc9b6b7c5a1db3d2475a2183b09f9dcd9c6f273e2b0c922a23d1cf049a6ce602a3").into(), + hex!("91013e0d537fb085a49bf1aa3b727239b3e2c1d74c0f52050ff066982d23d5ee6104e70b533047b685e8b1529a0f14dc").into(), + hex!("aa65c11071be23c9bddaa5203f3166e5cf043efe5fb8f4b26f8a9cabe71db701a450e79eb001c401da5752755d9cf1af").into(), + hex!("8645cc44d180c18a6d8f57ba57bae05879451997533cfe558cad4d3d586caec877e348915e32a09ee73483283c4df744").into(), + hex!("8eafbb7002f5bc4cea23e7b1ba1ec10558de447c7b3e209b77f4df7b042804a07bb27c85d76aea591fa5693542c070de").into(), + hex!("919c81bd1f3d9918e121e4793690f9ddd96c925ae928536322d4b98132f21979c1f34731d393f0ae6e0871af4355a8ad").into(), + hex!("98181e9291622f3f3f72937c3828cee9a1661ca522250dfbbe1c39cda23b23be5b6e970faf400c6c7f15c9ca1d563868").into(), + hex!("8f44c43b80a3c5f488118859fab054745cfe5b0824821944b82fcf870fda6d93489ea9ca4220c24db2f4ad09c6080cb7").into(), + hex!("a683d4865ddcc099f7b698153007b92f853b80f49b3be75163ea8cd1f8ff584b43a68e68de3ae61cda8ad4b41f355c87").into(), + hex!("942772b7c7c47d4e5957ccf1d6f1450070930af3e2b7eaab0dd7699372445df0cc910e6c0efcf501887dd1adabdaee23").into(), + hex!("805c06e565ee67cab0cbccb92b6656fdb240b430766eade3c6b0a0b1b93c840e2b4f028601451dca135c783239463880").into(), + hex!("84d3e2a06e16ced26094b356a16a4fb6aad50ad9ab23ef804a5852a33ef0bff76f3c5fbf7beb062376c2e669cb598679").into(), + hex!("803df08aa745cc3c0a799f3a91bb6ed423cd520c9d255d36c21bed1a0c3b12e8cad32f54da09dadca97683e9548fba91").into(), + hex!("aa2c3ef95b8d4265f01666129646004b6950d3e8ce74b4ca12aa3b90fbb445079a569178df772c272463a44d48922b8f").into(), + hex!("b0a4c136fb93594913ffcebba98ee1cdf7bc60ad175af0bc2fb1afe7314524bbb85f620dd101e9af765588b7b4bf51d0").into(), + hex!("93e4c18896f3ebbbf3cdb5ca6b346e1a76bee6897f927f081d477993eefbc54bbdfaddc871a90d5e96bc445e1cfce24e").into(), + hex!("89019e9550648962420984e9fd03597a854ae824567d9aa6cd5db01a4616b4e1477230f2d1362a2d307e2425a3eeb898").into(), + hex!("861b710d5ec8ce873e921655a2ca877429e34d432643f65d50e8b2669929be40a9ce11c6353b0ada1fe115e45396b2b7").into(), + hex!("88554c83648ea97dac83d806cd81d92531980346b208d281fba489da15a0084fd4d9a00591d1ca67aad3c5793685d55f").into(), + hex!("851fcadebee06930186f35293feefd40d7daedec9b94e6fe5967536c2c0e4cc68f58d3f5fbc76f1e77b90c9580074f98").into(), + hex!("b96a11048c7c327709d52e72e6f6ed0b7653329a374ea341ad909311b5b303e5629d6dcf11dcdb195e8c7592ceefac21").into(), + hex!("836075979eaf386ff6cb459cfd48fed171ae812b0ac3b38dc24dd8ca905cac1c600be717d4a0defa0a854f40cfaf8c33").into(), + hex!("90fc170529bcc0b80c46a53fffd8323fd2cc5cfa9b75ea4d36db21bd1f198335ad2bfa87f8990cf9cd9fd7989ecca718").into(), + hex!("b7eb6a49bf8f942dd8c37c41c1b35df43e4536e07ca9f4c1cfbbf8a8c03f84c54c1a0d8e901c49de526900aeac0f922f").into(), + hex!("af6911edd6c7ad30f905a0a3f78634808832fdeb4206b006934822d673bcced8e378779261b3c4b772b34b8871987f57").into(), + hex!("a74d240d0d7ea0afe68813fab55388d77e75eca0519d21771dcb7170cedb11dc14b237b26c5ae1f7f728b52e5ec0f02d").into(), + hex!("a7b86e4f1366da44fd59a3ee68018a99c23ba3588789463bd88b0177a9b94030b58cb879a506e64421af966f261eaa86").into(), + hex!("ad8d94e46cc02a1c0ad27105e8f672ec15b8296051801f1918d0bd470625686e8e8a0abde8f6852b846ee8d9132b26bc").into(), + hex!("980508c4d1e655cc6200f89a884b3a25c0c05708a3e4a101205c4fd901c3e20a943071a6300bb2614be41a139d4ef1df").into(), + hex!("b0173651b4ba0590b1d2f0265183f3729b5bb09893523ca12c4936120cbe5ef0d9b98733734407d99fdc766792ff10ac").into(), + hex!("abf72ec0280d56971e599b3be7915f5f224c0ccde2c440237e67b95489f0c9154ace04b7763db228473715f68053f071").into(), + hex!("b404beebf60026ca6843f2953cfcdee494d495c8e2d18865147102ef29a8f0ee470961d2246fe5a450c622d20ca51d53").into(), + hex!("89461cb2dadf51d6f1208b0965c8eabec895d7b19b7d90d3c6e49dbe75a75c30fd26db3dfb169dd46a4342280225032a").into(), + hex!("a61cb5b148cb7ff34775dead8efa7d54d7141182356bf614070dfaa710ebf07a4dfb684dad151db60c0f8261c30a4f40").into(), + hex!("83a798f47a4f62dcb8b531d463b0fd4a876d47a8ca990710290549255033c909de709471b4e823a60bf94d8baf8b5acf").into(), + hex!("a23431589f3a25070a188deead9adb0ed423d6b00af267f3f125cdd4391c1527909b5cfa88130dc4b67915f5002128fa").into(), + hex!("8d77e65ba6250fe18c54ce70d0ba4571a7d3e68a8b169055cd208e4434b35a4297e154775c73e7dfba511faadb2598c5").into(), + hex!("90e5db75f3787b819df471712f87b6f3281437090f5db7a2c21b07164446292a414c687e41de2d1ca00786b093239c64").into(), + hex!("b382fa28670a5e14dc954b2db8ace250c73df71ab095304bd8ee28f455ab26cc54f82775a831428e110d1a3a2af709bb").into(), + hex!("a58d2fb1c2612d28c54fafa7f2e1e6c336c24435abdb53e1be9dce9aebecbf7468a348b872549535ac18aa003f83ea87").into(), + hex!("9545f94c4e9056e360dd999985f8ad06210556fa6f07cff77136a2460605afb0ff1fb1d1a2abe4a4e319fd6c29fff80f").into(), + hex!("93121aa60f904a48e624e00f5410cf8c8925d2b0719f90c20e00cba584626f833de7c8a18dbfa6a07df24b916156bfc0").into(), + hex!("aa3446aac25f6c23ea16e8f7d19c58d187746ef3c2ac7d8fdf9bdc329409a07589ec8eebafbe2b156e7ba60addc15af8").into(), + hex!("b964f50011f03135e993739e2e63a71933ba4583040b3af96c7e2dce874226518f7b68f622c4a1d78b9c3ec671d33ad7").into(), + hex!("8cb5cb7cba886af58acadc5a4348524b1395a39dc51196316d759a9b72d9fc0fe45b706e264393a13ff911f0d15de45c").into(), + hex!("b50c306f78143b37986e68efa10dbe1fb047d58562e9b5c5439b341dd8f1896c7ae586afac0a3213759784a905c1caaa").into(), + hex!("97825edba8410e8bcb85c5943628c02ea95ee7595f559c030b94395c0d1d0d84c38eca199fce9c1992e572b5029b124c").into(), + hex!("b0922acd6da2a95b36de6d0755316594a7e2e32ea774792dc314e8c3cd76d9f1d69df38231e166e24bd42c664f4fbac7").into(), + hex!("ae5ea228c1b91ef23c245928186fbafa1275ff1817535018d7d2d913abff0fd76bf41fd04a96d816f2f1891bd16e9264").into(), + hex!("b106c6d13ca17a4c8ea599306e84918127cf2de21027ac3fe5a57d35cf6f3b1d7671c70b866f6e02168ae4e7adb56860").into(), + hex!("a044cd5a3b727dc1cb59875e4025718375d12e706fffcdb48874e51a675dc2cabb209670192e408cdced5aeac65192e4").into(), + hex!("ab1cc44983e46a6ea2430aa6616ab28614f43624665e3e6ae31a9357c0c5434f34e56c720906e184327693cc4ebe1fa2").into(), + hex!("890def696fc04bbb9e9ed87a2a4965b896a9ae127bc0e1cc515549b88ddbcbc02647e983561cab691f7d25cf7c7eb254").into(), + hex!("a86be58fef115445b909dffac6f51da3fe9214afd9c31fd564bb8f39b1dc3cb895b1222f2c63226b54b60b278ec45edb").into(), + hex!("8757e9a6a2dac742ab66011c53fa76edb5ebc3c2fbd9a7265529a3e5608b5c24b4482fed095725e9b8fed5a8319c17a4").into(), + hex!("a7e0ddbae16e4491822684c0da3affecbbd17ef96c5c491ac093c6eb4e162fc7854c367535e296fd3d6265c2ed1210bb").into(), + hex!("941fe0dabcdb3225a625af70a132bc1e24ccab1f8331dde87db3e26cbee710b12b85535e46b55de7f5d1c67a52ddd5c8").into(), + hex!("a24d05b51c7c128bb49979cbd9019e6618545d95275a44b5c3d1d03e71bf2ebffdf43fff50c30846ec27d279043cef4e").into(), + hex!("b526f40d519e7a8f2c81b69f71b3e2ef079028004c0448ba0608296c2787972491ec6d05ed6a8fbd5ef2da76325a93cb").into(), + hex!("87ca4fa85a257adf7e21af302437e0fa094e09efced2d7ebab6cf848e6a77ae7bfc7cf76079117f6ed6eded9d79ce9cb").into(), + hex!("9276e8051bed8f5dbfc6b35765aac577dd9351d9d6ac1bb14496bd98091005b9a4737b213e347336413743f681f5043b").into(), + hex!("a7741c52498e0a24db3ce7699882de8f462a2b3ed5e9f77dc7200cbdf46b6cdd923b1128759909d6dddd64700c4c20c5").into(), + hex!("ab5b363ed9551e32042e43495a456e394cbc6d53b15d37a8859850162608bdf36d3d4564b88fdbaf36ff391bb4090b8c").into(), + hex!("838ff6630dc3908a04c51fb44a29eca5a0d88330f48c1d0dd68b8890411a394fd728f14215482b03477d33f39645dceb").into(), + hex!("997d3b82e4753f1fc3fc2595cfe25b22ac1956d89c0950767c6b9de20623d310b1d84aaa72ab967ef1ea6d397e13524b").into(), + hex!("85416cf3eef63d5530062d6f031aeddad101c7f1aea3bccb826c73f8a25d5d963caefd789a6b9832bd4ed459f268ae64").into(), + hex!("9194bc45e11d7276ed1c9ef3ad5a33d6a27372f5568563ca8ee213e2e7029dee404ab5acbaecaef698129798d35fd895").into(), + hex!("a4828a003513ab887082390262a932a7e8c5e25431824b7b4cc10fccba73265c0e5ee5b315ccef13906d971644913806").into(), + hex!("b907ec84b6ae5729d36e2acd585a350acacdeef148bcc5dc4a91edb57505526462bd4371574865541d8bb0d786a29b2f").into(), + hex!("aa5d1c1f0a7f6b9b3c3734f85864aa60bddad5121450218d76d82edefd2602685a820965c56d7eefe789d5115cb41e01").into(), + hex!("ad28fe70a8606f87bcb5d6f44e1fca499c24bcee791971f599ffef1f403dc7aec2ab6ebed73c1f8750a9b0ff8f69a1e6").into(), + hex!("a641eaa149c366de228a2833907ad60eea423dd3edf47e76042fdf6f5dc47a5b5fc1f1b92c8b96c70e6d8a68d3b8896c").into(), + hex!("abac08f4df786b2d524f758bca43b403b724d12601dc0a8362b7a2779d55b060c6682a5618fffea2e4def169fcbd2bfb").into(), + hex!("8658a15df961c25648fd444bdf48a8f7bb382d9212c0c65d56bf9cdb61aab3bd86604c687fb682260dbc0ad2dc84bf01").into(), + hex!("ac7983d50ec447b65e62ed38054d8e8242c31b40030f630098ce0a4e93536da9179c3f3ae0b34a0b02aad427a97ee60d").into(), + hex!("b8877a00a24b0ffcb2bd3fce8a8ba327d8ee2e98d85531cb61fec21fd49cd1696491cd51024a9c3820cf06a77cacf04b").into(), + hex!("ae075b66e5f211c2149c45b211d1297bbc1d9e6497cb3315363c492a9a51ae5b9d0a28bfecd755d68553736901ac6606").into(), + hex!("afdc091a224486e7bfac169e6a7b4e008d2d04144508a337fd93b6f4d385ee3f0d927b1f5c1cd79a15e0fd6078e45dd4").into(), + hex!("b75c28941ee3f91b3535b4eaa0fb17b59ca65b5256601a1f6d0cf2bb4d66837fd16e51d6942856679012a5730a66e519").into(), + hex!("84a6edac5ac68a7ca837c46d5ada8fab136748b6c3a3b9165dbbc231ec386b15328e4ef7d69a15d4cf354135348a4ee4").into(), + hex!("b01ee30d120b97e7b60ea89b9b6c537cdf20b6e36337e70d289ed5949355dd32679dc0a747525d6f2076f5be051d3a89").into(), + hex!("a80deb10bba4bc7e729145e4caf009a39f5c69388a2a86eaba3de275b441d5217d615554a610466a33cfe0bbe09ef355").into(), + hex!("8d6e3df29419bd0da1deba52c1feebe37744108685b49ca703e1b76fb4d612e3959d3b60b822506e5c0aac50b2f5eee2").into(), + hex!("a373408beb5e4e0d3ebd5ca3843fe39bb56b77a5d3d2121d4a7a87f9add3ec7376388e9d4b8da0ba69164850cb4b077d").into(), + hex!("ae0beb452af7479134a7fbc31a5f59d248e8a67d4c7f73a0e30a51db9cd33a1da3f0ae947fa7e5983aea1343e7daf06a").into(), + hex!("aa103a329b699d4102f948101ce5fae27226419f75d866d235da8956f11367e71db5c0a179dd63007ed53f7eec333aaa").into(), + hex!("a094cca9d120d92c0e92ce740bc774a89667c6f796b438b0d98df0b7aef0935d8c915d5b0dad4b53e383dc9f095c29fa").into(), + hex!("a4d88467136b99d6e55603b3665b6da0f7fb27c7759687f7e6977b6230272773d7b95049d999538c008f310c05ed948a").into(), + hex!("a23710308d8e25a0bb1db53c8598e526235c5e91e4605e402f6a25c126687d9de146b75c39a31c69ab76bab514320e05").into(), + hex!("a36d6952c2d7f88bf28032a76ed46c4dabbf1901a46efc50deb798d1b44adf7e0210fbdf2473a1ba408b5c98d76943e5").into(), + hex!("ab45f5b756ec6e0b98d0d4301c87675a0a1f0b1178b8a9780c1ab23e482cd821834835afa1de890962212159e464b10a").into(), + hex!("b800be1788175a01a9228b0d3e7eb4302484a2654eb2a86c0f0900b593da0a436ef031ac230e2b05e968b33e90a342ce").into(), + hex!("8cc8d279ec08d0a5a2a09ad07fabb0122eb65f48da2571d83f86efa2c1c5bc51b04ae94b145f0a8ef19a3988638b9380").into(), + hex!("b4cd409256819e8e4627edbba90ec40b7da17a57f95749104d90db0364f5007b1accc816f4d51a0dbe5ffbcb737cb37e").into(), + hex!("99365fe5ab8ea8bd768ae7181a6ba49b79d240f512ce309b02f09d465fea276298ff55b5b9cb5b4162a901b390606024").into(), + hex!("ad77fcac9753efba7a9d9ef8ff4ec9889aa4b9e43ba185e5df6bf6574a5cf9b9ad3f0f3ef2bcbea660c7eef869ce76c8").into(), + hex!("ad2456725ac3aeb0e4ca5c0502a8abb4dbd8a8897d9d91e673fea6a0cffd64d907b714b662d73c0877b98d4ab3ce6a89").into(), + hex!("ac8436e33619e2907659741d66082acbda32612d245fcc8ae31e55f99703fac1a15657342fa66751d3be44fc35d71c36").into(), + hex!("b0eecd04c8d09fd364f9ca724036995c16ba6830d6c13a480b30eb2118c66c019cfdc9dacce6bfd8215abe025733e43d").into(), + hex!("9439b663e4104d64433be7d49d0beaae263f20cfac0b5af402a59412056094bd71f0450bc52a294fc759ca8a3fddfee9").into(), + hex!("b72de0187809aaea904652d81dcabd38295e7988e3b98d5279c1b6d097b05e35ca381d4e32083d2cf24ca73cc8289d2b").into(), + hex!("93706f8d7daca7c3b339538fb7087ddbf09c733662b55c35f2a71073f4a17c91741955d4d549c2ee6c22eaa84193c1ad").into(), + hex!("926dc729e135f1f0bff4662ee3d6823a64597fe189b763ada34f246e77705fd4e062d85506a338e9fa98c4d225a3b27a").into(), + hex!("93f03495d53c781be8b76e37e68b64aa260523004eff6455ddc8a8552af39854e5181f8c5365812b1f65926534fba5dd").into(), + hex!("9834f66e5c946c3a8241ca2bbde046a7e88072124911d5d15c037a95b61e82b88b5c2058fa4a3721537dee39dee5da18").into(), + hex!("92ec1aeb2aa24c51cd5f724972c8b6095e77b237d83f93ed34ca0bc91a1dbf1ad95adccc59e0f0abbfef33f331f3298c").into(), + hex!("94402d05dbe02a7505da715c5b26438880d086e3130dce7d6c59a9cca1943fe88c44771619303ec71736774b3cc5b1f6").into(), + hex!("8368bb9b9bb2e17730c42ed1100eb870c88a8431601312aa8cb1e738cdb9ca2704dfd432cf1703c0db043259819631dc").into(), + hex!("a35189a105401f0cfba4b43be21723486c04659e5a01e67c43e8f9911030810b878beee696f04f63d314ccfe97ebb790").into(), + hex!("93ccd8c5f82374e0bef6562e16576f742d79b6f400e3485ef36e148088b61fbd882c3d2bb38ab0b43fa1dac77f31d543").into(), + hex!("b85d9a426a23ca9ee582bc16c203a9352dcc5f85440e46979de80eb572384479b697dc964cafd9457d9f34eeb77bb72a").into(), + hex!("aefb70e89dbf4456e077690509afcdcabf975416ff2fa16777fdf90b3abd3f5dcd865c43f1ebe6f8a669edc7f3bd6ad8").into(), + hex!("8eb03001ac9e22c6956a682ed458e650785c36d23ddbcd51ac4d9cc991325c02519ff1958987a08eb29ff56ff6e2c293").into(), + hex!("ab4a1ffef7e001723c71f5d28f3dd030a06c42d91773733d117247bbf9c01cd66fca2cff8c6ce04c4bfb68dfcdd851f2").into(), + hex!("a9ef845ab489f61dbfdcd71abcc29fc38f3494a00243b9c20b9cd0dd9e8a0f23304df84939b9652cdf5542d9b3ee085e").into(), + hex!("b5726aee939d8aee0d50bf15565f99e6d0c4df7388073b4534f581f572ad55893c5566eab1a7e22db8feeb8a90175b7d").into(), + hex!("9953a7cbc152f101a60e3e381f2af17ebe7401e16ef6462d132b8f0f6c6a18837914a1299d1605f9f289b9561112f4bb").into(), + hex!("a0c9b944a338325f5efb675c9c12619fb43c8e25e80d38d6140e31d5070573b1a0ed9bb52576e4f22f37d0292d36a648").into(), + hex!("8bfd6a173a56b73480cc950ef266a18933ecafc86915a7453ded09efd8a0cf4466101f1373f05d48eae3e7fc5c0f7f54").into(), + hex!("983fc1ddf17f9756c9cecc00b39bb2ad432587a5c6d1c3296a383b9f539c9afe84c6c818447a709c0b686ba26ce5ea3e").into(), + hex!("94bbc6b2742d21eff4fae77c720313015dd4bbcc5add8146bf1c4b89e32f6f5df46ca770e1f385fdd29dc5c7b9653361").into(), + hex!("b26b4d483bca73d3f3a976bb595a0e40f9a42094e0febbad3a1874934be1939a1b362ee4ea14a4f5cbfa9b1392796a12").into(), + hex!("8dbe8fcbcc414eb352245c52549973f73d987012de9d5f2b2f55dfdc43cf8cc9ea6b147abf149817f80f9e15aea566c6").into(), + hex!("9604da21e23c994a0a875ad5e0d279c79210f7a7de5c9699fac4aebbd76d39b703eeec5dd5efc9ad6b9dc58936089ddc").into(), + hex!("8934e9a3feababa12ed142daa30e91bd6d28b432d182ac625501fe1dc82f973c67f0fe82d39c9b1da3613bb8bfe2f77b").into(), + hex!("85f2ed3ffb03e50c8f22553b8e6349be6244d893aa37a7c6dbd221e9e121579e5a04466e60d6b4d3567bc747b1fc1e9f").into(), + hex!("ab0ad421f6fd056687b4fa5e99dff97bd08840b7c4e00435eb9da80e0d7d071a447a22f8e5c1c5e93a9c729e5b875a1e").into(), + hex!("841d77b358c4567396925040dffe17b3b82c6f199285ac621b2a95aa401ddb2bc6f07ebd5fa500af01f64d3bb44de2df").into(), + hex!("83f21dfe0272a5a8682c3c7814c5e0e4db6a9098f1fa80fda725f77ea81fdfd2fa36b0c8db013503a89bd035f86306fa").into(), + hex!("95c98e3b6b62f84edf7f297cae93ee5f82593478877f92fb5bf43fd4422c3c78e37d48c1ee7ca474f807ab3e848d4496").into(), + hex!("81c3a8c00cfe4e82f3d8cb48de7d4926d5ec2f7689f9cb85c1886a23758bc107a4bc6e978601c3519156a169d0bf6779").into(), + hex!("8e956ca6050684b113a6c09d575996a9c99cc0bf61c6fb5c9eaae57b453838821cc604cf8adb70111de2c5076ae9d456").into(), + hex!("83474776ef2341051b781a8feaf971915b4a1034fa30a9232c4bf4b1bd0b57bc069c72c79510acef92e75da6f6b8843d").into(), + hex!("b41780d9d67e9e8b81b1f62d25c0c72ecfda659d2bfe6825edb70ecd0e0724250ac364e7be521cdc112ba638f16360d4").into(), + hex!("842ba3c847c99532bf3a9339380e84839326d39d404f9c2994821eaf265185c1ac87d3dc04a7f851df4961e540330323").into(), + hex!("af17532b35bcb373ce1deebce1c84abe34f88a412082b97795b0c73570cb6b88ea4ba52e7f5eb5ca181277cdba7a2d6d").into(), + hex!("b9574edb9567f07f85c7c2e6ca6c02d90ad7c7b87d49796f1e2fb7240ad071fb755cf13ca8678668a56217c62df168eb").into(), + hex!("82212706111fb1cf5def02b5b0eb7ae9e6ea42b4c7a2b9fcacb7aec928326edb9ac940850dd933f2822f6cf519de0d50").into(), + hex!("9579973ee2559da09b327c62b1cc0177f2859872885dca709e24dcfbb9bdf9224a6d26869aafce498f44c0e6bd8a996c").into(), + hex!("a102c2ade15ea2f2b0cbc7dbd8c1171de0c8092fc4ecef84b5fd2bae7424aea8be1629f851c75e4d1d0e96104e54bfbc").into(), + hex!("a5d7e847ce7793386e17fe525f82aabb790d5417c3c6e3f6312f8e5ff52efa8b345c1ff60c4c9bf7636f5ff17b7a0061").into(), + hex!("b4b80d7fbdb1dbf1567dfb30d8e814e63de670839a8f6ff434fe171416599fef831b8e978d6498851b8a81e0bc8dfb85").into(), + hex!("b6e6277b86cd5284299ced867d37ab98090ac44a94deef6898aeadd177e64605440c15b9609c07e71fe54c95b61873b0").into(), + hex!("8135a0633082e4465090d6930b770340e82366bc5c37be6ef6dd105f85acf63361e17de8b5fcab4c82e9f9b4029954b7").into(), + hex!("864d5d9858cd881eecb0dde5e3e0c6c5de623cd9ef619e87b82fd25c5edf45a1a025b1dc763c27c5f4d520fd564b464a").into(), + hex!("8784a8fa62e0ce23283386175007bb781a8ec91b06fd94f22a20cd869929de37259847a94a0f22078ab14bb74709fac6").into(), + hex!("8adb748d5fa5c22ce4c76a1debf394b00d58add9f4e08524cf9c503f95981b36b8d0cb2dfaef0d59d07768e555733ecc").into(), + hex!("b76cb8cb446eb3cb4f682a5cd884f6c93086a8bf626c5b5c557a06499de9c13315618d48a0c5693512a3dc143a799c07").into(), + hex!("b2af1f7ece1fd640c205a09614122d69d5d2e81a7618bedefd6dbb91c7f432679be4ced1e6dddd3de323bd44991931c5").into(), + hex!("b950b457c34bfdfdd9d6da9628d41749ccae03659518a04b56487bf1b4c0681b719ec5230c0b0fd5dd710894df6aa2f8").into(), + hex!("b21785008910a949804d1291e7533752641d31beae3cb518806488f81d58c38a5efe5ed9534ac692e68c3121e2f9d97d").into(), + hex!("a9b120a77d70c1cbc0178a12d97a78b2dd0b98d0584e8e780b937800ceb18c90eaa1f0a83c5b50e34cae1c20468f004f").into(), + hex!("998c9ee20d33f96a2388b1df642aa602bc8900ba335e8810baab17060c1eace4bc5203672c257b9ae750008b707b0aa1").into(), + hex!("a7d1676816e81a752267d309014de1772b571b109c2901dc7c9810f45417faa18c81965c114be489ed178e54ac3687a1").into(), + hex!("b409f87f0632aae9bc081345b17a50a767ba4198f9ac9d352246fb3bebd29ed53c9d6f148c2f318c2eb12846b0aac4cb").into(), + hex!("b40a3bae2b08c13db00f993db49e2042be99cde3d6f4f03d9991e42297933d6049394c659e31f316fcb081b60461dabf").into(), + hex!("8c1de4264e04ff7e8282faf81c0bfb5943656451be52170211cb7adf4ff21bccbb789400735579c622f69982fcb8e9c6").into(), + hex!("8085c60b6b12ac8a5be8a7e24977663125c34827842aa3b2730854ab199dd0d2eaa93084c9599f0939be8db6758b198b").into(), + hex!("972cfaefda96f5edfe0614c01533b76153118712c1c02c505008204a5be2aa438675d97f43384199517b1c08c7c9fdb2").into(), + hex!("a1e47798a782a024da340d6d6a1b1e5e15a0f2d8668adf349ca375086964414a563cc1eea3226ae637f87e78c0a630b3").into(), + hex!("8171f20c020faae112bb92ca213c1df5b1050151496c70db5c5319212bada83b120d515bd7d8b24736090c574e1b7203").into(), + hex!("afe779a9ca4edc032fed08ee0dd069be277d7663e898dceaba6001399b0b77bbce653c9dc90f27137b4278d754c1551a").into(), + hex!("a5a07bf219432e9c80c38596c93560b49c7de287f31e30b7a06fcb4d15982add4a24085adbc5b753c462be989c64c96d").into(), + hex!("9210be290176d7e8a5005d27e7ed825067b1c678b174bc8180f92b5c03b6c3d1822356edba84f460caf6bf5275cd7efb").into(), + hex!("a95bec86a7c8417a8df3a0158199327ba0924d3b7dd94cd7c1ef8489b10270ae64b8537ed39cd3699a48942bfc80c35d").into(), + hex!("ad9725114b01152fff134c1a8ccb8d171b8cd11685ef6815b76f442d757d130bab9ef4c9845e66f4aa0237ee2b525c20").into(), + hex!("8018499ef720e28759133033833edfe17ed23e42f99058bb79fe844ddee823cfdc43916be2dc9724d18f9726e6f1b409").into(), + hex!("809c7a08fbef7caf4c137cd639f2e47a8ca60d13bca3990eac51ac2a9e4442cd1a1473bebb63c61d595b586525d7b027").into(), + hex!("9793a74fa578ace75b083578277a1ae8766d41a5c508b0f1135fb97dff1d0826002393a7276b18cbc4b3c5671360ce0b").into(), + hex!("a6d7e65bf9f889532090ae4f9067bb63f15b21f05f22c2540ff1bb5b0b5d98f205e150b1b1690e9aa13d0dee37222143").into(), + hex!("99c935fe18699bca9852200c292690a2b834bac508890c4ee9af1aa6999a8d590bf6a3a274bb55d5a73f1b7095d10f37").into(), + hex!("860f5649c5299211728a36722a142bf1aa7cbbfbd225b671d427c67546375de96832c06709c73b7a51439b091249d34f").into(), + hex!("9104ac7ad13b441c6b2234a319e1c54e7f172c9a3efcb8c5fab0ac1d388b01895a9a208f59910bc00fb998b0adab1bc3").into(), + hex!("a3b109249ac2900806f0f39338da72d4f2cc6d1ac403b59834b46da5705cf436af8499fa83717f954edb32312397c8d9").into(), + hex!("b9893f7a47af457a9efd90ddc0c0ef383ab34e9c1284e617c126965cd9f0de5c54ee8b7b5208ff190366fe445e9c1325").into(), + hex!("b77416ea9a6b819e63ae427057d5741788bd6301b02d180083c7aa662200f5ebed14a486efae63c3de81572fe0d92a9c").into(), + hex!("8b20a852fc8f0b7cdbbd808c04a0cfd2fbccbdc0cb2361434f0d96341c8bde6155695977768d563b95746dcb4339fe2c").into(), + hex!("96b15806d9009962fa07f8c32e92e3bc30be4ded0645ab9f486962a1b317e313830992179826d746ea26d4d906bdb7b6").into(), + hex!("b0d69b3861ca6791632ec8a87114b463e0da571bc076c22a8f0d9e88a1a5eaef24683f3efa8f34900d0112412e3dc4fa").into(), + hex!("b01a30d439def99e676c097e5f4b2aa249aa4d184eaace81819a698cb37d33f5a24089339916ee0acb539f0e62936d83").into(), + hex!("b19ca6e55f349bbb2dc3e429520ff5b2e817972470794f35c1aac8c118b37a694cfcc875b6d72225343799825d2f5c39").into(), + hex!("b7ea5e0d3cfcf0570204b0371d69df1ab8f1fdc4e58688ecd2b884399644f7d318d660c23bd4d6d60d44a43aa9cf656d").into(), + hex!("a778da56ddfe4a383816b43b027464d7a28689fc4a6b35b36883d3f36d9c41f0177bdbfc8f258afe8da90f02d3b64fea").into(), + hex!("910fd030feb5538f538e5ba74b9bd017d889ed6d2a797be9c26d2be8caeba7a473006102de27e87755742ba34e445bca").into(), + hex!("b49593ea6040ce82cfb5aa2881a4b0c42b78aa9fc8467d79c8e4a8ae4ee7355842841c8e1cc0558362047ed80de44fd3").into(), + hex!("b07447c7e87459315fcbda3fb86fef27f98373b1246e2ce367e26afd87f6d698a438501fdc13cc5de9eef8d545aab768").into(), + hex!("8a9f7e8d45f11c4bfb0921c6008f3c79ff923452bcfa7769beb3222f1f37dcb861be979e6eae187f06cf26af05e8ee5b").into(), + hex!("8ebfbcaccddd2489c4a29a374a2babc26987c3312607eadb2c4b0a53a17de97107c54eab34def09144b3098c082c286b").into(), + hex!("93be3d4363659fb6fbf3e4c91ac25524f486450a3937bc210c2043773131f81018dbc042f40be623192fbdd174369be2").into(), + hex!("8cf8412bd48b21b008f0207b1f430ed96bc6512c3712dffbbecb66e493e33698c051b27a2998c5bddd89d6c373d02d06").into(), + hex!("a5562fbaa952d4dcfe234023f969fa691307a8dfa46de1b2dcff73d3791d56b1c52d3b949365911fdff6dde44c08e855").into(), + hex!("a8c167b93023b60e2050e704fcaca8951df180b2ae17bfb6af464533395ece7ed9d9ec200fd08b27b6f04dafa3a7a0bd").into(), + hex!("93e4d7740847caeeaca68e0b8f9a81b9475435108861506e3d3ccd3d716e05ced294ac30743eb9f45496acd6438b255d").into(), + hex!("8016d3229030424cfeff6c5b813970ea193f8d012cfa767270ca9057d58eddc556e96c14544bf4c038dbed5f24aa8da0").into(), + hex!("ab7eff4ef8696db334bce564bc273af0412bb4de547056326dff2037e1eca7abde039a51953948dd61d3d15925cd92f6").into(), + hex!("a3f9dcc48290883d233100b69404b0b05cf34df5f6e6f6833a17cc7b23a2612b85c39df03c1e6e3cd380f259402c6120").into(), + hex!("8b476b3b065a3b95a3d11ec60a749c2258ddcc5885bfb50b8a086d3fd1e49ff73e1dde733b8981c3d2d206aa0c87b09b").into(), + hex!("af3e694ad71684f7214f86bed85149db039971e1c362119b979a135255aa226128802e58e2caaeaf8d89304371dd0440").into(), + hex!("aa19a75f21a14ad5f170e336a0bd07e0c98b9f5d71f91e784d1dc28a5f5eb6870a4eb35bb41edcf9e6efe982ae5c2c5b").into(), + hex!("b9528983419ab5766596683faebb3592982a76b68593f810186b4e5f94f6de60830739ad8dcc164c601d575b84bd2700").into(), + hex!("88e7a12a90428bb45bcf4b01442c11607433211fc2f9bee9545304eb66e0b4b5339360160bc782e185391385da7c5ad7").into(), + hex!("a4c4df0e29db19ab4c82dd6ca8570b337d15b59c7d84577a7a444a8f762ff16ff5ab3e4203a1d6b60a23ff949a93ea81").into(), + hex!("8f11ee58ef82b1bbd2240d3f548d8681e22bed5ce118d605bed4523b4bb39899ac78e15337daab92666750dfcaf32aff").into(), + hex!("8d3cba4d10f94bd3406a341c903ad144cfcfe6b61678d5c03084a56b4413bc30bd20d7a9fd5d839dbb565cc9b2aa99fe").into(), + hex!("ab8a8769c754008a7976b6799e81d7bfe97413d0a79b90715703c1f8f567675463ec93aabee59277121fc4df88b5c7a9").into(), + hex!("b201b0546f19c5db88df9c684cf55ed623bdb43927d06051bd595497df741feb1485961f64e8d3d1811d9e2e9e1e54ad").into(), + hex!("a04016e9e13ad845763cfe44af4e29fecf920b4aa42f581715fc34fb9ca27776feee45c82093c7274839eef1838b10c4").into(), + hex!("8f84cba7ceb7652023fc8ebde4b00ecde1f550935bab12feb630d6f49517b4148f3cde184bf55d4f6ec99a849fc6f862").into(), + hex!("a2248409026f35c3da8bc4d5c02315066df8fca44ff5a358cc42b5c88bdf6866dc133617c697bff004b1ef20ec4b5748").into(), + hex!("a52c5a63b55a8001b6b67c5db4fd5e95923052f03618369312896ed9892d99354aebc0dee8c3b365bafa29e211a5c3f9").into(), + hex!("8c9fefe233d0d657349b7efcdc368f5aaead27071d224af780874751e7d241f6b88f7650fbb4133043b24bbebc12aa48").into(), + hex!("86ceb649a337a5a79c17b496993ca07fa93b38a582367ca04f3dfec5cef8f268d4e8080e5a76b150f5be1b177ef6984e").into(), + hex!("87dcb537e38cefa32e629ae669da42e809b5afcabdeeef244b72ce057fc18584a1e8c3f073d5d33775232707f0cc59ca").into(), + hex!("a020404547407be6d42856780a1b9cf46b5bc48122902880909bdcf45b204c083f3b03447c6e90d97fd241975566e9bf").into(), + hex!("a1beb9f673409ec678020ea4dcbe65177aa18e2932ceb9cfb33fccb94b9a8ccb664f71647d58b3c8b2bdbbffbc02d5f7").into(), + hex!("ae47b31c5b62b38ee886ee04945649054369018dd6543c91f0138464af489a32c1fea339e0e0cbe82e3e8b9f2ef3918c").into(), + hex!("b18c41c0f827f6d8656d3fb93c90b663eb2eac034923972f8842cb30e96c32842b3fbc1127930e1ba4322d5b6641f04d").into(), + hex!("a6d6ef51a361df2e8f1d993980e4df93dbbb32248a8608e3e2b724093936f013edabb2e3374842b7cce9630e57c7e4dd").into(), + hex!("a49da42c27d019a21cc6489ada7b712b98c4ede28ba25dbcfa916acef48446a2baf73e03a48be763378a09774d4a03fc").into(), + hex!("8b62902fb2855300580e94830a4bc825d997ede33bf356fe3b7c08d6a8bd85a37879433fc6bee58f9b44ca280f4e8dfd").into(), + hex!("af9d13103868c854821ba518907b067cfba025d739125f1e9cce0a04fffc3a2a1f25506c1209a0cfe1d6c1572c229ff0").into(), + hex!("8910f41db6952c25dfbf6b6b5ba252a2d999c51537d35a0d86b7688bb54dcb6f11eb755a5dce366113dfb2f6b56802b7").into(), + hex!("b551d1ce88cbf4ffbdcb0113a6e319513bd676d0078dd4e6a6f23ad336c1d0fb47a4e427bdedbe0fc8f152353971f81d").into(), + hex!("b8876bda1e709ab16e1347a1107852a7898a334a84af978de39920790b4d82eb0739cbfc34da1c7154dd6e9f7674759c").into(), + hex!("a7d9ae9621dd1f3da3cd2d435e891cc3579c4c0d60d6a4565cac86c315cea21a9ad883559fe7b897ae6e05f1aa989ad9").into(), + hex!("aac995a41c14d379853ef18ffc854ad62ad77061ca9bdf5029cab3d6c2630de114e777a7fc3322455939d5205ed59c55").into(), + hex!("999cec6a31d9b2f280017ddd59138014829fa34cab58e6c35a5014ec364b84712441e7a2f717cf2f0de8d5451e250924").into(), + hex!("b1f43b498cba1797f9793dc794a437500c3c44a8a4b59f9125a4d358afa304fc05b88ac31ed40b6eb68f0396b60cb7cd").into(), + hex!("93ba2e000bdb7269818d390bc4232992d280e69abebe2db2ecb6fcb1390d323238c9793574509bc1fa34051ac1928f07").into(), + hex!("a64808a2d15c30460651c200a09b50fc83e9d84d87abc156d06cee73b76fbd74e6d64424cb5bb83d3f16b21bdb7ae9d2").into(), + hex!("a75bcd04fcb44ce5cbab7eef6649155ec0bef46202e4eb86c88b4ced65e111f764ee7fb37e9f68e38067040fedf715ee").into(), + hex!("b95fc0ec39596deee2c4363f57bb4786f5bb8dfb345c1e5b14e2927be482615971d0d81f9a88b3389fac7079b3cb2f46").into(), + hex!("aef456af90354ff88039d2dde02b0f5a6790aa762b23e0a9da8c6ec92c3b8b3320687bb21666608b4a22615843afd1ef").into(), + hex!("b38be9ada17ced704a34a7498c4fd6ba2503f6bd886b693d4712267847efa887a26e7da5d60f8bc5014b92bca8b3a12d").into(), + hex!("991a7c93f06d50ec6a4340c6751b73eb5825bad02a954e44e1e2d424af928819ebbb590c6129ce35b3f1e908e2152f33").into(), + hex!("84888f2efd897a2aca04e34505774f6f4d62a02a5ae93f71405f2d3b326366b4038854458fd6553d12da6d4891788e59").into(), + hex!("941e2e3ba414a371a11c3fe92cabf688ff363da6230ec7c83ac7303f652a19ebc89cc494427c456d0c2ae84c72053f73").into(), + hex!("925f3bb79c89a759cbf1fabdaa4d332dfe1b2d146c9b782fe4a9f85fee522834e05c4c0df8915f8f7b5389604ba66c19").into(), + hex!("941c8962debd2756f92a6a0451a2bf7fbc01f32ed03d0823dffd4a61186628a4c3c7c482b18589ff65e4c449fa35c2a4").into(), + hex!("88ce41025aa153a94f91f22e7b96f9342b5e0e1d76274fc70c4df7d08f66d9f7ac86e55a1c6e77693b8b01b2b38bf900").into(), + hex!("8f142bde50abe4dac8e059003db41610436d5ca60d2dfe2660ecaa5f9628aeb8b5d443e1b57662076f77363c89a1479d").into(), + hex!("b2affe048c187d311a185503d8958cacbe03796edf79bc32e8533941004d9178bd2e376e627e1ba61ed43850c0c455cf").into(), + hex!("8f7bbaaac458bada6d852fe665c87c646133bab16c0d5136c3dc922095b9d647d93a9de7671cb7bfd4cbd138ae0709d1").into(), + hex!("b76f598fd5c28d742bc1a81af84f35f1284d62239989f1025e9eba9bece2d746a52f246f9bb6bcfde888b9f7b67fc4f6").into(), + hex!("a4c665a3e4e25a7af51e433c978573841bfa2c75c075e17dd1f43b2f0369249f3d3a46ff51051e8ce7da528b0fa98d16").into(), + hex!("81e0992e7c1c54c21cac32e36b90b25e1e5b72aac99c953c3c4d019eced64d7e316cbc0840204a4a51a4ad17d8b1d508").into(), + hex!("96d7a69eaf2761bf0e5ebcd607b134d5dedba8e262ca1d6d3e8fbf23e6419a8ce1bbe4cd23b9e4b5f80db54a802a9795").into(), + hex!("b2235bdf60dde5d0d78c72cb69e6e09153b0154efdbab97e1bc91f18d3cec4f660a80311fe6a1acd419a448ab65b18f1").into(), + hex!("838d5eee51f5d65c9ed1632d042bb7f88161f3789e6bb461318c5400eaf6728e7ba0f92c18e1a994aa4743145c96164b").into(), + hex!("acfbac397ae2ff23b31bb27b90788fd0fd51a50f8e8c9f4b31be8499194252014f0b1972b204aeb9c2836a20beb3c868").into(), + hex!("ad85789bb62b60e9768bd330a31a16f711b6018445af6a47646f318f12df8d4d256ad00d1ed7c3afa4e98fef73c6c610").into(), + hex!("b2349265be33d90aaf51362d015ce47c5ffe33e9e6e018c8c6e39336d9327ccdd13d25e792eb33b43ed89a162f6ac2fd").into(), + hex!("aa458aaca6ecb43b6e45ea72d02682e5a7dc8dc22782669a0628e1638e73999319f011803f4ec8cf072467bf2c49c629").into(), + hex!("b9e6c9f2562e90bd3008669a42151538b70faf028cc5bbc09fd6ab3febc626df911fcc65744a2ad793ecaf3f91a1f701").into(), + hex!("a37185bd96faa526dfd3ddaff89b1eb29ceb4597bfc7e346bff9d6b3225b9ca87cbce0db94f05243c7232ead5f6607e8").into(), + hex!("824fde65f1ff4f1f83207d0045137070e0facc8e70070422369a3b72bbf486a9387375c5ef33f4cb6c658a04c3f2bd7e").into(), + hex!("b0ed68167a67490bd7d7d49e83341606d6e6fdd99b82e46747c2190d270719f81c5f5f8733646c246260f438a695aa3a").into(), + hex!("a87c2f13f2a824b7e2c39cfb63ca7b94ae6a11ade0c6b8e83f5092b933fa8b6157a5d2f09c23081f49d35cc85f5db36c").into(), + hex!("88f5e795cb36ab22bdcff01caca0e9d04db463c3d88cf656c3a0e0f5ac864b7092c738758b4c8f3b65e31995c6aaf267").into(), + hex!("ac66f3a7041586ac1576e33598f01921e16d99afbf4249c3350f0ee1654de98bd37a61c243eb6a18a942db529e36af0d").into(), + hex!("aca69a4095567331a665e2841210655636a3273d7b7590e021925fe50757617898e1883532f9cfd46428c2e3d854f9f7").into(), + hex!("946d585d7aa452d37a8c89d404757c3cce2adf2410e18613483c19199abd88f7a12e206f87a43f6009e42f4e31ed20c0").into(), + hex!("9722c1079db7e2e1c49756288a02302b43b8fd92d5671585ac1ea7491123742a2744a526c12c9a0b4c4a80f26342a3a6").into(), + hex!("b80e8516598c59dddcf13fdb7a42d8f5a52c84e01bd6a39880f4acaefe8e4b8f09cc1b1a2423cd5121f4952201f20078").into(), + hex!("85bca2f86423a09014b562f7dc613246bedffdcb3aa41fee02270c13e6b00c8d6704dcbfbafc5997df6a90c7fc08c29f").into(), + hex!("a36dad4f7cba9f4cc843fe40f6240e1973a4c412cae29b4a68712598523cfaecb05272fc47d30772bf06906b5a26e282").into(), + hex!("a3d8610c2522d330df02511710e52b1d9bdc9f2b156deca12b1bf754266caeac4f449ed965d9863558df43ce9ae65a44").into(), + hex!("b3e313e79d905a3cc9cc8a86bd4dba7286fb641c2f93706adb3b932443e32eff2cbed695beeb26d93101c53d5f49d7db").into(), + hex!("88d8a32231ff2bfc39f1f9d39ccf638727b4ead866660b1b8bfbdf59c5ab4d76efddd76930eff49ea0af048b2e396b6c").into(), + hex!("a90d9502a9785e55c199630456fcb1e794bbeb0f5f8c022e66f238a0789998b126cf9911fd0b7d463b7706dc6f9ec128").into(), + hex!("8c627caf25eae6764501b9eff35aa90bd4f24952cad712aae20344579e83ecd104ad1f7915edc4f9023b17fddbdb4cd7").into(), + hex!("87d4b20bbe2dcd4f65f4e1087f58532d5140b39a5288e1a63fc0b7e97a6a56946eafdd90ba09300c3d1fef6356ac6b7c").into(), + hex!("a18f4464cf5cebade8ee280fa00e0917cbf1743aeb0dacc748ab68773b909e30dc60f40fdef3041b5f082e650985f7a6").into(), + hex!("a6ae4fd03fbb4e2150795f75a241ab3a95c622b4615f553bab342a1803b86b1c1a2fc93bd92ee12786bf2de22d455786").into(), + hex!("a89bc7548ea245ce9556eeee3fba98a3256f87499f54a7c5eec0c43b9fb4ef2fe8f6810867ed0df814a88ee100c245af").into(), + hex!("97f1a7370b4f5acf83b466f519da361c366915f560385dd7eff9d53700ad81b25c9862bc71d35428e82372a5ae555ea0").into(), + hex!("825359cfe68ad6a75578a94be6419179e0aa088170b6c20fc5c249dc3be7a260d687c93d8d8a343c7c72c2ed6a716de3").into(), + hex!("aa9b9cc039d147677aedd1e47ad9013fcc0da0164070ff7305b18e5786c7fac0471368637a3adbb78f3af174a5c1592a").into(), + hex!("a61687511b627bde7b3977e9a34cb7fddc2aaa509a7b99b6b6c7b97133845c721e1e69f99758698d82cca265d8703610").into(), + hex!("8853c582e86cf916750d670a621246a63c7fd78f68c556642053bcdfa7937de58885d728209736b7d5521b591387e9a7").into(), + hex!("82b8c013f24fe64b8e0337ae8b6a682cae336b8404eafc1404744f80f765efdb8b2873d1d3f31141e8dfe4d93346ac56").into(), + hex!("866ec39b9eda580d96bc2bff76af5cd4887b6788675149ab33bfefe38db82ad01b8d64c6b60704210918f3564cde1110").into(), + hex!("81337ebe90d6942d8b61922ea880c4d28ebc745ddc10a1acc85b745a15c6c8754af1a73b1b3483b6a5024b783510b35c").into(), + hex!("807c510df25c0ba10d4aa06a462e02f050c69a977c64c071401ab74f9ac1e60788aa504743b4cc1982da835ff9ac2541").into(), + hex!("96b1c82b85cdb8a7026fd3431bea9cd008f0261ee7f4179f4e69a399872837ab836a14e2dd45f5448d54800a4ae7c7f2").into(), + hex!("a48b1031ca2f5a5acb4dbdd0e9a2b4e9add5ccfc0b17d94818273c8df11e825193fade364e0aec10f1ff91d57d03a52f").into(), + ], + aggregate_pubkey: hex!("a825959280c88c6716f6df807204feb84d745dfbee3cb3474ce81a1ef0c4cd142e5ca962a0335e68b7b4266769d631b8").into(), + }, + current_sync_committee_branch: vec![ + hex!("bcfe80e1d24fbdad7bc058b011403a4c26cb56967654494cde51517f888023f4").into(), + hex!("4710ae46156553fee6231622052f7fb2f6945cdb59a5501cef824b1925c87445").into(), + hex!("6df62e05ef3e1ac92c659c3a519b8fa651d1b649c2b46fda58c48cdeffe8337c").into(), + hex!("d26ff22ef5958a707a8d98eb1ffaaf1f9f412e816c04b79f5434cb1792ccf608").into(), + hex!("90d5e61f0af673ab4d8b3ab0b978d05142a8295a163b198e6dea9d8c8f1c6d89").into(), + ], + validators_root: hex!("d8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078").into(), + block_roots_root: hex!("5078f286fa90b88a09dcccd4ac72f6c3615b77c0ab3132508cb8c0c07b20282d").into(), + block_roots_branch: vec![ + hex!("558b658b1230e225ac3adce3daf0b066ed0484b4a768d55b74ba81579ca0e5d0").into(), + hex!("2cbb27d38065ff3f230247af918e67d1998b67bc7e2ce6c244bab7146e16b8ad").into(), + hex!("c63bfc96585f424385e3b4b39ce46e957017b716c54d105eb7e07c841d1d4309").into(), + hex!("e662b38f57427b58c46b09980db3856f17e56b60b36bd5471823b0f2cc1b6467").into(), + hex!("8b3bd99618b1e50cf284b4c3b03d0cc272312bce377d585eded77154aa5580a5").into(), + ], + }) +} + +pub fn make_sync_committee_update() -> Box { + Box::new(Update { + attested_header: BeaconHeader { + slot: 4055104, + proposer_index: 1862, + parent_root: hex!("5f44df1f70338aca4b3046f9e5b144bda8b27276320ca000077389d0aba35317").into(), + state_root: hex!("9daecfedc819b45231bf93819a73efd4304ca79528032fae2e852ebbe514cfdf").into(), + body_root: hex!("a33f5cdc6732684e6f248e5a7636c7e7bf705f0bf709098a46ba15c660b4fc65").into(), + }, + sync_aggregate: SyncAggregate{ + sync_committee_bits: hex!("ffffffffff7bfdfffff7fffff1effffef7f9ffbdfdffffffdffbfffbbf7ffffffffffefdf7ffbeffdffef7bfffffffffffbffffffffffbffffffffffffffdfda"), + sync_committee_signature: hex!("880f147850ac0a94130b81f94203e2f69d512c929df8b954b6adc20cb1e8598aafadf366c074b590c0905d584dd980af18e0c8a837bbcadf6b4438507aa46ef95879c0acd9c2d273ccb13d93e4938e9c601f0dd466f53369ae94e1287955cae6").into(), + }, + signature_slot: 4055105, + next_sync_committee_update: Some(NextSyncCommitteeUpdate { + next_sync_committee: SyncCommittee { + pubkeys: [ + hex!("aedc2d47fa2662be6ab58ddd3682bd5e53f508162968fce8326c75f92fb3c1a25c4d4d0e6904f9b6cb1ccbaaa9dc28d8").into(), + hex!("8097b13908662d245820f3b045d8c2c665fe9a054e9c661323924ec86dfa713b36b0c787ad4dfdeb979318810e687a48").into(), + hex!("98aebd4bf15916512508a5fe89d814d5d76423c562cd3f0a0af504c8cde53be30f4df00e3ba0229cbf8528e198a0df11").into(), + hex!("86bba46d0031989d0f1baccea4174fc3fa0d595e60d35a464e86c33c233e2d6def84fced7a00f59afe397cf4fb5b67c5").into(), + hex!("845982c2672fdd44b33d2e56ad676e704c02f756b09e8765bea42b924c14724484567b55f0db42ac20cb70a7f5201c14").into(), + hex!("926dc729e135f1f0bff4662ee3d6823a64597fe189b763ada34f246e77705fd4e062d85506a338e9fa98c4d225a3b27a").into(), + hex!("b930ecc2a26183240f8da107e80979b59da4e05f090316d982815ed6151d7750490b85273187ec4e07eb221813a4f279").into(), + hex!("81564bee5a3bd09476f658cf7719326c353485e2f4fea58d110071c5dddd3cabc349a8d1ecea45d589ed4479952a2ba2").into(), + hex!("a66d5b1cf24a38a598a45d16818d04e1c1331f8535591e7b9d3d13e390bfb466a0180098b4656131e087b72bf10be172").into(), + hex!("b9b9b6113301bd2b409b71afa1ab9e31d22f84f8cb03badaa408e1d37032350094124e533de766622d7975a047fade6c").into(), + hex!("8eb3b3e3135720036c1120c4e8b8d405b00d002f2bdbe601a06f2c2fffb940a9966d18636ee34fc003dfef547d8f3b76").into(), + hex!("898deb30ede570d391266c81132a78239083aa9e27a9068e26a3bc14ff6468c3f2423484efb2f808b4996c16bfee0932").into(), + hex!("a90d9502a9785e55c199630456fcb1e794bbeb0f5f8c022e66f238a0789998b126cf9911fd0b7d463b7706dc6f9ec128").into(), + hex!("ae8af784224b434b4dfa9ae94481da4c425602097936623e8abb875f25deb907aa7530bce357786a26ed64ef53d5e6b3").into(), + hex!("b544c692b046aad8b6f5c2e3493bc8f638659795f06327fff1e9f4ffc8e9f7abdbf4b7f6fcdfb8fe19654d8fa7d68170").into(), + hex!("ac5c01c51dac6ee1cb365c9b03f09906d9b7b9b4d1b73c44d9e8e06823025d7070f242898a975420bc87d6372382cab8").into(), + hex!("a4632399c1a813e41fb2055ef293466098ea7752a9d3722d019aa01620f8c5ecdc5954f176c6c0901a770cbe6990eb11").into(), + hex!("85f7ae1a7a7c793c408750ddec2d7f58b985fc3cdf9fcf6b2192bc57092b8a271b2fb6ced0639baaffe0bec3203e568b").into(), + hex!("aaeb466f4316874c2107a0de38dafafa65ce50039c20723e8797815238011426f4e77e29fc573e7c6d2df85c1bbfefdd").into(), + hex!("a8fd63da16dd6a4aa1532568058d7f12831698134049c156a2d20264df6539318f65ec1e1a733e0f03a9845076bb8df8").into(), + hex!("93600f65c090814cee5cbd5f22f98e79c69e63510501a0be6a74b111e4c52441133fc1c198c7bf235f9005aeacf1d441").into(), + hex!("a69f0a66173645ebda4f0be19235c620c1a1024c66f90e76715068804b0d86a23dc68b60bca5a3e685cce2501d76de97").into(), + hex!("ac6e7e9960207138d5b4b6a7f061756c01cc4a830e5988423d344f23544ed0eaa790aed63a22df375768f670cc9b9bd4").into(), + hex!("93042dd42e56671155bb40d85d9d56f42caf27bd965c6a7a7948b39089dba8487d4d5fd30522dba6ba392964e3ffd590").into(), + hex!("85bca2f86423a09014b562f7dc613246bedffdcb3aa41fee02270c13e6b00c8d6704dcbfbafc5997df6a90c7fc08c29f").into(), + hex!("9550072f64a48cb86bfa224d492be9a91e5a6c9def04b6a290b7a19d96981937d5a2c35de6515d1881bcb167f6e3d661").into(), + hex!("8d797819318cdf7b26405d1a327d80d4c289e56f830b28d4e303bcb019aeb0b3d69bfed58adcde8a2445dd5281b86af1").into(), + hex!("90c04eb3f3679cd630434418cb3a225a73254887692429960bd45b1613f85b2c14723cd8c7f1e875588ed82b7f5576b7").into(), + hex!("9953a7cbc152f101a60e3e381f2af17ebe7401e16ef6462d132b8f0f6c6a18837914a1299d1605f9f289b9561112f4bb").into(), + hex!("a9300a33927335f482dd0e44d0d57704ebeb278f732ae8301073cb7d5e457f02a0cb03268de71d284b8c23fb96947469").into(), + hex!("88554c83648ea97dac83d806cd81d92531980346b208d281fba489da15a0084fd4d9a00591d1ca67aad3c5793685d55f").into(), + hex!("9131874b09aa95ba186bcaa9e040fabc811b9c7b905b7dc79e902cf2bb5816d7ee39b0b55be609f22bc8c538760b2037").into(), + hex!("8368bb9b9bb2e17730c42ed1100eb870c88a8431601312aa8cb1e738cdb9ca2704dfd432cf1703c0db043259819631dc").into(), + hex!("b49379bbb9f954d2ef5574199607bc6b3aa2cc3b48dcc3745cc77406bba2a394929844fec1b87c4ce65cd0ca0f83062d").into(), + hex!("876afcd045c8a18967923733a3a43757652289b0974cd348238a693f30bb57f38664ecb97877a5e5f7d0185039a2bf54").into(), + hex!("8db19f6dd3789df179ab606508ca7e3da7967ad4340f630bda83df54c197d6bd3a14980c87fe10cbced7678c0c300ef1").into(), + hex!("997a91da55801acb6134d067ad65a9a44ead0b53d3871bb97b46ec36149d25e712d7230d38605479796190abd3d134b7").into(), + hex!("ab1abf9cf630d6cbcac0c503df44603142ac81acd647784ae0e8fc97800ef04378bc9d7f2087f959ad4bbbeec65b8dfe").into(), + hex!("95718b06017ba9d45894867fd67148645d25d9db2229aa89971f444641ba9db4c5c6f0785f3b25cf2cd7fadaa6adc5eb").into(), + hex!("8ec38c68afdfb6ba019204039c2fb49a35467058f561f626fa87314d705fd615a7b9966576052be1b3690028d3c5c7bc").into(), + hex!("a5d72ac4cdcd847d67cb5a68c6141cde99a91303ca84165bbdc6fd7f643422faec783de60739e1b2753088280c90a68b").into(), + hex!("a778da56ddfe4a383816b43b027464d7a28689fc4a6b35b36883d3f36d9c41f0177bdbfc8f258afe8da90f02d3b64fea").into(), + hex!("a2ab566033062b6481eb7e4bbc64ed022407f56aa8dddc1aade76aa54a30ce3256052ce99218b66e6265f70837137a10").into(), + hex!("b9c347c1c350fb7ef6ee9ca6780cf0604f30e3a74e9d0234bca6b3e7faed26148f2b736d9fbff6b04f5b947fda458e8c").into(), + hex!("815f53751f6d3e7d76c489f3c98d2b49214938cac8c2b417e2d17bb13446c285fa76fd32a97e9c4564a68f4faa069ad2").into(), + hex!("b3f1319ae34ad1d59207288f01d3d7b7e1bad7733fb4a819a09b011d72a4d736bd3c7afeb74cf56da0e00cf712042ad2").into(), + hex!("abbfb501071148e98b6aa56308197356fd993c93e27fd58987eca82036c1ae0ea89f9fb1a06c82851234643904c58453").into(), + hex!("a0899189bba608887c6cb729580e570ecce9ca7107865ebd30def867afaaa250bac407c30dbee11b7ef6cd423269a8fd").into(), + hex!("88e7a12a90428bb45bcf4b01442c11607433211fc2f9bee9545304eb66e0b4b5339360160bc782e185391385da7c5ad7").into(), + hex!("82714b00a822c30b317ffc1d4ba163990cc1ffe5769f91906a7f71ad1f62b39865a5314433a4ab2ba762b1d62b01003e").into(), + hex!("a3a930dd70aeeaff0f2e3790927d5425db40467ee106261615de5fcb937bb1621be213ccd8b3a14d96c5908bedc2e421").into(), + hex!("b2902161b565dd5b8e8c54187b26f01741a39ea8bc1120598661bd367cf8fc73e21eda2f0f6f9ba2270c80a59ff5985e").into(), + hex!("b77cdf45f39bf85ab3e8c8afa602f159de8352188aba5378957d468315a2d2326daef83d8ac6b227f1e7a514488afbc6").into(), + hex!("a9e573274f5a131d6c7641bc0576a2621b6466a5bf2cecb21058160a854b1b9e0be176da2b6b9b3ed562fc36c5f09119").into(), + hex!("876561bba29e656b7122f1cb51a02dff1ac7d470217d8a4799c01e61816c4660eea91843a5a42502ddf842d2daeb0586").into(), + hex!("a0ebae60a998907a19baa396ae5a82bfe6aa22cf71bfca4e1b4df7d297bd9367bbeb2463bda37aa852ad8fd51803e482").into(), + hex!("84a6edac5ac68a7ca837c46d5ada8fab136748b6c3a3b9165dbbc231ec386b15328e4ef7d69a15d4cf354135348a4ee4").into(), + hex!("8b476b3b065a3b95a3d11ec60a749c2258ddcc5885bfb50b8a086d3fd1e49ff73e1dde733b8981c3d2d206aa0c87b09b").into(), + hex!("b48490c5a3bc9e66cdc78994f7c73e0f2724fec8a304b4147799e5142396df155ef7c42065ed6d2c0393d138fb4d2a0b").into(), + hex!("849ddbdc3ac55ff22a3b2f4bc51892fed694490ab4dd342165ac38c725c8b38921eaefe3c443962925fc3726aa41e236").into(), + hex!("b49c45d9da4aaa64967c28f1fd77b7f709f5a331b58823eb1613856fd8f92635135981830a287e8dbda3a0e0fc481c5b").into(), + hex!("93ccd8c5f82374e0bef6562e16576f742d79b6f400e3485ef36e148088b61fbd882c3d2bb38ab0b43fa1dac77f31d543").into(), + hex!("81522576ae4ec9358f1a16934cd1c1116de609634e68f552924a972101eb7215f037ab8e0582d7b13541537d55554d31").into(), + hex!("aad60e58a19598c5013b37e2e4adc6721eaa7e6e184960d1dc4e6f012246abbb58a047c0679064d5eaaaaff02de881e5").into(), + hex!("b4f034f2b53ff9989e8a0f12c1484c58ed7942432a429af58a6659feaf23f7d2bf20ff7b9a7e0a28a2e09c9a730681d8").into(), + hex!("88b2c68b425269850c1a4f4608aca194da5c641adeb99e2f7fb92e34b8245dff066e73bde072be60f7f2c3d3d13de3b6").into(), + hex!("a749ab53fc2662a0796489be84fcfa59bb723ff748bd8980df0cb4b3d1e2943845b0d7c67576fa0a33c8b0ff8a86932d").into(), + hex!("abd7248ae069d3a3a45b0ef4dd5d7d54b62994e578ea20bdd3b7876596673953b94c5b109a6e4b953b517544b915368f").into(), + hex!("a49da42c27d019a21cc6489ada7b712b98c4ede28ba25dbcfa916acef48446a2baf73e03a48be763378a09774d4a03fc").into(), + hex!("b3c36fa39f668bbc3fec028875a820057dbf96f727bb423280da96d5d50e885d23bc23fb73457bf79089691ce7663a7b").into(), + hex!("8dca376df4847cb8fc2e54a31894c820860c30b5e123b76670a37435e950f53312f089a8e9bd713f68f59fd1bf09202f").into(), + hex!("95d1f944b0c53eb3e9fcd5632713602bbb9195b87a172a370ae2df98504612a55f3968615a39b569ce6a0fe9fb559be7").into(), + hex!("8c9fefe233d0d657349b7efcdc368f5aaead27071d224af780874751e7d241f6b88f7650fbb4133043b24bbebc12aa48").into(), + hex!("a2ee6c29efa982e9b9abd3c5e4f14b99d5d0369d7bfc3c8edae1ab927398dc8a147a89e127b3324d7f4e3a7494c5d811").into(), + hex!("b7ea5e0d3cfcf0570204b0371d69df1ab8f1fdc4e58688ecd2b884399644f7d318d660c23bd4d6d60d44a43aa9cf656d").into(), + hex!("a07826925f401a7b4222d869bb8794b5714ef2fc66fba2b1170fcac98bed4ba85d976cf9ee268be8a349ae99e17ac075").into(), + hex!("b0a47515752c15e4dbeaf9ee27fab3b5c0db82f5c685e8f716fd7d8764164944340430fe3db1a5679e6ffea5a16dd919").into(), + hex!("b7de6d7a4afb05984dce153e5570b104338265e45c8f0156f4d45c458f47add234a479e01c02d3c1817c170b5b65b100").into(), + hex!("acd4d1e11f81f4833353b09d4473ec8b15b8ff31dbf39e97654f5338a26c4020306d51018f1f4b9c4efdb92992408a6e").into(), + hex!("80e09f3bf3ea87d48e04b53d8f3b43b7e53d61f445f8c8a5a35472b84f6bb4f58f17d9832f5881bb44fc06156151e5c5").into(), + hex!("98d6d46f603afebcbc561c130e416d5a588a7e6c1f17f89ed6e30538b7f8dbf4b3c75b8a3331425c4ca21e03fe8b57f3").into(), + hex!("ab671eb947490c43fd05e42a787344b21af89babb705393c82748eaa0cfcf80bee498d275a1eaf1d647ca3b2923d76ea").into(), + hex!("80e1dbf3296bdfa98aeec1a7560682165d13bc628061bd3257f345aa1ba13f8bd1bea14f117af562be22118f5a8265af").into(), + hex!("aef456af90354ff88039d2dde02b0f5a6790aa762b23e0a9da8c6ec92c3b8b3320687bb21666608b4a22615843afd1ef").into(), + hex!("a5a07bf219432e9c80c38596c93560b49c7de287f31e30b7a06fcb4d15982add4a24085adbc5b753c462be989c64c96d").into(), + hex!("84d2eb008578aebd6f01254b7e46584c1524e6fd7a5a2ae5fa0ea560865ca50d52290cf2d12dd20b042f402e62181b4d").into(), + hex!("b8e5226ad3515627ae6840235f5f7b7ecd54e8f01079c324d126ec852f6665ebb77168b3f2b3b51580e04a6ff602d5b3").into(), + hex!("8c1de4264e04ff7e8282faf81c0bfb5943656451be52170211cb7adf4ff21bccbb789400735579c622f69982fcb8e9c6").into(), + hex!("90bfbe37ac3992432e68c95c0d4342a9712126d1f50089239c9f4f6c0c202b54334e08604d245b97dc8e8f6706f6992c").into(), + hex!("b0a771b9a0dd7e352d46c8efcc1834e610dd097711bf7117678a99d386890c93b9b901872d4dcacb6dcbcf3aea0883ea").into(), + hex!("a4eb903990bee2374b14fa66fc262d6821669537e9ba241c87b4b5c9e2b89b32fff4bfc28ab8471ef52e8eebc3e743d1").into(), + hex!("a6b74c706b33d3cae9b7adc5c7502ac98f7bf94a14d579d2bf77b613ae555634ad6fe631ba36dc14bf44526436355e24").into(), + hex!("8296f8caf58316af535def398a43357e48cb3b1e674b857eba1bd1b970da3dd045e22fe6d17dee4e9117f62ece3ec31c").into(), + hex!("a129c9cf33df42b5a98ad98be9d940207ae154c715d3bde701b7160dfe45304679fb0481a4f9dde242c22a9849fc2d9c").into(), + hex!("858b6f1bd3e68fc536bdf1f4bd96db032994eb76e71571e2d85af73b898478b82f9ab432732b0beebc0864ad8025ae33").into(), + hex!("8658a15df961c25648fd444bdf48a8f7bb382d9212c0c65d56bf9cdb61aab3bd86604c687fb682260dbc0ad2dc84bf01").into(), + hex!("a8d152e5d94b75cb9e249230db21af31de4d4f3d4ef60ccbf2212babf69aed2a38435a993ee2f13cca410ad55a4875ab").into(), + hex!("95757096c132e7f6c096d7b93a5a0d2594d5e609b9f13c4a9f878e95a389fa1a111b185dc1fd8f7d98b737dcf8d2af60").into(), + hex!("a22542a4a2ebde18cc6aa29d5dace8b4f6720703f519610dcf01e671018392aff15728e3764730840272c9cfb074b612").into(), + hex!("8f90e72a54e6894d511061957162e753010812346afd4d90cfedb678b99ba1aacf2b6bd0e49b4b0e684da8082a048619").into(), + hex!("b2affe048c187d311a185503d8958cacbe03796edf79bc32e8533941004d9178bd2e376e627e1ba61ed43850c0c455cf").into(), + hex!("b549d272a7f3180826a978d747507e4dc80d82784abb655cfcd3a69cc72e7d58c70febea1ce002a89852a8f934ea70fb").into(), + hex!("a9ef845ab489f61dbfdcd71abcc29fc38f3494a00243b9c20b9cd0dd9e8a0f23304df84939b9652cdf5542d9b3ee085e").into(), + hex!("aa744c552b5fc41e1ac6ca53184df87a1b7e54d73500751a6903674041f5f36af25711e7bc8a6fbba975dc247ddad52d").into(), + hex!("a802b9ffbd4f01b877791aba27da972be4bacacc64a1f45687be4af01b84bd4b83fe2ba1ea78e29d7683f6c777ab2543").into(), + hex!("b44d2d9510516c0abb4fc101241cf0e0223b179fb70686519628c27f0ef56381232961bc79a30f592ef093ffecbc4486").into(), + hex!("a684a09add047c0fe648d9c5618500d1816047168e055e8ac8c952c3544a462cc095b32fab07d939947a58fcb4ec7ba7").into(), + hex!("b5eb31e5cba0193e74968099ace5808dfc457c6f404f270fdc4949b60daa7607ba1811abab1bb19fccdad61d489b6657").into(), + hex!("a10f19657a9bc5a5c16ebab9f9fddc3f1d812749cd5d80cb331f51de651873ff899e0670f1b079b29a194572de387a17").into(), + hex!("af61f03e3ceef5bef36afa29ba2edc7a3b01ca26cec2589edbc9d124dd46e41410e0e3afbae959c83a6f839bbcf8049a").into(), + hex!("8e6bbfe492ecbbb8dc8889d3dcd7037a58db605bc6bb79131a72a9b9c1bad630e75f5e5e0c1bc407e73f3d13b116739f").into(), + hex!("983fc1ddf17f9756c9cecc00b39bb2ad432587a5c6d1c3296a383b9f539c9afe84c6c818447a709c0b686ba26ce5ea3e").into(), + hex!("8d52413f981bc611427ad0534d25e914113d0ebcd6960aab6421608bec6648b89ae4b2ca2153c57d3cf4f1f37212aa5c").into(), + hex!("ae075b66e5f211c2149c45b211d1297bbc1d9e6497cb3315363c492a9a51ae5b9d0a28bfecd755d68553736901ac6606").into(), + hex!("a02f7fec0661394399a82b2e3151009160b3f5392017ba579b301ed42c85100c295acbfed46b6c58a9d71796ed0930e6").into(), + hex!("a3a7196fecd25e9cc7cac79c35365676e48c7be1493df255676adff2209c0719f2190ceff3ce008d08efa07c244c11a6").into(), + hex!("a5fe3dfb5031517bb8db0d5ade1e9f438e84bcf23221de003b03d2a2f4ea97629e81c79abc3769bdb8c69a512c189b91").into(), + hex!("8cd9d7e953c7ae07ee785d68a999e702565960d376692d9ea468556ad141229b1f3bc97926818c078901f73ecc578e93").into(), + hex!("81d6fc2f01633e8eab3ba4d72588e14f45b00e68ab887bdd4ec5e8558965db21189310df973837106216777b07fc0805").into(), + hex!("b75ac3d5b3dad1edf40a9f6b5d8923a81872832eb3a38e515539cec871a353b07cb477f6d55cf15ba2815a70458aac32").into(), + hex!("94d3c9406dc6dd7241a726355643d706e46b35f1ffe4509ac43e97c64c07592821156ba02ec9a78978e66709995a0ac8").into(), + hex!("a3b109249ac2900806f0f39338da72d4f2cc6d1ac403b59834b46da5705cf436af8499fa83717f954edb32312397c8d9").into(), + hex!("8336744d8ef3a3bb3e9ed3d6b83e08cafffc76b7438adedd3a7358b32acec0e73a4635aa3166362ab4e158e68576255d").into(), + hex!("99b74edbac662fff69ba412de466a427a928ce2363c9e59dddd664f6fa50f2e1dd3d464701b01784aa224b3d96dedea3").into(), + hex!("b397ed7134f447d9bf1c511bf92f2d27d7b6d425b8b411365fbef696cff95c2175461cf5dd83d93bb700e50ebb99b949").into(), + hex!("a3e1fe11f38d3954a7f48c8b68ff956ea0b6f8a3e603fd258c9406ec2b685ff48241db5257179ea020a83c31dc963854").into(), + hex!("949cf015ce50e27cf5c2ff1b8e2e066679905ac91164e3423d3fb7e05c64429e77e432db0f549acb99f91fb134b6edad").into(), + hex!("a1c0c317e6e352e16e25c140820b927161ce5d2c4c2e10bca3057ba4d46b4f42ad7aba20de86dad9fc6368ea92695268").into(), + hex!("8d6e3df29419bd0da1deba52c1feebe37744108685b49ca703e1b76fb4d612e3959d3b60b822506e5c0aac50b2f5eee2").into(), + hex!("a15e0cb96a463ab81e661ca44c619b71a159680bbc04707ea5a5867ff38b15416e3abe55d2fabdab9aede1f157dd37e1").into(), + hex!("b6d6482ad7b9b412ffbefbbdcc28eb3d091b1291f54f77bdd53c4ac85f705c454940f466dc272dde7b03c26f0cd6ecb3").into(), + hex!("8391e3ad6ec2686bdc686671d579edac2d5efa8cf0923577df28fe0735e4d5103173d44452816e3c2b2a7fcc1fcc20d9").into(), + hex!("818202d7cb60e4148c71633ccbe1ce311de7b7ff93a1988e86ba29cc58037189f0f275b3323a6719dc9bdcfbc49c35c3").into(), + hex!("a7c0fcc422c6da878926cc6763ae6ec685a5d8fd1afe61269957be6bfb3f1705a8e4c6e6d85bd15636521f5a2ceb3a00").into(), + hex!("8f7bbaaac458bada6d852fe665c87c646133bab16c0d5136c3dc922095b9d647d93a9de7671cb7bfd4cbd138ae0709d1").into(), + hex!("b6e9fe9fa3d4c833c3beae7f798f30f07e3cdf6f6c8eb8e2b70cad51b37af2549dc9f2e7f97f194e5897d4dedb904a45").into(), + hex!("b455f751232de0a48440d09983f4f4718b6169907979c9f282acf7177ab5b1f338fe1f2acd8d0bee4b4aad61d0340839").into(), + hex!("8aadfcf3562f1c357068323352cb1745349a27a7362358d869e617c2410db747149b993ee9e881e252ecdd42fd75f351").into(), + hex!("91bf4c32fa8888d3829d3c33e12550d2ecb70762d5eeecd044d4902e4a7f8b7a2592cf6cb7736eb6bd9d312f85c2777c").into(), + hex!("859426bf6211e68924eefdb26cdc168ac0deab291aaff7036163997bff34d45809932f91e12d113784c05553ca773b15").into(), + hex!("81730b4bc5f755e5b99c321a6996c65e57ea2ebe6c0e4e404ed30920194fd76db65304635ad054a8b25bfd982cead47a").into(), + hex!("b26f5ed09f7d5bb640ec94ddd1df0b76466f69a943b4699f53d45296d5d6b8010bb61477539bc377d1a673d89074d22f").into(), + hex!("aa65c11071be23c9bddaa5203f3166e5cf043efe5fb8f4b26f8a9cabe71db701a450e79eb001c401da5752755d9cf1af").into(), + hex!("a019370ca799c2c98a605850910cf43531bfb616393039fdfc370848feedd3339b2427b750ccc91952b03a09f690e9ed").into(), + hex!("8f84cba7ceb7652023fc8ebde4b00ecde1f550935bab12feb630d6f49517b4148f3cde184bf55d4f6ec99a849fc6f862").into(), + hex!("838733220d1559c800cf1714db8a43a67a0c0d1d3a9fc1e2cdcf615d20406501e5146fe8b59bf64f4c5daa1a6d74f15c").into(), + hex!("9708cfcc9ff95cf23f544119e17518a338575018f153b1ef50118da0681304919a226b2089a417c2ab7b4320dffafc2a").into(), + hex!("a988cfed9f481bc98beb5fc188ed3f6893a3ebba27c3ebace669792f6abf0997727023c3b6930a6421224f5b257b8b49").into(), + hex!("812d3ded3a3c9e58eecf13a29bb4cc13b01b2a0af322423a29bb0e4f6d9021d1d87ac4af7a2a6b88d34f44a8bc1b3c55").into(), + hex!("b2baa7eba496ac4ef60ad8ef27a9677f9507820d95a1c572d322621c4d0226b36146bfc3a9ca1645d123acbd945de3f4").into(), + hex!("89ab1e5c2565f154f92c9b3554160832d176613f1a2f872b6ed62ed925a33fb0b40b71b7443eaaa15099ab24693c8d13").into(), + hex!("8982534f2c343dda20cccf5a9c8bf98240bba5f4e8eb2206e63a1847097deadb6bf0d24b358014d564c5ef1d0448c43e").into(), + hex!("a1e47798a782a024da340d6d6a1b1e5e15a0f2d8668adf349ca375086964414a563cc1eea3226ae637f87e78c0a630b3").into(), + hex!("847b58626f306ef2d785e3fe1b6515f98d9f72037eea0604d92e891a0219142fec485323bec4e93a4ee132af61026b80").into(), + hex!("8368a0f17c8427beb71dbf11a09a2fe8495a33f08c29c74a9a996a88aa01c0a09f9555abeb1ef1592cab99a9e05875cf").into(), + hex!("b38e558a5e62ad196be361651264f5c28ced6ab7c2229d7e33fb04b7f4e441e9dcb82b463b118e73e05055dcc9ce64b6").into(), + hex!("8018499ef720e28759133033833edfe17ed23e42f99058bb79fe844ddee823cfdc43916be2dc9724d18f9726e6f1b409").into(), + hex!("aa9b9cc039d147677aedd1e47ad9013fcc0da0164070ff7305b18e5786c7fac0471368637a3adbb78f3af174a5c1592a").into(), + hex!("a5c0e42851b769d2d822e39222e708068455aae3bdf782975b59d3201e67a58fd66e16d380558bf2086bcab890a92dd5").into(), + hex!("af3f765fd293c253072b33a780ed68933f78d7e079d9a2079b6232755bedf6ebcbce9ba65c01f695602fa8ee17899867").into(), + hex!("8a0192ef0903d7a5ed2e5614a715901f2554b324ee72390974dc90727ff08dafa580041a21a8e6c48a3e08e1b042afab").into(), + hex!("907c827a4fb5f698bf0e6f10ca07741c5b8e3ecb26aa53f938ba34ceb50c01be80c4afc5ac4358a5fda88eadea0cbe73").into(), + hex!("a35ee5c2d7800489723c78008b495e1742f0542dbb487172ef438f60424c81aa41c2397095821248066140662133f6f4").into(), + hex!("b1925ee53c9228cf80e2f5ac0117008a91e98d878f69bf03d00d873ef45f4351cb6988772d89d4ccddb40778d11e0dd6").into(), + hex!("95aafa379cc6a2b4bdd0cad30b7f0a47839952af41f584219ec201c6c4d54610eb2c04b67b29080acb8cecc5e7543fbc").into(), + hex!("8f44c43b80a3c5f488118859fab054745cfe5b0824821944b82fcf870fda6d93489ea9ca4220c24db2f4ad09c6080cb7").into(), + hex!("af861bb21f84c3e7cab55370839d18ac24c475a9e833607fcd7e65c773ee9d64bea203ee9e8fd9d337f1cd28d5ca0d90").into(), + hex!("8f6fde2ebbd7682c69026069cfe93aa5410071f05de9ccd7070c8c3299a6539b39b3798f01a0b4e9b1330510bdb51de7").into(), + hex!("a35d9d6d5dd5428cce7616842203b5fa3721cb4b20f50c0113f138604954fe0cf214ca3d065b578f921054b9efe823df").into(), + hex!("8d562d6c0e0d8325032e1fbf836022c82a8f600a6fbb56c553ee5d1fac0f052c7ce2504c0fd48c9fa6494a6bff63c9fc").into(), + hex!("b02ce594310f1eb8acc92bb80de524a43e663e12fb64fc28291ff207f9d8ae761631416410c3c8f4d6890b8b7e6ed24d").into(), + hex!("a258f8c0eff666c2bb70e505544c3d10d6b258310e4fb2206fd0999f69bfb739a1e232d1e810e7206f490f6c44f6934a").into(), + hex!("a8a77936ca91df3b2ee7394ea821f2bfe91c6ad8193f44651466c170b6ecca97ab356fa7d947ebb4b767e8967092f143").into(), + hex!("88ad79a0320a896415e15b827a89969b4590d4dfa269b662bdc8f4633618f67b249f7e35a35884b131772d08025bfc32").into(), + hex!("a3c66439724d737d20a640bceed8671b20cf6795671b6d442ed1ea5eda6723ae559396c24f44e982ba7751dcc6adef5c").into(), + hex!("8d0e6475acfa2b904e7d53bc7acd070a2ee4894ff5720a20e560e9ecb7872ea442a51cf2f2eee4bef66604a5c08ad9eb").into(), + hex!("804c021152c3304853941847e80480fdaceba3b9676fbe018268cf77d1a1856966c2f9686bb4d4aa0c4118a7e85f83cc").into(), + hex!("a6565a060dc98e2bfab26b59aff2e494777654015c3292653ecdcefbeeebd2ce9091a4f3d1da10f0a4061f81d721f6ec").into(), + hex!("8d5de60e934ea0471d9e0a46489f21e03abb9722f5b3633631a9a099b9524beac5d67716969c83d824498796d9c106b7").into(), + hex!("8c5a9f6eb0a3ea95e75362b06e5cd23968447a212cf22e1419c984d74432c51d290b717f80e8ed3e76b1232216f99758").into(), + hex!("918ebb73eef984d0ce28083306626d04817038056aab4a82ff9ac8176ffdfbf3173c0b05e936daf553248b323fe54f56").into(), + hex!("8f9aededb605db4e499d3c383b0984b1322007c748dea18dc2f1c73da104a5c0bece6bb41d83abdfac594954801b6b62").into(), + hex!("adb198f70a7f1969ed0958be4a9a60dcc1806bced79c63692b9aad6c5648ffea1fed60b24bf4b1862e817cf229e93e83").into(), + hex!("b118f77f99ac947df97e7682f0fb446175185b842380af4ee7394531e4f93002c72b41a57a7c1b923a4f24b10924c84f").into(), + hex!("944f722d9a4879b5997dc3a3b06299182d8f68d767229220a2c9e369c00539a7a076c95f998bea86595e8ec9f1b957bb").into(), + hex!("b7270f33011db1bad18e076a162d6e53d9123808609773eb46e3a4ac69c84c257407907bd5d05b6eb5e926b8d8c6d884").into(), + hex!("b09c0a505457c6b473fc7b2d634222905b36a6ffcc015dbdffa3bd62218c94e891615e77f28e6e18dd8474be8c156695").into(), + hex!("97d076617cf0a64ab3d1f030cfd72a303b6b252c0a7b96157ff7fc8af5970f00d14492c46e8f6f37caafe837d0dc95c7").into(), + hex!("b405520ef829a2a3b8947f1687ab56a7af4026c1a6f99f59aa192bc4f3b12a2de407862ff74ba1b2c51889b8d6b090c7").into(), + hex!("8bb045e7482b7abe670d72eb2f7afe4207b5a3d488364ff7bb4266f8784ea41893553a4bf7d01e78c99ed9008e2c13bb").into(), + hex!("b2df29442b469c8e9e85a03cb8ea6544598efe3e35109b14c8101a0d2da5837a0427d5559f4e48ae302dec73464fec04").into(), + hex!("99daf03fa434a482d9aa4d090884c99b7208c1f5380b9acbf304e1bc33d3d6902afa5d248d20ccf03795e26901356ede").into(), + hex!("b60df25a7ac1ad14aef7e8809c4bfc190b715f94f14b0534cc2e4015ff6c322883cbdc5309e05d67dca4bc641c69725a").into(), + hex!("b46a818f3e492e231d8fa8de8848c16f0d648a2e0d1c816adf9306a8596fdf45922e59cbf745430570a19e54f45e28f7").into(), + hex!("b3ca2ab7d64b71e40693bd3e2288a1f78741a139403c783d259cb9dc9c29f16c00796b6302cdcea4a4314e132b4f9d1c").into(), + hex!("af3d3dffbe55842dfb4417295a6ed1a82d26a579199494b305445215045785759be4cb57dc870c7ddaffbc101a854a92").into(), + hex!("b21785008910a949804d1291e7533752641d31beae3cb518806488f81d58c38a5efe5ed9534ac692e68c3121e2f9d97d").into(), + hex!("ab7eff4ef8696db334bce564bc273af0412bb4de547056326dff2037e1eca7abde039a51953948dd61d3d15925cd92f6").into(), + hex!("8bb4d08318386c91a0136d980a42da18c05743a5c52a861ce52a436e66a8ebe472dac7f7461db32ea5da59a23e9bd6c9").into(), + hex!("a1c84730a5c41dcab9a5ef9e1508a48213dbc69b00c8f814baf3f5e676355fc0b432d58a23ad542b55b527a3909b3af6").into(), + hex!("948f808c6b8e3e109a999657ef966e1e02c96a7aae6eecaf912344e1c7bf7ea51c911cecd3cea2b41ff55acc31df9454").into(), + hex!("8d264fbfeeebb6c4df37ff02224e75e245e508f53fb3446192cd786ecf10d0f704c4fc2e53e7f7318ae1407e46fc0fb8").into(), + hex!("8d47a7c2c62b459b91e8f67e9841b34a282ceb11e2c4b0549883b627c8526d9e0ebd7333ba70630bc0ec2478114b6ae8").into(), + hex!("a4348ad30c12bb7dd03dd014cca599c3499ddf348e7795b0392a18f998289979478374e374a8297b5b6c427441e2b5af").into(), + hex!("92ec1aeb2aa24c51cd5f724972c8b6095e77b237d83f93ed34ca0bc91a1dbf1ad95adccc59e0f0abbfef33f331f3298c").into(), + hex!("941f73b2138b4347ecafcc7b8c3d03f2a54dc49f580394ed08f22b0878ee7cb63d42978f1d320c09e7dbc67648c06f8c").into(), + hex!("a308ed8737b3a9346ff20dc9f112efccc193472e6fde6aa218ceae11e288bbd2c35fa45c1d8bb238696a96767cd68b46").into(), + hex!("8eb03001ac9e22c6956a682ed458e650785c36d23ddbcd51ac4d9cc991325c02519ff1958987a08eb29ff56ff6e2c293").into(), + hex!("80637db55287f891baa0e865d2423191b9a575620bc4493ea76166d47b99fd89ad8625c21f446b01e3ae17292c78f7ef").into(), + hex!("a5b3da08aad945effdb645c797a0a8bfa828c9d658df2783a214597acebda3ffc07ee48d0ce1147d77540b557d9ada91").into(), + hex!("8d5e0b8cde1f62cc8f15d9f596e31de09c221da91b10335b92ef1155802e742442def161223333573158723f3408bbd3").into(), + hex!("931923f0c1f75a197e6244d67525b524ceb07510a6aae8cb3d56167cc1aacc76d26fadfa1bdfc55d8439c6ee4d4d8174").into(), + hex!("963a298fc8876b702424a697929c7a1938d298075e38b616c8711f1c7116f74868113a7617e0b4783fc00f88c614e72d").into(), + hex!("91ead7dacf43905eb5d4b179af29f945479ed074126bad3b5a2bbc1663af5f664fe53a36684e9389ab5819e53f1344fc").into(), + hex!("b8a6c999068c13fb71a99d75eabadf7edd2d32e28607baf001a0aeec412fdd3575602c68d3feb4d743b90396705e37f3").into(), + hex!("938bbaa0ba14597067ff4c0a7cfc1529c44160d6f61cfad12246526d84fb7a1ba964d3bbb065a348cf7a98356ee15234").into(), + hex!("80e44d3577f12cabaed7074feeb57162ff80b61f86cce8f41d1d1250bc455070b09f6ea9d0c263b7b4824701480f4c14").into(), + hex!("8d74f4c192561ce3acf87ffadc523294197831f2c9ff764734baa61cbad179f8c59ef81c437faaf0480f2b1f0ba1d4c8").into(), + hex!("a0133deca5ae8f1100df8db69920b2d0c31aa21bd3849dbaf4c264eaeaec8937ab8f982770ce1ea17e0e258910a56d02").into(), + hex!("b6a25d493d708b035b853f1f7a6628d8e0b205d2678293f763d7ea4da11d298539533b22b43ed2e5f708648556f3094e").into(), + hex!("a58c3a4ba86d0d6b81c8411bb73a528b4f3bc2debac0e0208f788c080a3a96541d57c927143c165f595070afe14b0517").into(), + hex!("a52c15840b89d92897d1e140b2b8468a88886c5e1092861e598b3a433b340ded5b35b3d632a9879820fd56f20ca3a68b").into(), + hex!("8c122bea78deee98f00a86184ded61c10c97335bd672dadddc8224a1da21a325e221f8a7cfd4e723608ebcd85a2f19fe").into(), + hex!("87a51e0011dd0488009baac9c611fbde01878f9cf1584ea407599742bb32ef10586d9040dae3e9800a125de54f80c047").into(), + hex!("98181e9291622f3f3f72937c3828cee9a1661ca522250dfbbe1c39cda23b23be5b6e970faf400c6c7f15c9ca1d563868").into(), + hex!("b01a30d439def99e676c097e5f4b2aa249aa4d184eaace81819a698cb37d33f5a24089339916ee0acb539f0e62936d83").into(), + hex!("830e70476c6093d8b9c621ddf0468a7890942589cae744300416639a8b3bc59a57a7e1150b8207b6ab83dafcc5b65d3c").into(), + hex!("83ca733849830cb8fc2ef469e7e464fd94def561ce49ff0aa352a6ecd0e52c7aefcd69ab59f3d1ed2d5b8536d0a7895d").into(), + hex!("b76cb8cb446eb3cb4f682a5cd884f6c93086a8bf626c5b5c557a06499de9c13315618d48a0c5693512a3dc143a799c07").into(), + hex!("8b027c14affe47f83ee59b504d83b2fd2d9303de2c03ee59d169bb199d9f4bd6533d7f8c812dd7a6f1e8155e3e185689").into(), + hex!("8e6b888197010ebadd216da35b9716daa8675d93b3c33a96a19fd9ca42624f6b430b2ff115cd0f5b717341605dda24bf").into(), + hex!("b6652440bd01316523feefceb460158cd9ba268dd8dbe860a0271f0176230f057767597e4197885ba907318ca202ba06").into(), + hex!("a0b3dff15982a38a2f56d8c6cfc5c5543c045bf2db24571d23387ccab42abe2756f34d5f0bf6a426bbad3c358b8bdb00").into(), + hex!("a8b593de2c6c90392325b2d7a6cb3f54ec441b33ed584076cc9da4ec6012e3aaf02cec64cc1fd222df32bf1c452cc024").into(), + hex!("96b478b1e5e49d4ea3fd97c4846ae0f781dcc9f9ff61ee022ca92c3d8dfba89c513c46e8bb38b73e6b678a79b9b12177").into(), + hex!("946d585d7aa452d37a8c89d404757c3cce2adf2410e18613483c19199abd88f7a12e206f87a43f6009e42f4e31ed20c0").into(), + hex!("8c432e044af778fb5e5e5677dbd29cd52d6574a66b09b0cd6e2a5812e71c91559c3f257587bfc557b4b072a822973a60").into(), + hex!("ad2cdae4ce412c92c6d0e6d7401639eecb9e31de949b5e6c09941aeafb89753a00ea1eb79fa70b54699acbfa31eda6b7").into(), + hex!("b504cb87a024fd71b7ee7bed2833115567461d1ae8902cccd26809005c4a56078617ec5d3fa5b29a1c5954adc3867a26").into(), + hex!("b8876bda1e709ab16e1347a1107852a7898a334a84af978de39920790b4d82eb0739cbfc34da1c7154dd6e9f7674759c").into(), + hex!("973dcf44ab60f55f5d10a8753ea16db9faedd839466a130729538f3a0724f00f74b3ca1de16987d7c6e24e9467f62bc7").into(), + hex!("94df5fe87661101a89b49091a3d4de89331cdbd88531ebb08a95f2629886ee53b3dcbcc26bb6bc68b443303d8d397141").into(), + hex!("a92beb343caf6a945990adcf84302c55d1fccdef96c34a21f2c00d3e206a9b2c6c6b412f66e5d4fafe26ef6446cde705").into(), + hex!("b298aa927713c86adfe0de1a8d6f4083b718c8be27156da9fd11abd8edb3a54a926ad487801eb39cfc9363a0a3be0d44").into(), + hex!("b34d4d2e15079e7e80fdba30cddf4fc0e6c9a61f7ab06a6ea0a4e55fd5bf632c6d72e021d6264d935439d321de883bb6").into(), + hex!("b4a86fb5b0049718caead1bc036833a2caeb88e1afadbbbcb0cd021d95e1f33fcc916f0b97fc1b9226c37050e3463796").into(), + hex!("b6cec65e5268818c82c0a4a029b02f8d23de98b68730a445119fee670118eb34027c23c987fac950f9b0151631328a4e").into(), + hex!("880b4ef2b278e1b2cccf36a3b5b7fbce94f106ed9fa2820cb9099a7a540a57e9fdeef5c0fb0a743049828fc2b8c46163").into(), + hex!("ab2053c376c6bd113b89fdb2ae3b8401aa891135345885730c61cac7813f69ea7d906c531be752e28657f73af92d1f4e").into(), + hex!("8fa2d7b22af8e6b82679ebdfa13efdcb34289a554653ea6c1b16efb9f957f7fe64df787e7b03d8cdc8a732b91c916bd1").into(), + hex!("8e825c03c8409a3302266dc5f47fbfc381dfbafbadc37bd8d40f079ca8963d4c5ae6ef0d0ba6aef2d4688736f5f6bb45").into(), + hex!("a40ef3d2291d8782540961ce285054678b3d322d3cf7fc154207228c290708b1abfc37a4d7762dab3dfea582a112444a").into(), + hex!("8dbe8fcbcc414eb352245c52549973f73d987012de9d5f2b2f55dfdc43cf8cc9ea6b147abf149817f80f9e15aea566c6").into(), + hex!("a7e8775e04214e3b9898ffb9625dc8bcd1b683e333acdceddb8ca6db241df08a7b80e9d476a711b8b7d66aefca81e9cd").into(), + hex!("8b6ed54668f78a4a7624683b9bf3abf2bb0b6dccffccd8c0967df6297dadaf51732800fb9832b069437a6bf82ed7e6ae").into(), + hex!("9437ce85146202d3815df7f341a182678665dfb74b96006dc9d6acc16110d00b4a02717b702a765566457710ff5a7280").into(), + hex!("86a790072efa2cafa97be4b6b31f8c533f3b20cf3922fc0285fd403da436e4c49c65c5f08d77bfe823526c67bb58fab6").into(), + hex!("8ee8873de7cd28a54ba2c63a80b63399effed76b154e96ed26e7c0668b9f2476e298688b6a00c4b2ab9d020a897695d7").into(), + hex!("975c3261f0f32d59473e588f89593be38f5694cfa09394a861e4330b7800fb2528ea832106a928c54c76a303d49140e2").into(), + hex!("b5222582ed6604b9856a48039bd643340f4bf1bf0fc805e8453a9eb7630d6cea1452d28536706d6fa3ec16617617991c").into(), + hex!("b75c28941ee3f91b3535b4eaa0fb17b59ca65b5256601a1f6d0cf2bb4d66837fd16e51d6942856679012a5730a66e519").into(), + hex!("97b510f9f46bdf77a002b2403d8e42b6d6ad5329ea080940844429763ad3efd592652789c8d3d4fac0903c705f533cf7").into(), + hex!("a3fd9d8bbdc98394883022299fd9793e0c4f374d8e40d6ce89b2869d3173cb6a5476371d6095dad068ff217729f60af4").into(), + hex!("a57d5de556853484b1d88808d2529450238bc467376ded84cfd7b4a1ba258f6d43b5958220f962c57b033abcef1d5158").into(), + hex!("8465bd8be9bd9c2c6116d4ae44ec6618c109cb9aaee2d241e7a6ed906d398ef15a6fc18bc8b1d3398184241405954bba").into(), + hex!("ab1cc44983e46a6ea2430aa6616ab28614f43624665e3e6ae31a9357c0c5434f34e56c720906e184327693cc4ebe1fa2").into(), + hex!("aafe14dd3b680f096010788226d8413ca628feedad79a2bc78cb04d47c6ad910f7f46ca87b8f8281744625d8f42d5eea").into(), + hex!("86a533b02ae929f67c301649a2d58651b98cdffe731b63fa32aa1013c271634bbb088c0d02865913c11bbb1bf57c0e12").into(), + hex!("b28df3e04bde4ec373171401dbd0546f4cb6fa8e9a4a8019aadc653d4e05e0b5b9a64417715dd87f6df9e7b3145f6659").into(), + hex!("ac63fc758c1a3bc5cbff0f5e0b5a07a5aa801363b129d4e0360165c7dc1057ec37b0d808e9fd6b179e2c1e66bbc6090e").into(), + hex!("93f941b4fe6c05621e7a651b87669eefd60b6e8a4a8e630a51fa3fee27417b9eebce39f80a5bade9ca779133ad8388f6").into(), + hex!("96d7a69eaf2761bf0e5ebcd607b134d5dedba8e262ca1d6d3e8fbf23e6419a8ce1bbe4cd23b9e4b5f80db54a802a9795").into(), + hex!("8b62902fb2855300580e94830a4bc825d997ede33bf356fe3b7c08d6a8bd85a37879433fc6bee58f9b44ca280f4e8dfd").into(), + hex!("b043156fcd02b75dbe940c763fa8e8a7c7f6d74c1d5395db5ce544af3b6097eab61686950535a810aa95889ced12f74d").into(), + hex!("8614a7599c8d97aa9ca63b876f677977cf0daa969ff2a9a153f297a4a46e08fa5d91492995de94dc32cf009ce6bb5b5f").into(), + hex!("81351fd284d6d07092875f366bc5e53bfd7944b81eece85eab71a00443d1d2a9fc0337aaf34c980f6778dd211caa9f64").into(), + hex!("8c722aaf5d5dad1845056bf5e56dbff0f8b501f4846610f99da01130a49c96db9962bfd9be20670658cf276cc308be08").into(), + hex!("8effe3fb27c9f76bbd78687b743b52e6f3330eddc81bc9006ca81fd640f149d73630af578694f4530833c2151522dcc1").into(), + hex!("a3d327f48eb34998a3b19a745bca3fade6a71360022c9180efb60d5a6f4126c3f4dfa498f45b9a626ca567fdd66ffbff").into(), + hex!("a59a59db246f981e9c8e54aba52898c714d9787fef8969a6d8677fe6dec82950ff22a1364393b579f3e596cdf5bcd7b1").into(), + hex!("a15ebe9ab6de62a4d1ff30b7fc58acfb14ea54d7fa513cbcb045af3070db22bf9c1e987fa26c0c54356b9e38fa412626").into(), + hex!("b58396bce7d32ba6c70adbd37156d859e153c1932d2b0c7c874a1182ba831439e80d6fc6d7d88a870e193f515aef2264").into(), + hex!("b666dae42ea858c9b7d903ea3ca5279f619c71ac6e3fda7469e2bbba08c7e8e12d6a3c35ff2c6383673b1b7c21db5e0e").into(), + hex!("8eaaa21c8955f15bbcfd5756421a045e7b4825576379cc6229fe9751f7a7738b90be19ba52261db01c1e13af955675b0").into(), + hex!("8027bc62b59f9f15613e38da74ccc71fc3eaee26f096d187c613068195ce6eb64176013f2d86b00c4b0b6a7c11b9a9e5").into(), + hex!("8275eb1a7356f403d4e67a5a70d49e0e1ad13f368ab12527f8a84e71944f71dd0d725352157dbf09732160ec99f7b3b0").into(), + hex!("b8c41c09c228da62a548e49cfa107630166ac5c1469abf6d8aab55938ed1d142d5ddbc4f1043eed9496e9002cac99945").into(), + hex!("912750d2f1b21756662a400236f797b8ba76c73e5af95941a8c6ef9427838c4826715c80942cf8cb7ed01566bc490754").into(), + hex!("862af7dbb38ad7293a4e598cb52a8ac84dacee3d9bf007b5cb6a18a1acead0aa33f6dba796ce630e632c97aeb7100d68").into(), + hex!("890def696fc04bbb9e9ed87a2a4965b896a9ae127bc0e1cc515549b88ddbcbc02647e983561cab691f7d25cf7c7eb254").into(), + hex!("b835ffaf54c8b878d3c4262ca2bf5e6be2c691adced622b35d998ed72e1467ba907f4fde8d64ce43b43a8196f48e55db").into(), + hex!("a6d7e65bf9f889532090ae4f9067bb63f15b21f05f22c2540ff1bb5b0b5d98f205e150b1b1690e9aa13d0dee37222143").into(), + hex!("8ebfbcaccddd2489c4a29a374a2babc26987c3312607eadb2c4b0a53a17de97107c54eab34def09144b3098c082c286b").into(), + hex!("900b9972180a2c8753f5ff49fdd2cfe18c700d9927b3c3e16deb6376ad6ee665c698be72d4837b94911a0b4c183cb140").into(), + hex!("aa9679c01ecf1f1452c54688e01cb25bf157bde6b09b1ed460b8c175d65eba439c7ad4b7c1d72415f5622f3fbc068dc8").into(), + hex!("887a4277ee8754733f3692a90416eeac1ebee52ff23173a827f0ba569bd84efd806eb9139049f66cc577e370d3f0962d").into(), + hex!("951b27456e2af80436608aadec54ebd03bda37fa58452631da63bc5ff3eecb5ffb73d356b19f6c9c4225fcb0da8fda20").into(), + hex!("9104b5af82dbca914370eadb5518b26bee7ed7edeca74b741585ba8b249204e2c998bd47a02cef4335e236f8efafef94").into(), + hex!("8757e9a6a2dac742ab66011c53fa76edb5ebc3c2fbd9a7265529a3e5608b5c24b4482fed095725e9b8fed5a8319c17a4").into(), + hex!("a7acf82999de75f231fd80770bcb0f4c720d6b1e4a2558fa1ce854382fda92beb89fea5b5d229dad85fafee7a9e98329").into(), + hex!("8fb74891a8642f25a55b5eda5818367aac2fdf9663ad1e3dbc0166b484c0cda581b243cc75131167f1afa9caaf6705a0").into(), + hex!("897d7a19b70dcef1af006df3365981d73068c81f18017f32fb9966599481496efd5f6caceef943b31c52750c46d9590d").into(), + hex!("87ac804ccfe7f1fa156b8666664a397236832569f8945e11d4688a9e43ada4d4104efb3fda750f48ef655a29357c5e7d").into(), + hex!("af18cf1e3d094b4d8423da072f98b3023d296f6a1f2a35d500f02bde522bb81dc65e9741c5bc74f7d5613bd78ce6bc03").into(), + hex!("9752561179783f336937757b619b2fdcb9dfce05aa3c4fce6d582dc966182eb85ab4ccb63e7e1736a7c5fad9d33cccd2").into(), + hex!("89e19b665ce7f6617884afaf854e88bb7b501ecdd195a5662c79802d721f5340eca8c48341ad1d6c78f519f82e5a9836").into(), + hex!("94402d05dbe02a7505da715c5b26438880d086e3130dce7d6c59a9cca1943fe88c44771619303ec71736774b3cc5b1f6").into(), + hex!("a76adeddf2454d131c91d5e2e3a464ef5d3c40ee6a2ab95e70ef2e49e0920d24f9b09276250ed7b29851affbdbc7885a").into(), + hex!("8934e9a3feababa12ed142daa30e91bd6d28b432d182ac625501fe1dc82f973c67f0fe82d39c9b1da3613bb8bfe2f77b").into(), + hex!("a5c11337eb91ce0e9b6d61bbdadea0a063beee1bc471cc02dc1d81c5dd2095315c400cbc6c33d23c77e98bba6bdf5439").into(), + hex!("92d00e64ed711951aeb852908aeb6fd379ea516872dd512384b1e773ef078e52e6d618beb202d437d2a46bcb78087f7a").into(), + hex!("97f1a7370b4f5acf83b466f519da361c366915f560385dd7eff9d53700ad81b25c9862bc71d35428e82372a5ae555ea0").into(), + hex!("95614544f65808f096c8297d7cf45b274fc9b2b1bd63f8c3a95d84393f1d0784d18cacb59a7ddd2caf2764b675fba272").into(), + hex!("8d474636a638e7b398566a39b3f939a314f1cf88e64d81db0f556ca60951ec1dca1b93e3906a6654ed9ba06f2c31d4ea").into(), + hex!("b87e5f481b938ac8a481b775cc58be2a06604549e3c810fc4734bab76099e5c617f0243c4c140cb7dd6d36a6dc2286bf").into(), + hex!("806efb61d1c948efc10dbf9bef30197d1c269e5e7fcf20a84367b26223d33fade413a0bbf4e33f0d1f1a00967289015e").into(), + hex!("880b99e77a6efb26c0a69583abb8e1e09a5307ac037962ddf752407cacaf8f46b5a67faf9126bdbcb9b75abf854f1c89").into(), + hex!("82ffe4de0e474109c9d99ad861f90afd33c99eae86ea7930551be40f08f0a6b44cad094cdfc9ed7dd165065b390579d0").into(), + hex!("941cd102228aa81ef99506313a4492a17c506e7169808c6b14dd330164e9e8b71b757cbe6e1bb02184372a8c26f7ad1f").into(), + hex!("ae96dc808c316a677977831bad1e529ef965dadb5d6aea25ab008fe7bb1543e596e33052cfbe4279fa060201199d2c34").into(), + hex!("a2053719da2b7501dab42011ae144b3c8d72bd17493181bf3ae79a678068dc3ee2f19d29a60b5a323692c3f684f96392").into(), + hex!("b17171939519d90e243d41839c3c5ce7ac7e6a978e4a7e56b2c8e6a2b1b587c7eacea47f2e31a55d88555d252c810ebd").into(), + hex!("a958987c2b3c84df8176b600f5b75a8badef9653c71eff967e76648937def38826eaab4027a639f4f300b20019166250").into(), + hex!("854aafa329e2b2563355641eba95f2aba5b33d443ab16f5e342048f97d97c4e2812ff27c6f4180b8110272f3151be690").into(), + hex!("94d4a1e3a3d28a948f14d1507372701ac6fc884a4905405a63663e170831578a2719714ef56f920baa0ca27954823e39").into(), + hex!("826be957cf66db958028fa95655b54b2337f78fb6ef26bd29e2e3a64b130b90521333f31d132c04779e4b23a6b6cd951").into(), + hex!("8261f7e644b929d18197b3a5dcbba5897e03dea3f6270a7218119bd6ec3955591f369b693daff58133b62a07f4031394").into(), + hex!("84926cf2265981e5531d90d8f2da1041cb73bdb1a7e11eb8ab21dbe94fefad5bbd674f6cafbcaa597480567edf0b2029").into(), + hex!("8fb51e3ef3c1047ae7c527dc24dc8824b2655faff2c4c78da1fcedde48b531d19abaf517363bf30605a87336b8642073").into(), + hex!("8ba45888012549a343983c43cea12a0c268d2f7884fcf563d98e8c0e08686064a9231ae83680f225e46d021a4e7959bb").into(), + hex!("973ab82026d360e2cf5676d883906186bc61b43f60767ca58f11d0995e40780b163961e6e096299ccf1c86175203abde").into(), + hex!("b77416ea9a6b819e63ae427057d5741788bd6301b02d180083c7aa662200f5ebed14a486efae63c3de81572fe0d92a9c").into(), + hex!("820cc2ac3eed5bce7dc72df2aa3214e71690b91445d8bb1634c0488a671e3669028efbe1eae52f7132bde29b16a020b7").into(), + hex!("a6b434ac201b511dceeed63b731111d2b985934884f07d65c9d7642075b581604e8a66afc7164fbc0eb556282e8d83d2").into(), + hex!("b81821a79c9148b41d24d85dc997336a1e1719da0e31e42af30812b97a5af31708ca3e7bc2e803c3751cff23af5c509d").into(), + hex!("a013cc5e3fbb47951637426581c1d72764556798f93e413e1317849efd60f3ecb64c762f92544201eb5d6cfb68233050").into(), + hex!("b5f32034d0f66bcbccefe2a177a60f31132d98c0899aa1ffff5ebf807546ff3104103077b1435fa6587bfe3e67ac0266").into(), + hex!("86ca8ed7c475d33455fae4242b05b1b3576e6ec05ac512ca7d3f9c8d44376e909c734c25cd0e33f0f6b4857d40452024").into(), + hex!("b781956110d24e4510a8b5500b71529f8635aa419a009d314898e8c572a4f923ba643ae94bdfdf9224509177aa8e6b73").into(), + hex!("a3f9dcc48290883d233100b69404b0b05cf34df5f6e6f6833a17cc7b23a2612b85c39df03c1e6e3cd380f259402c6120").into(), + hex!("a104d4bad69f1720307ed12363d1ec97952acfe09d9e3650034c33f3f20c763271ebe0d5b50b1d3bd15c469f4573b09d").into(), + hex!("94bbc6b2742d21eff4fae77c720313015dd4bbcc5add8146bf1c4b89e32f6f5df46ca770e1f385fdd29dc5c7b9653361").into(), + hex!("951aa38464912a29df2101c60771d6de7fadb63f2db3f13527f8bdacb66e9e8a97aaac7b81b19e3d1025b54e2c8facff").into(), + hex!("919b5187af7dae210f151dc64a9cbd396d1ae04acadebf542a7123004efc7ce00d6e14c170d876fbc64dc1b5d141a5f4").into(), + hex!("88e1e459ee5aeb8b36ed004f6d03da296101106fbe1b18f9bbf63e92321db51670c34050fd3b7dc56a4bad76403823ee").into(), + hex!("86b3ec14a8ffb811a0ecc3771f600d8b08c098537d100fba66def19e7ee4d1c397a311977bf37e6cd2d47a8a2ee8c223").into(), + hex!("898c4873bd356ba8015f6f686d57088fa8f79f38a187a0ef177a6a5f2bc470f263454ee63d0863b62fca37e5a0292987").into(), + hex!("b471c72bd2971353f4b44248b8e6cf5316812861a88ccfc20fd0d89a5e010428c387228b2f6f14c12f79e31afc9d0753").into(), + hex!("8b7cb5b8de09a6dfceddcbaa498bc65f86297bcf95d107880c08854ed2289441a67721340285cfe1749c62e8ef0f3c58").into(), + hex!("983cb6bbfe83bce8326e699e83fca01ea2958c09808c703cac97a0ea777e5a5f3f5bba9169a47732de7459a3c7af47d2").into(), + hex!("8235a3f09078dd34ce2fc17cc625e061298713b113dda12d354b3d2ba80e11c443b1dd59c9eb5a29513a909645ae97d4").into(), + hex!("8bb51b380a8a52d61a94e7b382ff6ce601260fa9b8c5d616764a3df719b382ec43aec9266444a16951e102d8b1fb2f38").into(), + hex!("9579973ee2559da09b327c62b1cc0177f2859872885dca709e24dcfbb9bdf9224a6d26869aafce498f44c0e6bd8a996c").into(), + hex!("842ba3c847c99532bf3a9339380e84839326d39d404f9c2994821eaf265185c1ac87d3dc04a7f851df4961e540330323").into(), + hex!("99dad12f78e1a554f2163afc50aa26ee2a3067fc30f9c2382975d7da40c738313eaae7adbc2521f34c1c708f3a7475b7").into(), + hex!("b96e3ff8bdae47aa13067c29318b1e96a7fe3941869c17ce6662183b7b064bf261e1cea03e2a4643c993728a2606b5b5").into(), + hex!("955bc897171aa65d0159aa6e5d51855833f83d8bd5e65f93ad26c27781171783f3988a12bf987472edb39994bd071ea5").into(), + hex!("a59249e4dfb674dfdc648ae00b4226f85f8374076ecfccb43dfde2b9b299bb880943181e8b908ddeba2411843e288085").into(), + hex!("ac2955c1d48354e1f95f1b36e085b9ea9829e8de4f2a3e2418a403cb1286e2599ba00a6b82609dd489eda370218dcf4c").into(), + hex!("b2eedff11e346518fa54e161be1d45db77136b724d497e337a55edfc896417de3a180bf90dd5f9d92c19db48e8574760").into(), + hex!("976eb5543e043b88d87fda18634470911dfe0e0cabab874ca38c1009e64d43026d9637d39dcd777bc7f809bbfc3e2110").into(), + hex!("8ea5f88a79f4eb9e7c0b6b29f8ef2d1cc4c15ed0ed798ab11a13d28b17ab99278d16cd59c3fa8217776c6dfae3aedf88").into(), + hex!("b7f146a357e02a63cd79ca47bf93998b193ce1174446953f12fa751f85dc2a54c9ed00c01a9308509152b3bad21d7230").into(), + hex!("87fd7e26a0749350ebdcd7c5d30e4b969a76bda530c831262fc98b36be932a4d025310f695d5b210ead89ee70eb7e53b").into(), + hex!("b9445bafb56298082c43ccbdabac4b0bf5c2f0a60a3f9e65916af4108d773d62ffc898a35b0b8efb72ea846e214faa02").into(), + hex!("b106c6d13ca17a4c8ea599306e84918127cf2de21027ac3fe5a57d35cf6f3b1d7671c70b866f6e02168ae4e7adb56860").into(), + hex!("9276e8051bed8f5dbfc6b35765aac577dd9351d9d6ac1bb14496bd98091005b9a4737b213e347336413743f681f5043b").into(), + hex!("aefc682f8784b18d36202a069269be7dba8ab67ae3543838e6d473fbc5713d103abcc8da1729a288503b786baac182d3").into(), + hex!("97578474be98726192cb0eac3cb9195a54c7315e9c619d5c44c56b3f98671636c383416f73605d4ea7ca9fbeff8dd699").into(), + hex!("99c34f9bd0fcb18b3d931e562988cf91886a417f8678f22651bf3cf138df2bbec3f675de90f62dda769e0eda03d72b7e").into(), + hex!("a0047e03c89a95248543618e6b7ca2c7aad7acda3c9f85771ec5c93fa898c651e8b2ea3b6b799d8cd592290a986cdd7d").into(), + hex!("993726e0b1c2277b97b83c80192e14b67977bf21b6ebcde2bda30261aa1897251cd2e277cfcb6193517f1eb156d2fe86").into(), + hex!("974a5180e55eab23d4c973fbee6ad1010335161ecdb849fe6520b34c1f96530a4faff80bd738fe281019b79d968c472c").into(), + hex!("8f1d90034f998018c3f4b5947b40b139fcead2e40aa80fdec6a4337c60e9d5ff1923dda7f0b5b1731ff16f55027d41bf").into(), + hex!("a7d9ae9621dd1f3da3cd2d435e891cc3579c4c0d60d6a4565cac86c315cea21a9ad883559fe7b897ae6e05f1aa989ad9").into(), + hex!("800f6be579b31ea950a50be65f7de8f678b23b7466579c01ac26ebf9c19599fb2b446da40ad4fc92c6109fcd6793303f").into(), + hex!("86fa3d4b60e8282827115c50b1b49b29a371b52aa9c9b8f83cd5268b535859f86e1a60aade6bf4f52e234777bea30bda").into(), + hex!("a80ac2a197002879ef4db6e2b1e1b9c239e4f6c0f0abf1cc9b9b7bf3da7e078a21893c01eaaab236a7e8618ac146b4a6").into(), + hex!("b4bf70468eff528bf8815a8d07080a7e98d1b03da1b499573e0dbbd9846408654535657062e7a87a54773d5493fc5079").into(), + hex!("ae0e15a09238508b769de83b30582cc224b31cd854d04fdb7b8008d5d8d936dbdd3f4a70fff560a8be634c141772561b").into(), + hex!("936f7e20c96b97548fef667aa9fa9e6cfdc578f392774586abe124e7afc36be3a484735e88cc0d6de6d69cf4548b1227").into(), + hex!("8163eea18eacc062e71bb9f7406c58ebe1ce42a8b93656077dd781c2772e37775fe20e8d5b980dd52fdad98b72f10b71").into(), + hex!("86a6560763e95ba0b4c3aa16efd240b1873813386871681d075266511063b2f5077779a4fe49ffc35e1f320b613b8c94").into(), + hex!("b156d9d22722bb6e3b75b3b885b64642fa510ba7e6057657cd61bac43fb9c284d05bb09e2d4b78a2a4ddada85da9c702").into(), + hex!("9779ca2759dbed8081f0cbbfffcb3b842ba335e3ae48a60c5e5c77c7a2a0623e4c415ec3a023cc4e216885fcbac3ce52").into(), + hex!("b8137fd57ce7d3cfaf8bdbaa28704734d567d0e7a2d87fb84716722c524bb93acb2c1284249027f3c87bccc264c01f4e").into(), + hex!("8cf06b34e7021e9401eb705dde411ecf7e7e7185f8c0b0aeed949097df31812a9fdd4db7d18f9383a8a5a8d2d58fa176").into(), + hex!("8c65aa29a9ee9066b81cf24cf9e0beca3e8e8926e3df22d5ff1236297e158cc8bc7970a2c7016009cc4efa8f14b14347").into(), + hex!("ac7e49f2059e99ff65505742978f8d61a03f73f40141a2bd46fde5a2346f36ce5366e01ed7f0b7e807a5ce0730e9eaa9").into(), + hex!("a1c25eb9b73723982be78180770aa63c5f7b23c2e54a2ed7e75a860c4512d273008066f1124ac8a43c60fe1e2a8bf03c").into(), + hex!("9310722e360a5652737362f6b9cb6e9c3969a0c9bb79b488b3c7d19d9e8c42ebd841df346258ded2e393895c99b413cf").into(), + hex!("893272a63650b08e5b8f9b3f17f8547b456192ad649c168bafd7166b4c08c5adf795c508b88fd2425f7be8334592afb2").into(), + hex!("b576c49c2a7b7c3445bbf9ba8eac10e685cc3760d6819de43b7d1e20769772bcab9f557df96f28fd24409ac8c84d05c4").into(), + hex!("af17532b35bcb373ce1deebce1c84abe34f88a412082b97795b0c73570cb6b88ea4ba52e7f5eb5ca181277cdba7a2d6d").into(), + hex!("8b8813bd2c07001a4d745cd6d9491bc2c4a9177512459a75dc2a0fa989680d173de638f76f887de3303a266b1ede9480").into(), + hex!("ab73a043ccdfe63437a339e6ee96ef1241264e04dd4d917f6d6bc99396006de54e1e156d38596ba3d15cb1aaa329f8f5").into(), + hex!("b67146b202afec0132ac0070c005cf664081e860339f8f4d45ac3e630dda05560936e646673e652d08cecd8d18fc64da").into(), + hex!("a750404e9d4b1a48f767d2b6aa699200c92c3b8102597f8c5c1dbaaf08112a0587c05801dfebb3612fb6dfd76ddc9ccb").into(), + hex!("b0d4231814e40e53ab4eed8333d418a6e2e4bd3910148b610dec5f91961df1ad63f4661d533137a503d809ea1ad576fa").into(), + hex!("81fc724846b5781f3736795c32b217458bb29972af36cc4483dd98ab91680d3d9bc18842db2661487d3a85430dc9e326").into(), + hex!("a5cf6f4fd67aecb845eebc8d7304c98c69806d774d4c468350f7f82ff0f5baeecc56837705e39432a8d246aa2a7075ed").into(), + hex!("a71d2c8374776f773bad4de6edfc5f3ff1ea41f06eb807787d3fba5b1f0f741aae63503dbca533e7d4d7d46ab8e4988a").into(), + hex!("825359cfe68ad6a75578a94be6419179e0aa088170b6c20fc5c249dc3be7a260d687c93d8d8a343c7c72c2ed6a716de3").into(), + hex!("b6aeb7a9b934a54e811921494f271d5d717924c561cd7a23ab3ef3dd3e86184d211c53c418f0746cdb3a12a26a334fc8").into(), + hex!("8c6fc89428c74f0c025e980c5a1e576deadf8685f57136e50600175fa2d19389c853d532bb45a3e22b4a879fab1fcb0d").into(), + hex!("ae95ddcf3db88f6b107dcf5d8aa907b2035e0250f7d664027656146395a794349d08a6a306ce7317b728ca83f70f3eaf").into(), + hex!("8c03fb67dd8c11034bd03c74a53a3d55a75a5752ea390bd2e7f74090bf30c271541b83c984d495871d32c98018088939").into(), + hex!("b8d68610fdee190ec5a1f4be4c4f750b00ad78d3e9c96b576c6913eab9e7a81e1d6d6a675ee3c6efac5d02ed4b3c093a").into(), + hex!("87d4b20bbe2dcd4f65f4e1087f58532d5140b39a5288e1a63fc0b7e97a6a56946eafdd90ba09300c3d1fef6356ac6b7c").into(), + hex!("83e264b1d3d4622826ab98d06f28bbbd03014cc55a41aaf3f2a30eec50430877d62b28c9d6d4be98cb83e1e20f3b13db").into(), + hex!("97ffcbf88b668cde86b2839c7f14d19cb7f634a4cf05d977e65f3cd0e8051b2670e521ae74edc572d88201cff225e38a").into(), + hex!("91efdbcaad9931312d7c41d24de977f94d7f3f7b88090a1f72d9a097a1e30cc805c5ea16180f463022d9b26b8863f958").into(), + hex!("a4b507a4bc2bc424297bf8968bf385fae3acc686cff4b7933b4f5b6ef3149995393d5331dbac4b629e8adce01a91a4cc").into(), + hex!("a76a26c30d8abbbd4bf982bb8bd2066a2ec823a5eb6fbe37c664e67efbe2f72d8ce2d00223b900699149f8441bff5ada").into(), + hex!("b3a5497365bd40a81202b8a94a5e28a8a039cc2e639d73de289294cbda2c0e987c1f9468daba09ea4390f8e4e806f3c8").into(), + hex!("a09b2a07d861e01645accfb088f7f9ad524186bd439712775459a60f8a1fbbd43ee084e4d6e23ffce06daa189cd1e654").into(), + hex!("a41cf5d678a007044005d62f5368b55958b733e3fdde302ba699842b1c4ecc000036eda22174a8e0c6d3e7ef93663659").into(), + hex!("a698b04227e8593a6fed6a1f6f6d1eafe186b9e73f87e42e7997f264d97225165c3f76e929a3c562ec93ee2babe953ed").into(), + hex!("8bc66e370296649989a27117c17fbc705d5ac2bda37c5dad0e4990d44fcc40d3e1872945f8b11195538af97961b5c496").into(), + hex!("8bff10f91b8c0abb6c9542588da17fa0118ffda4c82626a754887e333d7d69661b3ae4e400da15c49565f8d10a77d0d7").into(), + hex!("ac715c7b3d794860a61d9c7bd224a2b14a6023f696afa30345aad2ce0a6ea6dbc142f34af1ffe7f783542851a28e8ece").into(), + hex!("91c5e0b9146fe5403fcc309b8c0eede5933b0ab1de71ab02fac6614753caac5d1097369bdeed3a101f62bbcae258e927").into(), + hex!("8553748da4e0b695967e843277d0f6efeb8ba24b44aa9fa3230f4b731caec6ed5e87d3a2fcd31d8ee206e2e4414d6cf4").into(), + hex!("ac722bd742374f925185ea7d4d62d7510b2d8a6ebf5c750af6ce83e2d8a28c95a3e298870ec8254ab2d1d0aa2a063c60").into(), + hex!("b083c4cefb555576bb37b71f30532822cb4b1e1998e35cb00ffb80ca14e2853193c16a6756417853d4a74d625744dd76").into(), + hex!("85745bd84c92ddfc55df11fe134cf70e3c340aa1c7cdd6188a03308cf3a840f4f19629f9730b2e6426424989ff03000d").into(), + hex!("845b4531dee808b583645f56fa98cbdecce3ea100db60524b64f68e29866173791f01137714f4dc7fb8612f7f7943263").into(), + hex!("93f03495d53c781be8b76e37e68b64aa260523004eff6455ddc8a8552af39854e5181f8c5365812b1f65926534fba5dd").into(), + hex!("801c126abff96fe9b042be8869d2907d0c6963a79901f9db46577a445418b7465a1f4b346933d433e539536a9a2df01c").into(), + hex!("952cf6782b0ad3e85625391cc5f486a16bb5b1f8ea20defcb6857bd7d068dcd2701bc7ed5c3b773a869180d9042f772b").into(), + hex!("b3b6eccb2ec8509b4eea8392877887180841ab5794c512b2447be5df7165466d7e293696deaabf063173e5f2238ce763").into(), + hex!("b63fd45023f850985813a3f54eceaccb523d98d4c2ba77310a21f396e19a47c4f655f906783b4891de32b61a05dc7933").into(), + hex!("a113b889be5dcc859a7f50421614a51516b3aadc60489a8c52f668e035c59d61640da74ba1a608856db4ff1fa1fe2dfd").into(), + hex!("87fec026beda4217b0a2014a2e86f5920e6113b54ac79ab727da2666f57ff8a9bc3a21b327ad7e091a07720a30c507c9").into(), + hex!("a3ee8fd53158dad3b6d9757033abf2f3d1d78a4da4022643920c233711ff5378ac4a94eadcaf0416fdcca525391d0c64").into(), + hex!("8d6bed5f6b3f47b1428f00c306df550784cd24212ebac7e6384a0b1226ab50129c0341d0a10d990bd59b229869e7665a").into(), + hex!("b549cef11bf7c8bcf4bb11e5cdf5a289fc4bf145826e96a446fb4c729a2c839a4d8d38629cc599eda7efa05f3cf3425b").into(), + hex!("982691766a549df56436acd0fe76da78132e027515f27174c10d117bfcc20ed73fc31f5465bd7a22a101094fe913e221").into(), + hex!("985af1d441b93fa2a86c86b6d7b70b16973d3971e4e89e093b65f0ae626d702202336869af8e3af3923e287547d5384b").into(), + hex!("994b7baecc8bb68d270a3a88c58e4054afdbd713b4472f9522b27c1762c637ef8f013d745ce9d1dc8fc4d986d4c9338c").into(), + hex!("827dabda84c7f7b1adc0f5ca0fccf0729e9d7f78e1ffa7c5e9c4f66610ff0ab776c880b00c77137cf7abe14df977febc").into(), + hex!("acd17cba1203748b55bd9d7b940a16bb7c02988c93007a80b87e0bdb049b91f5ecce577e3e4ea68a0abe998a72cd300d").into(), + hex!("989fa046d04b41fc95a04dabb7ab8b64e84afaa85c0aa49e1c6878d7b2814094402d62ae42dfbf3ac72e6770ee0926a8").into(), + hex!("99dc48a054f448792523dcdeec819e1b928b1bd66f60f457261f0554f8532eedd7152792df70ae5316ab2f9c02a57cdc").into(), + hex!("ab33c65587ecb3278325948c706aed26547e47ed2b4bc027e9119bb37bec67ddf5489fbc30304ef6c80699c10662d392").into(), + hex!("ae89e41d8cfbf26057a4078f8a5146978e658801b08814190cbce017d79beaeb71558231a72bde726fa592fb0828c01c").into(), + hex!("a9901df92e2d3abbb25f3bf4b913692c4cd57da327b01c8ee2362c02fbefcf66cdb792c17a81dcbde3c9b9dba313e4a1").into(), + hex!("8ee41011424da5e2ecea941cbf069ea32420749f2519434d3d8f9725ac789753404687a6745cffe4bd5dfc8fec71a719").into(), + hex!("8cfcdfa192b17321be4e447204e1a49ecaadca70a3b5dd96b0c70ab64d1a927d1f8c11a7e596367e5fa34e2307af86fc").into(), + hex!("b8a0003e949cf994b1bb25e270cb61358200c93b1c6f611a041cf8536e2e0de59342453c5a8d13c6d4cc95ed8ce058f3").into(), + hex!("adc806dfa5fbf8ce659aab56fe6cfe0b9162ddd5874b6dcf6d658bd2a626379baeb7df80d765846fa16ad6aad0320540").into(), + hex!("a83b036b01e12cadd7260b00a750093388666aff6d9b639e2ce7dfc771504ef8b2090da28ec4613988f2ec553d1d749e").into(), + hex!("825aca3d3dfa1d0b914e59fc3eeab6afcc5dc7e30fccd4879c592da4ea9a4e8a7a1057fc5b3faab12086e587126aa443").into(), + hex!("845a4a09941f48677e6c03699770f9a56ba72695089e432a6f232294dd8da6d34e394116a9a87f3b0902c78332af9439").into(), + hex!("b2f168afc35ed9b308ab86c8c4aaf1dcd6833ce09153bb5e124dad198b006e86a941832d387b1bd34b63c261c6b88678").into(), + hex!("a094cca9d120d92c0e92ce740bc774a89667c6f796b438b0d98df0b7aef0935d8c915d5b0dad4b53e383dc9f095c29fa").into(), + hex!("956ecb233b3529b2d9cb80ae49e48667f2a3120e4a0d7131d1e9ec36db3a59dc2ef2a579cbb99d6f14880ca83f02b64c").into(), + hex!("906cde18b34f777027d0c64b16c94c9d8f94250449d353e94972d42c94dd4d915aa1b6c73a581da2986e09f336af9673").into(), + hex!("824c8a1399ab199498f84e4baa49ff2c905cf94d6ac176e27ec5e2c7985140dbaa9cc6303d906a07ab5d8e19adf25d8a").into(), + hex!("889a5cf9315383bf64dfe88e562d772213c256b0eed15ce27c41c3767c048afe06410d7675e5d59a2302993e7dc45d83").into(), + hex!("95791fb6b08443445b8757906f3a2b1a8414a9016b5f8059c577752b701d6dc1fe9b784bac1fa57a1446b7adfd11c868").into(), + hex!("99049e9a23c59bb5e8df27976b9e09067d66e4a248926d28171d6c3fdd1ab338944a8b428b2eaae5e491932c68711c7c").into(), + hex!("95c810431c8d4af4aa2b889f9ab3d87892c65a3df793f2bfd35df5cfdb604ca0129010fa9f8acae594700bece707d67f").into(), + hex!("841d77b358c4567396925040dffe17b3b82c6f199285ac621b2a95aa401ddb2bc6f07ebd5fa500af01f64d3bb44de2df").into(), + hex!("90c402a39cd1237c1c91ff04548d6af806663cbc57ff338ed309419c44121108d1fbe23f3166f61e4ab7502e728e31fd").into(), + hex!("968d44188e2d9d1508b0659e96d6dabd0b46aa22df8d182e977c7f59e13aa05d5da09f293f14f6f2ee1b996071cd2f25").into(), + hex!("8ae9585caa3c73e679fe9b00f2c691732f7b7ca096e22d88c475a89d4d55cb9fba3cd0fe0cedd64ce75c591211664955").into(), + hex!("94b81d5ad72efb4dd60867e71afcd8e87e1f24bf958d42fc07db66f6185a1e610987ab9ceef63109a36fe5544a0cf826").into(), + hex!("8499a8c3d67d1f6eccf1c69274393dc498cff862ea8e6c11ffb8107ae190d258ddc1d294f2a8f050488df0212063ece2").into(), + hex!("921109a390e4d7fbc94dff3228db755f71cb00df70a1d48f92d1a6352f5169025bb68bcd04d96ac72f40000cc140f863").into(), + hex!("b464d763e5ef724ab7ee13a60015df5c9a7809a79188ff6a7e0d5e5400febd42ad7330406a59704a44a08f2289d659c8").into(), + hex!("96f1a36134e0d4137a7fe8bbb354f50aaa67f28f194ae2fdbe8be3eb24596678d8c9287765ee90c1f2778d0d607931e0").into(), + hex!("b031d93b8f119211af76cfafee7c157d3759b2167ee1495d79ad5f83647d38248b4345917309ef1a10ecaa579af34760").into(), + hex!("88a7dc337d89324f025f686f37d21240c7da9a1cb802259ea8d8a83e246dcc2adceca7ca3534bc7bf8f3ae1cbeafb5c0").into(), + hex!("b30e022b8a563655074e08e123b5f96956bbf0fe221cc629c5fedd2764a66b475916ceb98867f935b4a47212e53ae9f3").into(), + hex!("ab6e3180dae399d41243f23545e5e6d118844f9b8edba502a3503fd1162ed826f9fc610889a1d685d374b6c21e86067d").into(), + hex!("96cf5760c79cfc830d1d5bd6df6cfd67596bef24e22eed52cee04c290ad418add74e77965ea5748b7f0fb34ee4f43232").into(), + hex!("a5817c74a394b0359a4376ef7e9e8f7dfa6a7829602da225074fb392b715e1fd52c50cae0f128a7006f28b22f233fbf5").into(), + hex!("a50ab79cf3f6777a45f28d1b5cdad2c7ea718c60efeeb4c828d6307b29ef319445e6a9f98aa90f351c78b496575150c1").into(), + hex!("8b300dea07e73dd2f07b05d477e51f8424589f6b2fa6f461240e1322a3a7ab5bf227b74544bb5d66a297702cdbf6c6bf").into(), + hex!("b13b5cb86dc8b8fe87125f1a51fe98db36bdde4f600401408b75059a44e70b1bbfefd874e539691f3f1bf6f54db883c8").into(), + hex!("8d06205cd66703ce6776b38b98c32b27f45c7b3f65ea2d05e2b702c24d553f51c69bf0b17e8db7382475e3d370d2e8d6").into(), + hex!("a11a7496c712734aec80738e30d2bf245758b34245076149854eb209fa6403be8bb0d4e515becc881b7f3610749260c0").into(), + hex!("9615800f8c95f95bf25055ae079b964e0a64fa0176cc98da272662014f57e7cd2745929daf838df0094b9f54be18b415").into(), + hex!("b19ca6e55f349bbb2dc3e429520ff5b2e817972470794f35c1aac8c118b37a694cfcc875b6d72225343799825d2f5c39").into(), + hex!("a650864b7eb6769aaf0625c254891447351e702e40d2be34dfd25f3b5367370de354318d8935ba18db7929270455ae6a").into(), + hex!("a649208372f44f32eb1cd895de458ca1b8be782746356f08ac8ef629429d0780a0799fcff85736e19aead0b79bfff261").into(), + hex!("89461cb2dadf51d6f1208b0965c8eabec895d7b19b7d90d3c6e49dbe75a75c30fd26db3dfb169dd46a4342280225032a").into(), + hex!("b5d6f664ec92e5343792d5d6b629919c5fd8cfb874677df2264daf02bcd9d12facf9b859d5402839c9022396e20d260b").into(), + hex!("a7179d338fe5a0e4669364a364e17f8d00cb6c59a80a069afd5f4f14510df2eee90c07826553e4f7fe46d28f72b2903e").into(), + hex!("8ded37d67b5368619a090266e9b5585fbff60319a90a4244a3c3342641f5bfa5130998dd97d7a42505cd896c29255530").into(), + hex!("a3fd63e87a00b48ba46a646a26187ae6dcb16779721973ada13a545853e2e51b5e4df04630d670884ad4a2304cc60c67").into(), + hex!("92761b7e31f0c758b3b1f5b43a194b25aabec668101946eb6511132863d3afb9d18f833d43a8338d0e7bc78d8689e523").into(), + hex!("ab8a8769c754008a7976b6799e81d7bfe97413d0a79b90715703c1f8f567675463ec93aabee59277121fc4df88b5c7a9").into(), + hex!("b354d0d1bd942f79002a2eaf37eb99dab650170e7040c13c824803ed7c1670dc910ccae13bbe58bde003829b140b45ea").into(), + hex!("b9eed89e003894ad2cc9d9b93a45247e1367ac69a00b0ed5e3280c1188b4cb90eb870d449b83a852a798bd02f9d0c813").into(), + hex!("b900a55013d0427e5da6b21611d6ae3e648f54f794cb099b2d2beebae0a957477a94dc415e8ec5e68e9029ce50d43843").into(), + hex!("afbf44071c2c905f7c8ef396eaed7f13deb7a91719cb5e8b9226aaceb876d81a10076383edc6216bc2f5c38a480b2957").into(), + hex!("80bdb82b7d583bf1e41653966b0ba3b4fec0e7df2ff08e3fa06fd9064bca0364263e075e1582741a5243bde786c9c32e").into(), + hex!("a841fe9ff26db21ade698f6dbfba025d90ae9f81f02af9e008fa0a429b993fb04d06acb93e40a9f81c78f73334555a17").into(), + hex!("8cd49711b42af58a5aae75a38fea9ddc5e4183c467a3159b5b0629f01ba548513c577456d34c861911e85782e52c3b1b").into(), + hex!("a322b5d2a6e3cb98b8aaa4c068e097188affef5dec2f08c3e9ce29e73687340d4e5a743a8be5f10e138f9cabbe0c7211").into(), + hex!("942772b7c7c47d4e5957ccf1d6f1450070930af3e2b7eaab0dd7699372445df0cc910e6c0efcf501887dd1adabdaee23").into(), + hex!("9834f66e5c946c3a8241ca2bbde046a7e88072124911d5d15c037a95b61e82b88b5c2058fa4a3721537dee39dee5da18").into(), + hex!("a90cc5b9c4d84f36962d0d55d5bc123dbe5ec5f4fe7b6bf0d009028b3cf14e36c11bc5365391cb4ae548d5eb04fe371b").into(), + hex!("a7c2174eea2b66b2a71cc8095fae39c423a353c7d5020ec2d0551317a66202fcf082c6119ba768755523fff49791bb4e").into(), + hex!("ab92b2a177dfa55d202a653532f0e04d1339ca301aebe6a0e8419bf45be3e573b6b9ae4d3d822cc8279367a3d2c39b06").into(), + hex!("8a9ad977988eb8d98d9f549e4fd2305348a34e6874674bcd6e467c793bba6d7a2f3c20fa44aabbf7151ca53ecb1612f6").into(), + hex!("a7d1676816e81a752267d309014de1772b571b109c2901dc7c9810f45417faa18c81965c114be489ed178e54ac3687a1").into(), + hex!("a575be185551c40eb8edbdb21a0df381c801b6e99467fcf5882dd7cb34916960ce47ac732c1920ad3218f497b690cef4").into(), + hex!("b50c306f78143b37986e68efa10dbe1fb047d58562e9b5c5439b341dd8f1896c7ae586afac0a3213759784a905c1caaa").into(), + hex!("b31e89b4a034c1b73d43b3d63ea3bddea682a6a5327eff389c70b13e9e72185b0327682a0cb1ff3c4a4f8ba08b13d898").into(), + ], + aggregate_pubkey: hex!("948a4b8d91bd29969cd4470b1bc24d34586d38e73d5be71c98a9894899471a5f708747563276b4b6d2716fdb72860267").into(), + }, + next_sync_committee_branch: vec![ + hex!("cb3fea582872d90706ddc6d029bac0d791ea75d43c3ab04f056f62a11b89d27b").into(), + hex!("f26b4bb68eb7e6906c8ef4a9958398a48e4450bf9c8a462fafa4fde51cd5628f").into(), + hex!("690925f92c1d322d2ff2a5636539094825dfd2c9bf7538fe111b2358e03a71de").into(), + hex!("51d977e358166401c7cd3f6185468c1a8c69a4c3d8577535dd583bc427692e02").into(), + hex!("88d2089aaf2f6fd8f6e4ae499c6fe33cc34289eb9310780861e772204f07b670").into(), + ], + }), + finalized_header: BeaconHeader{ + slot: 4055040, + proposer_index: 854, + parent_root: hex!("8adf3b288deb17566a553fa7a06a2f63f4ac4cea4868af4d89ddca41f73ae9b9").into(), + state_root: hex!("595e9ebaaa23f027672b4d2a33173a22b2839baac709c7f8e66d3219f492ee9f").into(), + body_root: hex!("acf37b466d4f6b5d1db5b6ffe5d77c13972d116c2b0809de924427fd597d391a").into(), + }, + finality_branch: vec![ + hex!("00ef010000000000000000000000000000000000000000000000000000000000").into(), + hex!("3d4be5d019ba15ea3ef304a83b8a067f2e79f46a3fac8069306a6c814a0a35eb").into(), + hex!("a2e2a28c0bb0ad56c25f3c461a4bfe4f3b3b894bc0105a62e85f43a4ae1adc3f").into(), + hex!("690925f92c1d322d2ff2a5636539094825dfd2c9bf7538fe111b2358e03a71de").into(), + hex!("51d977e358166401c7cd3f6185468c1a8c69a4c3d8577535dd583bc427692e02").into(), + hex!("88d2089aaf2f6fd8f6e4ae499c6fe33cc34289eb9310780861e772204f07b670").into(), + ], + block_roots_root: hex!("7054ba439f83e9b2223911e25fad48eb28f5c362d94c0de2455a45436cc93897").into(), + block_roots_branch: vec![ + hex!("c99a842c81d0b956eef988dbcd90499457d61f942375c6cbf67262909b708db5").into(), + hex!("5d32345aeb10aa3ede4be021d2231dac47cc2074f74b72466f0b042e69adf70f").into(), + hex!("b69608a2377956c1a39c3423d3399ccfb12307623c9df6358f5fcfca64a80102").into(), + hex!("cefd9b668e49ece82bd4b0ee2f1efc88ecaf0d9af464fb622735663aaf106c4c").into(), + hex!("c113ad1c971779b15c64772ab69cd775edfb926a60447974913bb6f58fbd12fb").into(), + ], + }) +} + +pub fn make_finalized_header_update() -> Box { + Box::new(Update { + attested_header: BeaconHeader { + slot: 4058720, + proposer_index: 1088, + parent_root: hex!("37c7398a391c71da07258b48f41d4caaaf891fdf558e110b9c25db716fa8ff55").into(), + state_root: hex!("6cf68a66c993f1c27f499e054a5fbd7c0e625c34ea0057fda9691c561e990002").into(), + body_root: hex!("109e4c0c647d42dba0c8c6569997c51b5bcfc1a33475b1433ded6353f48423ff").into(), + }, + sync_aggregate: SyncAggregate{ + sync_committee_bits: hex!("ffffffffff7bfdfffff7fffff1effffef7f9ffbdfdffffffdffbfffbbf7ffffffffffefdf7ffbeffdffef7bfffffffffffbffffffffffbffffffffffffffdfda"), + sync_committee_signature: hex!("b5727bad1db101b6f0fd7ec4cb79b43dae90366fe0cae31a62439388eb03ebd75732cee3bde51f814203a4c0f5b23898120cd0870f0e662bdf0f85a048b534d9a906e6d32a65df019059d34f724221075734ec2849c09679febecf6929934f09").into(), + }, + signature_slot: 4058721, + next_sync_committee_update: None, + finalized_header: BeaconHeader { + slot: 4058656, + proposer_index: 810, + parent_root: hex!("bb6cfda1e02c3117d9fa41c1e1594ce0645352a073ad8b474f83c148e0d9954f").into(), + state_root: hex!("f938f0f0cba85234afbaace20545134c70b35e6ff9f74d944b0fea309109f3cf").into(), + body_root: hex!("cf6a7a6f653cb64b2b910278a478339b34eb08abf00e0766d10c7a8fe9bdb139").into(), + }, + finality_branch: vec![ + hex!("71ef010000000000000000000000000000000000000000000000000000000000").into(), + hex!("3d4be5d019ba15ea3ef304a83b8a067f2e79f46a3fac8069306a6c814a0a35eb").into(), + hex!("a2e2a28c0bb0ad56c25f3c461a4bfe4f3b3b894bc0105a62e85f43a4ae1adc3f").into(), + hex!("aa2bad8cf9b0433d3d79bc5b95c067048b018d1d2ffd0c66db6e7cf86e0a314e").into(), + hex!("027f238235d07ac9757543c19deabe1d553d6fc110e8bea4b037b1fab263b4dc").into(), + hex!("7dfa1cc1907e8927295f78a770bf86b28f5c2bddcac38beb3b4beb265ff5608f").into(), + ], + block_roots_root: hex!("4a5a57fb0769443f6472f59dbb78d7a9a69ff61d09aa89d5da645d634ec46a14").into(), + block_roots_branch: vec![ + hex!("a09ad7f3afd681bb6fd54abba339549f3b601beedea79a5b7d448b1cf1e1613e").into(), + hex!("acdfd4d5eba154f118a84af7a2d17ba6100fcd9c24fc235e927f584a5b56e32f").into(), + hex!("36ca106eac009ed605e680415b105b3a6591830c38034511f300aae44802235f").into(), + hex!("171561a9e1afb413132d0f4d3cbbd810766c151be32ec9f2d609f40aef9e2588").into(), + hex!("7cd963eba3fb57ee5ce37ee4b621d24fc14d642e32f48dc48ade528e11458ab9").into(), + ] + }) +} + +pub fn make_execution_header_update() -> Box { + Box::new(ExecutionHeaderUpdate { + header: BeaconHeader { + slot: 4058654, + proposer_index: 1039, + parent_root: hex!("758fa0a54047c0221b3107423e78b8910514ba7a0c4250401dac77108dce2ff8").into(), + state_root: hex!("53c79320b4b7649e39a9f07903f4fc68a7cfe7a81cb2e30293dd7b00ee13f69a").into(), + body_root: hex!("a76a7f037f12ee070dcb273d9787b13ff0cf17420a39564a101789318a157ec3").into(), + }, + ancestry_proof: Some(AncestryProof { + header_branch: vec![ + hex!("bb6cfda1e02c3117d9fa41c1e1594ce0645352a073ad8b474f83c148e0d9954f").into(), + hex!("b44967bd8ff799126cad993ff7369f7a28d60281304d0c7c058e6721b6ce4c61").into(), + hex!("0009710ef2467f95542c2e8e7a7249282c08f62aedbe7d21ae4a7af04e1a890d").into(), + hex!("7bc5dc20638cfe1cfd5d2547c3efbed4cfb533c76c27d41f723ed876ab9edc3a").into(), + hex!("6dcd59a8a041cf2591921417cb8133f0ff5af9bfe1f1ab491e75a751adc9c9e1").into(), + hex!("3f25a2852042c7bf2c421bf16c0b9373c1d27ccb1eca4088f8191712481261be").into(), + hex!("d1f9cfe1f04031459e5c45f47b2a49c780cabb8ca5b8d76461db2b88c337ed76").into(), + hex!("8c37e3119bf7d3cb8208e832669261b0eda1b3c7b11d321760ba1c0649f61416").into(), + hex!("1783d3b7041ecb78d9e1f913b82bd335229ca1f2cc5d3cc8dd28c94152e887b4").into(), + hex!("e39fc366c951c7cb2100308b0a9417581c46812a7d7e89f516c19863f7686f96").into(), + hex!("3c29b6d9b8715dbe5d6831364229efc91ad56ae69e93cb119d5ef4bdc53fcb37").into(), + hex!("3cf6fe5e8d91dbaa77e6befa81e04fb25a3e089317d83ff35fc8adfbbf2aab5a").into(), + hex!("b41c97cf3b1b4b5bf2999dfb1b3eaeac5c1b12205e9ab0809988e3779d119047").into(), + ], + finalized_block_root: hex!("b4802863fc1d32778211ce6aac8109c73c516a003213f4f5333c80472d08fe4e").into(), + }), + execution_header: ExecutionPayloadHeader { + parent_hash: hex!("9cffcba69c88a619483e13864704dde5db80e05f8d49018f615395ce09cd24ab").into(), + fee_recipient: hex!("ff58d746a67c2e42bcc07d6b3f58406e8837e883").into(), + state_root: hex!("6a4aafc93626778475a416721104229035e91f0db788d0099b57e756cd272f0a").into(), + receipts_root: hex!("e1ce670bdcf9acf4c62fee845cd7e81eabbb6db9ddbff56130020c6cf999a45d").into(), + logs_bloom: hex!("a000980408008000328c1458805c005048b84812c134200090b40428568108a0648090105085100301844800090802484420800d020282019002040d083004031a20420240a4a8900a43296938c040802040220170860210910020036b8c482228c004440300021c82c0400110402a10800582424001c00000828310210020a18130504020790dca716194100880ea5501149104002bc05e189080901c4001010e0a040658a410072021230a5224265030082404000aa11f28162e216636000408842103d41010760972060060000500c20130b000000065401483200081a84934f020020120009618002269c884724616040000840e18080300024490000230").into(), + prev_randao: hex!("5d9ac7ea788ecb534e98bc9079fa0bef199011dadadedaee5dc40e2cd702d664").into(), + block_number: 5025098, + gas_limit: 30000000, + gas_used: 13802943, + timestamp: 1704437448, + extra_data: hex!("476f65726c69205365706f6c69612d4265706f6c696120513966").into(), + base_fee_per_gas: U256::from(19959019915_u64), + block_hash: hex!("795021134c2b7f9c00b498ff7b0971dbbe061561868f702d8ca68a05e5eb5a99").into(), + transactions_root: hex!("3cb7c92fde5d511cc90cd67e375c4388794f4c01e375e8e8a06d003b5593fd12").into(), + withdrawals_root: hex!("5f5155fd8e5cd24b7ecb1e039792b0caff01dfda2990786d9ffc88325b5d1ea8").into(), + }, + execution_branch: vec![ + hex!("85ff3d1c2bc3dcdd5543bcd29a1224c6a8c24875224fbb1e3b69f0515ffaacda").into(), + hex!("336488033fe5f3ef4ccc12af07b9370b92e553e35ecb4a337a1b1c0e4afe1e0e").into(), + hex!("db56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71").into(), + hex!("fe1fa7acd413c54ebd394126ade19fc624ad9e4c60792d54ff3d60b07076b76d").into(), + ], + }) +} diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures_minimal.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures_minimal.rs new file mode 100755 index 00000000000..b9476a0fb08 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures_minimal.rs @@ -0,0 +1,248 @@ +// Generated, do not edit! +// See README.md for instructions to generate +use crate::{CheckpointUpdate, ExecutionHeaderUpdate, Update}; +use hex_literal::hex; +use primitives::{ + updates::AncestryProof, BeaconHeader, ExecutionPayloadHeader, NextSyncCommitteeUpdate, + SyncAggregate, SyncCommittee, +}; +use sp_core::U256; +use sp_std::{boxed::Box, vec}; + +pub fn make_checkpoint() -> Box { + Box::new(CheckpointUpdate { + header: BeaconHeader { + slot: 152, + proposer_index: 7, + parent_root: hex!("7ecd45ee8bbacb20c6818eb46740b0f8d2fbd5af964e0dd844d3aa49ca75ce26").into(), + state_root: hex!("0859c78c54a2ecf1af0aecc05f3c8ba9274d1df500bfc4e6a7194c0235f55def").into(), + body_root: hex!("561bec3e5b200ee1bf6b60b5858ca2d7766ac9327b46355c070afafae8fca2ba").into(), + }, + current_sync_committee: SyncCommittee { + pubkeys: [ + hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), + hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), + hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), + hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), + hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), + hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), + hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), + hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), + hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), + hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), + hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), + hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), + hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), + hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), + hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), + hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), + hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), + hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), + hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), + hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), + hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), + hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), + hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), + hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), + hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), + hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), + hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), + hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), + hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), + hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), + hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), + hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), + ], + aggregate_pubkey: hex!("8fe11476a05750c52618deb79918e2e674f56dfbf12dbce55ae4386d108e8a1e83c6326f5957e2ef19137582ce270dc6").into(), + }, + current_sync_committee_branch: vec![ + hex!("c6dd41df7b4978b7ee7479dcbfdbfa9fb56d1464afe9806bfd6f527e9d1c69a4").into(), + hex!("b3824f305318071010d4f4d9505f9fc102cdd57f1c03cf4540e471b157f98e3f").into(), + hex!("66677299731d34be9d4dea7c0e89d8eae81b8dffa3c6218152484a063b1064a1").into(), + hex!("ef53c2b02cdb7f44fb37ea75f4c48c5086604a26be9635f88b1138f961f87773").into(), + hex!("1a3f86a88fb2ec99cb1d7b0f35227c0f646490773bac523c30fc7eccf87c0f84").into(), + ], + validators_root: hex!("270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69").into(), + block_roots_root: hex!("8ad7487f0e79a6cf67ce49916f74e5b272be9e38ea5f8a6a588eaa89ea7f858e").into(), + block_roots_branch: vec![ + hex!("90683050cb3f3b04b2a89c206365747bef4c42154feb5d3f4198dfd48b2067ae").into(), + hex!("34f521b45630273930475b8a4350fe2c71c804878ebcd89064eb1dc24a85e468").into(), + hex!("81e166eaeaff5df2d3a5df306c78af075106cbf63c2f1b50ab67eec2dbb0f5ce").into(), + hex!("857526b3bf20de3ec6e57565dd593304f83e47541cc18d7c2d5b4c9f2724ba14").into(), + hex!("1b4bedd5ecc523599da000387f5e33ffe5324b8e234c43ee702de8ccc88d713f").into(), + ], + }) +} + +pub fn make_sync_committee_update() -> Box { + Box::new(Update { + attested_header: BeaconHeader { + slot: 144, + proposer_index: 2, + parent_root: hex!("74e7da3093f79414b5ab593d1c12ba63767db7f4af62672fa1be641331c338e0").into(), + state_root: hex!("92a08dc74f6af7bfcd428aa1677d58f36fefc159c0134b312c186a69fcd00496").into(), + body_root: hex!("51506a8230d40d065a29ad01197c983b9b5d4b9abd26d3c48773941f4e6f482d").into(), + }, + sync_aggregate: SyncAggregate{ + sync_committee_bits: hex!("ffffffff"), + sync_committee_signature: hex!("92cbff711040bcc4a81616edbadbe712ea3ac4939c3d3121a4561b4b3950e2e5b09809606b79fdad2ce20fdef413120a04f02dc65149ca9b6ecab2a94ac4087062df4ab03e161ae56fa6fee4ba40af29c3b4327e21e846f98144cab30684d197").into(), + }, + signature_slot: 145, + next_sync_committee_update: Some(NextSyncCommitteeUpdate { + next_sync_committee: SyncCommittee { + pubkeys: [ + hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), + hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), + hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), + hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), + hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), + hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), + hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), + hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), + hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), + hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), + hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), + hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), + hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), + hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), + hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), + hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), + hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), + hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), + hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), + hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), + hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), + hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), + hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), + hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), + hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), + hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), + hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), + hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), + hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), + hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), + hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), + hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), + ], + aggregate_pubkey: hex!("8fe11476a05750c52618deb79918e2e674f56dfbf12dbce55ae4386d108e8a1e83c6326f5957e2ef19137582ce270dc6").into(), + }, + next_sync_committee_branch: vec![ + hex!("c243f5286cbf6c3c5f58ef6e1734a737bf96cfc0adbf2ee88d4a996f8dfc7097").into(), + hex!("6ae16cb8ea57014c75a9469485bc024bb1e64676656cb069753bf091e58de88f").into(), + hex!("1afa3c77cd75040c1bbbc5d1b7c07e65eeee44fbc659b64ccd55b4ba579038ae").into(), + hex!("89b14216f60859ae366de066eeff4c7b69f8b5738c5b70cdfab4b3a976f9f12f").into(), + hex!("b7d8fa1e64e6d6339a7c68a81e20daab65804777b93a04236fa503b575c2f1a9").into(), + ], + }), + finalized_header: BeaconHeader{ + slot: 128, + proposer_index: 3, + parent_root: hex!("3774d6a479fc6f71ccaff3f8a1881c424b0319e96a7da15f87e3b750ba50dae5").into(), + state_root: hex!("85937007c564046bcc147d53b1d2d78941e2787ec059bee191420369a7f80447").into(), + body_root: hex!("c8f31c33ffaeef2d534363b7ef9ec391f90c17bc5bbe439cf0dcf0de8eeb4d7d").into(), + }, + finality_branch: vec![ + hex!("1000000000000000000000000000000000000000000000000000000000000000").into(), + hex!("10c726fac935bf9657cc7476d3cfa7bedec5983dcfb59e8a7df6d0a619e108d7").into(), + hex!("c2374959a44ad09eb825ada636c430d530e656d7f06dccbcf2ca8b6dc834b188").into(), + hex!("1afa3c77cd75040c1bbbc5d1b7c07e65eeee44fbc659b64ccd55b4ba579038ae").into(), + hex!("89b14216f60859ae366de066eeff4c7b69f8b5738c5b70cdfab4b3a976f9f12f").into(), + hex!("b7d8fa1e64e6d6339a7c68a81e20daab65804777b93a04236fa503b575c2f1a9").into(), + ], + block_roots_root: hex!("b10da1bbb1c0dcb01637b9e3dcb710d1013dc42a002bd837d5b4effa0ac995c9").into(), + block_roots_branch: vec![ + hex!("9c62693fd336e4b3ca61d3cbe9caeb85f1f1b59ef50aeddfce53dc7321d6058b").into(), + hex!("364947a6574f4acc97888e1fddb5ec718859d54cd7e3db98cda8db4dbea82ded").into(), + hex!("10a61d26b0c1b5b89cf5b82b965f772a1b6ae852fbd13a986c5c63bf12b99244").into(), + hex!("506ed8ca9908af4b5acb4cfdec6dd968acf38346c16385abca360c9976411c3e").into(), + hex!("ada571922caf3dde48e19f1482df8d17dd6bb05e525c016c8cf6796a5d7f4a00").into(), + ], + }) +} + +pub fn make_finalized_header_update() -> Box { + Box::new(Update { + attested_header: BeaconHeader { + slot: 184, + proposer_index: 5, + parent_root: hex!("13548d0b72ef2b352ba73a53274ad02e9310d8417d4782bf9cdad877da549595").into(), + state_root: hex!("cbd5e841afef5103a613bb9a89199d39c40751af1af7cabadfa8e1fd49c4be09").into(), + body_root: hex!("c9b5074ac3043ae2ad6da067b0787d61b6f1611b560ef80860ce62564534a53a").into(), + }, + sync_aggregate: SyncAggregate{ + sync_committee_bits: hex!("ffffffff"), + sync_committee_signature: hex!("80628825caef48ef13b4ffda96fcee74743609fe3537b7cd0ca8bc25c8a540b96dfbe23bdd0a60a8db70b2c48f090c1d03a25923207a193724d98e140db90ab692cd00ec2b4d3c0c4cbff13b4ab343e0c896e15cba08f9d82c392b1c982a8115").into(), + }, + signature_slot: 185, + next_sync_committee_update: None, + finalized_header: BeaconHeader { + slot: 168, + proposer_index: 1, + parent_root: hex!("bb8245e89f5d7d9191c559425b8522487d98b8f2c9b814a158656eaf06caaa06").into(), + state_root: hex!("98b4d1141cfc324ce7095417d81b28995587e9a50ebb4872254187155e6b160c").into(), + body_root: hex!("c1a089291dbc744be622356dcbdd65fe053dcb908056511e5148f73a3d5c8a7e").into(), + }, + finality_branch: vec![ + hex!("1500000000000000000000000000000000000000000000000000000000000000").into(), + hex!("10c726fac935bf9657cc7476d3cfa7bedec5983dcfb59e8a7df6d0a619e108d7").into(), + hex!("c2374959a44ad09eb825ada636c430d530e656d7f06dccbcf2ca8b6dc834b188").into(), + hex!("97a3662f859b89f96d7c6ce03496c353df5f6c225455f3f2c5edde329f5a94d1").into(), + hex!("4c4720ad9a38628c6774dbd1180d026aceb0be3cb0085d531b1e09faf014328a").into(), + hex!("c3d59497774f8f1c13fda9f9c6b4f773efabbac8a24d914dc7cf02874d5f5658").into(), + ], + block_roots_root: hex!("dff54b382531f4af2cb6e5b27ea905cc8e19b48f3ae8e02955f859e6bfd37e42").into(), + block_roots_branch: vec![ + hex!("8f957e090dec42d80c118d24c0e841681e82d3b330707729cb939d538c208fb7").into(), + hex!("4d33691095103fbf0df53ae0ea14378d721356b54592019050fc532bfef42d0c").into(), + hex!("bc9b31cd5d18358bff3038fab52101cfd5c56c75539449d988c5a789200fb264").into(), + hex!("7d57e424243eeb39169edccf9dab962ba8d80a9575179799bbd509c95316d8df").into(), + hex!("c07eeb9da14bcedb7dd225a68b92f578ef0b86187724879e5171d5de8a00be3a").into(), + ] + }) +} + +pub fn make_execution_header_update() -> Box { + Box::new(ExecutionHeaderUpdate { + header: BeaconHeader { + slot: 166, + proposer_index: 7, + parent_root: hex!("da28a205118aaf4aa69a3fb4eb7a565541b7172cc77771ec886b54b6f5bc10f3").into(), + state_root: hex!("179a6249c3e86ebcc9c71a0fc604a825a5fb5dd1602177681c54dc7e09af4265").into(), + body_root: hex!("e1290e50d64f043594bcac66824b04eb3047ae4174188e40106235183f47074c").into(), + }, + ancestry_proof: Some(AncestryProof { + header_branch: vec![ + hex!("bb8245e89f5d7d9191c559425b8522487d98b8f2c9b814a158656eaf06caaa06").into(), + hex!("ab498fef414d709fcac589217246527b82c25706fa800f21d543c83a0ccc59a2").into(), + hex!("de054acbf636cf9f1692137f78179381b5b0328b49fbc4d324eb8e897b41f52c").into(), + hex!("c472fde1df644788c92208467ff5aad686ce55bab1570917e8de1922296666fd").into(), + hex!("11a71c67676c72696c452d875318501cd50968106f72fb611bfe5952285516f8").into(), + hex!("6d2bd2b6cd84ddadc89df27f3f7f9141bb88c742a30123c77eefebef9d5f6667").into(), + ], + finalized_block_root: hex!("be7d9cc4483ed0065fc7c32e2a783ca3782d8dbd7bfe899fd7c0bcee82f11629").into(), + }), + execution_header: ExecutionPayloadHeader { + parent_hash: hex!("96b27b6e0919c19a70c4a2f7136fd59d2e63a3ba0453a86775add3f2dd681cea").into(), + fee_recipient: hex!("0000000000000000000000000000000000000000").into(), + state_root: hex!("b847ee60946ebdb5bd92c22385da44b8a9aea4c6779f1a1402cc06e22b76fb4a").into(), + receipts_root: hex!("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").into(), + logs_bloom: hex!("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").into(), + prev_randao: hex!("e6c6665aa502e12dd8f5937da2eb7f7fe7a78bc9a900c9321412b8ddd4d72325").into(), + block_number: 166, + gas_limit: 68022694, + gas_used: 0, + timestamp: 1704700423, + extra_data: hex!("d983010d05846765746888676f312e32312e318664617277696e").into(), + base_fee_per_gas: U256::from(7_u64), + block_hash: hex!("1871ded7b2b8b4b5b358c904104704811b15aeefc24e49daa2a1a68176d6553a").into(), + transactions_root: hex!("7ffe241ea60187fdb0187bfa22de35d1f9bed7ab061d9401fd47e34a54fbede1").into(), + withdrawals_root: hex!("28ba1834a3a7b657460ce79fa3a1d909ab8828fd557659d4d0554a9bdbc0ec30").into(), + }, + execution_branch: vec![ + hex!("276d006ecfe51451787321ef00417b194e90b35d4106bd7d51372f39918a4531").into(), + hex!("336488033fe5f3ef4ccc12af07b9370b92e553e35ecb4a337a1b1c0e4afe1e0e").into(), + hex!("db56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71").into(), + hex!("6b8ff91d1be713c644ef9b3e5b77323897930c342fd12615c0d2142bee5cd1d7").into(), + ], + }) +} diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/mod.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/mod.rs index cba22fc86c9..807d4de14ee 100644 --- a/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/mod.rs +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/mod.rs @@ -1,18 +1,21 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: 2023 Snowfork use super::*; - -mod fixtures; mod util; use crate::Pallet as EthereumBeaconClient; use frame_benchmarking::v2::*; use frame_system::RawOrigin; -use fixtures::{ - make_checkpoint, make_execution_header_update, make_finalized_header_update, - make_sync_committee_update, -}; +#[cfg(feature = "beacon-spec-minimal")] +mod fixtures_minimal; +#[cfg(feature = "beacon-spec-minimal")] +use fixtures_minimal::*; + +#[cfg(not(feature = "beacon-spec-minimal"))] +mod fixtures_mainnet; +#[cfg(not(feature = "beacon-spec-minimal"))] +use fixtures_mainnet::*; use primitives::{ fast_aggregate_verify, prepare_aggregate_pubkey, prepare_aggregate_signature, @@ -148,6 +151,13 @@ mod benchmarks { Ok(()) } + #[cfg(feature = "beacon-spec-minimal")] + impl_benchmark_test_suite!( + EthereumBeaconClient, + crate::mock::minimal::new_tester(), + crate::mock::minimal::Test + ); + #[cfg(not(feature = "beacon-spec-minimal"))] impl_benchmark_test_suite!( EthereumBeaconClient, crate::mock::mainnet::new_tester(), diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mod.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mod.rs index 6b959ebfec9..d20743b846e 100644 --- a/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mod.rs +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mod.rs @@ -6,10 +6,10 @@ use static_assertions::const_assert; pub mod mainnet; pub mod minimal; -#[cfg(not(feature = "beacon-spec-mainnet"))] +#[cfg(feature = "beacon-spec-minimal")] pub use minimal::*; -#[cfg(feature = "beacon-spec-mainnet")] +#[cfg(not(feature = "beacon-spec-minimal"))] pub use mainnet::*; // Generalized Indices diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/lib.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/lib.rs index fdda200251a..53877ea58fe 100644 --- a/snowbridge/parachain/pallets/ethereum-beacon-client/src/lib.rs +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/lib.rs @@ -28,7 +28,7 @@ pub mod weights; #[cfg(any(test, feature = "fuzzing"))] pub mod mock; -#[cfg(all(test, not(feature = "beacon-spec-mainnet")))] +#[cfg(test)] mod tests; #[cfg(feature = "runtime-benchmarks")] diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs index 4d1d14a1015..b25e8b0e813 100644 --- a/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs @@ -1,22 +1,127 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: 2023 Snowfork use crate as ethereum_beacon_client; +use crate::config; use frame_support::parameter_types; +use hex_literal::hex; use pallet_timestamp; -use primitives::{Fork, ForkVersions}; +use primitives::{CompactExecutionHeader, Fork, ForkVersions}; +use snowbridge_core::inbound::{Log, Proof}; use sp_core::H256; use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; +use std::{fs::File, path::PathBuf}; -#[cfg(not(feature = "beacon-spec-mainnet"))] +fn load_fixture(basename: String) -> Result +where + T: for<'de> serde::Deserialize<'de>, +{ + let filepath: PathBuf = + [env!("CARGO_MANIFEST_DIR"), "tests", "fixtures", &basename].iter().collect(); + serde_json::from_reader(File::open(filepath).unwrap()) +} + +pub fn load_execution_header_update_fixture() -> primitives::ExecutionHeaderUpdate { + #[cfg(feature = "beacon-spec-minimal")] + const SPEC: &str = "minimal"; + #[cfg(not(feature = "beacon-spec-minimal"))] + const SPEC: &str = "mainnet"; + let basename = format!("execution-header-update.{}.json", SPEC); + load_fixture(basename).unwrap() +} + +pub fn load_checkpoint_update_fixture( +) -> primitives::CheckpointUpdate<{ config::SYNC_COMMITTEE_SIZE }> { + #[cfg(feature = "beacon-spec-minimal")] + const SPEC: &str = "minimal"; + #[cfg(not(feature = "beacon-spec-minimal"))] + const SPEC: &str = "mainnet"; + let basename = format!("initial-checkpoint.{}.json", SPEC); + load_fixture(basename).unwrap() +} + +pub fn load_sync_committee_update_fixture( +) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { + #[cfg(feature = "beacon-spec-minimal")] + const SPEC: &str = "minimal"; + #[cfg(not(feature = "beacon-spec-minimal"))] + const SPEC: &str = "mainnet"; + let basename = format!("sync-committee-update.{}.json", SPEC); + load_fixture(basename).unwrap() +} + +pub fn load_finalized_header_update_fixture( +) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { + #[cfg(feature = "beacon-spec-minimal")] + const SPEC: &str = "minimal"; + #[cfg(not(feature = "beacon-spec-minimal"))] + const SPEC: &str = "mainnet"; + let basename = format!("finalized-header-update.{}.json", SPEC); + load_fixture(basename).unwrap() +} + +pub fn load_next_sync_committee_update_fixture( +) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { + #[cfg(feature = "beacon-spec-minimal")] + const SPEC: &str = "minimal"; + #[cfg(not(feature = "beacon-spec-minimal"))] + const SPEC: &str = "mainnet"; + let basename = format!("next-sync-committee-update.{}.json", SPEC); + load_fixture(basename).unwrap() +} + +pub fn load_next_finalized_header_update_fixture( +) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { + #[cfg(feature = "beacon-spec-minimal")] + const SPEC: &str = "minimal"; + #[cfg(not(feature = "beacon-spec-minimal"))] + const SPEC: &str = "mainnet"; + let basename = format!("next-finalized-header-update.{}.json", SPEC); + load_fixture(basename).unwrap() +} + +pub fn get_message_verification_payload() -> (Log, Proof) { + ( + Log { + address: hex!("ee9170abfbf9421ad6dd07f6bdec9d89f2b581e0").into(), + topics: vec![ + hex!("1b11dcf133cc240f682dab2d3a8e4cd35c5da8c9cf99adac4336f8512584c5ad").into(), + hex!("00000000000000000000000000000000000000000000000000000000000003e8").into(), + hex!("0000000000000000000000000000000000000000000000000000000000000001").into(), + ], + data: hex!("0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004b000f000000000000000100d184c103f7acc340847eee82a0b909e3358bc28d440edffa1352b13227e8ee646f3ea37456dec701345772617070656420457468657210574554481235003511000000000000000000000000000000000000000000").into(), + }, + Proof { + block_hash: hex!("05aaa60b0f27cce9e71909508527264b77ee14da7b5bf915fcc4e32715333213").into(), + tx_index: 0, + data: (vec![ + hex!("cf0d1c1ba57d1e0edfb59786c7e30c2b7e12bd54612b00cd21c4eaeecedf44fb").to_vec(), + hex!("d21fc4f68ab05bc4dcb23c67008e92c4d466437cdd6ed7aad0c008944c185510").to_vec(), + hex!("b9890f91ca0d77aa2a4adfaf9b9e40c94cac9e638b6d9797923865872944b646").to_vec(), + ], vec![ + hex!("f90131a0b601337b3aa10a671caa724eba641e759399979856141d3aea6b6b4ac59b889ba00c7d5dd48be9060221a02fb8fa213860b4c50d47046c8fa65ffaba5737d569e0a094601b62a1086cd9c9cb71a7ebff9e718f3217fd6e837efe4246733c0a196f63a06a4b0dd0aefc37b3c77828c8f07d1b7a2455ceb5dbfd3c77d7d6aeeddc2f7e8ca0d6e8e23142cdd8ec219e1f5d8b56aa18e456702b195deeaa210327284d42ade4a08a313d4c87023005d1ab631bbfe3f5de1e405d0e66d0bef3e033f1e5711b5521a0bf09a5d9a48b10ade82b8d6a5362a15921c8b5228a3487479b467db97411d82fa0f95cccae2a7c572ef3c566503e30bac2b2feb2d2f26eebf6d870dcf7f8cf59cea0d21fc4f68ab05bc4dcb23c67008e92c4d466437cdd6ed7aad0c008944c1855108080808080808080").to_vec(), + hex!("f851a0b9890f91ca0d77aa2a4adfaf9b9e40c94cac9e638b6d9797923865872944b646a060a634b9280e3a23fb63375e7bbdd9ab07fd379ab6a67e2312bbc112195fa358808080808080808080808080808080").to_vec(), + hex!("f9030820b9030402f90300018301d6e2b9010000000000000800000000000020040008000000000000000000000000400000008000000000000000000000000000000000000000000000000000000000042010000000001000000000000000000000000000000000040000000000000000000000000000000000000000000000008000000000000000002000000000000000000000000200000000000000200000000000100000000040000001000200008000000000000200000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000f901f5f87a942ffa5ecdbe006d30397c7636d3e015eee251369ff842a0c965575a00553e094ca7c5d14f02e107c258dda06867cbf9e0e69f80e71bbcc1a000000000000000000000000000000000000000000000000000000000000003e8a000000000000000000000000000000000000000000000000000000000000003e8f9011c94ee9170abfbf9421ad6dd07f6bdec9d89f2b581e0f863a01b11dcf133cc240f682dab2d3a8e4cd35c5da8c9cf99adac4336f8512584c5ada000000000000000000000000000000000000000000000000000000000000003e8a00000000000000000000000000000000000000000000000000000000000000001b8a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004b000f000000000000000100d184c103f7acc340847eee82a0b909e3358bc28d440edffa1352b13227e8ee646f3ea37456dec701345772617070656420457468657210574554481235003511000000000000000000000000000000000000000000f858948cf6147918a5cbb672703f879f385036f8793a24e1a01449abf21e49fd025f33495e77f7b1461caefdd3d4bb646424a3f445c4576a5ba0000000000000000000000000440edffa1352b13227e8ee646f3ea37456dec701").to_vec(), + ]), + } + ) +} + +pub fn get_message_verification_header() -> CompactExecutionHeader { + CompactExecutionHeader { + parent_hash: hex!("04a7f6ab8282203562c62f38b0ab41d32aaebe2c7ea687702b463148a6429e04") + .into(), + block_number: 55, + state_root: hex!("894d968712976d613519f973a317cb0781c7b039c89f27ea2b7ca193f7befdb3").into(), + receipts_root: hex!("cf0d1c1ba57d1e0edfb59786c7e30c2b7e12bd54612b00cd21c4eaeecedf44fb") + .into(), + } +} + +#[cfg(feature = "beacon-spec-minimal")] pub mod minimal { use super::*; - use crate::config; - use hex_literal::hex; - use primitives::CompactExecutionHeader; - use snowbridge_core::inbound::{Log, Proof}; use sp_runtime::BuildStorage; - use std::{fs::File, path::PathBuf}; type Block = frame_system::mocking::MockBlock; @@ -103,86 +208,9 @@ pub mod minimal { let _ = ext.execute_with(|| Timestamp::set(RuntimeOrigin::signed(1), 30_000)); ext } - - fn load_fixture(basename: &str) -> Result - where - T: for<'de> serde::Deserialize<'de>, - { - let filepath: PathBuf = - [env!("CARGO_MANIFEST_DIR"), "tests", "fixtures", basename].iter().collect(); - serde_json::from_reader(File::open(filepath).unwrap()) - } - - pub fn load_execution_header_update_fixture() -> primitives::ExecutionHeaderUpdate { - load_fixture("execution-header-update.minimal.json").unwrap() - } - - pub fn load_checkpoint_update_fixture( - ) -> primitives::CheckpointUpdate<{ config::SYNC_COMMITTEE_SIZE }> { - load_fixture("initial-checkpoint.minimal.json").unwrap() - } - - pub fn load_sync_committee_update_fixture( - ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { - load_fixture("sync-committee-update.minimal.json").unwrap() - } - - pub fn load_finalized_header_update_fixture( - ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { - load_fixture("finalized-header-update.minimal.json").unwrap() - } - - pub fn load_next_sync_committee_update_fixture( - ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { - load_fixture("next-sync-committee-update.minimal.json").unwrap() - } - - pub fn load_next_finalized_header_update_fixture( - ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { - load_fixture("next-finalized-header-update.minimal.json").unwrap() - } - - pub fn get_message_verification_payload() -> (Log, Proof) { - ( - Log { - address: hex!("ee9170abfbf9421ad6dd07f6bdec9d89f2b581e0").into(), - topics: vec![ - hex!("1b11dcf133cc240f682dab2d3a8e4cd35c5da8c9cf99adac4336f8512584c5ad").into(), - hex!("00000000000000000000000000000000000000000000000000000000000003e8").into(), - hex!("0000000000000000000000000000000000000000000000000000000000000001").into(), - ], - data: hex!("0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004b000f000000000000000100d184c103f7acc340847eee82a0b909e3358bc28d440edffa1352b13227e8ee646f3ea37456dec701345772617070656420457468657210574554481235003511000000000000000000000000000000000000000000").into(), - }, - Proof { - block_hash: hex!("05aaa60b0f27cce9e71909508527264b77ee14da7b5bf915fcc4e32715333213").into(), - tx_index: 0, - data: (vec![ - hex!("cf0d1c1ba57d1e0edfb59786c7e30c2b7e12bd54612b00cd21c4eaeecedf44fb").to_vec(), - hex!("d21fc4f68ab05bc4dcb23c67008e92c4d466437cdd6ed7aad0c008944c185510").to_vec(), - hex!("b9890f91ca0d77aa2a4adfaf9b9e40c94cac9e638b6d9797923865872944b646").to_vec(), - ], vec![ - hex!("f90131a0b601337b3aa10a671caa724eba641e759399979856141d3aea6b6b4ac59b889ba00c7d5dd48be9060221a02fb8fa213860b4c50d47046c8fa65ffaba5737d569e0a094601b62a1086cd9c9cb71a7ebff9e718f3217fd6e837efe4246733c0a196f63a06a4b0dd0aefc37b3c77828c8f07d1b7a2455ceb5dbfd3c77d7d6aeeddc2f7e8ca0d6e8e23142cdd8ec219e1f5d8b56aa18e456702b195deeaa210327284d42ade4a08a313d4c87023005d1ab631bbfe3f5de1e405d0e66d0bef3e033f1e5711b5521a0bf09a5d9a48b10ade82b8d6a5362a15921c8b5228a3487479b467db97411d82fa0f95cccae2a7c572ef3c566503e30bac2b2feb2d2f26eebf6d870dcf7f8cf59cea0d21fc4f68ab05bc4dcb23c67008e92c4d466437cdd6ed7aad0c008944c1855108080808080808080").to_vec(), - hex!("f851a0b9890f91ca0d77aa2a4adfaf9b9e40c94cac9e638b6d9797923865872944b646a060a634b9280e3a23fb63375e7bbdd9ab07fd379ab6a67e2312bbc112195fa358808080808080808080808080808080").to_vec(), - hex!("f9030820b9030402f90300018301d6e2b9010000000000000800000000000020040008000000000000000000000000400000008000000000000000000000000000000000000000000000000000000000042010000000001000000000000000000000000000000000040000000000000000000000000000000000000000000000008000000000000000002000000000000000000000000200000000000000200000000000100000000040000001000200008000000000000200000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000f901f5f87a942ffa5ecdbe006d30397c7636d3e015eee251369ff842a0c965575a00553e094ca7c5d14f02e107c258dda06867cbf9e0e69f80e71bbcc1a000000000000000000000000000000000000000000000000000000000000003e8a000000000000000000000000000000000000000000000000000000000000003e8f9011c94ee9170abfbf9421ad6dd07f6bdec9d89f2b581e0f863a01b11dcf133cc240f682dab2d3a8e4cd35c5da8c9cf99adac4336f8512584c5ada000000000000000000000000000000000000000000000000000000000000003e8a00000000000000000000000000000000000000000000000000000000000000001b8a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004b000f000000000000000100d184c103f7acc340847eee82a0b909e3358bc28d440edffa1352b13227e8ee646f3ea37456dec701345772617070656420457468657210574554481235003511000000000000000000000000000000000000000000f858948cf6147918a5cbb672703f879f385036f8793a24e1a01449abf21e49fd025f33495e77f7b1461caefdd3d4bb646424a3f445c4576a5ba0000000000000000000000000440edffa1352b13227e8ee646f3ea37456dec701").to_vec(), - ]), - } - ) - } - - pub fn get_message_verification_header() -> CompactExecutionHeader { - CompactExecutionHeader { - parent_hash: hex!("04a7f6ab8282203562c62f38b0ab41d32aaebe2c7ea687702b463148a6429e04") - .into(), - block_number: 55, - state_root: hex!("894d968712976d613519f973a317cb0781c7b039c89f27ea2b7ca193f7befdb3") - .into(), - receipts_root: hex!("cf0d1c1ba57d1e0edfb59786c7e30c2b7e12bd54612b00cd21c4eaeecedf44fb") - .into(), - } - } } -#[cfg(feature = "beacon-spec-mainnet")] +#[cfg(not(feature = "beacon-spec-minimal"))] pub mod mainnet { use super::*; @@ -237,25 +265,25 @@ pub mod mainnet { } parameter_types! { - pub const ChainForkVersions: ForkVersions = ForkVersions{ + pub const ChainForkVersions: ForkVersions = ForkVersions { genesis: Fork { - version: [0, 0, 16, 32], // 0x00001020 + version: [144, 0, 0, 111], // 0x90000069 epoch: 0, }, altair: Fork { - version: [1, 0, 16, 32], // 0x01001020 - epoch: 36660, + version: [144, 0, 0, 112], // 0x90000070 + epoch: 50, }, bellatrix: Fork { - version: [2, 0, 16, 32], // 0x02001020 - epoch: 112260, + version: [144, 0, 0, 113], // 0x90000071 + epoch: 100, }, capella: Fork { - version: [3, 0, 16, 32], // 0x03001020 - epoch: 162304, + version: [144, 0, 0, 114], // 0x90000072 + epoch: 56832, }, }; - pub const ExecutionHeadersPruneThreshold: u32 = 10; + pub const ExecutionHeadersPruneThreshold: u32 = 8192; } impl ethereum_beacon_client::Config for Test { diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/tests.rs b/snowbridge/parachain/pallets/ethereum-beacon-client/src/tests.rs index 92a93720ae9..d6346d3aafe 100644 --- a/snowbridge/parachain/pallets/ethereum-beacon-client/src/tests.rs +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/src/tests.rs @@ -1,15 +1,28 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: 2023 Snowfork use crate::{ - config::{EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH}, - functions::compute_period, - mock::minimal::*, - pallet::ExecutionHeaders, - sync_committee_sum, verify_merkle_branch, BeaconHeader, CompactBeaconState, Error, - ExecutionHeaderBuffer, FinalizedBeaconState, LatestExecutionState, LatestFinalizedBlockRoot, - NextSyncCommittee, SyncCommitteePrepared, + functions::compute_period, pallet::ExecutionHeaders, sync_committee_sum, verify_merkle_branch, + BeaconHeader, CompactBeaconState, Error, ExecutionHeaderBuffer, FinalizedBeaconState, + LatestExecutionState, LatestFinalizedBlockRoot, NextSyncCommittee, SyncCommitteePrepared, }; +use crate::mock::{ + get_message_verification_header, get_message_verification_payload, + load_checkpoint_update_fixture, load_execution_header_update_fixture, + load_finalized_header_update_fixture, load_next_finalized_header_update_fixture, + load_next_sync_committee_update_fixture, load_sync_committee_update_fixture, +}; + +#[cfg(feature = "beacon-spec-minimal")] +pub use crate::config::minimal::*; +#[cfg(feature = "beacon-spec-minimal")] +pub use crate::mock::minimal::*; + +#[cfg(not(feature = "beacon-spec-minimal"))] +pub use crate::config::mainnet::*; +#[cfg(not(feature = "beacon-spec-minimal"))] +pub use crate::mock::mainnet::*; + use frame_support::{assert_err, assert_noop, assert_ok}; use hex_literal::hex; use primitives::{ @@ -168,7 +181,7 @@ pub fn verify_merkle_branch_fails_if_depth_and_branch_dont_match() { #[test] pub fn sync_committee_participation_is_supermajority() { let bits = - hex!("bffffffff7f1ffdfcfeffeffbfdffffbfffffdffffefefffdffff7f7ffff77fffdf7bff77ffdf7fffafffffff77fefffeff7effffffff5f7fedfffdfb6ddff7b" + hex!("bffffffff7f1ffdfcfeffeffbfdffffbfffffdffffefefffdffff7f7ffff77fffdf7bff77ffdf7fffafffffff77fefffeff7effffffff5f7fedfffdfb6ddff7b" ); let participation = primitives::decompress_sync_committee_bits::<512, 64>(bits); assert_ok!(EthereumBeaconClient::sync_committee_participation_is_supermajority(&participation)); diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/execution-header-update.mainnet.json b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/execution-header-update.mainnet.json new file mode 100755 index 00000000000..97d498e2d9e --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/execution-header-update.mainnet.json @@ -0,0 +1,50 @@ +{ + "header": { + "slot": 4058654, + "proposer_index": 1039, + "parent_root": "0x758fa0a54047c0221b3107423e78b8910514ba7a0c4250401dac77108dce2ff8", + "state_root": "0x53c79320b4b7649e39a9f07903f4fc68a7cfe7a81cb2e30293dd7b00ee13f69a", + "body_root": "0xa76a7f037f12ee070dcb273d9787b13ff0cf17420a39564a101789318a157ec3" + }, + "ancestry_proof": { + "header_branch": [ + "0xbb6cfda1e02c3117d9fa41c1e1594ce0645352a073ad8b474f83c148e0d9954f", + "0xb44967bd8ff799126cad993ff7369f7a28d60281304d0c7c058e6721b6ce4c61", + "0x0009710ef2467f95542c2e8e7a7249282c08f62aedbe7d21ae4a7af04e1a890d", + "0x7bc5dc20638cfe1cfd5d2547c3efbed4cfb533c76c27d41f723ed876ab9edc3a", + "0x6dcd59a8a041cf2591921417cb8133f0ff5af9bfe1f1ab491e75a751adc9c9e1", + "0x3f25a2852042c7bf2c421bf16c0b9373c1d27ccb1eca4088f8191712481261be", + "0xd1f9cfe1f04031459e5c45f47b2a49c780cabb8ca5b8d76461db2b88c337ed76", + "0x8c37e3119bf7d3cb8208e832669261b0eda1b3c7b11d321760ba1c0649f61416", + "0x1783d3b7041ecb78d9e1f913b82bd335229ca1f2cc5d3cc8dd28c94152e887b4", + "0xe39fc366c951c7cb2100308b0a9417581c46812a7d7e89f516c19863f7686f96", + "0x3c29b6d9b8715dbe5d6831364229efc91ad56ae69e93cb119d5ef4bdc53fcb37", + "0x3cf6fe5e8d91dbaa77e6befa81e04fb25a3e089317d83ff35fc8adfbbf2aab5a", + "0xb41c97cf3b1b4b5bf2999dfb1b3eaeac5c1b12205e9ab0809988e3779d119047" + ], + "finalized_block_root": "0xb4802863fc1d32778211ce6aac8109c73c516a003213f4f5333c80472d08fe4e" + }, + "execution_header": { + "parent_hash": "0x9cffcba69c88a619483e13864704dde5db80e05f8d49018f615395ce09cd24ab", + "fee_recipient": "0xff58d746a67c2e42bcc07d6b3f58406e8837e883", + "state_root": "0x6a4aafc93626778475a416721104229035e91f0db788d0099b57e756cd272f0a", + "receipts_root": "0xe1ce670bdcf9acf4c62fee845cd7e81eabbb6db9ddbff56130020c6cf999a45d", + "logs_bloom": "0xa000980408008000328c1458805c005048b84812c134200090b40428568108a0648090105085100301844800090802484420800d020282019002040d083004031a20420240a4a8900a43296938c040802040220170860210910020036b8c482228c004440300021c82c0400110402a10800582424001c00000828310210020a18130504020790dca716194100880ea5501149104002bc05e189080901c4001010e0a040658a410072021230a5224265030082404000aa11f28162e216636000408842103d41010760972060060000500c20130b000000065401483200081a84934f020020120009618002269c884724616040000840e18080300024490000230", + "prev_randao": "0x5d9ac7ea788ecb534e98bc9079fa0bef199011dadadedaee5dc40e2cd702d664", + "block_number": 5025098, + "gas_limit": 30000000, + "gas_used": 13802943, + "timestamp": 1704437448, + "extra_data": "0x476f65726c69205365706f6c69612d4265706f6c696120513966", + "base_fee_per_gas": 19959019915, + "block_hash": "0x795021134c2b7f9c00b498ff7b0971dbbe061561868f702d8ca68a05e5eb5a99", + "transactions_root": "0x3cb7c92fde5d511cc90cd67e375c4388794f4c01e375e8e8a06d003b5593fd12", + "withdrawals_root": "0x5f5155fd8e5cd24b7ecb1e039792b0caff01dfda2990786d9ffc88325b5d1ea8" + }, + "execution_branch": [ + "0x85ff3d1c2bc3dcdd5543bcd29a1224c6a8c24875224fbb1e3b69f0515ffaacda", + "0x336488033fe5f3ef4ccc12af07b9370b92e553e35ecb4a337a1b1c0e4afe1e0e", + "0xdb56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71", + "0xfe1fa7acd413c54ebd394126ade19fc624ad9e4c60792d54ff3d60b07076b76d" + ] +} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/finalized-header-update.mainnet.json b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/finalized-header-update.mainnet.json new file mode 100755 index 00000000000..49434dee72d --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/finalized-header-update.mainnet.json @@ -0,0 +1,38 @@ +{ + "attested_header": { + "slot": 4058720, + "proposer_index": 1088, + "parent_root": "0x37c7398a391c71da07258b48f41d4caaaf891fdf558e110b9c25db716fa8ff55", + "state_root": "0x6cf68a66c993f1c27f499e054a5fbd7c0e625c34ea0057fda9691c561e990002", + "body_root": "0x109e4c0c647d42dba0c8c6569997c51b5bcfc1a33475b1433ded6353f48423ff" + }, + "sync_aggregate": { + "sync_committee_bits": "0xffffffffff7bfdfffff7fffff1effffef7f9ffbdfdffffffdffbfffbbf7ffffffffffefdf7ffbeffdffef7bfffffffffffbffffffffffbffffffffffffffdfda", + "sync_committee_signature": "0xb5727bad1db101b6f0fd7ec4cb79b43dae90366fe0cae31a62439388eb03ebd75732cee3bde51f814203a4c0f5b23898120cd0870f0e662bdf0f85a048b534d9a906e6d32a65df019059d34f724221075734ec2849c09679febecf6929934f09" + }, + "signature_slot": 4058721, + "next_sync_committee_update": null, + "finalized_header": { + "slot": 4058656, + "proposer_index": 810, + "parent_root": "0xbb6cfda1e02c3117d9fa41c1e1594ce0645352a073ad8b474f83c148e0d9954f", + "state_root": "0xf938f0f0cba85234afbaace20545134c70b35e6ff9f74d944b0fea309109f3cf", + "body_root": "0xcf6a7a6f653cb64b2b910278a478339b34eb08abf00e0766d10c7a8fe9bdb139" + }, + "finality_branch": [ + "0x71ef010000000000000000000000000000000000000000000000000000000000", + "0x3d4be5d019ba15ea3ef304a83b8a067f2e79f46a3fac8069306a6c814a0a35eb", + "0xa2e2a28c0bb0ad56c25f3c461a4bfe4f3b3b894bc0105a62e85f43a4ae1adc3f", + "0xaa2bad8cf9b0433d3d79bc5b95c067048b018d1d2ffd0c66db6e7cf86e0a314e", + "0x027f238235d07ac9757543c19deabe1d553d6fc110e8bea4b037b1fab263b4dc", + "0x7dfa1cc1907e8927295f78a770bf86b28f5c2bddcac38beb3b4beb265ff5608f" + ], + "block_roots_root": "0x4a5a57fb0769443f6472f59dbb78d7a9a69ff61d09aa89d5da645d634ec46a14", + "block_roots_branch": [ + "0xa09ad7f3afd681bb6fd54abba339549f3b601beedea79a5b7d448b1cf1e1613e", + "0xacdfd4d5eba154f118a84af7a2d17ba6100fcd9c24fc235e927f584a5b56e32f", + "0x36ca106eac009ed605e680415b105b3a6591830c38034511f300aae44802235f", + "0x171561a9e1afb413132d0f4d3cbbd810766c151be32ec9f2d609f40aef9e2588", + "0x7cd963eba3fb57ee5ce37ee4b621d24fc14d642e32f48dc48ade528e11458ab9" + ] +} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/initial-checkpoint.mainnet.json b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/initial-checkpoint.mainnet.json new file mode 100755 index 00000000000..1f0f837f596 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/initial-checkpoint.mainnet.json @@ -0,0 +1,542 @@ +{ + "header": { + "slot": 4058624, + "proposer_index": 631, + "parent_root": "0x4abadda13b61df8d40fcb061d1ec15d0fb7bc5144252bb54c57b41893b642bf3", + "state_root": "0x6fe9fa01a04dcdeaa64eba04a72fa6dbadc8596dc5ec1fff2ef343520fe722e1", + "body_root": "0x6cd83df0ee7669e06e64496a1d2be083bc3bb9f2da17e9b1e62979d200328106" + }, + "current_sync_committee": { + "pubkeys": [ + "0xa13bf1fc1826b61cceefcc941c5a4865cefdfa6c91e5223308fa6a0aa6e7b13a0499a63edf5d9fff48fdeae83e38dcbf", + "0xb3285148b91dab139b053442bdd14d627ba1e1250fe469f0f2df854b6e6ff4a18671ae3879ec9f7d8091f99f092162e9", + "0xb00d95908e72c6051478a422eb2231b5f797c2fa5c696ed1e6b9c9996ba1d8236f512443f18c01ce63312c38fa383fd4", + "0xa866633b4293e726accf6e97ac90c1898cac83e8531a25b50ae99f0ecb477a692e6a5f2488447ccd83ed869ab5abc406", + "0xa308ed8737b3a9346ff20dc9f112efccc193472e6fde6aa218ceae11e288bbd2c35fa45c1d8bb238696a96767cd68b46", + "0x81534e2a182da0c6831479c7e722953d267ba9c63a204ac96a178b1dc90d0a6ba8737002688ba5f102eda5669249f114", + "0x87c5670e16a84e27529677881dbedc5c1d6ebb4e4ff58c13ece43d21d5b42dc89470f41059bfa6ebcf18167f97ddacaa", + "0xb37334c41a3456b73b61d0eb0777260af9c2e400bbec0e0c0fdb45c39ce0dd19f021d9760f35da801f20486c6be30e9e", + "0xab73a043ccdfe63437a339e6ee96ef1241264e04dd4d917f6d6bc99396006de54e1e156d38596ba3d15cb1aaa329f8f5", + "0x8983fdebbeba6e3cc3ee1c9feb24faaeee712356975e359b0ddca3f7c9c7448132d665f54a4629002252d3fcf375f7b0", + "0xa03c1e287ccc4d457f5e71e9dc769294835945561e6f236ac7de210d2e614eee8a85e21dfb46e2143c68de22ccee8660", + "0x8e6b888197010ebadd216da35b9716daa8675d93b3c33a96a19fd9ca42624f6b430b2ff115cd0f5b717341605dda24bf", + "0x8fb51e3ef3c1047ae7c527dc24dc8824b2655faff2c4c78da1fcedde48b531d19abaf517363bf30605a87336b8642073", + "0x893272a63650b08e5b8f9b3f17f8547b456192ad649c168bafd7166b4c08c5adf795c508b88fd2425f7be8334592afb2", + "0xa90c42266ca0a65976fb4dc18465b0a44a63ed3b2747cae74e46e3ccf158f98384e2e86c852e7c5556b083b3ded9d243", + "0xb67c621d9b6313a9f6744dfcdd77d4e9cb4bd413fb5e3199cdcd7f675fc39f1ba492860749bfddf98f4088756e844a98", + "0xa9760afaa51002be0948acf7aebd90ec4e60e0dba8456e445aea93408a0468b62bb6da4984b92f8f6061561c9d56f4c4", + "0x981b2d7c56ff38f1d02c5d7a7f8bfe71daaf94d48c3bc93e8083a0a23c1ae1ff05f90312deb09b35d4513c1ffa573d86", + "0x9515dedf061e654d58a43e4e525a63ad2a6274ea6f20b1d624a6ba7d3062ed68a0226eee6951ab8464906c52ba5556b0", + "0x901f724ee1891ca876e5551bd8f4ad4da422576c618465f63d65700c2dd7953496d83abe148c6a4875a46a5a36c218cf", + "0xa8d152e5d94b75cb9e249230db21af31de4d4f3d4ef60ccbf2212babf69aed2a38435a993ee2f13cca410ad55a4875ab", + "0x875ebfe737cea438e967d70ceaffb4360cce28ecc76c8c4ee612c47fb6b3e89af03c66981571066107323f49a6242772", + "0xa798a0371e8cc4dc42ccd79934b0db5a3a59f18a0ae09f2eb172596428fcb3f00312e783d6fd21cbc1610317f44e08cb", + "0x99c629c9cd603a9344b04d22d2bcc06cf45ebf62d97f968df19c73c7a50f4f6a2a2cc7fb633f509f961edfb94fbab94e", + "0x854410e6fb856da8b997ebf28ae2415ce6e1f9f6a4579fad15b5df61709c924a925397b33fe67c89ffad6143a39d756a", + "0xa3969926aa2e52f1a48ac53074b764648b4c71bd43430944679628463cd68398f700d874c14503b53756be451c8ba284", + "0x8ee8873de7cd28a54ba2c63a80b63399effed76b154e96ed26e7c0668b9f2476e298688b6a00c4b2ab9d020a897695d7", + "0xad54241ba3de6a4426c788690d3f78d2eb678814edc49d3fb988d7fc752e43512972567bb384bcc1b18d083d15e376da", + "0x942bee9ee880ac5e2f8ba35518b60890a211974d273b2ae415d34ce842803de7d29a4d26f6ee79c09e910559bdcac6d3", + "0x96b478b1e5e49d4ea3fd97c4846ae0f781dcc9f9ff61ee022ca92c3d8dfba89c513c46e8bb38b73e6b678a79b9b12177", + "0xaad9577501d7f3a5dbac329f2c1fe711710869cc825740f365488fc55a278d687bb72423560f7cb2cbd60546a82ea1e6", + "0x8aa3d9dad1c122b9aed75e3cc94b3a9dab160fa4cad92ebab68a58c0151a5d93f0f6b40b86fba00e63d45bd29a93b982", + "0xa12fc78b8d3334a3eb7b535cd5e648bb030df645cda4e90272a1fc3b368ee43975051bbecc3275d6b1e4600cc07239b0", + "0xab01a7b13c967620d98de736b8ff23d856daa26d5cd8576993ee02a5d694332c0464ed018ebffcd5c71bab5cada850ce", + "0x96cf5760c79cfc830d1d5bd6df6cfd67596bef24e22eed52cee04c290ad418add74e77965ea5748b7f0fb34ee4f43232", + "0x9443e6ba4400fb3370c573cd7e33f05e1475f9cf1d6adb905bee3aff8f1452d8d384c8a72c9110070f35c6aad940bba6", + "0x95c60b5561e53cfc26d620be90f84199ffd6dd9687c1be3a547048e7cba10a0be9bb6da000e7521cbd488d0901d48ee9", + "0xab69cf79750436d310dc3c5e96c2b97003f4394f31dfa8a9ac420595dc7b4d96dad5787d93347ba2bc6f196c241a3dbf", + "0x9145ee1fb6e84114c903819db94fa5a72bcbc15fcb8a7fd8eefba23b156cc46309281dcf78b48a2847b3754f7d7d7a79", + "0xb118f77f99ac947df97e7682f0fb446175185b842380af4ee7394531e4f93002c72b41a57a7c1b923a4f24b10924c84f", + "0xa4aabd1890ebf35423565dbff3477a09eea4e35f5a26ed449eab38e0a21fb89e9ddfe3a2003cddc457db648a1b5891a3", + "0x8ff5d2e6c98b1fea70cb36ea8ed497fd1233b9418948ac58c6c379ed35fb10f8253ef188c909d5e77e81b5b8e2a4ad17", + "0xa23f076306c120dccf69d7d2ac7f83a377a72d35bf448f88feff8b6dba9307fdabf34452e30b87407b2258b9edfd1174", + "0x87d2217eb05d657aba7b048cf3c661b463e78e51135a5b937e71975ff5102e596434720f02349c73415decb88418cb0d", + "0x8bb51b380a8a52d61a94e7b382ff6ce601260fa9b8c5d616764a3df719b382ec43aec9266444a16951e102d8b1fb2f38", + "0xb0053550040ab3a3996cba5caf9ad5718867b5f5df273ed8c6520761571f03a94e50b5f8a6a8c42d725383cce97d3cae", + "0xae50f93230983a82e732903d6ed50a506d678f35b6b4a4b3686a92b12aeb9d34cb095e8562b0900125bbced0359b37de", + "0x8bfa106ada4914419bf1d8900c5981dd5b90c3023196d7e918d62879fc3a575bd0a25f939366f7fd2240df6108b069ec", + "0xb3a5497365bd40a81202b8a94a5e28a8a039cc2e639d73de289294cbda2c0e987c1f9468daba09ea4390f8e4e806f3c8", + "0xb4f583e10aa9af79b4ebd647e0fffe1c720112727e5ffac4313f236737491fceeee194537786c561cd5777b453e5b03c", + "0x826be957cf66db958028fa95655b54b2337f78fb6ef26bd29e2e3a64b130b90521333f31d132c04779e4b23a6b6cd951", + "0xaace45334070c51cc8b3579598d4cd8cda2153bba51f56e3b1fe5e135c83ef70503c322756b9cad9d3cd28f1ecfc8227", + "0x94bb68c8180496472262455fd6ab338697810825fa4e82fc673f3ac2dacfd29ee539ac0bfe97eb39d4ef118db875bab6", + "0xb560c33950a355119845f63defb355807e56773f636fb836f7746155fad070e384fc1091b8e5c057e4cbc7da9275ecf7", + "0x820cc2ac3eed5bce7dc72df2aa3214e71690b91445d8bb1634c0488a671e3669028efbe1eae52f7132bde29b16a020b7", + "0x9244703338879e3ea00663dcde8f11095de3e38df9277d8c2acc26e72021c222ae40bcc91228789fdf0b69acc3144783", + "0x8d474636a638e7b398566a39b3f939a314f1cf88e64d81db0f556ca60951ec1dca1b93e3906a6654ed9ba06f2c31d4ea", + "0x889a5cf9315383bf64dfe88e562d772213c256b0eed15ce27c41c3767c048afe06410d7675e5d59a2302993e7dc45d83", + "0xb544c692b046aad8b6f5c2e3493bc8f638659795f06327fff1e9f4ffc8e9f7abdbf4b7f6fcdfb8fe19654d8fa7d68170", + "0xaefc682f8784b18d36202a069269be7dba8ab67ae3543838e6d473fbc5713d103abcc8da1729a288503b786baac182d3", + "0xa0f2092ac34d2363614fb2f57fc7b72db247eb1fa53f395881ce6b4aacd6fb920d6dc59507701d487288102e4c4fa389", + "0xb33de3de106be61481ccb7f07a7a63cf4d1674010e462388fb8ab5ea08f444ed7a277905207e0b3aa2f00bb9efca984f", + "0x84173aeaf3d96368dc7ca1ad5e5575da279113567e5815a364a0356a720c5e08cb58ca1fdd891924f4871d3eaae5de40", + "0xb6d6482ad7b9b412ffbefbbdcc28eb3d091b1291f54f77bdd53c4ac85f705c454940f466dc272dde7b03c26f0cd6ecb3", + "0xa2053719da2b7501dab42011ae144b3c8d72bd17493181bf3ae79a678068dc3ee2f19d29a60b5a323692c3f684f96392", + "0x8296f8caf58316af535def398a43357e48cb3b1e674b857eba1bd1b970da3dd045e22fe6d17dee4e9117f62ece3ec31c", + "0x84faf4d90edaa6cc837e5e04dc67761084ae24e410345f21923327c9cb5494ffa51b504c89bee168c11250edbdcbe194", + "0x879aea8f09dec92f354e31aa479d00cb77457d363de2d9a51ddf7d734061b6f83d6345cf33dbef22004cd23dd6c4b760", + "0xb8fca0f7bc276f03c526d42df9f88c19b8dc630ad1299689e2d52cd4717bbe5425479b13bdf6e6337c48832e4cd34bb5", + "0xb2a01dc47dd98f089f28eee67ba2f789153516b7d3b47127f430f542869ec42dd8fd4dc83cfbe625c5c40a2d2d0633ea", + "0xa19f2ce14e09ece5972fe5af1c1778b86d2ab6e825eccdb0ac368bb246cfe53433327abfe0c6fa00e0553863d0a8128e", + "0x95d1f944b0c53eb3e9fcd5632713602bbb9195b87a172a370ae2df98504612a55f3968615a39b569ce6a0fe9fb559be7", + "0xae36ab11be96f8c8fcfd75382bb7f4727511596bc08c25814d22f2b894952489d08396b458f7884d6b3c0adb69856a6d", + "0x824d0dc002e158adef06fc38d79b01553be5a3903566029cf0beddb2248b11da40e66feb168e8e3e2a63ea033a75f382", + "0x8f9f85ae6377414fcf8297ed45a736210cd3803f54f33116b0f290b853dc61e99ea08f3c422ed9bc6bdc2f42ab4f56ba", + "0x86c53fc078846c3d9bc47682506f8285ba4551475921fd388b96291741970c34b8de4210202e40d2de4acb6e2892072b", + "0x853184f246d098139230962e511585368b44d46a115c5f06ccaeef746773951bead595fb6246c69975496bac61b42a4f", + "0xb91b4260e2884bae9778fe29a2c1e4525e4663ec004159def5d47320de304c96d2a33ad7a670e05acf90cbba3efdd4d9", + "0x83492e27e07e35c0836aee6bee95d040b8d3e82db6f94a3917d07797800f7200f5dbc6c9596c6c3c70f8f470b65a9b6e", + "0xb1bb33607d10ea8c954064ecb00c1f02b446355ef73763a122f43b9ea42cd5650b54c5c9d1cfa81d4a421d17a0a451aa", + "0x99cb1728157a1b7cdd9607cf15911bbcb56b64d52fb0d0117b457853a81ec55913f977850f26e188fa2652579efe9ddf", + "0x8b7cb5b8de09a6dfceddcbaa498bc65f86297bcf95d107880c08854ed2289441a67721340285cfe1749c62e8ef0f3c58", + "0xb97447233c8b97a8654749a840f12dab6764209c3a033154e045c76e0c8ed93b89788aac5cd1e24ed4a18c36de3fbf60", + "0xb4790910e2cbef848448f24f63e9dd4a1b122cf65feecf152d5fde282ad6fcc6ea3f9cc23178baf85612020795e4b13a", + "0x81fc724846b5781f3736795c32b217458bb29972af36cc4483dd98ab91680d3d9bc18842db2661487d3a85430dc9e326", + "0xa154892ff23b284040e623bba940a6a1ef1207b8b089fc699cb152b00bcce220464502cfa1dfb5a2f62e6f3960cdf349", + "0xaf3f765fd293c253072b33a780ed68933f78d7e079d9a2079b6232755bedf6ebcbce9ba65c01f695602fa8ee17899867", + "0x97578474be98726192cb0eac3cb9195a54c7315e9c619d5c44c56b3f98671636c383416f73605d4ea7ca9fbeff8dd699", + "0x917c4fd52538d34c26ccdd816e54ebea09517712aa74cec68a2e3d759c6a69b5ccb4089ad1e0b988e916b2ce9f5c8918", + "0x8cf3c29531a17489a5f8232d56c5251ffddc95be3ff7ff61472e19fb38c5eaec841ef3b1ee36756b3dd8ff71ae199982", + "0x96d4b9b411319e531bab6af55c13f0adb1dd6b4286784ff807f283e7990dc368c16d536fc5db3d992deb4b0278914e6f", + "0x8903f7e0c9764ce844b15d84feea04406dc66b195a5f82ff4027f27361e11cf368538137d139368f5a6f42876b04f056", + "0xa4047173b5906c9b4292aaee1e91d9080ae74b1d3eb990449ed1f96bf22c3ee80f4915361e5bf7dccce24ae1618dae77", + "0xa4c4b96071e7bc92e41defba3507ddf423d93f3a94271b1f9812dfc4660e4c9fd24e0dd7aef324c46deb8d7a7c97eaa4", + "0x8289b65d6245fde8a768ce48d7c4cc7d861880ff5ff1b110db6b7e1ffbfdc5eadff0b172ba79fd426458811f2b7095eb", + "0xab4119eef94133198adb684b81f5e90070d3ca8f578c4c6c3d07de592a9af4e9fa18314db825f4c31cea1e2c7c62ed87", + "0xa3ffc3dad920d41ec3f4c39743ef571bcabb4430465d9aa811d0f0a7daa12bee4ed256527d16a6e937bf709ebb560ebd", + "0x8553748da4e0b695967e843277d0f6efeb8ba24b44aa9fa3230f4b731caec6ed5e87d3a2fcd31d8ee206e2e4414d6cf4", + "0xb15e1b4ac64bafbc4fdfead9aeff126bf102fdd125c1c914f7979680ec1715fbeccf3dc35c77d284421ec1371ed8bc32", + "0x9377aab082c8ae33b26519d6a8c3f586c7c7fccc96ec29a6f698b67d72d9266ad07378ba90d18e8c86a2ec77ecc7f137", + "0xb71c11828ecad7731136cb1f5b80392a4add8d62f8866a781fdde797a201ebf6d483b2348aacbea2061a5108933b757d", + "0x86793899ef71740ab2ec221d0085701f7909251b1cf59a276c8d629492f9ef15fc0b471beedc446a25b777391ab00718", + "0x8100b48ac2785477a123a7967bfcea8bacef59391680a411692880098a08771ff9786bd3b8dfb034cae00d5a7665621c", + "0x8b027c14affe47f83ee59b504d83b2fd2d9303de2c03ee59d169bb199d9f4bd6533d7f8c812dd7a6f1e8155e3e185689", + "0x9615800f8c95f95bf25055ae079b964e0a64fa0176cc98da272662014f57e7cd2745929daf838df0094b9f54be18b415", + "0x951aa38464912a29df2101c60771d6de7fadb63f2db3f13527f8bdacb66e9e8a97aaac7b81b19e3d1025b54e2c8facff", + "0xa0e68d24f784fcb2b71acc2d5871285623c829d0e939146b145e04908b904468a67c07a2f156e6b17bf531adc5777c4b", + "0x86a533b02ae929f67c301649a2d58651b98cdffe731b63fa32aa1013c271634bbb088c0d02865913c11bbb1bf57c0e12", + "0x81f145ebb9a5674a5b052d0e9059acc8f8ab612dd9f54d43ff620202606e19a86a9b284dc6480d555a030e5fefee8c50", + "0xa698b04227e8593a6fed6a1f6f6d1eafe186b9e73f87e42e7997f264d97225165c3f76e929a3c562ec93ee2babe953ed", + "0xb3180ded54610b1b3a2db7db539197ced6a75e9bb381d1f4b802ca7cd450f5418522ad2bee3df1956ed63ff1ffe95dc1", + "0x86fa3d4b60e8282827115c50b1b49b29a371b52aa9c9b8f83cd5268b535859f86e1a60aade6bf4f52e234777bea30bda", + "0x97d076617cf0a64ab3d1f030cfd72a303b6b252c0a7b96157ff7fc8af5970f00d14492c46e8f6f37caafe837d0dc95c7", + "0xac2c98a0ab3f9d041fc115d9be4a6c77bd2219bb4b851cbee0d9257a4de5791251735b5b8fad09c55d16eb0d97080eff", + "0xace7fda25c2fb7c18710603c16a0ff0f963352d1582a42a20c9f5603c66f485df8383465c35c31e8379b4cb2ec15b4c4", + "0xa07b35ec8d6849e95cbd89645283050882209617a3bb53eae0149d78a60dbf8c1626d7af498e363025896febdba86ee7", + "0xb2fc4478830f2ae4234569346d80b59899247c609b75bd2190a896498539e1f30dca5edbad69f0224918d09f0d7eb332", + "0x84926cf2265981e5531d90d8f2da1041cb73bdb1a7e11eb8ab21dbe94fefad5bbd674f6cafbcaa597480567edf0b2029", + "0xb5f32034d0f66bcbccefe2a177a60f31132d98c0899aa1ffff5ebf807546ff3104103077b1435fa6587bfe3e67ac0266", + "0x938206740a33d82ffda3e01598216324731335d367965aa0b740486d60ba2e86a4ecd546851046a61a4b0fc88295b5cb", + "0xad2b1ab32161e37ee553e3787f05f9281073d7ef7d0ae035daa353bc83da8ef8c76c99ad2928463c7c708f7404020476", + "0x94f4720c194e7ea4232048b0af18b8a920fde7b82869e2abcc7e14a9906530be1ef61132884bb159df019e66d83a0315", + "0xa26dd9b28564c3d95679aca03e3432ac26e287f80e870714c5946b05538b3cb43bba7b85c16bceb5430e81b7a04c1b1d", + "0x8ef0930db046c45ca5c69d565d54681d2b6d249e27092736aee582b29de3aac3fd96e1066a57cadd851b4e5334261594", + "0x92096ebf98ebac5c82345d3ef0db0f5a14af23ceea73279087426b281d6701997fe131fe65a7df7d624b4ff91d997ae8", + "0x81c850f419cf426223fc976032883d87daed6d8a505f652e363a10c7387c8946abee55cf9f71a9181b066f1cde353993", + "0x97070a33393a7c9ce99c51a7811b41d477d57086e7255f7647fd369de9d40baed63ce1ea23ad82b6412e79f364c2d9a3", + "0xa99cde5c7c85ae291c74c893e598cc0e6eb2dda2a81dbb504a638eb21dd2c41d6e5caf7baa29e3c1c32e94dca0d791f1", + "0x937ccbf8cd19b82af2755b4856cfcca3d791e33ae37e4881982ea89d3b21d205a9402d754fac63037243e699484d21f6", + "0xad7dca7640444f1268f03b67544815d4366c6a4a2f0d25ee78f3361c63095416216fd31aa0bcce7448cdd7ba73a6344e", + "0x84991ca8ef255610ebc6aff6d66ea413a768e4d3a7764750fd02b5cd4735d41df399b36e87647fc83cf73421a39d09e9", + "0x91215fc3f7243638733fe293dab7029e0c4275550102acf5f1638773cf8f8ef2c53ffa5bdfc1b602c269a2b5ab164b7a", + "0xaa6cfb3a25f4d06c3ce1e8fd87496a74a5b951ab72557472a181a2e278c5e982d290dd4facf40bd2f4f8be62263dadb0", + "0xac9f29ad08aaf27581fe1f12e210ad4ac6011507fe3100763a4120f9e439f3c6d191f3fb55aadf58bd865cfd4406c68e", + "0x87c6cb9ca628d4081000bc6c71425b95570291eb32ef2cf62416bd1ce3666eb2ce54accd69f79d506cefbfe6feb5a1da", + "0x93042dd42e56671155bb40d85d9d56f42caf27bd965c6a7a7948b39089dba8487d4d5fd30522dba6ba392964e3ffd590", + "0xa76adeddf2454d131c91d5e2e3a464ef5d3c40ee6a2ab95e70ef2e49e0920d24f9b09276250ed7b29851affbdbc7885a", + "0x92a488068e1b70bf01e6e417f81e1dc3bcec71d51e7eabbc53b6736e8afdb8b67d191940fe09c55783be9210e1cbd73c", + "0x8180ffffb5abe78c38f2a42a3b7f1a408a6d70d3f698d047d5f1eef3018068256110fcb9fb028c8bdccbc22c0a4c3a20", + "0xa50ab79cf3f6777a45f28d1b5cdad2c7ea718c60efeeb4c828d6307b29ef319445e6a9f98aa90f351c78b496575150c1", + "0xa4632399c1a813e41fb2055ef293466098ea7752a9d3722d019aa01620f8c5ecdc5954f176c6c0901a770cbe6990eb11", + "0x83bf5055d6332009c060fd50b8dc698d42b764b079c90a1fad8a83101f8dd1cc27acb27dc9d1c25ac8d3db4107471b4a", + "0x8c432e044af778fb5e5e5677dbd29cd52d6574a66b09b0cd6e2a5812e71c91559c3f257587bfc557b4b072a822973a60", + "0x8368a0f17c8427beb71dbf11a09a2fe8495a33f08c29c74a9a996a88aa01c0a09f9555abeb1ef1592cab99a9e05875cf", + "0xa8795e7f4c4c5d025ead0077c3aa374daaf9858f1025c0d3024d72f5d6c03355ae6ac7418bf0757fe49c220acff89f7f", + "0xa6d9f67ca319ea9de50c3fed513269b83fa067977adfd1e9d9ee07ad61b2ac1de64a39d7b6897ab55870cf982fe481dd", + "0x86b3a4ea9b1fde00cce79d5ae480353d60cb6ddce363c535bbbc3e41a4b8e39fcf2978eb430091ae1b10420d43193971", + "0x90fb5cac22a22fb8a6b619f1eacd95873be974d4d5d1f7080e523bb9b4b2644eda7340d780bd1ea8ce36407ca0410fea", + "0xb5036d4c241685bcd67156e4ab0eba42b97f639947d54b17af2c88fbcc5fc57359c7df4bc7f8df955a524fb1501a6fda", + "0xb1c56f028f31f0ff86bdf55788703b4d809becaf3e4d9d349f1b660a07d2f15e127eb72a0e2a5a2742313785a3de43a5", + "0xa3e909196f447e492200cc67000c5d7f0f585fb98e966cf9bf08257597fea8d92a90ceb054d4b5553d561330b5d0c89a", + "0x87cac423d0847ee3547f45ac5babf53bddb154814e291f368cbb62ddd4f2c6f18d77a1c39fddb482befe1a0e77d5b7fd", + "0x8605b88ce23190b1fa9d389b15e6907417239a72b97673d1479c4ccb8f4515c7921d14537775c74e738a9c3f122b1443", + "0x87587504e819bc7f0349705a05c15e8504fd6b2c25c3fd264096cdb7aaa22d8078da776215925d9d775a7f9355b6f0c0", + "0xafba279768f0f928b864645aa4e491e9c949bf3dab57efa24eeaa1a9a7d4d5a53c840019354068e64c65a2f5889b8f3c", + "0x86b1cdd26ea9a3ae04d31a0b34aa3edc9e8d038437152214d195381173e79e4ccf7f8f0ce9801086724a1c927c20e4c8", + "0x812d3ded3a3c9e58eecf13a29bb4cc13b01b2a0af322423a29bb0e4f6d9021d1d87ac4af7a2a6b88d34f44a8bc1b3c55", + "0xa988cfed9f481bc98beb5fc188ed3f6893a3ebba27c3ebace669792f6abf0997727023c3b6930a6421224f5b257b8b49", + "0xa38c974b57da968f0c4611f5d85d8014fd48594c8cd763ef2f721cfd2c738e828d41ff029e3591d7447e3125641db8ef", + "0x880b4ef2b278e1b2cccf36a3b5b7fbce94f106ed9fa2820cb9099a7a540a57e9fdeef5c0fb0a743049828fc2b8c46163", + "0x96e7d1bbd42195360267c2a324b4d9bccad3231ed8a7f070278472a90371867e2ef2c29c9979a1ec6e194893afd992df", + "0xa92beb343caf6a945990adcf84302c55d1fccdef96c34a21f2c00d3e206a9b2c6c6b412f66e5d4fafe26ef6446cde705", + "0xaa48afa77d5a81cd967b285c0035e941ca6d783493e1840d7cbc0f2829a114ace9146a8fbe31ecbd8e63e9b3c216a8c5", + "0x893a2d97ae067202c8401f626ab3938b135110105b719b94b8d54b56e9158665e96d8096effe9b15c5a40c6701b83c41", + "0xb614910b247c6ade31001b0435686c3026b425b9bff80b6c23df81c55968633349e1408a9a5a9398a7d5d6ed5d9d3835", + "0x991c660e4d476ad92aa32ef2c5b27669ab84026eeb5ca70af69bbbcd8ebc0a8fec17843423306edc78b4436629d55c25", + "0xb926a21f555c296603dc9e24e176243199a533914f48994b20abca16f19c30cfd0baf319268139fe3f83ce69afdc324d", + "0x8e70e4867d2731901d603928d72bbeb34b2e0339a4f5cf06e7a771640717421b4ea039c61dde951582a28c2ff152ff70", + "0x95aafa379cc6a2b4bdd0cad30b7f0a47839952af41f584219ec201c6c4d54610eb2c04b67b29080acb8cecc5e7543fbc", + "0x8465bd8be9bd9c2c6116d4ae44ec6618c109cb9aaee2d241e7a6ed906d398ef15a6fc18bc8b1d3398184241405954bba", + "0xb455f751232de0a48440d09983f4f4718b6169907979c9f282acf7177ab5b1f338fe1f2acd8d0bee4b4aad61d0340839", + "0x970df2314849c27daa16c6845f95b7be178c034d795b00a5b6757cc2f43c4c8d8c2e4d082bec28d58dd4de0cb5718d61", + "0x8d52413f981bc611427ad0534d25e914113d0ebcd6960aab6421608bec6648b89ae4b2ca2153c57d3cf4f1f37212aa5c", + "0xb7ac87da14b783914ab2e914fb7b536893b7a650cdc5baa1f3b4aca9da77b93a3336671335250e6467a8cd4aa8dc61e9", + "0xb37a2ec9dec3d7d9cbc911fa1e5310a47d23a841d02c8b99a923991c73fc0185d130a494748c64f2b5a4c07bcd06920e", + "0x86108b661fb2c363adcca84c114c83346413df748b959015c018452cfac14890bf585dc0a646d68727cc3cdfd2b61897", + "0x8421044f794a1bcb497de6d8705f57faaba7f70632f99982e1c66b7e7403a4fb10d9ef5fb2877b66da72fd556fd6ffb0", + "0x84d2eb008578aebd6f01254b7e46584c1524e6fd7a5a2ae5fa0ea560865ca50d52290cf2d12dd20b042f402e62181b4d", + "0x8d6bed5f6b3f47b1428f00c306df550784cd24212ebac7e6384a0b1226ab50129c0341d0a10d990bd59b229869e7665a", + "0x80e30cabe1b6b4c3454bc8632b9ba068a0bcfd20ce5b6d44c8b1e2e39cbe84792fd96c51cf45cf9855c847dc92ce9437", + "0xb7e74ab2b379ceb9e660087ee2160dafe1e36926dfab1d321a001a9c5adde6c60cd48c6da146d8adfa2bd33162eeaf1a", + "0xa2b1ea43f51460b3cb83657b4e296944658945d3ad6ae7b392e60f40829ba1da6a812d89f0380474578cbd0ab09801ac", + "0x91ead7dacf43905eb5d4b179af29f945479ed074126bad3b5a2bbc1663af5f664fe53a36684e9389ab5819e53f1344fc", + "0x927c030d5a69f0908c08f95715f7a8d1e33bed5e95fc4cfb17f7743cb0262755b1e6b56d409adcfb7351b2706c964d3b", + "0x883f38af3b2c1d50f6e7c515a5e02468d76890f6e669f7acd2df89365862fa65877095deb001b4e2868bc5b59439dbb1", + "0xa0ebae60a998907a19baa396ae5a82bfe6aa22cf71bfca4e1b4df7d297bd9367bbeb2463bda37aa852ad8fd51803e482", + "0x8ae80eeaed3fc456f8a25c2176bd09f52a2546d45d77a70f48a9e30aa29e35ff561c510ae1f64e476e4a0f330b9fdbdd", + "0xa7be457b8bc1bfde4865a35b7b1826118edba213b0f0d3cf5d877267cc1559cabe61cefb1e300142a978c29676036179", + "0xaf51da717d2a45ab96fad5d9317ea867ec4c6a411af6fabd72e568230099a04c036a0f114158815b1a75da6474dc892a", + "0xb549cef11bf7c8bcf4bb11e5cdf5a289fc4bf145826e96a446fb4c729a2c839a4d8d38629cc599eda7efa05f3cf3425b", + "0x8d264fbfeeebb6c4df37ff02224e75e245e508f53fb3446192cd786ecf10d0f704c4fc2e53e7f7318ae1407e46fc0fb8", + "0xac3195143035cdb4ddcd5f93c150035d327addee5503ea2087b1a10b2f73b02453ddd1a94d8e7d883e365f9f0e3c38c9", + "0xacbb398ea9d782388c834cf7b3d95b9ff80ee2a8d072acae8f9979595910849e657889b994531c949d2601b3ce7b235d", + "0x811e6a5478f708495addbb1445a2ef23e39ee90287f3a23ecd3d57d4b844e4f85b828bae8fa0f1893dfcc456f86f7889", + "0x8cde690247d4831dfe312145ae879f4e53cb26641b3a3bb9eb4d590c56c11ece3cfe77180bd809468df5cddaea4f5ab1", + "0xb42578df29a9eb23bed91db6a1698df49654d2bc1b0d7973b2a7e300e9cf32e0e6ac464d463d4d26e394e7598239c4bf", + "0x97ffcbf88b668cde86b2839c7f14d19cb7f634a4cf05d977e65f3cd0e8051b2670e521ae74edc572d88201cff225e38a", + "0xa322b5d2a6e3cb98b8aaa4c068e097188affef5dec2f08c3e9ce29e73687340d4e5a743a8be5f10e138f9cabbe0c7211", + "0xa076ea1084b7a1a33115ef62d6524f36e7820579868763a6ed1f8bce468f150cbfbf0ed04be2487aaa34100d828b0db6", + "0x944259a56e3b4f745996289912740281bde47e22705f142c2a483ffd701e780f51a01b177d2494dc8db9e69157f45d44", + "0x91cb79d52951d1b901e4a686bf4ad587e31db57ea5af6ffeb93eeafae3929879c386ddec860f803c2dc61055437e6bee", + "0x91efdbcaad9931312d7c41d24de977f94d7f3f7b88090a1f72d9a097a1e30cc805c5ea16180f463022d9b26b8863f958", + "0xb26f5ed09f7d5bb640ec94ddd1df0b76466f69a943b4699f53d45296d5d6b8010bb61477539bc377d1a673d89074d22f", + "0x80822499f96a1a8c0048f01f389dfcaaa5d8269c332dbb507fe46f270bcfd5f67c53f827fd867221592dbde77b6b37ab", + "0x8860ba25d5530cb8585975d8013a1c2d5b0f0f96066044fdc43ed13488ae44e379c624ff6993a18cb6e037809d7985e7", + "0x999d1c44e14184349064415ae28a149b3b11aba5baab6792744378d14df554a3625fac82038eaca920064822294dd513", + "0xa62c2e7c692403e874a16e08e46a067e19dd561993ca07ff79cecb53c753763b3e49d372638c96c0a8c921bfa0798a0c", + "0xa1c84730a5c41dcab9a5ef9e1508a48213dbc69b00c8f814baf3f5e676355fc0b432d58a23ad542b55b527a3909b3af6", + "0xa1c0c317e6e352e16e25c140820b927161ce5d2c4c2e10bca3057ba4d46b4f42ad7aba20de86dad9fc6368ea92695268", + "0x85c216e314eb7bd8ba02e092c90e132bc4bafb21c6a0fbe058b0dd4272cb76f183b83c6783fc321786065ff78c95f952", + "0x8e8f63ec8f4f1f7fcc61f893b671710c3c17f9d2d26c5c6ca40e671bd4b252bc0cc1655e6780d2ddcf2915d8f623b9a4", + "0xaaeb0005d77e120ef764f1764967833cba61f2b30b0e9fed1d3f0c90b5ad6588646b8153bdf1d66707ac2e59fd4a2671", + "0x92ff79402d5005d463006e0a6991eaacc3136c4823487d912cc7eec1fe9f61caf24cd10022afdab5f6b4f85bfb3eee4f", + "0xa32a5bd9b7bec31dd138c44d8365186b9323afbba359550414a01e1cdb529426bfa0b6f7daaf3536e9402821faa80003", + "0x845982c2672fdd44b33d2e56ad676e704c02f756b09e8765bea42b924c14724484567b55f0db42ac20cb70a7f5201c14", + "0x89cd9f6ae7d9a9ff2b4db916ba3af9fe700fcfbd16577bf73a965af938e8cf633020466b0298d3c31300360aa6851af2", + "0x8fa2d7b22af8e6b82679ebdfa13efdcb34289a554653ea6c1b16efb9f957f7fe64df787e7b03d8cdc8a732b91c916bd1", + "0x94f327bc57ed1ce88ce4504b4810cc8af5bd21a7e07b280a7866ce08e39b6cf7a6560bf73a5f10671271624cd7893970", + "0x90f4476224b64c2a5333198a4300ece8b3a59ae315469b23fd98dadcdceaaf38642d2076e9cd0bfacc515306f807819f", + "0xae0db78548261216ad7d6a7ed4e6089ee17b3fa311494b2f2c559e215cd3de7e5f3a781a49dcff428a8a61c2a4f49a19", + "0xa83371f44e007c708dc4bcafa7bd3581f9080a4583c9be88624265014fd92f060127e628de5af3c442a25f049c7e7766", + "0xb471c72bd2971353f4b44248b8e6cf5316812861a88ccfc20fd0d89a5e010428c387228b2f6f14c12f79e31afc9d0753", + "0x8962afddcb1a26cc8ccd3c993109e79a4dd747ca473b8b5ef93d9c2e71d29623b834ac945074acf118248e3ae7878a6c", + "0xaa0940e4e5586e79a3d97397c8aff3d112c6f759d2efac29366acc5b5c6a7cfef8d50516bf309da8b787de265dc8deda", + "0xa211120e1bb3b10138df1fa58efb009a298b8771f884b82bb3de15822b1252124a68f3980f96122a775fb96f05ddc3d5", + "0xa1047401598b1e6e2613d746bb4689e0406eccdbadf319a6609a3261cd09deec215d90eba6d0ddc50dd3787d60104e7f", + "0x96791b2b8066b155de0b57a2e4b814bc9b6b7c5a1db3d2475a2183b09f9dcd9c6f273e2b0c922a23d1cf049a6ce602a3", + "0x91013e0d537fb085a49bf1aa3b727239b3e2c1d74c0f52050ff066982d23d5ee6104e70b533047b685e8b1529a0f14dc", + "0xaa65c11071be23c9bddaa5203f3166e5cf043efe5fb8f4b26f8a9cabe71db701a450e79eb001c401da5752755d9cf1af", + "0x8645cc44d180c18a6d8f57ba57bae05879451997533cfe558cad4d3d586caec877e348915e32a09ee73483283c4df744", + "0x8eafbb7002f5bc4cea23e7b1ba1ec10558de447c7b3e209b77f4df7b042804a07bb27c85d76aea591fa5693542c070de", + "0x919c81bd1f3d9918e121e4793690f9ddd96c925ae928536322d4b98132f21979c1f34731d393f0ae6e0871af4355a8ad", + "0x98181e9291622f3f3f72937c3828cee9a1661ca522250dfbbe1c39cda23b23be5b6e970faf400c6c7f15c9ca1d563868", + "0x8f44c43b80a3c5f488118859fab054745cfe5b0824821944b82fcf870fda6d93489ea9ca4220c24db2f4ad09c6080cb7", + "0xa683d4865ddcc099f7b698153007b92f853b80f49b3be75163ea8cd1f8ff584b43a68e68de3ae61cda8ad4b41f355c87", + "0x942772b7c7c47d4e5957ccf1d6f1450070930af3e2b7eaab0dd7699372445df0cc910e6c0efcf501887dd1adabdaee23", + "0x805c06e565ee67cab0cbccb92b6656fdb240b430766eade3c6b0a0b1b93c840e2b4f028601451dca135c783239463880", + "0x84d3e2a06e16ced26094b356a16a4fb6aad50ad9ab23ef804a5852a33ef0bff76f3c5fbf7beb062376c2e669cb598679", + "0x803df08aa745cc3c0a799f3a91bb6ed423cd520c9d255d36c21bed1a0c3b12e8cad32f54da09dadca97683e9548fba91", + "0xaa2c3ef95b8d4265f01666129646004b6950d3e8ce74b4ca12aa3b90fbb445079a569178df772c272463a44d48922b8f", + "0xb0a4c136fb93594913ffcebba98ee1cdf7bc60ad175af0bc2fb1afe7314524bbb85f620dd101e9af765588b7b4bf51d0", + "0x93e4c18896f3ebbbf3cdb5ca6b346e1a76bee6897f927f081d477993eefbc54bbdfaddc871a90d5e96bc445e1cfce24e", + "0x89019e9550648962420984e9fd03597a854ae824567d9aa6cd5db01a4616b4e1477230f2d1362a2d307e2425a3eeb898", + "0x861b710d5ec8ce873e921655a2ca877429e34d432643f65d50e8b2669929be40a9ce11c6353b0ada1fe115e45396b2b7", + "0x88554c83648ea97dac83d806cd81d92531980346b208d281fba489da15a0084fd4d9a00591d1ca67aad3c5793685d55f", + "0x851fcadebee06930186f35293feefd40d7daedec9b94e6fe5967536c2c0e4cc68f58d3f5fbc76f1e77b90c9580074f98", + "0xb96a11048c7c327709d52e72e6f6ed0b7653329a374ea341ad909311b5b303e5629d6dcf11dcdb195e8c7592ceefac21", + "0x836075979eaf386ff6cb459cfd48fed171ae812b0ac3b38dc24dd8ca905cac1c600be717d4a0defa0a854f40cfaf8c33", + "0x90fc170529bcc0b80c46a53fffd8323fd2cc5cfa9b75ea4d36db21bd1f198335ad2bfa87f8990cf9cd9fd7989ecca718", + "0xb7eb6a49bf8f942dd8c37c41c1b35df43e4536e07ca9f4c1cfbbf8a8c03f84c54c1a0d8e901c49de526900aeac0f922f", + "0xaf6911edd6c7ad30f905a0a3f78634808832fdeb4206b006934822d673bcced8e378779261b3c4b772b34b8871987f57", + "0xa74d240d0d7ea0afe68813fab55388d77e75eca0519d21771dcb7170cedb11dc14b237b26c5ae1f7f728b52e5ec0f02d", + "0xa7b86e4f1366da44fd59a3ee68018a99c23ba3588789463bd88b0177a9b94030b58cb879a506e64421af966f261eaa86", + "0xad8d94e46cc02a1c0ad27105e8f672ec15b8296051801f1918d0bd470625686e8e8a0abde8f6852b846ee8d9132b26bc", + "0x980508c4d1e655cc6200f89a884b3a25c0c05708a3e4a101205c4fd901c3e20a943071a6300bb2614be41a139d4ef1df", + "0xb0173651b4ba0590b1d2f0265183f3729b5bb09893523ca12c4936120cbe5ef0d9b98733734407d99fdc766792ff10ac", + "0xabf72ec0280d56971e599b3be7915f5f224c0ccde2c440237e67b95489f0c9154ace04b7763db228473715f68053f071", + "0xb404beebf60026ca6843f2953cfcdee494d495c8e2d18865147102ef29a8f0ee470961d2246fe5a450c622d20ca51d53", + "0x89461cb2dadf51d6f1208b0965c8eabec895d7b19b7d90d3c6e49dbe75a75c30fd26db3dfb169dd46a4342280225032a", + "0xa61cb5b148cb7ff34775dead8efa7d54d7141182356bf614070dfaa710ebf07a4dfb684dad151db60c0f8261c30a4f40", + "0x83a798f47a4f62dcb8b531d463b0fd4a876d47a8ca990710290549255033c909de709471b4e823a60bf94d8baf8b5acf", + "0xa23431589f3a25070a188deead9adb0ed423d6b00af267f3f125cdd4391c1527909b5cfa88130dc4b67915f5002128fa", + "0x8d77e65ba6250fe18c54ce70d0ba4571a7d3e68a8b169055cd208e4434b35a4297e154775c73e7dfba511faadb2598c5", + "0x90e5db75f3787b819df471712f87b6f3281437090f5db7a2c21b07164446292a414c687e41de2d1ca00786b093239c64", + "0xb382fa28670a5e14dc954b2db8ace250c73df71ab095304bd8ee28f455ab26cc54f82775a831428e110d1a3a2af709bb", + "0xa58d2fb1c2612d28c54fafa7f2e1e6c336c24435abdb53e1be9dce9aebecbf7468a348b872549535ac18aa003f83ea87", + "0x9545f94c4e9056e360dd999985f8ad06210556fa6f07cff77136a2460605afb0ff1fb1d1a2abe4a4e319fd6c29fff80f", + "0x93121aa60f904a48e624e00f5410cf8c8925d2b0719f90c20e00cba584626f833de7c8a18dbfa6a07df24b916156bfc0", + "0xaa3446aac25f6c23ea16e8f7d19c58d187746ef3c2ac7d8fdf9bdc329409a07589ec8eebafbe2b156e7ba60addc15af8", + "0xb964f50011f03135e993739e2e63a71933ba4583040b3af96c7e2dce874226518f7b68f622c4a1d78b9c3ec671d33ad7", + "0x8cb5cb7cba886af58acadc5a4348524b1395a39dc51196316d759a9b72d9fc0fe45b706e264393a13ff911f0d15de45c", + "0xb50c306f78143b37986e68efa10dbe1fb047d58562e9b5c5439b341dd8f1896c7ae586afac0a3213759784a905c1caaa", + "0x97825edba8410e8bcb85c5943628c02ea95ee7595f559c030b94395c0d1d0d84c38eca199fce9c1992e572b5029b124c", + "0xb0922acd6da2a95b36de6d0755316594a7e2e32ea774792dc314e8c3cd76d9f1d69df38231e166e24bd42c664f4fbac7", + "0xae5ea228c1b91ef23c245928186fbafa1275ff1817535018d7d2d913abff0fd76bf41fd04a96d816f2f1891bd16e9264", + "0xb106c6d13ca17a4c8ea599306e84918127cf2de21027ac3fe5a57d35cf6f3b1d7671c70b866f6e02168ae4e7adb56860", + "0xa044cd5a3b727dc1cb59875e4025718375d12e706fffcdb48874e51a675dc2cabb209670192e408cdced5aeac65192e4", + "0xab1cc44983e46a6ea2430aa6616ab28614f43624665e3e6ae31a9357c0c5434f34e56c720906e184327693cc4ebe1fa2", + "0x890def696fc04bbb9e9ed87a2a4965b896a9ae127bc0e1cc515549b88ddbcbc02647e983561cab691f7d25cf7c7eb254", + "0xa86be58fef115445b909dffac6f51da3fe9214afd9c31fd564bb8f39b1dc3cb895b1222f2c63226b54b60b278ec45edb", + "0x8757e9a6a2dac742ab66011c53fa76edb5ebc3c2fbd9a7265529a3e5608b5c24b4482fed095725e9b8fed5a8319c17a4", + "0xa7e0ddbae16e4491822684c0da3affecbbd17ef96c5c491ac093c6eb4e162fc7854c367535e296fd3d6265c2ed1210bb", + "0x941fe0dabcdb3225a625af70a132bc1e24ccab1f8331dde87db3e26cbee710b12b85535e46b55de7f5d1c67a52ddd5c8", + "0xa24d05b51c7c128bb49979cbd9019e6618545d95275a44b5c3d1d03e71bf2ebffdf43fff50c30846ec27d279043cef4e", + "0xb526f40d519e7a8f2c81b69f71b3e2ef079028004c0448ba0608296c2787972491ec6d05ed6a8fbd5ef2da76325a93cb", + "0x87ca4fa85a257adf7e21af302437e0fa094e09efced2d7ebab6cf848e6a77ae7bfc7cf76079117f6ed6eded9d79ce9cb", + "0x9276e8051bed8f5dbfc6b35765aac577dd9351d9d6ac1bb14496bd98091005b9a4737b213e347336413743f681f5043b", + "0xa7741c52498e0a24db3ce7699882de8f462a2b3ed5e9f77dc7200cbdf46b6cdd923b1128759909d6dddd64700c4c20c5", + "0xab5b363ed9551e32042e43495a456e394cbc6d53b15d37a8859850162608bdf36d3d4564b88fdbaf36ff391bb4090b8c", + "0x838ff6630dc3908a04c51fb44a29eca5a0d88330f48c1d0dd68b8890411a394fd728f14215482b03477d33f39645dceb", + "0x997d3b82e4753f1fc3fc2595cfe25b22ac1956d89c0950767c6b9de20623d310b1d84aaa72ab967ef1ea6d397e13524b", + "0x85416cf3eef63d5530062d6f031aeddad101c7f1aea3bccb826c73f8a25d5d963caefd789a6b9832bd4ed459f268ae64", + "0x9194bc45e11d7276ed1c9ef3ad5a33d6a27372f5568563ca8ee213e2e7029dee404ab5acbaecaef698129798d35fd895", + "0xa4828a003513ab887082390262a932a7e8c5e25431824b7b4cc10fccba73265c0e5ee5b315ccef13906d971644913806", + "0xb907ec84b6ae5729d36e2acd585a350acacdeef148bcc5dc4a91edb57505526462bd4371574865541d8bb0d786a29b2f", + "0xaa5d1c1f0a7f6b9b3c3734f85864aa60bddad5121450218d76d82edefd2602685a820965c56d7eefe789d5115cb41e01", + "0xad28fe70a8606f87bcb5d6f44e1fca499c24bcee791971f599ffef1f403dc7aec2ab6ebed73c1f8750a9b0ff8f69a1e6", + "0xa641eaa149c366de228a2833907ad60eea423dd3edf47e76042fdf6f5dc47a5b5fc1f1b92c8b96c70e6d8a68d3b8896c", + "0xabac08f4df786b2d524f758bca43b403b724d12601dc0a8362b7a2779d55b060c6682a5618fffea2e4def169fcbd2bfb", + "0x8658a15df961c25648fd444bdf48a8f7bb382d9212c0c65d56bf9cdb61aab3bd86604c687fb682260dbc0ad2dc84bf01", + "0xac7983d50ec447b65e62ed38054d8e8242c31b40030f630098ce0a4e93536da9179c3f3ae0b34a0b02aad427a97ee60d", + "0xb8877a00a24b0ffcb2bd3fce8a8ba327d8ee2e98d85531cb61fec21fd49cd1696491cd51024a9c3820cf06a77cacf04b", + "0xae075b66e5f211c2149c45b211d1297bbc1d9e6497cb3315363c492a9a51ae5b9d0a28bfecd755d68553736901ac6606", + "0xafdc091a224486e7bfac169e6a7b4e008d2d04144508a337fd93b6f4d385ee3f0d927b1f5c1cd79a15e0fd6078e45dd4", + "0xb75c28941ee3f91b3535b4eaa0fb17b59ca65b5256601a1f6d0cf2bb4d66837fd16e51d6942856679012a5730a66e519", + "0x84a6edac5ac68a7ca837c46d5ada8fab136748b6c3a3b9165dbbc231ec386b15328e4ef7d69a15d4cf354135348a4ee4", + "0xb01ee30d120b97e7b60ea89b9b6c537cdf20b6e36337e70d289ed5949355dd32679dc0a747525d6f2076f5be051d3a89", + "0xa80deb10bba4bc7e729145e4caf009a39f5c69388a2a86eaba3de275b441d5217d615554a610466a33cfe0bbe09ef355", + "0x8d6e3df29419bd0da1deba52c1feebe37744108685b49ca703e1b76fb4d612e3959d3b60b822506e5c0aac50b2f5eee2", + "0xa373408beb5e4e0d3ebd5ca3843fe39bb56b77a5d3d2121d4a7a87f9add3ec7376388e9d4b8da0ba69164850cb4b077d", + "0xae0beb452af7479134a7fbc31a5f59d248e8a67d4c7f73a0e30a51db9cd33a1da3f0ae947fa7e5983aea1343e7daf06a", + "0xaa103a329b699d4102f948101ce5fae27226419f75d866d235da8956f11367e71db5c0a179dd63007ed53f7eec333aaa", + "0xa094cca9d120d92c0e92ce740bc774a89667c6f796b438b0d98df0b7aef0935d8c915d5b0dad4b53e383dc9f095c29fa", + "0xa4d88467136b99d6e55603b3665b6da0f7fb27c7759687f7e6977b6230272773d7b95049d999538c008f310c05ed948a", + "0xa23710308d8e25a0bb1db53c8598e526235c5e91e4605e402f6a25c126687d9de146b75c39a31c69ab76bab514320e05", + "0xa36d6952c2d7f88bf28032a76ed46c4dabbf1901a46efc50deb798d1b44adf7e0210fbdf2473a1ba408b5c98d76943e5", + "0xab45f5b756ec6e0b98d0d4301c87675a0a1f0b1178b8a9780c1ab23e482cd821834835afa1de890962212159e464b10a", + "0xb800be1788175a01a9228b0d3e7eb4302484a2654eb2a86c0f0900b593da0a436ef031ac230e2b05e968b33e90a342ce", + "0x8cc8d279ec08d0a5a2a09ad07fabb0122eb65f48da2571d83f86efa2c1c5bc51b04ae94b145f0a8ef19a3988638b9380", + "0xb4cd409256819e8e4627edbba90ec40b7da17a57f95749104d90db0364f5007b1accc816f4d51a0dbe5ffbcb737cb37e", + "0x99365fe5ab8ea8bd768ae7181a6ba49b79d240f512ce309b02f09d465fea276298ff55b5b9cb5b4162a901b390606024", + "0xad77fcac9753efba7a9d9ef8ff4ec9889aa4b9e43ba185e5df6bf6574a5cf9b9ad3f0f3ef2bcbea660c7eef869ce76c8", + "0xad2456725ac3aeb0e4ca5c0502a8abb4dbd8a8897d9d91e673fea6a0cffd64d907b714b662d73c0877b98d4ab3ce6a89", + "0xac8436e33619e2907659741d66082acbda32612d245fcc8ae31e55f99703fac1a15657342fa66751d3be44fc35d71c36", + "0xb0eecd04c8d09fd364f9ca724036995c16ba6830d6c13a480b30eb2118c66c019cfdc9dacce6bfd8215abe025733e43d", + "0x9439b663e4104d64433be7d49d0beaae263f20cfac0b5af402a59412056094bd71f0450bc52a294fc759ca8a3fddfee9", + "0xb72de0187809aaea904652d81dcabd38295e7988e3b98d5279c1b6d097b05e35ca381d4e32083d2cf24ca73cc8289d2b", + "0x93706f8d7daca7c3b339538fb7087ddbf09c733662b55c35f2a71073f4a17c91741955d4d549c2ee6c22eaa84193c1ad", + "0x926dc729e135f1f0bff4662ee3d6823a64597fe189b763ada34f246e77705fd4e062d85506a338e9fa98c4d225a3b27a", + "0x93f03495d53c781be8b76e37e68b64aa260523004eff6455ddc8a8552af39854e5181f8c5365812b1f65926534fba5dd", + "0x9834f66e5c946c3a8241ca2bbde046a7e88072124911d5d15c037a95b61e82b88b5c2058fa4a3721537dee39dee5da18", + "0x92ec1aeb2aa24c51cd5f724972c8b6095e77b237d83f93ed34ca0bc91a1dbf1ad95adccc59e0f0abbfef33f331f3298c", + "0x94402d05dbe02a7505da715c5b26438880d086e3130dce7d6c59a9cca1943fe88c44771619303ec71736774b3cc5b1f6", + "0x8368bb9b9bb2e17730c42ed1100eb870c88a8431601312aa8cb1e738cdb9ca2704dfd432cf1703c0db043259819631dc", + "0xa35189a105401f0cfba4b43be21723486c04659e5a01e67c43e8f9911030810b878beee696f04f63d314ccfe97ebb790", + "0x93ccd8c5f82374e0bef6562e16576f742d79b6f400e3485ef36e148088b61fbd882c3d2bb38ab0b43fa1dac77f31d543", + "0xb85d9a426a23ca9ee582bc16c203a9352dcc5f85440e46979de80eb572384479b697dc964cafd9457d9f34eeb77bb72a", + "0xaefb70e89dbf4456e077690509afcdcabf975416ff2fa16777fdf90b3abd3f5dcd865c43f1ebe6f8a669edc7f3bd6ad8", + "0x8eb03001ac9e22c6956a682ed458e650785c36d23ddbcd51ac4d9cc991325c02519ff1958987a08eb29ff56ff6e2c293", + "0xab4a1ffef7e001723c71f5d28f3dd030a06c42d91773733d117247bbf9c01cd66fca2cff8c6ce04c4bfb68dfcdd851f2", + "0xa9ef845ab489f61dbfdcd71abcc29fc38f3494a00243b9c20b9cd0dd9e8a0f23304df84939b9652cdf5542d9b3ee085e", + "0xb5726aee939d8aee0d50bf15565f99e6d0c4df7388073b4534f581f572ad55893c5566eab1a7e22db8feeb8a90175b7d", + "0x9953a7cbc152f101a60e3e381f2af17ebe7401e16ef6462d132b8f0f6c6a18837914a1299d1605f9f289b9561112f4bb", + "0xa0c9b944a338325f5efb675c9c12619fb43c8e25e80d38d6140e31d5070573b1a0ed9bb52576e4f22f37d0292d36a648", + "0x8bfd6a173a56b73480cc950ef266a18933ecafc86915a7453ded09efd8a0cf4466101f1373f05d48eae3e7fc5c0f7f54", + "0x983fc1ddf17f9756c9cecc00b39bb2ad432587a5c6d1c3296a383b9f539c9afe84c6c818447a709c0b686ba26ce5ea3e", + "0x94bbc6b2742d21eff4fae77c720313015dd4bbcc5add8146bf1c4b89e32f6f5df46ca770e1f385fdd29dc5c7b9653361", + "0xb26b4d483bca73d3f3a976bb595a0e40f9a42094e0febbad3a1874934be1939a1b362ee4ea14a4f5cbfa9b1392796a12", + "0x8dbe8fcbcc414eb352245c52549973f73d987012de9d5f2b2f55dfdc43cf8cc9ea6b147abf149817f80f9e15aea566c6", + "0x9604da21e23c994a0a875ad5e0d279c79210f7a7de5c9699fac4aebbd76d39b703eeec5dd5efc9ad6b9dc58936089ddc", + "0x8934e9a3feababa12ed142daa30e91bd6d28b432d182ac625501fe1dc82f973c67f0fe82d39c9b1da3613bb8bfe2f77b", + "0x85f2ed3ffb03e50c8f22553b8e6349be6244d893aa37a7c6dbd221e9e121579e5a04466e60d6b4d3567bc747b1fc1e9f", + "0xab0ad421f6fd056687b4fa5e99dff97bd08840b7c4e00435eb9da80e0d7d071a447a22f8e5c1c5e93a9c729e5b875a1e", + "0x841d77b358c4567396925040dffe17b3b82c6f199285ac621b2a95aa401ddb2bc6f07ebd5fa500af01f64d3bb44de2df", + "0x83f21dfe0272a5a8682c3c7814c5e0e4db6a9098f1fa80fda725f77ea81fdfd2fa36b0c8db013503a89bd035f86306fa", + "0x95c98e3b6b62f84edf7f297cae93ee5f82593478877f92fb5bf43fd4422c3c78e37d48c1ee7ca474f807ab3e848d4496", + "0x81c3a8c00cfe4e82f3d8cb48de7d4926d5ec2f7689f9cb85c1886a23758bc107a4bc6e978601c3519156a169d0bf6779", + "0x8e956ca6050684b113a6c09d575996a9c99cc0bf61c6fb5c9eaae57b453838821cc604cf8adb70111de2c5076ae9d456", + "0x83474776ef2341051b781a8feaf971915b4a1034fa30a9232c4bf4b1bd0b57bc069c72c79510acef92e75da6f6b8843d", + "0xb41780d9d67e9e8b81b1f62d25c0c72ecfda659d2bfe6825edb70ecd0e0724250ac364e7be521cdc112ba638f16360d4", + "0x842ba3c847c99532bf3a9339380e84839326d39d404f9c2994821eaf265185c1ac87d3dc04a7f851df4961e540330323", + "0xaf17532b35bcb373ce1deebce1c84abe34f88a412082b97795b0c73570cb6b88ea4ba52e7f5eb5ca181277cdba7a2d6d", + "0xb9574edb9567f07f85c7c2e6ca6c02d90ad7c7b87d49796f1e2fb7240ad071fb755cf13ca8678668a56217c62df168eb", + "0x82212706111fb1cf5def02b5b0eb7ae9e6ea42b4c7a2b9fcacb7aec928326edb9ac940850dd933f2822f6cf519de0d50", + "0x9579973ee2559da09b327c62b1cc0177f2859872885dca709e24dcfbb9bdf9224a6d26869aafce498f44c0e6bd8a996c", + "0xa102c2ade15ea2f2b0cbc7dbd8c1171de0c8092fc4ecef84b5fd2bae7424aea8be1629f851c75e4d1d0e96104e54bfbc", + "0xa5d7e847ce7793386e17fe525f82aabb790d5417c3c6e3f6312f8e5ff52efa8b345c1ff60c4c9bf7636f5ff17b7a0061", + "0xb4b80d7fbdb1dbf1567dfb30d8e814e63de670839a8f6ff434fe171416599fef831b8e978d6498851b8a81e0bc8dfb85", + "0xb6e6277b86cd5284299ced867d37ab98090ac44a94deef6898aeadd177e64605440c15b9609c07e71fe54c95b61873b0", + "0x8135a0633082e4465090d6930b770340e82366bc5c37be6ef6dd105f85acf63361e17de8b5fcab4c82e9f9b4029954b7", + "0x864d5d9858cd881eecb0dde5e3e0c6c5de623cd9ef619e87b82fd25c5edf45a1a025b1dc763c27c5f4d520fd564b464a", + "0x8784a8fa62e0ce23283386175007bb781a8ec91b06fd94f22a20cd869929de37259847a94a0f22078ab14bb74709fac6", + "0x8adb748d5fa5c22ce4c76a1debf394b00d58add9f4e08524cf9c503f95981b36b8d0cb2dfaef0d59d07768e555733ecc", + "0xb76cb8cb446eb3cb4f682a5cd884f6c93086a8bf626c5b5c557a06499de9c13315618d48a0c5693512a3dc143a799c07", + "0xb2af1f7ece1fd640c205a09614122d69d5d2e81a7618bedefd6dbb91c7f432679be4ced1e6dddd3de323bd44991931c5", + "0xb950b457c34bfdfdd9d6da9628d41749ccae03659518a04b56487bf1b4c0681b719ec5230c0b0fd5dd710894df6aa2f8", + "0xb21785008910a949804d1291e7533752641d31beae3cb518806488f81d58c38a5efe5ed9534ac692e68c3121e2f9d97d", + "0xa9b120a77d70c1cbc0178a12d97a78b2dd0b98d0584e8e780b937800ceb18c90eaa1f0a83c5b50e34cae1c20468f004f", + "0x998c9ee20d33f96a2388b1df642aa602bc8900ba335e8810baab17060c1eace4bc5203672c257b9ae750008b707b0aa1", + "0xa7d1676816e81a752267d309014de1772b571b109c2901dc7c9810f45417faa18c81965c114be489ed178e54ac3687a1", + "0xb409f87f0632aae9bc081345b17a50a767ba4198f9ac9d352246fb3bebd29ed53c9d6f148c2f318c2eb12846b0aac4cb", + "0xb40a3bae2b08c13db00f993db49e2042be99cde3d6f4f03d9991e42297933d6049394c659e31f316fcb081b60461dabf", + "0x8c1de4264e04ff7e8282faf81c0bfb5943656451be52170211cb7adf4ff21bccbb789400735579c622f69982fcb8e9c6", + "0x8085c60b6b12ac8a5be8a7e24977663125c34827842aa3b2730854ab199dd0d2eaa93084c9599f0939be8db6758b198b", + "0x972cfaefda96f5edfe0614c01533b76153118712c1c02c505008204a5be2aa438675d97f43384199517b1c08c7c9fdb2", + "0xa1e47798a782a024da340d6d6a1b1e5e15a0f2d8668adf349ca375086964414a563cc1eea3226ae637f87e78c0a630b3", + "0x8171f20c020faae112bb92ca213c1df5b1050151496c70db5c5319212bada83b120d515bd7d8b24736090c574e1b7203", + "0xafe779a9ca4edc032fed08ee0dd069be277d7663e898dceaba6001399b0b77bbce653c9dc90f27137b4278d754c1551a", + "0xa5a07bf219432e9c80c38596c93560b49c7de287f31e30b7a06fcb4d15982add4a24085adbc5b753c462be989c64c96d", + "0x9210be290176d7e8a5005d27e7ed825067b1c678b174bc8180f92b5c03b6c3d1822356edba84f460caf6bf5275cd7efb", + "0xa95bec86a7c8417a8df3a0158199327ba0924d3b7dd94cd7c1ef8489b10270ae64b8537ed39cd3699a48942bfc80c35d", + "0xad9725114b01152fff134c1a8ccb8d171b8cd11685ef6815b76f442d757d130bab9ef4c9845e66f4aa0237ee2b525c20", + "0x8018499ef720e28759133033833edfe17ed23e42f99058bb79fe844ddee823cfdc43916be2dc9724d18f9726e6f1b409", + "0x809c7a08fbef7caf4c137cd639f2e47a8ca60d13bca3990eac51ac2a9e4442cd1a1473bebb63c61d595b586525d7b027", + "0x9793a74fa578ace75b083578277a1ae8766d41a5c508b0f1135fb97dff1d0826002393a7276b18cbc4b3c5671360ce0b", + "0xa6d7e65bf9f889532090ae4f9067bb63f15b21f05f22c2540ff1bb5b0b5d98f205e150b1b1690e9aa13d0dee37222143", + "0x99c935fe18699bca9852200c292690a2b834bac508890c4ee9af1aa6999a8d590bf6a3a274bb55d5a73f1b7095d10f37", + "0x860f5649c5299211728a36722a142bf1aa7cbbfbd225b671d427c67546375de96832c06709c73b7a51439b091249d34f", + "0x9104ac7ad13b441c6b2234a319e1c54e7f172c9a3efcb8c5fab0ac1d388b01895a9a208f59910bc00fb998b0adab1bc3", + "0xa3b109249ac2900806f0f39338da72d4f2cc6d1ac403b59834b46da5705cf436af8499fa83717f954edb32312397c8d9", + "0xb9893f7a47af457a9efd90ddc0c0ef383ab34e9c1284e617c126965cd9f0de5c54ee8b7b5208ff190366fe445e9c1325", + "0xb77416ea9a6b819e63ae427057d5741788bd6301b02d180083c7aa662200f5ebed14a486efae63c3de81572fe0d92a9c", + "0x8b20a852fc8f0b7cdbbd808c04a0cfd2fbccbdc0cb2361434f0d96341c8bde6155695977768d563b95746dcb4339fe2c", + "0x96b15806d9009962fa07f8c32e92e3bc30be4ded0645ab9f486962a1b317e313830992179826d746ea26d4d906bdb7b6", + "0xb0d69b3861ca6791632ec8a87114b463e0da571bc076c22a8f0d9e88a1a5eaef24683f3efa8f34900d0112412e3dc4fa", + "0xb01a30d439def99e676c097e5f4b2aa249aa4d184eaace81819a698cb37d33f5a24089339916ee0acb539f0e62936d83", + "0xb19ca6e55f349bbb2dc3e429520ff5b2e817972470794f35c1aac8c118b37a694cfcc875b6d72225343799825d2f5c39", + "0xb7ea5e0d3cfcf0570204b0371d69df1ab8f1fdc4e58688ecd2b884399644f7d318d660c23bd4d6d60d44a43aa9cf656d", + "0xa778da56ddfe4a383816b43b027464d7a28689fc4a6b35b36883d3f36d9c41f0177bdbfc8f258afe8da90f02d3b64fea", + "0x910fd030feb5538f538e5ba74b9bd017d889ed6d2a797be9c26d2be8caeba7a473006102de27e87755742ba34e445bca", + "0xb49593ea6040ce82cfb5aa2881a4b0c42b78aa9fc8467d79c8e4a8ae4ee7355842841c8e1cc0558362047ed80de44fd3", + "0xb07447c7e87459315fcbda3fb86fef27f98373b1246e2ce367e26afd87f6d698a438501fdc13cc5de9eef8d545aab768", + "0x8a9f7e8d45f11c4bfb0921c6008f3c79ff923452bcfa7769beb3222f1f37dcb861be979e6eae187f06cf26af05e8ee5b", + "0x8ebfbcaccddd2489c4a29a374a2babc26987c3312607eadb2c4b0a53a17de97107c54eab34def09144b3098c082c286b", + "0x93be3d4363659fb6fbf3e4c91ac25524f486450a3937bc210c2043773131f81018dbc042f40be623192fbdd174369be2", + "0x8cf8412bd48b21b008f0207b1f430ed96bc6512c3712dffbbecb66e493e33698c051b27a2998c5bddd89d6c373d02d06", + "0xa5562fbaa952d4dcfe234023f969fa691307a8dfa46de1b2dcff73d3791d56b1c52d3b949365911fdff6dde44c08e855", + "0xa8c167b93023b60e2050e704fcaca8951df180b2ae17bfb6af464533395ece7ed9d9ec200fd08b27b6f04dafa3a7a0bd", + "0x93e4d7740847caeeaca68e0b8f9a81b9475435108861506e3d3ccd3d716e05ced294ac30743eb9f45496acd6438b255d", + "0x8016d3229030424cfeff6c5b813970ea193f8d012cfa767270ca9057d58eddc556e96c14544bf4c038dbed5f24aa8da0", + "0xab7eff4ef8696db334bce564bc273af0412bb4de547056326dff2037e1eca7abde039a51953948dd61d3d15925cd92f6", + "0xa3f9dcc48290883d233100b69404b0b05cf34df5f6e6f6833a17cc7b23a2612b85c39df03c1e6e3cd380f259402c6120", + "0x8b476b3b065a3b95a3d11ec60a749c2258ddcc5885bfb50b8a086d3fd1e49ff73e1dde733b8981c3d2d206aa0c87b09b", + "0xaf3e694ad71684f7214f86bed85149db039971e1c362119b979a135255aa226128802e58e2caaeaf8d89304371dd0440", + "0xaa19a75f21a14ad5f170e336a0bd07e0c98b9f5d71f91e784d1dc28a5f5eb6870a4eb35bb41edcf9e6efe982ae5c2c5b", + "0xb9528983419ab5766596683faebb3592982a76b68593f810186b4e5f94f6de60830739ad8dcc164c601d575b84bd2700", + "0x88e7a12a90428bb45bcf4b01442c11607433211fc2f9bee9545304eb66e0b4b5339360160bc782e185391385da7c5ad7", + "0xa4c4df0e29db19ab4c82dd6ca8570b337d15b59c7d84577a7a444a8f762ff16ff5ab3e4203a1d6b60a23ff949a93ea81", + "0x8f11ee58ef82b1bbd2240d3f548d8681e22bed5ce118d605bed4523b4bb39899ac78e15337daab92666750dfcaf32aff", + "0x8d3cba4d10f94bd3406a341c903ad144cfcfe6b61678d5c03084a56b4413bc30bd20d7a9fd5d839dbb565cc9b2aa99fe", + "0xab8a8769c754008a7976b6799e81d7bfe97413d0a79b90715703c1f8f567675463ec93aabee59277121fc4df88b5c7a9", + "0xb201b0546f19c5db88df9c684cf55ed623bdb43927d06051bd595497df741feb1485961f64e8d3d1811d9e2e9e1e54ad", + "0xa04016e9e13ad845763cfe44af4e29fecf920b4aa42f581715fc34fb9ca27776feee45c82093c7274839eef1838b10c4", + "0x8f84cba7ceb7652023fc8ebde4b00ecde1f550935bab12feb630d6f49517b4148f3cde184bf55d4f6ec99a849fc6f862", + "0xa2248409026f35c3da8bc4d5c02315066df8fca44ff5a358cc42b5c88bdf6866dc133617c697bff004b1ef20ec4b5748", + "0xa52c5a63b55a8001b6b67c5db4fd5e95923052f03618369312896ed9892d99354aebc0dee8c3b365bafa29e211a5c3f9", + "0x8c9fefe233d0d657349b7efcdc368f5aaead27071d224af780874751e7d241f6b88f7650fbb4133043b24bbebc12aa48", + "0x86ceb649a337a5a79c17b496993ca07fa93b38a582367ca04f3dfec5cef8f268d4e8080e5a76b150f5be1b177ef6984e", + "0x87dcb537e38cefa32e629ae669da42e809b5afcabdeeef244b72ce057fc18584a1e8c3f073d5d33775232707f0cc59ca", + "0xa020404547407be6d42856780a1b9cf46b5bc48122902880909bdcf45b204c083f3b03447c6e90d97fd241975566e9bf", + "0xa1beb9f673409ec678020ea4dcbe65177aa18e2932ceb9cfb33fccb94b9a8ccb664f71647d58b3c8b2bdbbffbc02d5f7", + "0xae47b31c5b62b38ee886ee04945649054369018dd6543c91f0138464af489a32c1fea339e0e0cbe82e3e8b9f2ef3918c", + "0xb18c41c0f827f6d8656d3fb93c90b663eb2eac034923972f8842cb30e96c32842b3fbc1127930e1ba4322d5b6641f04d", + "0xa6d6ef51a361df2e8f1d993980e4df93dbbb32248a8608e3e2b724093936f013edabb2e3374842b7cce9630e57c7e4dd", + "0xa49da42c27d019a21cc6489ada7b712b98c4ede28ba25dbcfa916acef48446a2baf73e03a48be763378a09774d4a03fc", + "0x8b62902fb2855300580e94830a4bc825d997ede33bf356fe3b7c08d6a8bd85a37879433fc6bee58f9b44ca280f4e8dfd", + "0xaf9d13103868c854821ba518907b067cfba025d739125f1e9cce0a04fffc3a2a1f25506c1209a0cfe1d6c1572c229ff0", + "0x8910f41db6952c25dfbf6b6b5ba252a2d999c51537d35a0d86b7688bb54dcb6f11eb755a5dce366113dfb2f6b56802b7", + "0xb551d1ce88cbf4ffbdcb0113a6e319513bd676d0078dd4e6a6f23ad336c1d0fb47a4e427bdedbe0fc8f152353971f81d", + "0xb8876bda1e709ab16e1347a1107852a7898a334a84af978de39920790b4d82eb0739cbfc34da1c7154dd6e9f7674759c", + "0xa7d9ae9621dd1f3da3cd2d435e891cc3579c4c0d60d6a4565cac86c315cea21a9ad883559fe7b897ae6e05f1aa989ad9", + "0xaac995a41c14d379853ef18ffc854ad62ad77061ca9bdf5029cab3d6c2630de114e777a7fc3322455939d5205ed59c55", + "0x999cec6a31d9b2f280017ddd59138014829fa34cab58e6c35a5014ec364b84712441e7a2f717cf2f0de8d5451e250924", + "0xb1f43b498cba1797f9793dc794a437500c3c44a8a4b59f9125a4d358afa304fc05b88ac31ed40b6eb68f0396b60cb7cd", + "0x93ba2e000bdb7269818d390bc4232992d280e69abebe2db2ecb6fcb1390d323238c9793574509bc1fa34051ac1928f07", + "0xa64808a2d15c30460651c200a09b50fc83e9d84d87abc156d06cee73b76fbd74e6d64424cb5bb83d3f16b21bdb7ae9d2", + "0xa75bcd04fcb44ce5cbab7eef6649155ec0bef46202e4eb86c88b4ced65e111f764ee7fb37e9f68e38067040fedf715ee", + "0xb95fc0ec39596deee2c4363f57bb4786f5bb8dfb345c1e5b14e2927be482615971d0d81f9a88b3389fac7079b3cb2f46", + "0xaef456af90354ff88039d2dde02b0f5a6790aa762b23e0a9da8c6ec92c3b8b3320687bb21666608b4a22615843afd1ef", + "0xb38be9ada17ced704a34a7498c4fd6ba2503f6bd886b693d4712267847efa887a26e7da5d60f8bc5014b92bca8b3a12d", + "0x991a7c93f06d50ec6a4340c6751b73eb5825bad02a954e44e1e2d424af928819ebbb590c6129ce35b3f1e908e2152f33", + "0x84888f2efd897a2aca04e34505774f6f4d62a02a5ae93f71405f2d3b326366b4038854458fd6553d12da6d4891788e59", + "0x941e2e3ba414a371a11c3fe92cabf688ff363da6230ec7c83ac7303f652a19ebc89cc494427c456d0c2ae84c72053f73", + "0x925f3bb79c89a759cbf1fabdaa4d332dfe1b2d146c9b782fe4a9f85fee522834e05c4c0df8915f8f7b5389604ba66c19", + "0x941c8962debd2756f92a6a0451a2bf7fbc01f32ed03d0823dffd4a61186628a4c3c7c482b18589ff65e4c449fa35c2a4", + "0x88ce41025aa153a94f91f22e7b96f9342b5e0e1d76274fc70c4df7d08f66d9f7ac86e55a1c6e77693b8b01b2b38bf900", + "0x8f142bde50abe4dac8e059003db41610436d5ca60d2dfe2660ecaa5f9628aeb8b5d443e1b57662076f77363c89a1479d", + "0xb2affe048c187d311a185503d8958cacbe03796edf79bc32e8533941004d9178bd2e376e627e1ba61ed43850c0c455cf", + "0x8f7bbaaac458bada6d852fe665c87c646133bab16c0d5136c3dc922095b9d647d93a9de7671cb7bfd4cbd138ae0709d1", + "0xb76f598fd5c28d742bc1a81af84f35f1284d62239989f1025e9eba9bece2d746a52f246f9bb6bcfde888b9f7b67fc4f6", + "0xa4c665a3e4e25a7af51e433c978573841bfa2c75c075e17dd1f43b2f0369249f3d3a46ff51051e8ce7da528b0fa98d16", + "0x81e0992e7c1c54c21cac32e36b90b25e1e5b72aac99c953c3c4d019eced64d7e316cbc0840204a4a51a4ad17d8b1d508", + "0x96d7a69eaf2761bf0e5ebcd607b134d5dedba8e262ca1d6d3e8fbf23e6419a8ce1bbe4cd23b9e4b5f80db54a802a9795", + "0xb2235bdf60dde5d0d78c72cb69e6e09153b0154efdbab97e1bc91f18d3cec4f660a80311fe6a1acd419a448ab65b18f1", + "0x838d5eee51f5d65c9ed1632d042bb7f88161f3789e6bb461318c5400eaf6728e7ba0f92c18e1a994aa4743145c96164b", + "0xacfbac397ae2ff23b31bb27b90788fd0fd51a50f8e8c9f4b31be8499194252014f0b1972b204aeb9c2836a20beb3c868", + "0xad85789bb62b60e9768bd330a31a16f711b6018445af6a47646f318f12df8d4d256ad00d1ed7c3afa4e98fef73c6c610", + "0xb2349265be33d90aaf51362d015ce47c5ffe33e9e6e018c8c6e39336d9327ccdd13d25e792eb33b43ed89a162f6ac2fd", + "0xaa458aaca6ecb43b6e45ea72d02682e5a7dc8dc22782669a0628e1638e73999319f011803f4ec8cf072467bf2c49c629", + "0xb9e6c9f2562e90bd3008669a42151538b70faf028cc5bbc09fd6ab3febc626df911fcc65744a2ad793ecaf3f91a1f701", + "0xa37185bd96faa526dfd3ddaff89b1eb29ceb4597bfc7e346bff9d6b3225b9ca87cbce0db94f05243c7232ead5f6607e8", + "0x824fde65f1ff4f1f83207d0045137070e0facc8e70070422369a3b72bbf486a9387375c5ef33f4cb6c658a04c3f2bd7e", + "0xb0ed68167a67490bd7d7d49e83341606d6e6fdd99b82e46747c2190d270719f81c5f5f8733646c246260f438a695aa3a", + "0xa87c2f13f2a824b7e2c39cfb63ca7b94ae6a11ade0c6b8e83f5092b933fa8b6157a5d2f09c23081f49d35cc85f5db36c", + "0x88f5e795cb36ab22bdcff01caca0e9d04db463c3d88cf656c3a0e0f5ac864b7092c738758b4c8f3b65e31995c6aaf267", + "0xac66f3a7041586ac1576e33598f01921e16d99afbf4249c3350f0ee1654de98bd37a61c243eb6a18a942db529e36af0d", + "0xaca69a4095567331a665e2841210655636a3273d7b7590e021925fe50757617898e1883532f9cfd46428c2e3d854f9f7", + "0x946d585d7aa452d37a8c89d404757c3cce2adf2410e18613483c19199abd88f7a12e206f87a43f6009e42f4e31ed20c0", + "0x9722c1079db7e2e1c49756288a02302b43b8fd92d5671585ac1ea7491123742a2744a526c12c9a0b4c4a80f26342a3a6", + "0xb80e8516598c59dddcf13fdb7a42d8f5a52c84e01bd6a39880f4acaefe8e4b8f09cc1b1a2423cd5121f4952201f20078", + "0x85bca2f86423a09014b562f7dc613246bedffdcb3aa41fee02270c13e6b00c8d6704dcbfbafc5997df6a90c7fc08c29f", + "0xa36dad4f7cba9f4cc843fe40f6240e1973a4c412cae29b4a68712598523cfaecb05272fc47d30772bf06906b5a26e282", + "0xa3d8610c2522d330df02511710e52b1d9bdc9f2b156deca12b1bf754266caeac4f449ed965d9863558df43ce9ae65a44", + "0xb3e313e79d905a3cc9cc8a86bd4dba7286fb641c2f93706adb3b932443e32eff2cbed695beeb26d93101c53d5f49d7db", + "0x88d8a32231ff2bfc39f1f9d39ccf638727b4ead866660b1b8bfbdf59c5ab4d76efddd76930eff49ea0af048b2e396b6c", + "0xa90d9502a9785e55c199630456fcb1e794bbeb0f5f8c022e66f238a0789998b126cf9911fd0b7d463b7706dc6f9ec128", + "0x8c627caf25eae6764501b9eff35aa90bd4f24952cad712aae20344579e83ecd104ad1f7915edc4f9023b17fddbdb4cd7", + "0x87d4b20bbe2dcd4f65f4e1087f58532d5140b39a5288e1a63fc0b7e97a6a56946eafdd90ba09300c3d1fef6356ac6b7c", + "0xa18f4464cf5cebade8ee280fa00e0917cbf1743aeb0dacc748ab68773b909e30dc60f40fdef3041b5f082e650985f7a6", + "0xa6ae4fd03fbb4e2150795f75a241ab3a95c622b4615f553bab342a1803b86b1c1a2fc93bd92ee12786bf2de22d455786", + "0xa89bc7548ea245ce9556eeee3fba98a3256f87499f54a7c5eec0c43b9fb4ef2fe8f6810867ed0df814a88ee100c245af", + "0x97f1a7370b4f5acf83b466f519da361c366915f560385dd7eff9d53700ad81b25c9862bc71d35428e82372a5ae555ea0", + "0x825359cfe68ad6a75578a94be6419179e0aa088170b6c20fc5c249dc3be7a260d687c93d8d8a343c7c72c2ed6a716de3", + "0xaa9b9cc039d147677aedd1e47ad9013fcc0da0164070ff7305b18e5786c7fac0471368637a3adbb78f3af174a5c1592a", + "0xa61687511b627bde7b3977e9a34cb7fddc2aaa509a7b99b6b6c7b97133845c721e1e69f99758698d82cca265d8703610", + "0x8853c582e86cf916750d670a621246a63c7fd78f68c556642053bcdfa7937de58885d728209736b7d5521b591387e9a7", + "0x82b8c013f24fe64b8e0337ae8b6a682cae336b8404eafc1404744f80f765efdb8b2873d1d3f31141e8dfe4d93346ac56", + "0x866ec39b9eda580d96bc2bff76af5cd4887b6788675149ab33bfefe38db82ad01b8d64c6b60704210918f3564cde1110", + "0x81337ebe90d6942d8b61922ea880c4d28ebc745ddc10a1acc85b745a15c6c8754af1a73b1b3483b6a5024b783510b35c", + "0x807c510df25c0ba10d4aa06a462e02f050c69a977c64c071401ab74f9ac1e60788aa504743b4cc1982da835ff9ac2541", + "0x96b1c82b85cdb8a7026fd3431bea9cd008f0261ee7f4179f4e69a399872837ab836a14e2dd45f5448d54800a4ae7c7f2", + "0xa48b1031ca2f5a5acb4dbdd0e9a2b4e9add5ccfc0b17d94818273c8df11e825193fade364e0aec10f1ff91d57d03a52f" + ], + "aggregate_pubkey": "0xa825959280c88c6716f6df807204feb84d745dfbee3cb3474ce81a1ef0c4cd142e5ca962a0335e68b7b4266769d631b8" + }, + "current_sync_committee_branch": [ + "0xbcfe80e1d24fbdad7bc058b011403a4c26cb56967654494cde51517f888023f4", + "0x4710ae46156553fee6231622052f7fb2f6945cdb59a5501cef824b1925c87445", + "0x6df62e05ef3e1ac92c659c3a519b8fa651d1b649c2b46fda58c48cdeffe8337c", + "0xd26ff22ef5958a707a8d98eb1ffaaf1f9f412e816c04b79f5434cb1792ccf608", + "0x90d5e61f0af673ab4d8b3ab0b978d05142a8295a163b198e6dea9d8c8f1c6d89" + ], + "validators_root": "0xd8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078", + "block_roots_root": "0x5078f286fa90b88a09dcccd4ac72f6c3615b77c0ab3132508cb8c0c07b20282d", + "block_roots_branch": [ + "0x558b658b1230e225ac3adce3daf0b066ed0484b4a768d55b74ba81579ca0e5d0", + "0x2cbb27d38065ff3f230247af918e67d1998b67bc7e2ce6c244bab7146e16b8ad", + "0xc63bfc96585f424385e3b4b39ce46e957017b716c54d105eb7e07c841d1d4309", + "0xe662b38f57427b58c46b09980db3856f17e56b60b36bd5471823b0f2cc1b6467", + "0x8b3bd99618b1e50cf284b4c3b03d0cc272312bce377d585eded77154aa5580a5" + ] +} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-finalized-header-update.mainnet.json b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-finalized-header-update.mainnet.json new file mode 100755 index 00000000000..3440749102a --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-finalized-header-update.mainnet.json @@ -0,0 +1,38 @@ +{ + "attested_header": { + "slot": 4066880, + "proposer_index": 1904, + "parent_root": "0xcab3b6fe3ca0c3ec6f9a8290d1cb3ade42b019f399dca754060518eda41fd429", + "state_root": "0xc47d2d0ec566de4bd41082ee14aa6294c05f264a4fb6a73766c75df917b57a55", + "body_root": "0x5dc66f1cdd8fe849e0aa63b096a8083c16b00814f37edd213819852cc43317d6" + }, + "sync_aggregate": { + "sync_committee_bits": "0x9fffefffffbfebfffffffeffffffbfffffdfffbffffff7ffffff7fddfffffaffcfeffff7ff3e6ffefffffbfffffdefbffdffffffbffffefffffff7ffffbfdffe", + "sync_committee_signature": "0x9146a1a3cc2520a69415103446e2c30676fcd164ef2beb42933bf4beb753f5e94f28fdcb6296e3ceda302b2a93c716d515a890894365a36ed535e099da76c7e585b8d6ed5fc2ec3c316049b14da844add39bc79cd3829a455f552438669ab70c" + }, + "signature_slot": 4066881, + "next_sync_committee_update": null, + "finalized_header": { + "slot": 4066816, + "proposer_index": 1396, + "parent_root": "0x17d77d07327f42b16d6d87a06c6ab5e56ce02e3ebc65ed2d28a64dd0c3a33d15", + "state_root": "0x9b498175419bce5a027c432fbb844f35138dc00083540a04ec0f54c77eaf061d", + "body_root": "0x6650167595152e94d0741c7a7b64d2c10ed01b0d11519f7d0c615c8a60dfae2e" + }, + "finality_branch": [ + "0x70f0010000000000000000000000000000000000000000000000000000000000", + "0x3d4be5d019ba15ea3ef304a83b8a067f2e79f46a3fac8069306a6c814a0a35eb", + "0x452c63d803b8bf301447a73b2f7a747e49f37f9c9a096d8ddb6c8302666b809e", + "0xdfebfd48ce69c56abd05de8266c76478936901404ac3869f0c068c5cfd33b301", + "0x6f1a65d993b2f461764934642be084a68bccee505bd3adc20cc69e151bc6330a", + "0xbd65074f41adb20717d733e64d219d832064b6417b90f22de6d065cbbd6b3d83" + ], + "block_roots_root": "0x4729dbb81e8ebbbae1acc10857551a3991fd5da08c27dbd304b62673edcd46a0", + "block_roots_branch": [ + "0xa3c286182434bdd4d55be8ef6e7212917dc272c204a4daff2d0244fa993d86cd", + "0x00d2df4cb3c0b06bb4f2722f975d6630a7f3c2a1ff12d635e2109f08379e3922", + "0x135a357782eb8f46d14db6e62bd3e9ad611d01f16a3e573cad9ea0c53010bdc7", + "0xdb944338cc4e7b11242b39bd83159afb122504a1934569bb500a4228b884b8c6", + "0xd381920000999813479b975b7cf0e5663b52c3ab06bb6ac66e723731e8f41e9b" + ] +} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-sync-committee-update.mainnet.json b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-sync-committee-update.mainnet.json new file mode 100755 index 00000000000..c445bfb48a2 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-sync-committee-update.mainnet.json @@ -0,0 +1,563 @@ +{ + "attested_header": { + "slot": 4063296, + "proposer_index": 944, + "parent_root": "0x3e8712719bae71b519a25b7eeea9b412acb882ba6bbeeadc596b1682838cb6a6", + "state_root": "0x16add3b722d0b9075e7a3fe9cef6d237698053edeffe1b95f5b59a31f1bb4f1c", + "body_root": "0x724f1d72cbacde14baf82d273d3c4eafbbda3a56cb0f641cbfe76a426657327c" + }, + "sync_aggregate": { + "sync_committee_bits": "0x9fffefffffbfebfffffffeffffffbfffffdfffbffffff7ffffff7fddfffffaffcfeffff7ff3e6ffefffffbfffffdefbffdffffffbffffefffffff7ffffbfdffe", + "sync_committee_signature": "0xb2f86b054283455ef620757c13531ef64baaf8899527864aee1b86301c62c72b6c979865579e04880790c1ea418b53a717d7b8b85c70fda1760b2436ee04a25b13a8906d6aea8e94facef2444f33e4d5b4e91439adb981900c253186e742f1ec" + }, + "signature_slot": 4063297, + "next_sync_committee_update": { + "next_sync_committee": { + "pubkeys": [ + "0x936749ff47e5be307546564a5a4615bd8df52e2590034b2db19846939af3595a79ccabf0f6ff52ca46b9a1de3efd47a5", + "0x93fda62b785757b465e6f396f74674d5b95a08c938cf694e66beed7d2f317a4c9d736cb54d7c221d61e8cb3d64dca3ab", + "0xa39e96e33076fbb49c35a58b6e386d22fa7378337bb8b0d47699264f78e5ae8dc143f1f6d5f8b371deafc5c875adb60a", + "0xb5f69b7614fe07889b58142d7b438186d70214ff4cb209b6f271a3bf2bcdef5e6f1c7e95dbf5f2785aa471f0294cd029", + "0x987dd977d6b8d27c4065b61b3c078ec9ce3871fec02844ed00f5ad28c42f9cedecbe830ddd19e11a5c879b01eb0f8f80", + "0x9969ab62009b6aa81734579346766937d22ba73c008d24bebc183d1b3d3cfabc90b47f41b29bc6e23d70165594c2e774", + "0x840ac0e104b22eaebcaa1e49be43689f45434a6c5ddb71eec577323f38836ada5464b317fa3862773132166f2ac0a536", + "0xaf96a83f97ed0696fd29e59daa24e1857e16371f67089d08129f9c236753ea68c93590dce4d32c9e9818a21014da6f0d", + "0x8779a0376579008d0daa99895f548dd091b3abab37e91efc9cabf08835068c983ab0927e7c8eb0396eb83a5e0a713c56", + "0x99289672bfc48d2fbfd51a32d0d7f9d03fff37b8269ce45cbae1e9a091ee3983774d053efe8eae2f2d3f22a9eb532457", + "0xb60df25a7ac1ad14aef7e8809c4bfc190b715f94f14b0534cc2e4015ff6c322883cbdc5309e05d67dca4bc641c69725a", + "0x8c22f1f2a530879a93e744397fa6acca57b01fb62b62188ffa7487464815c605e1520ff4bb18e832753893649ab80d62", + "0xb3acfe8f25eb5153b880a03e07760f7fa30beca475843581b4878ac0412cd2038117f25a48c152e6d60ec16e4b1e9a45", + "0x8163eea18eacc062e71bb9f7406c58ebe1ce42a8b93656077dd781c2772e37775fe20e8d5b980dd52fdad98b72f10b71", + "0x8100b48ac2785477a123a7967bfcea8bacef59391680a411692880098a08771ff9786bd3b8dfb034cae00d5a7665621c", + "0x83bbd31e799ac14686085868e8ea7587c7c7969c7015bfe45fd8e3a3847ad5338005f9cdf58396b2ea833c4af98bd9ca", + "0xa59249e4dfb674dfdc648ae00b4226f85f8374076ecfccb43dfde2b9b299bb880943181e8b908ddeba2411843e288085", + "0x9793a74fa578ace75b083578277a1ae8766d41a5c508b0f1135fb97dff1d0826002393a7276b18cbc4b3c5671360ce0b", + "0xa734a3c947be4c7e6704639d4400aec2ccf5f1af0901b41a29e336afb37c53bf168774939ce51f32d4496bce1a32e612", + "0xb96a11048c7c327709d52e72e6f6ed0b7653329a374ea341ad909311b5b303e5629d6dcf11dcdb195e8c7592ceefac21", + "0xb3b7af9258af054362d461a74fcfeb6dcf3a37b6e33b6df32f8317d50d8be8e1970818a6e41c8232b89e1c8f964c6c1d", + "0x907c827a4fb5f698bf0e6f10ca07741c5b8e3ecb26aa53f938ba34ceb50c01be80c4afc5ac4358a5fda88eadea0cbe73", + "0x84173aeaf3d96368dc7ca1ad5e5575da279113567e5815a364a0356a720c5e08cb58ca1fdd891924f4871d3eaae5de40", + "0x92127d55535bf59f2b00511c82f74afe90529d4abfbaca6e53515d63303fe52b4b22383fb026a2a3f88e96d2bd235f6a", + "0xa9f261d19934fd26458421551e91f484d7a1522a7e7adbfb28f6371102a7650a5ae6efd49d9e33b03aefde647d134ce6", + "0x880b4ef2b278e1b2cccf36a3b5b7fbce94f106ed9fa2820cb9099a7a540a57e9fdeef5c0fb0a743049828fc2b8c46163", + "0xaace45334070c51cc8b3579598d4cd8cda2153bba51f56e3b1fe5e135c83ef70503c322756b9cad9d3cd28f1ecfc8227", + "0x97578474be98726192cb0eac3cb9195a54c7315e9c619d5c44c56b3f98671636c383416f73605d4ea7ca9fbeff8dd699", + "0xac5c01c51dac6ee1cb365c9b03f09906d9b7b9b4d1b73c44d9e8e06823025d7070f242898a975420bc87d6372382cab8", + "0xa9a591fdd18aec8746435eeead0a54bb88e055f55e91ffdd9bc663ce0bc2937fb296034ebb959d6adcf9af94bbd2f49b", + "0xb495404544c9335d5f184cd6873299a93174905fa34c14092f67d9b8545e71fab29545bc337e380dffcb533f7390e9cd", + "0xa3b7fabaabd4c2e555dce46add6c56851b68308c1bb7253576a9f32eda141522317b5c00a28b384ead3a880b8e7e40dc", + "0xae0beb452af7479134a7fbc31a5f59d248e8a67d4c7f73a0e30a51db9cd33a1da3f0ae947fa7e5983aea1343e7daf06a", + "0xa9d9a295590641b2b09d8473b50c0f6e036e1a009dcd1a0b16d84406763b4b078d5de6ca90898232e34f7f7bf147f61c", + "0xa5fe3dfb5031517bb8db0d5ade1e9f438e84bcf23221de003b03d2a2f4ea97629e81c79abc3769bdb8c69a512c189b91", + "0xb614910b247c6ade31001b0435686c3026b425b9bff80b6c23df81c55968633349e1408a9a5a9398a7d5d6ed5d9d3835", + "0xa19e7db50604f6b82cc28bc97135025459c8eac107a1c482919df10b8be2e4f24fceb93b963c0b8ac9f402e2f6ebf387", + "0xabf7da952c9d8f75fcc67fa7969fac0b26d4dc3e022961ed674ce85d734f11620a950fb1fb0ef830fba1d8b5bc3eced4", + "0xb382fa28670a5e14dc954b2db8ace250c73df71ab095304bd8ee28f455ab26cc54f82775a831428e110d1a3a2af709bb", + "0xb284286dd815e2897bb321e0b1f52f9c917b9ef36c9e85671f63b909c0b2c40a8132910325b20a543640b01dc63b48da", + "0xa2b1ea43f51460b3cb83657b4e296944658945d3ad6ae7b392e60f40829ba1da6a812d89f0380474578cbd0ab09801ac", + "0x8b886448cbbbeb40be3e71ccee251632186dccb51697f69eb5c746000b4327fd85be3a58fbd49f1df642a37f6388a8f2", + "0x9161ba220130eea190932ecdad9f114e385a31ec51c71cc8de451ffe5e75abcda37227c6a77f7090d4d8bbf134421bca", + "0xa24d05b51c7c128bb49979cbd9019e6618545d95275a44b5c3d1d03e71bf2ebffdf43fff50c30846ec27d279043cef4e", + "0x8cd1c73b7fe915e7169d351f88ade0f810d6a156fe20e4b52c7a697c3d93459e6d6c2f10dc1c6ec4114beae3e0a8c45a", + "0xb95e3032192bdc064306c683982d885f0ded8b907a532f15526a257ffeff2c8bdd7a2334c10d74b1484909b2e3ae0e47", + "0xac754a42f279472760bd36dd0cf36f5ec685e7fc2970c275811a70cd05843f94fe21745dddbd54135144edf1793aa0cc", + "0xb26b4d483bca73d3f3a976bb595a0e40f9a42094e0febbad3a1874934be1939a1b362ee4ea14a4f5cbfa9b1392796a12", + "0xa841594e74b66935efd295a6c06e2be03cc8c187b277cbf5cd2f590630d4812801ad55f3e502736d126441a2f22f1867", + "0xa845a8a3299f8e5fcf72358521a114c6077251e62ff6a885003f7281b0e1ee33715d9ca0b0082fbf7cb9d452d531c38c", + "0xa7b86e4f1366da44fd59a3ee68018a99c23ba3588789463bd88b0177a9b94030b58cb879a506e64421af966f261eaa86", + "0x85822227f6a96d3b6d6f5cf943e9fb819c8eaf42a9aa0bdd1527055442b1caf672522762831b2dac397af37a1c5ed702", + "0xb455f751232de0a48440d09983f4f4718b6169907979c9f282acf7177ab5b1f338fe1f2acd8d0bee4b4aad61d0340839", + "0xb97b2f1b2d6d744f2322812825ea1cf91453dfe1bbbb2678776e40e7d0fe682239d0dc8053f94d97e5a9678232b7a71f", + "0x815f53751f6d3e7d76c489f3c98d2b49214938cac8c2b417e2d17bb13446c285fa76fd32a97e9c4564a68f4faa069ad2", + "0x8ed7790f87f6975e0f3e501901b0bec1778c88bf39588989014c5dda76c2163732e7e5703c9cb2c1a6144ffdac5dcbab", + "0xb6cacc458ca5a0f04836c5640d34c70cab34cb5c87df28579a0d5e2c72edbc092814bdbe902747ebe3ce36808d8f4dac", + "0xab7c058199294c02e1edf9b790004f971cb8c41ae7efd25592705970141cdd5318e8eb187959f1ac8bf45c59f1ead0d9", + "0x99365fe5ab8ea8bd768ae7181a6ba49b79d240f512ce309b02f09d465fea276298ff55b5b9cb5b4162a901b390606024", + "0xb1afaefc9fb0e436c8fb93ba69feb5282e9f672c62cbb3a9fc56e5377985e9d8d1b8a068936a1007efa52ef8be55ce9c", + "0xb37334c41a3456b73b61d0eb0777260af9c2e400bbec0e0c0fdb45c39ce0dd19f021d9760f35da801f20486c6be30e9e", + "0x95757096c132e7f6c096d7b93a5a0d2594d5e609b9f13c4a9f878e95a389fa1a111b185dc1fd8f7d98b737dcf8d2af60", + "0x8f71f8edae59d6936846d8b50da29520f69b339f574ba9156d3d5f0cd4a279d36bad7ca7eb724dd48aefc4ca9ce26bdc", + "0xac2c98a0ab3f9d041fc115d9be4a6c77bd2219bb4b851cbee0d9257a4de5791251735b5b8fad09c55d16eb0d97080eff", + "0xa09f11d2bc6000d12a42b545ddc29c1973944a39787c5f27c96d4f6aa0d9c8fa9c479f2ed327fbd30376df3fa5b7d2a8", + "0xaa19a75f21a14ad5f170e336a0bd07e0c98b9f5d71f91e784d1dc28a5f5eb6870a4eb35bb41edcf9e6efe982ae5c2c5b", + "0x92a488068e1b70bf01e6e417f81e1dc3bcec71d51e7eabbc53b6736e8afdb8b67d191940fe09c55783be9210e1cbd73c", + "0x95cf2e038c790ce7a2960add7ab44804375f04ec6829f8cc63793dfe9fc48c7471079f81b932726509394fd3d46a52e9", + "0x87fdca39618051c4b3f03c816b13df2d4cd4c7c564e3d8693dcb58145b7b3b3db7884b0125b1e84d9bb82e91bed8bba3", + "0x815922ad356f490910e8cc3b0f7d3934b5e28c09711b5151ae8329876670f3de6d7a3a298fd97b580ac8f693305afb21", + "0x8bb4d08318386c91a0136d980a42da18c05743a5c52a861ce52a436e66a8ebe472dac7f7461db32ea5da59a23e9bd6c9", + "0xb0053550040ab3a3996cba5caf9ad5718867b5f5df273ed8c6520761571f03a94e50b5f8a6a8c42d725383cce97d3cae", + "0xa42c46a7e617d78b12053d7783f0d175fd9103db06d0c6982b38893a20b72fd8ad8501eacb3d47be06fd7c3ad89a8159", + "0x838ff6630dc3908a04c51fb44a29eca5a0d88330f48c1d0dd68b8890411a394fd728f14215482b03477d33f39645dceb", + "0x8ba45888012549a343983c43cea12a0c268d2f7884fcf563d98e8c0e08686064a9231ae83680f225e46d021a4e7959bb", + "0xa59a59db246f981e9c8e54aba52898c714d9787fef8969a6d8677fe6dec82950ff22a1364393b579f3e596cdf5bcd7b1", + "0x8722f3267a945f7123c1df8b6c2122456d81fed56e6369ba726b023c01c1f6738fc12e506e260d99e448fc920fd5e5af", + "0x89d356593ec09d838cd89306ce83c060ee797bf9eec8523f581cf263925699ef0f7161a790bd00bb09681534ed05ac82", + "0xb97fb8ebf2ee1bae5914cf96e5a07887ba41e712530eb2096ace318e989c0ad93060cfcf40507d927af6c7e945bcc289", + "0x88015bec478fd3ddff72efda0e8fc54b74faf804b0a3473cca38efbe5a7e6dc0be1cfe3dd62b8ac5a6a7a21971dcc58c", + "0x860c0eaee51b7de26e99033f352aa09c093943b59237f1313ecc35b0d711509bbe9f939c4bd646deb7de8103eea9ea13", + "0xaf9d13103868c854821ba518907b067cfba025d739125f1e9cce0a04fffc3a2a1f25506c1209a0cfe1d6c1572c229ff0", + "0xac7983d50ec447b65e62ed38054d8e8242c31b40030f630098ce0a4e93536da9179c3f3ae0b34a0b02aad427a97ee60d", + "0x8261f7e644b929d18197b3a5dcbba5897e03dea3f6270a7218119bd6ec3955591f369b693daff58133b62a07f4031394", + "0x8fa2d7b22af8e6b82679ebdfa13efdcb34289a554653ea6c1b16efb9f957f7fe64df787e7b03d8cdc8a732b91c916bd1", + "0x897eed8c65712e9b1ed8213abb85a6252ec30ab47eda4e36aeb8a72447ce7972861bc97957bc321714328c64af27544b", + "0x998c9ee20d33f96a2388b1df642aa602bc8900ba335e8810baab17060c1eace4bc5203672c257b9ae750008b707b0aa1", + "0x92378adc9d56996ce8ecdb9ed6510affccbcfd96712a23631edfd6ffdb1469847aa447db6b2bf61dad416ebcc5b7d1a7", + "0x83fc998e050cb1004fd016c7dc62885b07a95fc9b219fd6fde8ca2824c647f331f6b18ebdbd14569b906cd1ca1066189", + "0xa87c2f13f2a824b7e2c39cfb63ca7b94ae6a11ade0c6b8e83f5092b933fa8b6157a5d2f09c23081f49d35cc85f5db36c", + "0xa89bc7548ea245ce9556eeee3fba98a3256f87499f54a7c5eec0c43b9fb4ef2fe8f6810867ed0df814a88ee100c245af", + "0x8d52413f981bc611427ad0534d25e914113d0ebcd6960aab6421608bec6648b89ae4b2ca2153c57d3cf4f1f37212aa5c", + "0xb0a4c136fb93594913ffcebba98ee1cdf7bc60ad175af0bc2fb1afe7314524bbb85f620dd101e9af765588b7b4bf51d0", + "0xb7ac87da14b783914ab2e914fb7b536893b7a650cdc5baa1f3b4aca9da77b93a3336671335250e6467a8cd4aa8dc61e9", + "0xaaeb0005d77e120ef764f1764967833cba61f2b30b0e9fed1d3f0c90b5ad6588646b8153bdf1d66707ac2e59fd4a2671", + "0x8a60e066b13eabb372067a6b08704f3b6b98c0d468942738768127ebfcf122aef0ae2303f361c6338010fd371646769c", + "0xb7de6d7a4afb05984dce153e5570b104338265e45c8f0156f4d45c458f47add234a479e01c02d3c1817c170b5b65b100", + "0x983cb6bbfe83bce8326e699e83fca01ea2958c09808c703cac97a0ea777e5a5f3f5bba9169a47732de7459a3c7af47d2", + "0x8db19f6dd3789df179ab606508ca7e3da7967ad4340f630bda83df54c197d6bd3a14980c87fe10cbced7678c0c300ef1", + "0xb4e6bb207e08a1e096f6b27a5a60effc74fc8db0b6cdebc9ddbe88f434f4c8e0bd7fa77e015cc309db0f0922bd05b3f5", + "0x951d69f32685615df304c035151bd596d43bc3250f966e0c777544c506e3035d031afa4a3fcca1b85c41a4a041aefc01", + "0x942bee9ee880ac5e2f8ba35518b60890a211974d273b2ae415d34ce842803de7d29a4d26f6ee79c09e910559bdcac6d3", + "0xa0e68d24f784fcb2b71acc2d5871285623c829d0e939146b145e04908b904468a67c07a2f156e6b17bf531adc5777c4b", + "0x921da028f26a61a034f5425d6618eeb61adaa8ff10141bd65ac970adaefd3737a4bbd77d8a7a90cccfca35b0f4d585de", + "0xaf6911edd6c7ad30f905a0a3f78634808832fdeb4206b006934822d673bcced8e378779261b3c4b772b34b8871987f57", + "0xb044857d879d06e9be5dd70498b27a20aee758ef829d37d0ea12b92aa84b9d3c6194205368014d942ae0517cf6d0e201", + "0x8f90e72a54e6894d511061957162e753010812346afd4d90cfedb678b99ba1aacf2b6bd0e49b4b0e684da8082a048619", + "0x8317974fb1bdd174c7ef81a2a6478f887f44c1e8680c21730974e5c440846c4d43a76a3e90334b39508f507163e2ff8f", + "0x976eb5543e043b88d87fda18634470911dfe0e0cabab874ca38c1009e64d43026d9637d39dcd777bc7f809bbfc3e2110", + "0xb53fb1956a2a34a840de4ff0b5b1e0e2fb78a21ac8edbce6be6c26a4b4de6d37e9dce799110a802a344e8541912353d7", + "0x85bca2f86423a09014b562f7dc613246bedffdcb3aa41fee02270c13e6b00c8d6704dcbfbafc5997df6a90c7fc08c29f", + "0x8bca3560946189e4984126acb42153d8dad0b60e7f86518b55ea9ff7c899c9ec12821850943b6adeffbe9363bce4d217", + "0x952a95612aecce4321d2c17aabd2fb260b1cb41df5f76f5b82b46cf818d7a4f18e5e2944cddcd2280a993c0af4f834fe", + "0x9722c1079db7e2e1c49756288a02302b43b8fd92d5671585ac1ea7491123742a2744a526c12c9a0b4c4a80f26342a3a6", + "0x824c8a1399ab199498f84e4baa49ff2c905cf94d6ac176e27ec5e2c7985140dbaa9cc6303d906a07ab5d8e19adf25d8a", + "0x94bbc6b2742d21eff4fae77c720313015dd4bbcc5add8146bf1c4b89e32f6f5df46ca770e1f385fdd29dc5c7b9653361", + "0x90f7fa9a30d9f2812a20db97b3d03962a5b59719385c1881c61009e4c049809efe378b39cf74b64daa981358edd691de", + "0xa4632399c1a813e41fb2055ef293466098ea7752a9d3722d019aa01620f8c5ecdc5954f176c6c0901a770cbe6990eb11", + "0xac79f5491dbbd0eb47669225e781f94b98d04947cbc55baf287365831c100248bd0b39c911ac09b518715ba1ef0602f3", + "0xb9574edb9567f07f85c7c2e6ca6c02d90ad7c7b87d49796f1e2fb7240ad071fb755cf13ca8678668a56217c62df168eb", + "0x889a5cf9315383bf64dfe88e562d772213c256b0eed15ce27c41c3767c048afe06410d7675e5d59a2302993e7dc45d83", + "0xa0b3dff15982a38a2f56d8c6cfc5c5543c045bf2db24571d23387ccab42abe2756f34d5f0bf6a426bbad3c358b8bdb00", + "0x8009dff405aada0798a6cb7f418f73017d7a569a7576aff51348b15913a5e639dd232657cd775cfa0dd811ae5e301241", + "0xb31949c4a21181a54928f25f8598ea3dfcacab697a5653beb288d218d312133e5a93f434010ffdab3f3ebd0b43b207dd", + "0xb46f481155df4c4d576e5d76f1d4054e1129cc49398533ed32d0f681701276cecad4759e47b818f20d6a087989449529", + "0x88158d759eafd2205c770f166829fd61e8f17b2c13f440777eaf45f4d88a6e2028bc507680ff435882d5fb462f813735", + "0xa922d48a2a7da3540dd65bda3a8b5fb1f1741604e2335de285ac814c69c40b5373d92bc1babd3e4b2d32993f251c70b5", + "0xb7efcb232d3b639921ce21e80744c293ea77e25982b609e8cc82bd3999a734ca04ca43f41d9c7c15d162e0bbc3152495", + "0x96b1c82b85cdb8a7026fd3431bea9cd008f0261ee7f4179f4e69a399872837ab836a14e2dd45f5448d54800a4ae7c7f2", + "0x8295f613c162159f368340ca0fc2fd7776f7ad64eeafbd132bd3be1f1c30b5fbdc5f107f12fb0cff15b12c08621f457f", + "0x89e3ff351ce4f0d43cbb6385bac30b37431b31c7c073bacedbe0a60af3dd372aca672c6c4b4d05d2c4b7a040e80f3ef5", + "0xb075db32979df905cef986cfcd6db823ac21dd4013cecfe088885390ff8acd18d76dec793b80db5f7779426127daed7b", + "0xa18f4464cf5cebade8ee280fa00e0917cbf1743aeb0dacc748ab68773b909e30dc60f40fdef3041b5f082e650985f7a6", + "0x8fb51e3ef3c1047ae7c527dc24dc8824b2655faff2c4c78da1fcedde48b531d19abaf517363bf30605a87336b8642073", + "0x93e4d7740847caeeaca68e0b8f9a81b9475435108861506e3d3ccd3d716e05ced294ac30743eb9f45496acd6438b255d", + "0x946d585d7aa452d37a8c89d404757c3cce2adf2410e18613483c19199abd88f7a12e206f87a43f6009e42f4e31ed20c0", + "0xa4cfe97f6e61e45577ed6ce6eb7d1d9aca9e323b79b30736b407000555bf3e2ecbffd6314585b09000f09ee8381903af", + "0x87c5670e16a84e27529677881dbedc5c1d6ebb4e4ff58c13ece43d21d5b42dc89470f41059bfa6ebcf18167f97ddacaa", + "0xac7e49f2059e99ff65505742978f8d61a03f73f40141a2bd46fde5a2346f36ce5366e01ed7f0b7e807a5ce0730e9eaa9", + "0xb471c72bd2971353f4b44248b8e6cf5316812861a88ccfc20fd0d89a5e010428c387228b2f6f14c12f79e31afc9d0753", + "0x86b3a4ea9b1fde00cce79d5ae480353d60cb6ddce363c535bbbc3e41a4b8e39fcf2978eb430091ae1b10420d43193971", + "0x8167484b6a9bcbdef21464cee959a7a6aab5ac92ccc46214f4a2ed520cfb4d4de8917f9b9bd6fad71e66c17bd831eeeb", + "0x86ca8ed7c475d33455fae4242b05b1b3576e6ec05ac512ca7d3f9c8d44376e909c734c25cd0e33f0f6b4857d40452024", + "0xb49379bbb9f954d2ef5574199607bc6b3aa2cc3b48dcc3745cc77406bba2a394929844fec1b87c4ce65cd0ca0f83062d", + "0xab6366a7c6da8ca8ea43a3479e50ecf9a1f3b20ec01b8eae1d2a21ba2223a4ce62615836377c6395580a079c284947d3", + "0x9175ec473efbfaa029aadf1584f986371ecbeccd82ff6a52d1f6c66f51d7395e0ad67a5e8bef0600ffdb348978913e6e", + "0x8cfcdfa192b17321be4e447204e1a49ecaadca70a3b5dd96b0c70ab64d1a927d1f8c11a7e596367e5fa34e2307af86fc", + "0x905a97217fae8cfdc4a006b644e91b097df28e02da2f19f77e18f4b0c4aac2538ea83919a722eee5c0ff315a1daf3cc7", + "0x94b2d97448b452a986c039df1cfd651da59249b649182941556018af4ab61d2c6af82a29e69599153316f9b262efbcb5", + "0xb0eecd04c8d09fd364f9ca724036995c16ba6830d6c13a480b30eb2118c66c019cfdc9dacce6bfd8215abe025733e43d", + "0xb4d07d50fbc9634e5f4aeb884974068ea6b94e67e4527207f5f9c41a244943347d69d3c73af74d8de9ab3659d06c6d6a", + "0x8e54267871d8d3ce2a080e48786be3d97e5fc9404156436dc2a37bf05a588470b7656383bd79d58746d1667ceac54344", + "0x8277508c9aa4d1938c83b48d05fe3a440bfb50c5be79b30da1ac1853d19ee062797be19521f94b038cb991b1237abc59", + "0xb4aa92a60de61ad089cb027ef19a211c720ec0e51743b1166e3d71bac08a9ffff2f0687e250c6a7e1db866f7c4ae8f29", + "0xb9299f950db8cafd236a17f141cd2ea9ff441730749bab3571211d207ccafbf5a3990dc137400c405086c4d2879ab91f", + "0x8c38ab2a9558ac41c6ef736a5560e5960102e92f710efac3f631367a3f6d7227e0813579f349e661116bb29b2163b296", + "0xa5c11337eb91ce0e9b6d61bbdadea0a063beee1bc471cc02dc1d81c5dd2095315c400cbc6c33d23c77e98bba6bdf5439", + "0x8d3cba4d10f94bd3406a341c903ad144cfcfe6b61678d5c03084a56b4413bc30bd20d7a9fd5d839dbb565cc9b2aa99fe", + "0xac9f0b44105cf77ad721b97b0f04a37fddb2bb62c345b0d22a29e2870b8964d7484aad30e454c74608ce9901043501a5", + "0x8be4830a391aace561decdfea6aa610696d292a9e6b56448c6a590027df9f6762668671775272bac46ea335391ae157d", + "0x8e662149e22ce32383461ceb489b912f3c6320293d6edf61499164beaab7a265ffb9de3e0af6c95ca824d800718e1506", + "0x88b49b1130f9df26407ff3f6ac10539a6a67b6ddcc73eaf27fe2a18fb69aa2aff0581a5b0eef96b9ddd3cb761bdbbf51", + "0xa41cf5d678a007044005d62f5368b55958b733e3fdde302ba699842b1c4ecc000036eda22174a8e0c6d3e7ef93663659", + "0xa663c57b72e8acac40127fd3af579dcf9aba05910b26ed1155888543223d6558ee8e1c07f0a0e634e532ef6c5e9cf17c", + "0xaa103a329b699d4102f948101ce5fae27226419f75d866d235da8956f11367e71db5c0a179dd63007ed53f7eec333aaa", + "0x86c53fc078846c3d9bc47682506f8285ba4551475921fd388b96291741970c34b8de4210202e40d2de4acb6e2892072b", + "0xa7e0ddbae16e4491822684c0da3affecbbd17ef96c5c491ac093c6eb4e162fc7854c367535e296fd3d6265c2ed1210bb", + "0x88f0f11d0c2bf51453077cce0d3191931e73b104ee5c524da57e4eac0a88965f58b4abe423c1073f75fe3d3c666a209a", + "0xae8af784224b434b4dfa9ae94481da4c425602097936623e8abb875f25deb907aa7530bce357786a26ed64ef53d5e6b3", + "0x9408bfab1e7ac8b8b888c623bc0438b3a3460aff12436d13888315f496fdb808e9dc00894f272f348ed6aa475f848c49", + "0xabcf138d9363a73131f5bca56679d15606216bae1647c59c2857cb56818a0529c1b4b45e382273c993d62b7bcd552ded", + "0xab37a400dafa918d28ef43294b18dabcb4dd942261832f9839e59e53747c7b1bc44230967a9610b261f3abbd648e3dd8", + "0xa73b3c9d16f6c63659179b74b1aa5a0f4447c683ba38f9fc112efaccde4835e5b92c2f7041fa82cd90b2c4932704b9ac", + "0xa3fd9d8bbdc98394883022299fd9793e0c4f374d8e40d6ce89b2869d3173cb6a5476371d6095dad068ff217729f60af4", + "0xb4c5aa21659b3ae37fde62233b0bf41182fdd57c22fb5f47a236048e725a0e8636b9a595b13d9ecdf18c445f156ad7ee", + "0xb3a5497365bd40a81202b8a94a5e28a8a039cc2e639d73de289294cbda2c0e987c1f9468daba09ea4390f8e4e806f3c8", + "0x8cd49711b42af58a5aae75a38fea9ddc5e4183c467a3159b5b0629f01ba548513c577456d34c861911e85782e52c3b1b", + "0x868c13bb6bec7d56afd4e518f2f02b857a58d224fbe698be0e00bc178c1858e6bf5f0f7824fa013d5c8dd6f6e4147974", + "0x86f5a9bdeebd38fef93bf20a7451ef4c851d63f08e025a59109c68b46f4c61069a6c8c5fe90eb5af36943acc35e62f51", + "0x90c402a39cd1237c1c91ff04548d6af806663cbc57ff338ed309419c44121108d1fbe23f3166f61e4ab7502e728e31fd", + "0xa21477f0b51d73b0816b4b411c12db1e3a83698113ff9299ab2827e8da59baa85dbcc70afb831f5b0c038e0470562f00", + "0x82d09556978fa09b3d110e6066c20db31da2e18de90f973930f752970046f2df96b2a0248fdd833cbc50abad5c756026", + "0x92a346a321cfd73214be02f084ac2ff417900a1392d134b538099c92e7fdb7ba2174e9929c51b5e45bc3bcf718414dd2", + "0xac4b39bb8f0f62666a50574632764f8b6a1dc98afba5a5dad4409c920a0c0d5d2b5c2506c3a0d2f8727b7b7dce2ba1a8", + "0x8296f8caf58316af535def398a43357e48cb3b1e674b857eba1bd1b970da3dd045e22fe6d17dee4e9117f62ece3ec31c", + "0xa931bb29b6200899e8a8c257166400eff9888594daa1e37501390a1d219b019ed1b730d921a8f6d6fe62dff7b86ee387", + "0x8ae9585caa3c73e679fe9b00f2c691732f7b7ca096e22d88c475a89d4d55cb9fba3cd0fe0cedd64ce75c591211664955", + "0xb4a86fb5b0049718caead1bc036833a2caeb88e1afadbbbcb0cd021d95e1f33fcc916f0b97fc1b9226c37050e3463796", + "0xa15e0cb96a463ab81e661ca44c619b71a159680bbc04707ea5a5867ff38b15416e3abe55d2fabdab9aede1f157dd37e1", + "0x8b3f8fc8d2ec7a8db6ecadb8be90f55c1be4871bde10eb18c1773dc45dce042d93baa65b75c4688eb4125b6b7965c2d3", + "0xa4f964d672fa5579479e939d2d5dad6a5dac6fca4bcbf7d5ebbe7489f3809131667b41c3472addfe766d83202ea29c1a", + "0x86f0253db0918337e4e128e8056d2c793562c6b5cce8ba43695a02eae7df12605309722fd1e3b8c02ac513a4a49894a5", + "0x89cdbd610e7f57e86438e50874c3c7ba85afa63f5adcab9e454b5c203e4da65d74bb7cac5995a8652d10a6e438a1c2b8", + "0xaf2dc13a599c834b9af1b54a4fa675c0db92e807cab3bfc825f2c5571b3bc2e1c213cff941cc8b1080d894036f9f73f8", + "0xa0899189bba608887c6cb729580e570ecce9ca7107865ebd30def867afaaa250bac407c30dbee11b7ef6cd423269a8fd", + "0xa22542a4a2ebde18cc6aa29d5dace8b4f6720703f519610dcf01e671018392aff15728e3764730840272c9cfb074b612", + "0x88ce41025aa153a94f91f22e7b96f9342b5e0e1d76274fc70c4df7d08f66d9f7ac86e55a1c6e77693b8b01b2b38bf900", + "0xb76cb8cb446eb3cb4f682a5cd884f6c93086a8bf626c5b5c557a06499de9c13315618d48a0c5693512a3dc143a799c07", + "0xa7741c52498e0a24db3ce7699882de8f462a2b3ed5e9f77dc7200cbdf46b6cdd923b1128759909d6dddd64700c4c20c5", + "0xa211120e1bb3b10138df1fa58efb009a298b8771f884b82bb3de15822b1252124a68f3980f96122a775fb96f05ddc3d5", + "0x92ff79402d5005d463006e0a6991eaacc3136c4823487d912cc7eec1fe9f61caf24cd10022afdab5f6b4f85bfb3eee4f", + "0xa48b1031ca2f5a5acb4dbdd0e9a2b4e9add5ccfc0b17d94818273c8df11e825193fade364e0aec10f1ff91d57d03a52f", + "0xa0af9e02a7620e7ff119c3650d59d80169edd0ad452062b0e3e429c038cdaa4f55a18495e459367aaeb6a92c98003191", + "0xa61687511b627bde7b3977e9a34cb7fddc2aaa509a7b99b6b6c7b97133845c721e1e69f99758698d82cca265d8703610", + "0xb9691fb57be7aeb9d43995b8022051f199978d6ad635e1623a1bc1754b250fb8a94985cdc1e623e98767690a417e92a0", + "0xa6d6ef51a361df2e8f1d993980e4df93dbbb32248a8608e3e2b724093936f013edabb2e3374842b7cce9630e57c7e4dd", + "0x9820d98ef31bab813a0124ce48cacb9d99b2c1c625c41cb3d6e0b21f604ee215d5f37505c86766531dc302622d889766", + "0xa35ee5c2d7800489723c78008b495e1742f0542dbb487172ef438f60424c81aa41c2397095821248066140662133f6f4", + "0xae95ddcf3db88f6b107dcf5d8aa907b2035e0250f7d664027656146395a794349d08a6a306ce7317b728ca83f70f3eaf", + "0xa36dad4f7cba9f4cc843fe40f6240e1973a4c412cae29b4a68712598523cfaecb05272fc47d30772bf06906b5a26e282", + "0xaefc682f8784b18d36202a069269be7dba8ab67ae3543838e6d473fbc5713d103abcc8da1729a288503b786baac182d3", + "0xb551d1ce88cbf4ffbdcb0113a6e319513bd676d0078dd4e6a6f23ad336c1d0fb47a4e427bdedbe0fc8f152353971f81d", + "0xa11a7496c712734aec80738e30d2bf245758b34245076149854eb209fa6403be8bb0d4e515becc881b7f3610749260c0", + "0xb38e558a5e62ad196be361651264f5c28ced6ab7c2229d7e33fb04b7f4e441e9dcb82b463b118e73e05055dcc9ce64b6", + "0x9437ce85146202d3815df7f341a182678665dfb74b96006dc9d6acc16110d00b4a02717b702a765566457710ff5a7280", + "0x813bafdf6a64a9c40ef774e6c8cad52b19008f1207fc41bd10ad59c870fda8089299dd057fc6da34818e7a35b5a363e9", + "0xa5a1f7d42220d3740b3f353de74469fbd3a75ceccb3c84d0a87e43444855be0c51116a32a56cb1980294724d36bdda16", + "0xb4b80d7fbdb1dbf1567dfb30d8e814e63de670839a8f6ff434fe171416599fef831b8e978d6498851b8a81e0bc8dfb85", + "0x971882d02ad64729cc87251b49effc0b8db9880c25083bfa0ff34e7394e691288c7cefbb5cfdc76d6677ffb9da765dba", + "0x8144a5c583a61f809f6a9f5ba97dbed42f4086de71af955f5df5774f66a3581335926663502d7cc7b5129216da225f9c", + "0xb2eedff11e346518fa54e161be1d45db77136b724d497e337a55edfc896417de3a180bf90dd5f9d92c19db48e8574760", + "0xa6b434ac201b511dceeed63b731111d2b985934884f07d65c9d7642075b581604e8a66afc7164fbc0eb556282e8d83d2", + "0x85ab3c57517e3c348e7ec13a878b9303ff9aad78ec95b13242e087ec41f05f4a19366ae169fda8afec5300065db58f2f", + "0xa51f7858f1a7832b743a114127ebee1cffe176c988d4cb2348e45d4ebc52b43f80432c7276c6a5f8bfe39a432d4412ee", + "0x9332251b4b56579b201a2fd9e777e4be80aa213bc986ed5d1187cada9b225a7ed18f1f5bf68c2839bf330e00b2d63f22", + "0xb87e5f481b938ac8a481b775cc58be2a06604549e3c810fc4734bab76099e5c617f0243c4c140cb7dd6d36a6dc2286bf", + "0x83ca733849830cb8fc2ef469e7e464fd94def561ce49ff0aa352a6ecd0e52c7aefcd69ab59f3d1ed2d5b8536d0a7895d", + "0x8302ad0f2234535b55b975c5dd752c8a555d278b85b9e04e83b1db3bb2ae06f082f134d55216b5cacbf80444e1d0af84", + "0x8c627caf25eae6764501b9eff35aa90bd4f24952cad712aae20344579e83ecd104ad1f7915edc4f9023b17fddbdb4cd7", + "0x91066bac5341cead3d2cb168fde7da62b3dcf933ff5c1d379a4dd424b218c4e2ebcce038cc342e758795ecd4dbb8b790", + "0xa17e8874e2c59a2bdc31cc67095a271d31d5a4852ccf2a82eb7c457a3ba8c87ee5beb93a65a8f7bd04d10247e63d6b84", + "0xa15ebe9ab6de62a4d1ff30b7fc58acfb14ea54d7fa513cbcb045af3070db22bf9c1e987fa26c0c54356b9e38fa412626", + "0xa2ee6c29efa982e9b9abd3c5e4f14b99d5d0369d7bfc3c8edae1ab927398dc8a147a89e127b3324d7f4e3a7494c5d811", + "0x8cde690247d4831dfe312145ae879f4e53cb26641b3a3bb9eb4d590c56c11ece3cfe77180bd809468df5cddaea4f5ab1", + "0x8dc3c6478fe0150a2cc11b2bfb1b072620335516ad322dc5a644676a4a6aee71a8680eafb37db9065b5aa2f37696de07", + "0xa35fe9443b05f6632b080d0812e71142dba534b328f7d77e165aa89b370c158be708fed2ab8d8b3c60a3f83d6b1c4fd7", + "0x8266f9cc52944d85c50ba04d421c0ecb7ceac774f4485bca84115772ade238fdb5f5bf93f1f6c5288b3a44af177042e5", + "0x995194ca593943e772c58944789a30f8a91f20e58059967fa65364e4357b3483b0f94a3fe34e133bcf967859c5bd026d", + "0x83117ec2e506e292ff4759c270b3bca2ac221fc044ee7d3a4fcdd424ff0f4b961d6d268f7b9fce9ff07d29a4cb6ee3fd", + "0xb0a47515752c15e4dbeaf9ee27fab3b5c0db82f5c685e8f716fd7d8764164944340430fe3db1a5679e6ffea5a16dd919", + "0x91babaea18cf8f1e56feb0b89f0a3956c6469bb963d63312431057093b0ea0240a36abc3b7ac160e644e826cceb62530", + "0x9302bb41f741deaa5f2b6e3bca1427a6cf98b7ec2bf7967b7c0595efa258427323a022ef12f23426ff7a7c318462f07a", + "0x9022541f84e48b655e74bf3da484179e0e0040827fc71e777b68f19bcfd0e103d385ef957692e7091fe713561f38035c", + "0xa3b109249ac2900806f0f39338da72d4f2cc6d1ac403b59834b46da5705cf436af8499fa83717f954edb32312397c8d9", + "0xa94ccbf61b3a857744aa1540fc6d633afb8ab3c92d07fceef90a0dc54ecd2133490cbaac8832b26cf2f4b956471f36fe", + "0xaa744c552b5fc41e1ac6ca53184df87a1b7e54d73500751a6903674041f5f36af25711e7bc8a6fbba975dc247ddad52d", + "0xb544c692b046aad8b6f5c2e3493bc8f638659795f06327fff1e9f4ffc8e9f7abdbf4b7f6fcdfb8fe19654d8fa7d68170", + "0x94179fcc1fa644ff8a9776a4c03ac8bff759f1a810ca746a9be2b345546e01ddb58d871ddac4e6110b948173522eef06", + "0xa3a7196fecd25e9cc7cac79c35365676e48c7be1493df255676adff2209c0719f2190ceff3ce008d08efa07c244c11a6", + "0xb746447b0c0d7165f965672d71c318f2c1052a5ac6ebe320b14165c9276c839ed822a9183ea6e6dae63a4f826d421d65", + "0xa66d5b1cf24a38a598a45d16818d04e1c1331f8535591e7b9d3d13e390bfb466a0180098b4656131e087b72bf10be172", + "0xac1af27a7c67b1c6c082f0fe733046f8b155a7d66caa8ccc40a53ac5a55a4903d598b5f80543ea52c25205b02959f4f5", + "0xa485a082dee2987e528d1897dfc5ee99c8de9cdc0c955fc38c404c16c35b71bccd08770c93102110547381a2eb9d3782", + "0x900b9972180a2c8753f5ff49fdd2cfe18c700d9927b3c3e16deb6376ad6ee665c698be72d4837b94911a0b4c183cb140", + "0xb8454e8438641340b7fc8ac55b869abe54806f873ec0f2d8fc5425a1ba76ed8471425440621763b6e9d834b6e5451b98", + "0xb3ed0906d97f72f0fd5fe01cbd06b77d61c69f059f1e87a143a5630073ab69ef8876bc2a5e261d467a7f00f0050388d5", + "0x90a908b47d0c29a2d0e7e65a212d7e1788454062f46458c519c7f2ccd794ff21d4c24b91acf42a71a509aff6544f676a", + "0xb07d7c3f1d486f5657d5935e3d67403024ffdcf25da5c460fdadc980d8d6b931de623c4f8a3da5eb6af346193eb36573", + "0x87c2989f377be3751da3bc19172c5987d21c095cc3d851ee5120f67a5b3986d387b058688d54336d8510c49c6a66d754", + "0x8e70e4867d2731901d603928d72bbeb34b2e0339a4f5cf06e7a771640717421b4ea039c61dde951582a28c2ff152ff70", + "0x8336744d8ef3a3bb3e9ed3d6b83e08cafffc76b7438adedd3a7358b32acec0e73a4635aa3166362ab4e158e68576255d", + "0xa70132fe0c9580ecce2e3c0d4a531cabe48bbf6e7d1c1daf9ed2f315e81705bf1616b4cfda1c903b074e239ac6ab4c47", + "0xa978fb8ce8253f58e1a87da354f06af989b0bafaafec2fb3100bee272dd8664d2690f8ada7dd4817bc8b06ffb1fe23f9", + "0x94274299f0faca1152cca89282c10d00b5d3679cd4b7b02e018f653257b778262fb3c6c49d0eb83ce388869c283c3c05", + "0xb8233d647876eafe2746c10c1b41d99beea28b2627ea2ecb67a3eb0d166fadbceee34dfe942aa4ecf39e0d55f9d6d2a6", + "0x980a54f9e9d88a7ec08d04edbdd7c9222e99f270b1e978ce7140cc67e38a2e60cc1034dc5b0deb5b60e10697d3bc7295", + "0x8553bfd1a163df0d8bb1424383552b85a1c0d288dc1f46fdde90ce2d9be7e2688d7d06e1d6be06252c7099588d3488e5", + "0x8e8e48992d0394fcb9a0c56bbd3797400128e28fe395ad9acf582919d66d11a4811a7187897e60ee2ab4842800c8c36c", + "0x8853eff72fa4c7b4eda77e448e12bc8ee75f5cb0f35b721c7ee8184cf030a11e3e0278a4e76b326416fd645a9645d901", + "0x88e1e459ee5aeb8b36ed004f6d03da296101106fbe1b18f9bbf63e92321db51670c34050fd3b7dc56a4bad76403823ee", + "0x890def696fc04bbb9e9ed87a2a4965b896a9ae127bc0e1cc515549b88ddbcbc02647e983561cab691f7d25cf7c7eb254", + "0x95915d8ff2df795e7baac5433887c39ec6bbb9281c5d3406a4a1a2008f96c6f266adad4824c6c46429a158e36f5e1210", + "0xaf917d086e2e327d8d9e37ff85702536d7b15f444310d4aa832a61d850c7c3f09d31b3f5fd2a073e7fd64601275b6fca", + "0xa448516054e31866b54f1951b9a03f0a54fb13d938b105e3f67396ed3fbb015f290a37fa538baeb077fb4f9ac86c8305", + "0x8e58219fde5e9525e525b16b5332ef27fb6269e08e8c0bd3c20abb89397864b2c5bb55f5b6e03e8f0a0e0b04e5f72b14", + "0xa798a0371e8cc4dc42ccd79934b0db5a3a59f18a0ae09f2eb172596428fcb3f00312e783d6fd21cbc1610317f44e08cb", + "0xa8cbb85e8f38734d95b9d69346cbcb169c149b9801d9da46df5e27b5ff8d0ab7b870c83db3fac32a90d02efe5fb8fb49", + "0xa63868892ce200c7d82d7ae041db371c91ce03282adf796c8b1a1652732ec77add0945727b110339a80596c367c97deb", + "0xa0133deca5ae8f1100df8db69920b2d0c31aa21bd3849dbaf4c264eaeaec8937ab8f982770ce1ea17e0e258910a56d02", + "0xab88f81dc77f09a2b62078e7baf4b6c7503925a7a077bb30d72f4baeff8225039c5333242e325e824f7192d4d132b596", + "0xad83b3c5e9a08161950b1df9261d332dda2602cc68e0f5ee75bfa7e03bbef9edfb4945ca1f139df1bcb8affe8ae025da", + "0xa52c5a63b55a8001b6b67c5db4fd5e95923052f03618369312896ed9892d99354aebc0dee8c3b365bafa29e211a5c3f9", + "0x973dcf44ab60f55f5d10a8753ea16db9faedd839466a130729538f3a0724f00f74b3ca1de16987d7c6e24e9467f62bc7", + "0x991a7c93f06d50ec6a4340c6751b73eb5825bad02a954e44e1e2d424af928819ebbb590c6129ce35b3f1e908e2152f33", + "0xaa48afa77d5a81cd967b285c0035e941ca6d783493e1840d7cbc0f2829a114ace9146a8fbe31ecbd8e63e9b3c216a8c5", + "0x8c01b901e1067a89471927d911246a8b2f1284e93be9913406d7c88aba784694317e22a0a7635583dae7db45cafb73ed", + "0x942772b7c7c47d4e5957ccf1d6f1450070930af3e2b7eaab0dd7699372445df0cc910e6c0efcf501887dd1adabdaee23", + "0xafc555559b435c585b61096a34a15b8ad8722b2d3306ac8cbf158b46c135b293b08a5f37b109b138350dbcd1e0da9f8e", + "0xadc806dfa5fbf8ce659aab56fe6cfe0b9162ddd5874b6dcf6d658bd2a626379baeb7df80d765846fa16ad6aad0320540", + "0x80bdb82b7d583bf1e41653966b0ba3b4fec0e7df2ff08e3fa06fd9064bca0364263e075e1582741a5243bde786c9c32e", + "0x8d5776148c65e35d717da1902d74727b3bee21ceba8d337d77738932865f1b851e810b91346f705880da6cac63183717", + "0xb9d24940937b6e50a1797cad9ca58d4b2b2d8987bb8ec056ca2f397a2bdbb7af7939c0f4bcdf5a3b6fc80f65f9d535ce", + "0x81d6fc2f01633e8eab3ba4d72588e14f45b00e68ab887bdd4ec5e8558965db21189310df973837106216777b07fc0805", + "0xaf03bc1e94067741bca4978b9cf065cc6852090fde3aaf822bbe0744705ebda5baac6ed20b31144db0391309e474ba48", + "0x8cf8412bd48b21b008f0207b1f430ed96bc6512c3712dffbbecb66e493e33698c051b27a2998c5bddd89d6c373d02d06", + "0xb9c8a3894365780842a2096da49e48f7e77f05972e2acdeae8e8fed8ddc52a1e2fd754547087bc9292cf0c868155fbcd", + "0x85c8e7e1d7ee3ed366b530c5c9fe0a353f2907d8b80b16d00391780c04e3f7e060d433539780457732864e334039474f", + "0x8a3987de0131b7461bbbe54e59f6cefe8b3f5051ed3f35e4ad06e681c47beee6614b4e1fba2baa84dff8c94080dddda0", + "0x852ab89dc28bc26f6300800d9a3046bccfb3fe1491f29030f1389f40ca452f6b8a2f6d1541c1e523f1b59f8730823488", + "0xb5726aee939d8aee0d50bf15565f99e6d0c4df7388073b4534f581f572ad55893c5566eab1a7e22db8feeb8a90175b7d", + "0xa356e5b70bc478c625e32a38d29f0a619fdeb665503eedc304d1bf34562d4b6814dfc30aee5aee94ca4bc6394e412765", + "0x8b476b3b065a3b95a3d11ec60a749c2258ddcc5885bfb50b8a086d3fd1e49ff73e1dde733b8981c3d2d206aa0c87b09b", + "0x9171a7b23f3dbb32ab35712912ebf432bcc7d320c1e278d652200b5d49ad13a49ec8e56a0c85a90888be44de11fc11b5", + "0xaeddb53c6daac757916039e0992ec5305814e9deb113773f5ecf10355cc3723848fd9c55e0a6ffb6bcff4ad65ed5eb3c", + "0xb576c49c2a7b7c3445bbf9ba8eac10e685cc3760d6819de43b7d1e20769772bcab9f557df96f28fd24409ac8c84d05c4", + "0x8a277710379ba4fababb423026d9db3d8dcd484b2ee812439eb91b4b5177d03433b7a4486e43efbf2d2ce8ccfeabf323", + "0x80e30cabe1b6b4c3454bc8632b9ba068a0bcfd20ce5b6d44c8b1e2e39cbe84792fd96c51cf45cf9855c847dc92ce9437", + "0x804c021152c3304853941847e80480fdaceba3b9676fbe018268cf77d1a1856966c2f9686bb4d4aa0c4118a7e85f83cc", + "0x901f724ee1891ca876e5551bd8f4ad4da422576c618465f63d65700c2dd7953496d83abe148c6a4875a46a5a36c218cf", + "0x90fb5cac22a22fb8a6b619f1eacd95873be974d4d5d1f7080e523bb9b4b2644eda7340d780bd1ea8ce36407ca0410fea", + "0xa34eba9a41f2307891af1825ed501b74278f67eaef4bc57cae5c0c46202c19fa0d9a5dd8b91325f6c151a0644762ef29", + "0xa5c225b7bd946deb3e6df3197ce80d7448785a939e586413208227d5b8b4711dfd6518f091152d2da53bd4b905896f48", + "0x84888f2efd897a2aca04e34505774f6f4d62a02a5ae93f71405f2d3b326366b4038854458fd6553d12da6d4891788e59", + "0xb897fa90529458bdf3cede5ced3f3823dfb9b6d93b96b81429bf05e8f1a80f7c857d458045cfee58296b3ccbc4119abb", + "0x8117fbcf61d946bee1ce3dff9e568b83716907acfde9b352c3521cfed44158874af8dd5b3906b4a6b49da2fb212ef802", + "0xb6e9fe9fa3d4c833c3beae7f798f30f07e3cdf6f6c8eb8e2b70cad51b37af2549dc9f2e7f97f194e5897d4dedb904a45", + "0xa7555d66719916a2be7a7f0c8b7001aa2925bcb79723f78288f10831f9cec64923228b0e4b89dfd4342de8f70ce03cb4", + "0xa10788831a0cb2c3d14d8bc214d92bee6e2a9e92c423d2974760d84a6872a9465d12b628f9bd8a6e777a7db6f509b3a0", + "0x946948e31311703f64d34dc6faaae992e39b7ced92ecdc01df9761e3819a6db1266be718fdf434fbec912da37d1986f1", + "0x8675d210e67eddb3cefeed200b9e205679d36d8dcad70f09e678d8d1b3eb1059d12542f3aca300f384504458a881dd60", + "0xaaa18df4ad95f7443955accf8ec206f46d4d8ad9f1adb07b143b4225590917ed7ae050fc329d54310d3d0b198cedaf0b", + "0xad77fcac9753efba7a9d9ef8ff4ec9889aa4b9e43ba185e5df6bf6574a5cf9b9ad3f0f3ef2bcbea660c7eef869ce76c8", + "0xb201b0546f19c5db88df9c684cf55ed623bdb43927d06051bd595497df741feb1485961f64e8d3d1811d9e2e9e1e54ad", + "0x836075979eaf386ff6cb459cfd48fed171ae812b0ac3b38dc24dd8ca905cac1c600be717d4a0defa0a854f40cfaf8c33", + "0xa0617db822d559764a23c4361e849534d4b411e2cf9e1c4132c1104085175aa5f2ce475a6d1d5cb178056945ca782182", + "0x9831b8c836114f6d8213170dde1e7f48d5113974878ae831fc9b4da03f5ed3636342008228b380fd50d4affe909eb54a", + "0x97b43a6d1a47a1c415278344dba0cdfa952663a71fdcaf58d313c161e479ab5d1b980d8870055cc8f0d283bec8f97425", + "0x9340bfc34ffab8c28b1870a4125c559978ac2b278f76f462b5c859a00c3ba3426b176dc2c689096ad575b4cd4dbb76ae", + "0x88ad79a0320a896415e15b827a89969b4590d4dfa269b662bdc8f4633618f67b249f7e35a35884b131772d08025bfc32", + "0xa0230bdf83cd469c7248074bec535eba8280cfde587d7c63d307149e9626bc7642b4bacc9beff2d8e8f6ea398dc0ade7", + "0x8934e9a3feababa12ed142daa30e91bd6d28b432d182ac625501fe1dc82f973c67f0fe82d39c9b1da3613bb8bfe2f77b", + "0x87fd7e26a0749350ebdcd7c5d30e4b969a76bda530c831262fc98b36be932a4d025310f695d5b210ead89ee70eb7e53b", + "0x83a9cd621beecac8baebf7df4f7ee17bf4b70aac31df816ec3efb5cfef2dc5c0bf959c5227df3a7ef4c2b8d1e1b658a8", + "0x9529ea4a51324ed4ecd855faea43846a223da8cbb494e5854cef700ebbcf4d76119cef16192e6b7c51f82ab79371756e", + "0xb15e1b4ac64bafbc4fdfead9aeff126bf102fdd125c1c914f7979680ec1715fbeccf3dc35c77d284421ec1371ed8bc32", + "0x8f1d90034f998018c3f4b5947b40b139fcead2e40aa80fdec6a4337c60e9d5ff1923dda7f0b5b1731ff16f55027d41bf", + "0x86b706c5d3c5aca72cb23ddfb6452bc70dd3b1a98c8539a7c32f760778b401cbe90ef86c12d0468892dbcbd9a268a38b", + "0x9752561179783f336937757b619b2fdcb9dfce05aa3c4fce6d582dc966182eb85ab4ccb63e7e1736a7c5fad9d33cccd2", + "0x8bb51b380a8a52d61a94e7b382ff6ce601260fa9b8c5d616764a3df719b382ec43aec9266444a16951e102d8b1fb2f38", + "0x8097b13908662d245820f3b045d8c2c665fe9a054e9c661323924ec86dfa713b36b0c787ad4dfdeb979318810e687a48", + "0xa09b2a07d861e01645accfb088f7f9ad524186bd439712775459a60f8a1fbbd43ee084e4d6e23ffce06daa189cd1e654", + "0x941e2e3ba414a371a11c3fe92cabf688ff363da6230ec7c83ac7303f652a19ebc89cc494427c456d0c2ae84c72053f73", + "0x820cc2ac3eed5bce7dc72df2aa3214e71690b91445d8bb1634c0488a671e3669028efbe1eae52f7132bde29b16a020b7", + "0xb5222582ed6604b9856a48039bd643340f4bf1bf0fc805e8453a9eb7630d6cea1452d28536706d6fa3ec16617617991c", + "0x938bbaa0ba14597067ff4c0a7cfc1529c44160d6f61cfad12246526d84fb7a1ba964d3bbb065a348cf7a98356ee15234", + "0xa83371f44e007c708dc4bcafa7bd3581f9080a4583c9be88624265014fd92f060127e628de5af3c442a25f049c7e7766", + "0x8c17ccc763fcdf2ba7e27ea643654e52f62a6e3943ba25f66e1003fd52f728e38bfd1036c0d50eb3e3e878378bcc2e9d", + "0x9517cd84390fbbfb7862ca3e0171750b4c75a15ceb6030673e76b6fc1ce61ac264f6dd1758d817662abfc50095550bd3", + "0x936f7e20c96b97548fef667aa9fa9e6cfdc578f392774586abe124e7afc36be3a484735e88cc0d6de6d69cf4548b1227", + "0x908d762396519ce3c409551b3b5915033cdfe521a586d5c17f49c1d2faa6cb59fa51e1fb74f200487bea87a1d6f37477", + "0x8ec38c68afdfb6ba019204039c2fb49a35467058f561f626fa87314d705fd615a7b9966576052be1b3690028d3c5c7bc", + "0xb790669f1acb10911e520198795b259a18471cb3ac03f3885b4fa40626d414e26025790296fd078ef5c3681ebe4689cf", + "0xb659c05488f778fca3c918505d2d849c667471af03369ad9fa29e37bac4cc9caa18e749c62fcff22856945a74ef51356", + "0x97ffcbf88b668cde86b2839c7f14d19cb7f634a4cf05d977e65f3cd0e8051b2670e521ae74edc572d88201cff225e38a", + "0x9888c250b4b60306f4ecb1babbf95d0b6dbf6186503b2024b134478d721fb782d801bafd126cc3247bcdb1ee9d66de85", + "0x941f73b2138b4347ecafcc7b8c3d03f2a54dc49f580394ed08f22b0878ee7cb63d42978f1d320c09e7dbc67648c06f8c", + "0xac3195143035cdb4ddcd5f93c150035d327addee5503ea2087b1a10b2f73b02453ddd1a94d8e7d883e365f9f0e3c38c9", + "0xab6b47627cf76d9552c723818db5ebee7734542436b50ffe15b3a96e8e7a6b54f9a0965de78405e16e309193f147108d", + "0xb7c66da483b18f08344fc3c27bdf4914dabbcefd7ee7672fab651d05127d85d25ce363b0c338d6eed55c4e31f57bcb35", + "0xa641eaa149c366de228a2833907ad60eea423dd3edf47e76042fdf6f5dc47a5b5fc1f1b92c8b96c70e6d8a68d3b8896c", + "0x805c06e565ee67cab0cbccb92b6656fdb240b430766eade3c6b0a0b1b93c840e2b4f028601451dca135c783239463880", + "0x8528cf6ed82d9f729f9aee83c3ef763d85649d46019c4ca7dfb58d7824c2003f88ddb2bc5a40c4d78d86e68b675f4e56", + "0xac2955c1d48354e1f95f1b36e085b9ea9829e8de4f2a3e2418a403cb1286e2599ba00a6b82609dd489eda370218dcf4c", + "0xb043156fcd02b75dbe940c763fa8e8a7c7f6d74c1d5395db5ce544af3b6097eab61686950535a810aa95889ced12f74d", + "0x8e7d1dc7beb2de660b7da19ebf4cfef3ebb6a3d6f2f367e2dc91105653226e859137879171dccc586c10d9c4cccee7b6", + "0xa278bea51af1de8bbd2319f3a37ab14abc3bc0289ed31aae44f38897a7b24263a4dde1cb037e1441217bec0ddcf47266", + "0x8afa23226c47083bba80ab1be55b48c90c6629135533e3e4c14057d19febeba7f8e2cabe617b28ce1f0bd97a06972f66", + "0x9865218b0eb281e547e693055456d1d0c598bfcd0138dddb5edd5f5ff66cc2d52465f3e70c0f321246036d7ed8c606d1", + "0xa3a6d1ee35cc0ed9290a135086b32f136028b320650e1f3443434af7ff52dd74c546ffe2a1bebfc329f1b52cd72aca34", + "0x812d3ded3a3c9e58eecf13a29bb4cc13b01b2a0af322423a29bb0e4f6d9021d1d87ac4af7a2a6b88d34f44a8bc1b3c55", + "0x8d7dc174aa361d046cf183dd202cbc12fed780d7053f7047e11af9aded336318bf9928aab73ebfc81ca86f12007077b6", + "0xa9fdc2209bbf48970a404de3d803c65b11be96ab5a165183d05ed6477b3a0c633c3d6f0cb8eefb430fddb5b5be8cf887", + "0x83a798f47a4f62dcb8b531d463b0fd4a876d47a8ca990710290549255033c909de709471b4e823a60bf94d8baf8b5acf", + "0xa8b0bb9e1f8b0508c7d6e7382676663d27fb27e3f1c0e991a295e59498f4a5dbcc4cf89c73d3d587fb3b8f5838153885", + "0x80414adc7e0a9cb961b1f31682c33d8e01e3b8cf2aa2c2a911ab9b1f54d5c4bf92e18466cacf9b80333112ab015136d2", + "0x82d2b1053f6610064f838b3aeec585878f86323cac357c4aed054d87595c7734729a737b29b57940884ee839e984d612", + "0x91efdbcaad9931312d7c41d24de977f94d7f3f7b88090a1f72d9a097a1e30cc805c5ea16180f463022d9b26b8863f958", + "0x90ab68c372fd01bb210fb94094adb27296b7144d964bb1dd807ea8f718181747356b0f9db3feda78dd7a596209099ab8", + "0xb40a3bae2b08c13db00f993db49e2042be99cde3d6f4f03d9991e42297933d6049394c659e31f316fcb081b60461dabf", + "0x94402d05dbe02a7505da715c5b26438880d086e3130dce7d6c59a9cca1943fe88c44771619303ec71736774b3cc5b1f6", + "0x8adb748d5fa5c22ce4c76a1debf394b00d58add9f4e08524cf9c503f95981b36b8d0cb2dfaef0d59d07768e555733ecc", + "0xa129c9cf33df42b5a98ad98be9d940207ae154c715d3bde701b7160dfe45304679fb0481a4f9dde242c22a9849fc2d9c", + "0xb3180ded54610b1b3a2db7db539197ced6a75e9bb381d1f4b802ca7cd450f5418522ad2bee3df1956ed63ff1ffe95dc1", + "0x80e1dbf3296bdfa98aeec1a7560682165d13bc628061bd3257f345aa1ba13f8bd1bea14f117af562be22118f5a8265af", + "0x8d286e63f64a3e24c2e4c2b91bafb7c6a71d9438a2ffd7288c58ec6de9db6194eaf671b39c5a462c8658ad3cfce46f85", + "0xb4f4ed1bd274a852189719a8808a8f214c8386e844ca9ba13161b75d04c74633b1d8a758ce0b23ccbce8052494c81c3f", + "0xb1a3e6baed1cc37b9a67f38648f4fe365d23fb982027ab4202c3392d5459d7995264c2e9bb8e821a3e75e71390b6dc7c", + "0xabd7248ae069d3a3a45b0ef4dd5d7d54b62994e578ea20bdd3b7876596673953b94c5b109a6e4b953b517544b915368f", + "0x9377aab082c8ae33b26519d6a8c3f586c7c7fccc96ec29a6f698b67d72d9266ad07378ba90d18e8c86a2ec77ecc7f137", + "0x959675679fb41dd62595d8266e796834c1207dd70750e304b1ce45d3fc215ceb5214d6651fc97a061b6a570eba35b811", + "0xace7fda25c2fb7c18710603c16a0ff0f963352d1582a42a20c9f5603c66f485df8383465c35c31e8379b4cb2ec15b4c4", + "0xaaf15335f1fa2a187f24f3db7966fcda52c2859113ed8f460167538f5cde43429750349f9714edda0adb6705d401d27c", + "0xab99038a2a6f9228d5d7e67f47107abaf06af293586c3a6ab1adaf02aae373e3434ae3e26bb617302b8e3a7ce5107bd0", + "0xb3119de346a02c87743faa4a20fb90e7eac404a6f81ac681d593171cb29c5f79d4d5ab761b66ec71d4a86f43e0b4165c", + "0x89255902846cb35c706f6e8869a9122527afcf8a8b8f5f81497b5b71c6a96c601e7185acc78646e2a7884d148eeea815", + "0x8c26d4ec9fc8728b3f0340a457c5c05b14cc4345e6c0b9b9402f73e882812999e2b29b4bffdcb7fe645171071e2add88", + "0x903b9bf66c147ddfddacce63c8f12f62e45638383bf91b50e2fef29013ce54a3fd8c3eccc9b8961d91ca2920ba5b0c1e", + "0xb7a2c83971c4e4132f3fcaf3c4374872de67ea5d89814492309cf924520a23787401f9621681fcf526154e80849a7e72", + "0xb74f6e53b56856f88f8607b1c4e6c9e54aec15c5bb891e7bab00e2a13caab3b1d6529bf0d72d4ce99714b8cb8b973f1a", + "0xab8a8769c754008a7976b6799e81d7bfe97413d0a79b90715703c1f8f567675463ec93aabee59277121fc4df88b5c7a9", + "0xb34d4d2e15079e7e80fdba30cddf4fc0e6c9a61f7ab06a6ea0a4e55fd5bf632c6d72e021d6264d935439d321de883bb6", + "0x927c030d5a69f0908c08f95715f7a8d1e33bed5e95fc4cfb17f7743cb0262755b1e6b56d409adcfb7351b2706c964d3b", + "0x95718b06017ba9d45894867fd67148645d25d9db2229aa89971f444641ba9db4c5c6f0785f3b25cf2cd7fadaa6adc5eb", + "0xb30faf88fe203495aa268503bc82576f76a27f8bc8c4125b4c6f6e5e7b6880d495481cc9454713e0833317fa07da9b5f", + "0xa9ee291de5997232c68c9f6c3b568b05f46bfedfa18eb3776699d98cc7c6320003b7d862564d07fd28fc3691d1d28b21", + "0x8e54c7270d2c7041796f202e929ae921fd0fcdc8ef1e6eae7e67d461114fd45ecc7fb78247c072222e48d1292a12acf9", + "0xb7f146a357e02a63cd79ca47bf93998b193ce1174446953f12fa751f85dc2a54c9ed00c01a9308509152b3bad21d7230", + "0x8aadfcf3562f1c357068323352cb1745349a27a7362358d869e617c2410db747149b993ee9e881e252ecdd42fd75f351", + "0x8068da6d588f7633334da98340cb5316f61fcab31ddfca2ab0d085d02819b8e0131eb7cdef8507262ad891036280702c", + "0x89ab1e5c2565f154f92c9b3554160832d176613f1a2f872b6ed62ed925a33fb0b40b71b7443eaaa15099ab24693c8d13", + "0x8e9bccb749e66fbe47296f5dec33bd86e52987516263240f35ce9a212dbcf71348b60a016f830f2acd05482962403542", + "0x8fb74891a8642f25a55b5eda5818367aac2fdf9663ad1e3dbc0166b484c0cda581b243cc75131167f1afa9caaf6705a0", + "0x8027bc62b59f9f15613e38da74ccc71fc3eaee26f096d187c613068195ce6eb64176013f2d86b00c4b0b6a7c11b9a9e5", + "0x8658a15df961c25648fd444bdf48a8f7bb382d9212c0c65d56bf9cdb61aab3bd86604c687fb682260dbc0ad2dc84bf01", + "0xaf76d2de3664f45ed4024f1b944cd316cf758393232bb07bc695e5eaa7f04e7e09007f29e83f62ef6fa25d1000113ca9", + "0xa3c4269e6fdb75882f0bb83529388fb8e08d025d00d869a2ceefdbd38a060e59535bca43012815444cb84021787f6c7c", + "0x8784a8fa62e0ce23283386175007bb781a8ec91b06fd94f22a20cd869929de37259847a94a0f22078ab14bb74709fac6", + "0xa99cde5c7c85ae291c74c893e598cc0e6eb2dda2a81dbb504a638eb21dd2c41d6e5caf7baa29e3c1c32e94dca0d791f1", + "0x802f512bd4a97487491c0e07ab8a94d5580c72212032e34c42b7039b860a7cf8f1e2e24b7185b80d3ee00a9cd4c92903", + "0xb12fd5f747c5223c5150dca2728bb3a363c5bdade5a9d1415642b2201c51aa6bba20a988c51bb6452fee7e05a8586b42", + "0x99caf2cbdd4427666fcfb506bb6956772e058150b0638eacd5db2e8869c8565c1ff2c63f308bc3143874e0f31446292e", + "0xa9d47cb4c69fde551b2648a2444091502a56a778212ab544ac75cc1bd14d0f043f4e31de47fce9a890ef5428cc28dd41", + "0x94240350a53e7715c178382b174c4f918d35cde875faeda528c2f32073085c6032b47fcf00240dc264621041c105e0e8", + "0xa413befdecf9441fa6e6dd318af49173f19e8b95b8d928ebe1cc46cacc78b1377afa8867083be473457cd31dfff88221", + "0xb7c4e55e2b48ba55a71f72387475886e5b4715100e93cd2ae09582fd37e5646b54bd93fba311b65c842bd0aae1424bc7", + "0xb7ea5e0d3cfcf0570204b0371d69df1ab8f1fdc4e58688ecd2b884399644f7d318d660c23bd4d6d60d44a43aa9cf656d", + "0xa7c2174eea2b66b2a71cc8095fae39c423a353c7d5020ec2d0551317a66202fcf082c6119ba768755523fff49791bb4e", + "0x991e0fc7fddd0e316cf4bfe20478f10c15b8bbb618e6be52a5095e457ca52db8adc008f47d4624b6cf4f7d6c2b94a29e", + "0xa7d76c88daa3ba893d4bd023e039e1f587565d317609cc9ddce73f2d3c4d6d9facee20fca31c85322f10fdf15267fbec", + "0xb880555398668dc7d064a18ba82d574999a93a6843423703aa8e543fc196607239de7a4258710b85563f2889eacdd0fb", + "0x903f569a8de771406b9fd36384f1fea20d5d79374b8d9af24b4814f96c44739193662aa47be857543fa101aa70ab205d", + "0xb9ee3b7b95db0122edd90b641de3c07fbf63a4f70fee5f72051cbe25c92d88444314d0489a5ecdb1805f4f149f462ee6", + "0x8ee41011424da5e2ecea941cbf069ea32420749f2519434d3d8f9725ac789753404687a6745cffe4bd5dfc8fec71a719", + "0x8a978ee4be90254fd7003ee1e76e5257462cbb14a64dbca0b32cea078908d7da47588a40ffeb42af11a83a304608c0f7", + "0xab73a043ccdfe63437a339e6ee96ef1241264e04dd4d917f6d6bc99396006de54e1e156d38596ba3d15cb1aaa329f8f5", + "0x9439b663e4104d64433be7d49d0beaae263f20cfac0b5af402a59412056094bd71f0450bc52a294fc759ca8a3fddfee9", + "0xa53d2a4bef5f3d412fed35ac375f632eb72a6650efe811e2131a6ddcb530f88044f65b80b7d739998115b9f961bbe391", + "0x88e7a12a90428bb45bcf4b01442c11607433211fc2f9bee9545304eb66e0b4b5339360160bc782e185391385da7c5ad7", + "0xa163470735c16f800bed412bf0190d7c85cb2d3d588ffce245ec8e8d4872c756a109367e293caf4f5c0ca1ad31f8be5d", + "0x897d7a19b70dcef1af006df3365981d73068c81f18017f32fb9966599481496efd5f6caceef943b31c52750c46d9590d", + "0x90f4476224b64c2a5333198a4300ece8b3a59ae315469b23fd98dadcdceaaf38642d2076e9cd0bfacc515306f807819f", + "0xa8d152e5d94b75cb9e249230db21af31de4d4f3d4ef60ccbf2212babf69aed2a38435a993ee2f13cca410ad55a4875ab", + "0x95aafa379cc6a2b4bdd0cad30b7f0a47839952af41f584219ec201c6c4d54610eb2c04b67b29080acb8cecc5e7543fbc", + "0xa8795e7f4c4c5d025ead0077c3aa374daaf9858f1025c0d3024d72f5d6c03355ae6ac7418bf0757fe49c220acff89f7f", + "0x85e2013728a13c41601d4f984f0420a124db40154a98bbe8fddc99e87188b4a1272d20360406a9dbae9e49bfe3f1c11c", + "0xb380ee52038a0b622cd7eccf4bd52966573fadde4fe8f70f43fa9c43a5a99b3eaf58335a1948b561f5b368ab4e0710f6", + "0xb43fdb2ba9128fd24721209e958be7b9c84dca08387c982723f93ed4a272f933823ae084f1b1399ff6271e0da6f5aa3f", + "0xab2053c376c6bd113b89fdb2ae3b8401aa891135345885730c61cac7813f69ea7d906c531be752e28657f73af92d1f4e", + "0xb586e67ae1826a1cdd651ac785e4b38f8a0e042f103a9b7dbb0035626d5dec3ded04a4e2cc09e63b4b01aebe304e40d7", + "0xa86be58fef115445b909dffac6f51da3fe9214afd9c31fd564bb8f39b1dc3cb895b1222f2c63226b54b60b278ec45edb", + "0x8016d3229030424cfeff6c5b813970ea193f8d012cfa767270ca9057d58eddc556e96c14544bf4c038dbed5f24aa8da0", + "0xa8b593de2c6c90392325b2d7a6cb3f54ec441b33ed584076cc9da4ec6012e3aaf02cec64cc1fd222df32bf1c452cc024", + "0x860d581af35d522b5eb5fddd92a98a6b4cc483fda00820d1ce4530e07892890c096e99b33976ca3550bb900e830ad3b6", + "0x82212706111fb1cf5def02b5b0eb7ae9e6ea42b4c7a2b9fcacb7aec928326edb9ac940850dd933f2822f6cf519de0d50", + "0xa98f68569ced00cf2c9f85fe0b4bcaabed0652b9fbe438bb5a86612a0addb5975e3b98395f2a4788639c602cf21a8494", + "0x8600e2031c9113ad2a75c19872b5efef85765b524f74de98baf4efe4a75c6be563e9e19622388fbe9afe58aa6017b930", + "0x8e825c03c8409a3302266dc5f47fbfc381dfbafbadc37bd8d40f079ca8963d4c5ae6ef0d0ba6aef2d4688736f5f6bb45", + "0x8bff10f91b8c0abb6c9542588da17fa0118ffda4c82626a754887e333d7d69661b3ae4e400da15c49565f8d10a77d0d7", + "0x8421044f794a1bcb497de6d8705f57faaba7f70632f99982e1c66b7e7403a4fb10d9ef5fb2877b66da72fd556fd6ffb0", + "0xb504cb87a024fd71b7ee7bed2833115567461d1ae8902cccd26809005c4a56078617ec5d3fa5b29a1c5954adc3867a26", + "0xb5f32034d0f66bcbccefe2a177a60f31132d98c0899aa1ffff5ebf807546ff3104103077b1435fa6587bfe3e67ac0266", + "0x9604659740f6d473bd2c470c6751f2a129328e74e01b23368f692ad9b6cce0fe1509c3f82e9f01019b72f6bf3a8e4600", + "0xa6ae4fd03fbb4e2150795f75a241ab3a95c622b4615f553bab342a1803b86b1c1a2fc93bd92ee12786bf2de22d455786", + "0x8f142bde50abe4dac8e059003db41610436d5ca60d2dfe2660ecaa5f9628aeb8b5d443e1b57662076f77363c89a1479d", + "0x919b0dca4050f3304144debd653bce45768355d2faa698b99de06ca6ab8573a285764904cafc9262352c87d9287f0545", + "0xabf28b692bed19ee9152d5f8ade776f0a42a9762ea5f37d80f47ff219fc0a8ebe5e6eb920453e1ced3ea5bba19ae5be7", + "0xb67146b202afec0132ac0070c005cf664081e860339f8f4d45ac3e630dda05560936e646673e652d08cecd8d18fc64da", + "0xaa25208385573caee2a4830f09e1cc9bd041cdb78d3ee27a4b011815a62d0d2e0295c222480947ae427b1578fb5509f5", + "0xa35d9d6d5dd5428cce7616842203b5fa3721cb4b20f50c0113f138604954fe0cf214ca3d065b578f921054b9efe823df", + "0xa1c0c317e6e352e16e25c140820b927161ce5d2c4c2e10bca3057ba4d46b4f42ad7aba20de86dad9fc6368ea92695268", + "0xb9ed23f3f26fc9f31e1e30e8ae88482352fab6ef79a2eb8939dc78110580708f482ba3ab306ed6e09030653b9704a80e", + "0xb15978155af006d231888257c6e4beac0d3b0782bcbc99e61802a5c031252f05213c9ee9465e6816d9702e4a21cb9571", + "0x8c9fefe233d0d657349b7efcdc368f5aaead27071d224af780874751e7d241f6b88f7650fbb4133043b24bbebc12aa48", + "0x92f0bf3257e775c5c469cd9a43249421c9fd223996aeda09654045b885a512e86bd834b2947aef216b4d9dd5f8f2e9aa", + "0x81ad5baedeacae12f19cc6d268779c791ddbdbae859d218806cf887b91e83bee3472740b0736877c81c5c1969eeccfec", + "0xa54e104339286d3ce8271828fbac20f6cf7afd3b72d9b194b7cbaf65f6612416117be492bf4aa88faf6ada56cf4b6462", + "0xac2c341f0054876d28393d5125c84b913e754bafdadf769ded764b8dcd4b042b5dbc19b6f40ce8eb45edf7639b3d62d3", + "0x8eebee05702bf1574b12597b72a86d5badef064879fa9d1b9aff5ab75e5c71d81d8bc404f2614085855d6ed87f581238", + "0xa5a07bf219432e9c80c38596c93560b49c7de287f31e30b7a06fcb4d15982add4a24085adbc5b753c462be989c64c96d", + "0xa3d31b20198f326eac488e88fc5b9171276d4934b0bc573c8b55b2abd26380d5296d5bbea281de91c0945f34b37f42bb", + "0xb928a1a20f078a50f9c67da1d909e6656c3980f20b96bb8d06c0cc42557ccd290ed64cd78f9c9ca090cfdb9327eebd89", + "0x8a0a4b295761aa6d2d1b988fb0c65b4338cc3ea48410cc673671ca029ba6c51fd4e101b54472eae93611faee53d4eb2f", + "0x935f616bc620ddcde07f28b19a66c996798792b953264d1471f686e84f3c6f125e2a3d3a7a535c4175973c7ed2e4bece", + "0xa80deb10bba4bc7e729145e4caf009a39f5c69388a2a86eaba3de275b441d5217d615554a610466a33cfe0bbe09ef355", + "0x8dca376df4847cb8fc2e54a31894c820860c30b5e123b76670a37435e950f53312f089a8e9bd713f68f59fd1bf09202f", + "0xa04016e9e13ad845763cfe44af4e29fecf920b4aa42f581715fc34fb9ca27776feee45c82093c7274839eef1838b10c4", + "0xb8a0003e949cf994b1bb25e270cb61358200c93b1c6f611a041cf8536e2e0de59342453c5a8d13c6d4cc95ed8ce058f3", + "0xa50ab79cf3f6777a45f28d1b5cdad2c7ea718c60efeeb4c828d6307b29ef319445e6a9f98aa90f351c78b496575150c1", + "0x8253e3b0b85538d01b0ca90b0a1656ad80ee576d0c3fa6349df58df92683b510e56c524fa6144f79a5525f41e4a2ed34", + "0x917721639b1bd13c33ad5b332e4486c4202ed28ddd9fe97b4d2367a87829c742c9e4bfb508827f4b8cadd0bdab99708f", + "0xb0b8c15d67a443907315ba3e94a89491dfbfd04ff9238d856f46cd49a3324788ddff3be9d61b2987f6f5a3c7d852133c", + "0xb2a4000ce0ddd3f0543ebfe4906570853a85350d75418a1ff2608099c069f03510df576ea0cbb406b7ae8e4f21576811", + "0x801c126abff96fe9b042be8869d2907d0c6963a79901f9db46577a445418b7465a1f4b346933d433e539536a9a2df01c", + "0x9530f92929f61f9afeea5737bded7aaff3078367aaf65b2c75f0f4263b6e90990a2bf64927774c4f0289120d49558d6f", + "0xa065363b9c4b731b08fd361081f93d987ad336475487dd28bbda2dca92b0b5da4edf326995a4ae923a4b2add7aa1df4d", + "0x85c216e314eb7bd8ba02e092c90e132bc4bafb21c6a0fbe058b0dd4272cb76f183b83c6783fc321786065ff78c95f952", + "0xa53658aaddc51e20752454dcbc69dac133577a0163aaf8c7ff54018b39ba6c2e08259b0f31971eaff9cd463867f9fd2f", + "0xa013cc5e3fbb47951637426581c1d72764556798f93e413e1317849efd60f3ecb64c762f92544201eb5d6cfb68233050", + "0xb7e5497eda543c02a7b3245eece98d21dd4c587b5a05f21b5c785756a0b875715782f706fbbfeaa0edaa6faa6b03d8eb", + "0x8ded37d67b5368619a090266e9b5585fbff60319a90a4244a3c3342641f5bfa5130998dd97d7a42505cd896c29255530", + "0xa9b120a77d70c1cbc0178a12d97a78b2dd0b98d0584e8e780b937800ceb18c90eaa1f0a83c5b50e34cae1c20468f004f", + "0xa22b351f139096f9ed5baafe27affde1351685765805d458381e392e0bfc51cbd8af5909b3a1da05d0d176877028eb32", + "0xa16938f556b8c11d110d95b8584cecef8b95ef349ea64b59df806cc62c52ee48074d0b3f18d84533e41583aefd6a9d43", + "0xb95fc0ec39596deee2c4363f57bb4786f5bb8dfb345c1e5b14e2927be482615971d0d81f9a88b3389fac7079b3cb2f46", + "0x89ca7b7aecbb224d04839d36e4b323ae613c548a942830317aa0d51a111cb40d7e6d98600dc1a51e5a32f437951d6c7c", + "0xb28df3e04bde4ec373171401dbd0546f4cb6fa8e9a4a8019aadc653d4e05e0b5b9a64417715dd87f6df9e7b3145f6659", + "0x89df46082b8dc997c3e33fa94fb6ebfd19af29d619ed4d861f8ffcf83d02b9077b9754d0667c2fceb7aa31ab5f806f65", + "0xb0c707313762e66c681b0efe03ca11a49791173c1e5d42b235c3370e98c37ca4393e6babaabc3933e3d54e72843337d8", + "0xa4bf094dcd71e1a8dccca76dc7887476154e673551f25b0ca90d6dac8b3b3a2241bc601afeeb1564bde0432db1972999", + "0x8f88615a86867c4add4c6dbd2c717a7d5c9e6450e9540b56de14c31d9ff84e2495aca3f1d5be51940c183c6ced9da2d4", + "0x81351fd284d6d07092875f366bc5e53bfd7944b81eece85eab71a00443d1d2a9fc0337aaf34c980f6778dd211caa9f64", + "0xaf7616b8f2f56dc68e3e8ae5dc5dbb4b027e53ce652860687f1b15b2f820ea0349baea5af4e3ba4d865429330d3383d8" + ], + "aggregate_pubkey": "0x90ad8bc2718e8464a78d43480f280d3ae08068ad88c2686227ec6a25f4393099e7e21b6200e83ba1a8fc34a9c08f5069" + }, + "next_sync_committee_branch": [ + "0xbcfe80e1d24fbdad7bc058b011403a4c26cb56967654494cde51517f888023f4", + "0x621312d94927fb6e3633ca6b4a8f61e8fbc72799bd54639043f1abe818ba816f", + "0x16fc985fc30e89dee4524512296e2a5438c4c68d8f035d3377cdbc2c7f9e1804", + "0x88c597da85b7b1a0ca4f2e149ecaa3eb869e60e78e5127db801706005d3d0d3a", + "0x7b3e52c66c24e912c1c7aa3207753cd882ec3c691354ede99ec716da5fa0fe3e" + ] + }, + "finalized_header": { + "slot": 4063232, + "proposer_index": 1311, + "parent_root": "0x9f5209af620727873d563ec0386856f5100df2278ee157f8b058021e29a2d0a9", + "state_root": "0x9cfb7a4ceeb31d6be6dba26dace0a074066152dbe507e328886be16e8b38bd9c", + "body_root": "0x9b934ad271680073ffce322e54a0ba990caafa9a0ab95195e4553aa5936d3f41" + }, + "finality_branch": [ + "0x00f0010000000000000000000000000000000000000000000000000000000000", + "0x3d4be5d019ba15ea3ef304a83b8a067f2e79f46a3fac8069306a6c814a0a35eb", + "0x452c63d803b8bf301447a73b2f7a747e49f37f9c9a096d8ddb6c8302666b809e", + "0x16fc985fc30e89dee4524512296e2a5438c4c68d8f035d3377cdbc2c7f9e1804", + "0x88c597da85b7b1a0ca4f2e149ecaa3eb869e60e78e5127db801706005d3d0d3a", + "0x7b3e52c66c24e912c1c7aa3207753cd882ec3c691354ede99ec716da5fa0fe3e" + ], + "block_roots_root": "0x31ed28275cbaae8300426740b8f08d2d31b0bebac67939a5f6507adc361458d3", + "block_roots_branch": [ + "0x7fb8181acdb3d8c6c5e2db5dafd701f1439abfaf2da9435818dae5cc47683035", + "0xc439004cf29049836d890c28867350dc62197484a9c97ca0fcd7be38904e826b", + "0x433cf8bf2df73fd85edc9445bd609ffff88cdf3eaea77b593e3aa48e6648666e", + "0xf092d3324350b4889c0a16d9c2ed940798360d33e5d82b32e0049b6b25cad0a8", + "0x565c0d114cdf1e419edfdcda9941aabc3d9bb8ebf07a4afea082ba1ec2083331" + ] +} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/sync-committee-update.mainnet.json b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/sync-committee-update.mainnet.json new file mode 100755 index 00000000000..22a44e3cf79 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/sync-committee-update.mainnet.json @@ -0,0 +1,563 @@ +{ + "attested_header": { + "slot": 4055104, + "proposer_index": 1862, + "parent_root": "0x5f44df1f70338aca4b3046f9e5b144bda8b27276320ca000077389d0aba35317", + "state_root": "0x9daecfedc819b45231bf93819a73efd4304ca79528032fae2e852ebbe514cfdf", + "body_root": "0xa33f5cdc6732684e6f248e5a7636c7e7bf705f0bf709098a46ba15c660b4fc65" + }, + "sync_aggregate": { + "sync_committee_bits": "0xffffffffff7bfdfffff7fffff1effffef7f9ffbdfdffffffdffbfffbbf7ffffffffffefdf7ffbeffdffef7bfffffffffffbffffffffffbffffffffffffffdfda", + "sync_committee_signature": "0x880f147850ac0a94130b81f94203e2f69d512c929df8b954b6adc20cb1e8598aafadf366c074b590c0905d584dd980af18e0c8a837bbcadf6b4438507aa46ef95879c0acd9c2d273ccb13d93e4938e9c601f0dd466f53369ae94e1287955cae6" + }, + "signature_slot": 4055105, + "next_sync_committee_update": { + "next_sync_committee": { + "pubkeys": [ + "0xaedc2d47fa2662be6ab58ddd3682bd5e53f508162968fce8326c75f92fb3c1a25c4d4d0e6904f9b6cb1ccbaaa9dc28d8", + "0x8097b13908662d245820f3b045d8c2c665fe9a054e9c661323924ec86dfa713b36b0c787ad4dfdeb979318810e687a48", + "0x98aebd4bf15916512508a5fe89d814d5d76423c562cd3f0a0af504c8cde53be30f4df00e3ba0229cbf8528e198a0df11", + "0x86bba46d0031989d0f1baccea4174fc3fa0d595e60d35a464e86c33c233e2d6def84fced7a00f59afe397cf4fb5b67c5", + "0x845982c2672fdd44b33d2e56ad676e704c02f756b09e8765bea42b924c14724484567b55f0db42ac20cb70a7f5201c14", + "0x926dc729e135f1f0bff4662ee3d6823a64597fe189b763ada34f246e77705fd4e062d85506a338e9fa98c4d225a3b27a", + "0xb930ecc2a26183240f8da107e80979b59da4e05f090316d982815ed6151d7750490b85273187ec4e07eb221813a4f279", + "0x81564bee5a3bd09476f658cf7719326c353485e2f4fea58d110071c5dddd3cabc349a8d1ecea45d589ed4479952a2ba2", + "0xa66d5b1cf24a38a598a45d16818d04e1c1331f8535591e7b9d3d13e390bfb466a0180098b4656131e087b72bf10be172", + "0xb9b9b6113301bd2b409b71afa1ab9e31d22f84f8cb03badaa408e1d37032350094124e533de766622d7975a047fade6c", + "0x8eb3b3e3135720036c1120c4e8b8d405b00d002f2bdbe601a06f2c2fffb940a9966d18636ee34fc003dfef547d8f3b76", + "0x898deb30ede570d391266c81132a78239083aa9e27a9068e26a3bc14ff6468c3f2423484efb2f808b4996c16bfee0932", + "0xa90d9502a9785e55c199630456fcb1e794bbeb0f5f8c022e66f238a0789998b126cf9911fd0b7d463b7706dc6f9ec128", + "0xae8af784224b434b4dfa9ae94481da4c425602097936623e8abb875f25deb907aa7530bce357786a26ed64ef53d5e6b3", + "0xb544c692b046aad8b6f5c2e3493bc8f638659795f06327fff1e9f4ffc8e9f7abdbf4b7f6fcdfb8fe19654d8fa7d68170", + "0xac5c01c51dac6ee1cb365c9b03f09906d9b7b9b4d1b73c44d9e8e06823025d7070f242898a975420bc87d6372382cab8", + "0xa4632399c1a813e41fb2055ef293466098ea7752a9d3722d019aa01620f8c5ecdc5954f176c6c0901a770cbe6990eb11", + "0x85f7ae1a7a7c793c408750ddec2d7f58b985fc3cdf9fcf6b2192bc57092b8a271b2fb6ced0639baaffe0bec3203e568b", + "0xaaeb466f4316874c2107a0de38dafafa65ce50039c20723e8797815238011426f4e77e29fc573e7c6d2df85c1bbfefdd", + "0xa8fd63da16dd6a4aa1532568058d7f12831698134049c156a2d20264df6539318f65ec1e1a733e0f03a9845076bb8df8", + "0x93600f65c090814cee5cbd5f22f98e79c69e63510501a0be6a74b111e4c52441133fc1c198c7bf235f9005aeacf1d441", + "0xa69f0a66173645ebda4f0be19235c620c1a1024c66f90e76715068804b0d86a23dc68b60bca5a3e685cce2501d76de97", + "0xac6e7e9960207138d5b4b6a7f061756c01cc4a830e5988423d344f23544ed0eaa790aed63a22df375768f670cc9b9bd4", + "0x93042dd42e56671155bb40d85d9d56f42caf27bd965c6a7a7948b39089dba8487d4d5fd30522dba6ba392964e3ffd590", + "0x85bca2f86423a09014b562f7dc613246bedffdcb3aa41fee02270c13e6b00c8d6704dcbfbafc5997df6a90c7fc08c29f", + "0x9550072f64a48cb86bfa224d492be9a91e5a6c9def04b6a290b7a19d96981937d5a2c35de6515d1881bcb167f6e3d661", + "0x8d797819318cdf7b26405d1a327d80d4c289e56f830b28d4e303bcb019aeb0b3d69bfed58adcde8a2445dd5281b86af1", + "0x90c04eb3f3679cd630434418cb3a225a73254887692429960bd45b1613f85b2c14723cd8c7f1e875588ed82b7f5576b7", + "0x9953a7cbc152f101a60e3e381f2af17ebe7401e16ef6462d132b8f0f6c6a18837914a1299d1605f9f289b9561112f4bb", + "0xa9300a33927335f482dd0e44d0d57704ebeb278f732ae8301073cb7d5e457f02a0cb03268de71d284b8c23fb96947469", + "0x88554c83648ea97dac83d806cd81d92531980346b208d281fba489da15a0084fd4d9a00591d1ca67aad3c5793685d55f", + "0x9131874b09aa95ba186bcaa9e040fabc811b9c7b905b7dc79e902cf2bb5816d7ee39b0b55be609f22bc8c538760b2037", + "0x8368bb9b9bb2e17730c42ed1100eb870c88a8431601312aa8cb1e738cdb9ca2704dfd432cf1703c0db043259819631dc", + "0xb49379bbb9f954d2ef5574199607bc6b3aa2cc3b48dcc3745cc77406bba2a394929844fec1b87c4ce65cd0ca0f83062d", + "0x876afcd045c8a18967923733a3a43757652289b0974cd348238a693f30bb57f38664ecb97877a5e5f7d0185039a2bf54", + "0x8db19f6dd3789df179ab606508ca7e3da7967ad4340f630bda83df54c197d6bd3a14980c87fe10cbced7678c0c300ef1", + "0x997a91da55801acb6134d067ad65a9a44ead0b53d3871bb97b46ec36149d25e712d7230d38605479796190abd3d134b7", + "0xab1abf9cf630d6cbcac0c503df44603142ac81acd647784ae0e8fc97800ef04378bc9d7f2087f959ad4bbbeec65b8dfe", + "0x95718b06017ba9d45894867fd67148645d25d9db2229aa89971f444641ba9db4c5c6f0785f3b25cf2cd7fadaa6adc5eb", + "0x8ec38c68afdfb6ba019204039c2fb49a35467058f561f626fa87314d705fd615a7b9966576052be1b3690028d3c5c7bc", + "0xa5d72ac4cdcd847d67cb5a68c6141cde99a91303ca84165bbdc6fd7f643422faec783de60739e1b2753088280c90a68b", + "0xa778da56ddfe4a383816b43b027464d7a28689fc4a6b35b36883d3f36d9c41f0177bdbfc8f258afe8da90f02d3b64fea", + "0xa2ab566033062b6481eb7e4bbc64ed022407f56aa8dddc1aade76aa54a30ce3256052ce99218b66e6265f70837137a10", + "0xb9c347c1c350fb7ef6ee9ca6780cf0604f30e3a74e9d0234bca6b3e7faed26148f2b736d9fbff6b04f5b947fda458e8c", + "0x815f53751f6d3e7d76c489f3c98d2b49214938cac8c2b417e2d17bb13446c285fa76fd32a97e9c4564a68f4faa069ad2", + "0xb3f1319ae34ad1d59207288f01d3d7b7e1bad7733fb4a819a09b011d72a4d736bd3c7afeb74cf56da0e00cf712042ad2", + "0xabbfb501071148e98b6aa56308197356fd993c93e27fd58987eca82036c1ae0ea89f9fb1a06c82851234643904c58453", + "0xa0899189bba608887c6cb729580e570ecce9ca7107865ebd30def867afaaa250bac407c30dbee11b7ef6cd423269a8fd", + "0x88e7a12a90428bb45bcf4b01442c11607433211fc2f9bee9545304eb66e0b4b5339360160bc782e185391385da7c5ad7", + "0x82714b00a822c30b317ffc1d4ba163990cc1ffe5769f91906a7f71ad1f62b39865a5314433a4ab2ba762b1d62b01003e", + "0xa3a930dd70aeeaff0f2e3790927d5425db40467ee106261615de5fcb937bb1621be213ccd8b3a14d96c5908bedc2e421", + "0xb2902161b565dd5b8e8c54187b26f01741a39ea8bc1120598661bd367cf8fc73e21eda2f0f6f9ba2270c80a59ff5985e", + "0xb77cdf45f39bf85ab3e8c8afa602f159de8352188aba5378957d468315a2d2326daef83d8ac6b227f1e7a514488afbc6", + "0xa9e573274f5a131d6c7641bc0576a2621b6466a5bf2cecb21058160a854b1b9e0be176da2b6b9b3ed562fc36c5f09119", + "0x876561bba29e656b7122f1cb51a02dff1ac7d470217d8a4799c01e61816c4660eea91843a5a42502ddf842d2daeb0586", + "0xa0ebae60a998907a19baa396ae5a82bfe6aa22cf71bfca4e1b4df7d297bd9367bbeb2463bda37aa852ad8fd51803e482", + "0x84a6edac5ac68a7ca837c46d5ada8fab136748b6c3a3b9165dbbc231ec386b15328e4ef7d69a15d4cf354135348a4ee4", + "0x8b476b3b065a3b95a3d11ec60a749c2258ddcc5885bfb50b8a086d3fd1e49ff73e1dde733b8981c3d2d206aa0c87b09b", + "0xb48490c5a3bc9e66cdc78994f7c73e0f2724fec8a304b4147799e5142396df155ef7c42065ed6d2c0393d138fb4d2a0b", + "0x849ddbdc3ac55ff22a3b2f4bc51892fed694490ab4dd342165ac38c725c8b38921eaefe3c443962925fc3726aa41e236", + "0xb49c45d9da4aaa64967c28f1fd77b7f709f5a331b58823eb1613856fd8f92635135981830a287e8dbda3a0e0fc481c5b", + "0x93ccd8c5f82374e0bef6562e16576f742d79b6f400e3485ef36e148088b61fbd882c3d2bb38ab0b43fa1dac77f31d543", + "0x81522576ae4ec9358f1a16934cd1c1116de609634e68f552924a972101eb7215f037ab8e0582d7b13541537d55554d31", + "0xaad60e58a19598c5013b37e2e4adc6721eaa7e6e184960d1dc4e6f012246abbb58a047c0679064d5eaaaaff02de881e5", + "0xb4f034f2b53ff9989e8a0f12c1484c58ed7942432a429af58a6659feaf23f7d2bf20ff7b9a7e0a28a2e09c9a730681d8", + "0x88b2c68b425269850c1a4f4608aca194da5c641adeb99e2f7fb92e34b8245dff066e73bde072be60f7f2c3d3d13de3b6", + "0xa749ab53fc2662a0796489be84fcfa59bb723ff748bd8980df0cb4b3d1e2943845b0d7c67576fa0a33c8b0ff8a86932d", + "0xabd7248ae069d3a3a45b0ef4dd5d7d54b62994e578ea20bdd3b7876596673953b94c5b109a6e4b953b517544b915368f", + "0xa49da42c27d019a21cc6489ada7b712b98c4ede28ba25dbcfa916acef48446a2baf73e03a48be763378a09774d4a03fc", + "0xb3c36fa39f668bbc3fec028875a820057dbf96f727bb423280da96d5d50e885d23bc23fb73457bf79089691ce7663a7b", + "0x8dca376df4847cb8fc2e54a31894c820860c30b5e123b76670a37435e950f53312f089a8e9bd713f68f59fd1bf09202f", + "0x95d1f944b0c53eb3e9fcd5632713602bbb9195b87a172a370ae2df98504612a55f3968615a39b569ce6a0fe9fb559be7", + "0x8c9fefe233d0d657349b7efcdc368f5aaead27071d224af780874751e7d241f6b88f7650fbb4133043b24bbebc12aa48", + "0xa2ee6c29efa982e9b9abd3c5e4f14b99d5d0369d7bfc3c8edae1ab927398dc8a147a89e127b3324d7f4e3a7494c5d811", + "0xb7ea5e0d3cfcf0570204b0371d69df1ab8f1fdc4e58688ecd2b884399644f7d318d660c23bd4d6d60d44a43aa9cf656d", + "0xa07826925f401a7b4222d869bb8794b5714ef2fc66fba2b1170fcac98bed4ba85d976cf9ee268be8a349ae99e17ac075", + "0xb0a47515752c15e4dbeaf9ee27fab3b5c0db82f5c685e8f716fd7d8764164944340430fe3db1a5679e6ffea5a16dd919", + "0xb7de6d7a4afb05984dce153e5570b104338265e45c8f0156f4d45c458f47add234a479e01c02d3c1817c170b5b65b100", + "0xacd4d1e11f81f4833353b09d4473ec8b15b8ff31dbf39e97654f5338a26c4020306d51018f1f4b9c4efdb92992408a6e", + "0x80e09f3bf3ea87d48e04b53d8f3b43b7e53d61f445f8c8a5a35472b84f6bb4f58f17d9832f5881bb44fc06156151e5c5", + "0x98d6d46f603afebcbc561c130e416d5a588a7e6c1f17f89ed6e30538b7f8dbf4b3c75b8a3331425c4ca21e03fe8b57f3", + "0xab671eb947490c43fd05e42a787344b21af89babb705393c82748eaa0cfcf80bee498d275a1eaf1d647ca3b2923d76ea", + "0x80e1dbf3296bdfa98aeec1a7560682165d13bc628061bd3257f345aa1ba13f8bd1bea14f117af562be22118f5a8265af", + "0xaef456af90354ff88039d2dde02b0f5a6790aa762b23e0a9da8c6ec92c3b8b3320687bb21666608b4a22615843afd1ef", + "0xa5a07bf219432e9c80c38596c93560b49c7de287f31e30b7a06fcb4d15982add4a24085adbc5b753c462be989c64c96d", + "0x84d2eb008578aebd6f01254b7e46584c1524e6fd7a5a2ae5fa0ea560865ca50d52290cf2d12dd20b042f402e62181b4d", + "0xb8e5226ad3515627ae6840235f5f7b7ecd54e8f01079c324d126ec852f6665ebb77168b3f2b3b51580e04a6ff602d5b3", + "0x8c1de4264e04ff7e8282faf81c0bfb5943656451be52170211cb7adf4ff21bccbb789400735579c622f69982fcb8e9c6", + "0x90bfbe37ac3992432e68c95c0d4342a9712126d1f50089239c9f4f6c0c202b54334e08604d245b97dc8e8f6706f6992c", + "0xb0a771b9a0dd7e352d46c8efcc1834e610dd097711bf7117678a99d386890c93b9b901872d4dcacb6dcbcf3aea0883ea", + "0xa4eb903990bee2374b14fa66fc262d6821669537e9ba241c87b4b5c9e2b89b32fff4bfc28ab8471ef52e8eebc3e743d1", + "0xa6b74c706b33d3cae9b7adc5c7502ac98f7bf94a14d579d2bf77b613ae555634ad6fe631ba36dc14bf44526436355e24", + "0x8296f8caf58316af535def398a43357e48cb3b1e674b857eba1bd1b970da3dd045e22fe6d17dee4e9117f62ece3ec31c", + "0xa129c9cf33df42b5a98ad98be9d940207ae154c715d3bde701b7160dfe45304679fb0481a4f9dde242c22a9849fc2d9c", + "0x858b6f1bd3e68fc536bdf1f4bd96db032994eb76e71571e2d85af73b898478b82f9ab432732b0beebc0864ad8025ae33", + "0x8658a15df961c25648fd444bdf48a8f7bb382d9212c0c65d56bf9cdb61aab3bd86604c687fb682260dbc0ad2dc84bf01", + "0xa8d152e5d94b75cb9e249230db21af31de4d4f3d4ef60ccbf2212babf69aed2a38435a993ee2f13cca410ad55a4875ab", + "0x95757096c132e7f6c096d7b93a5a0d2594d5e609b9f13c4a9f878e95a389fa1a111b185dc1fd8f7d98b737dcf8d2af60", + "0xa22542a4a2ebde18cc6aa29d5dace8b4f6720703f519610dcf01e671018392aff15728e3764730840272c9cfb074b612", + "0x8f90e72a54e6894d511061957162e753010812346afd4d90cfedb678b99ba1aacf2b6bd0e49b4b0e684da8082a048619", + "0xb2affe048c187d311a185503d8958cacbe03796edf79bc32e8533941004d9178bd2e376e627e1ba61ed43850c0c455cf", + "0xb549d272a7f3180826a978d747507e4dc80d82784abb655cfcd3a69cc72e7d58c70febea1ce002a89852a8f934ea70fb", + "0xa9ef845ab489f61dbfdcd71abcc29fc38f3494a00243b9c20b9cd0dd9e8a0f23304df84939b9652cdf5542d9b3ee085e", + "0xaa744c552b5fc41e1ac6ca53184df87a1b7e54d73500751a6903674041f5f36af25711e7bc8a6fbba975dc247ddad52d", + "0xa802b9ffbd4f01b877791aba27da972be4bacacc64a1f45687be4af01b84bd4b83fe2ba1ea78e29d7683f6c777ab2543", + "0xb44d2d9510516c0abb4fc101241cf0e0223b179fb70686519628c27f0ef56381232961bc79a30f592ef093ffecbc4486", + "0xa684a09add047c0fe648d9c5618500d1816047168e055e8ac8c952c3544a462cc095b32fab07d939947a58fcb4ec7ba7", + "0xb5eb31e5cba0193e74968099ace5808dfc457c6f404f270fdc4949b60daa7607ba1811abab1bb19fccdad61d489b6657", + "0xa10f19657a9bc5a5c16ebab9f9fddc3f1d812749cd5d80cb331f51de651873ff899e0670f1b079b29a194572de387a17", + "0xaf61f03e3ceef5bef36afa29ba2edc7a3b01ca26cec2589edbc9d124dd46e41410e0e3afbae959c83a6f839bbcf8049a", + "0x8e6bbfe492ecbbb8dc8889d3dcd7037a58db605bc6bb79131a72a9b9c1bad630e75f5e5e0c1bc407e73f3d13b116739f", + "0x983fc1ddf17f9756c9cecc00b39bb2ad432587a5c6d1c3296a383b9f539c9afe84c6c818447a709c0b686ba26ce5ea3e", + "0x8d52413f981bc611427ad0534d25e914113d0ebcd6960aab6421608bec6648b89ae4b2ca2153c57d3cf4f1f37212aa5c", + "0xae075b66e5f211c2149c45b211d1297bbc1d9e6497cb3315363c492a9a51ae5b9d0a28bfecd755d68553736901ac6606", + "0xa02f7fec0661394399a82b2e3151009160b3f5392017ba579b301ed42c85100c295acbfed46b6c58a9d71796ed0930e6", + "0xa3a7196fecd25e9cc7cac79c35365676e48c7be1493df255676adff2209c0719f2190ceff3ce008d08efa07c244c11a6", + "0xa5fe3dfb5031517bb8db0d5ade1e9f438e84bcf23221de003b03d2a2f4ea97629e81c79abc3769bdb8c69a512c189b91", + "0x8cd9d7e953c7ae07ee785d68a999e702565960d376692d9ea468556ad141229b1f3bc97926818c078901f73ecc578e93", + "0x81d6fc2f01633e8eab3ba4d72588e14f45b00e68ab887bdd4ec5e8558965db21189310df973837106216777b07fc0805", + "0xb75ac3d5b3dad1edf40a9f6b5d8923a81872832eb3a38e515539cec871a353b07cb477f6d55cf15ba2815a70458aac32", + "0x94d3c9406dc6dd7241a726355643d706e46b35f1ffe4509ac43e97c64c07592821156ba02ec9a78978e66709995a0ac8", + "0xa3b109249ac2900806f0f39338da72d4f2cc6d1ac403b59834b46da5705cf436af8499fa83717f954edb32312397c8d9", + "0x8336744d8ef3a3bb3e9ed3d6b83e08cafffc76b7438adedd3a7358b32acec0e73a4635aa3166362ab4e158e68576255d", + "0x99b74edbac662fff69ba412de466a427a928ce2363c9e59dddd664f6fa50f2e1dd3d464701b01784aa224b3d96dedea3", + "0xb397ed7134f447d9bf1c511bf92f2d27d7b6d425b8b411365fbef696cff95c2175461cf5dd83d93bb700e50ebb99b949", + "0xa3e1fe11f38d3954a7f48c8b68ff956ea0b6f8a3e603fd258c9406ec2b685ff48241db5257179ea020a83c31dc963854", + "0x949cf015ce50e27cf5c2ff1b8e2e066679905ac91164e3423d3fb7e05c64429e77e432db0f549acb99f91fb134b6edad", + "0xa1c0c317e6e352e16e25c140820b927161ce5d2c4c2e10bca3057ba4d46b4f42ad7aba20de86dad9fc6368ea92695268", + "0x8d6e3df29419bd0da1deba52c1feebe37744108685b49ca703e1b76fb4d612e3959d3b60b822506e5c0aac50b2f5eee2", + "0xa15e0cb96a463ab81e661ca44c619b71a159680bbc04707ea5a5867ff38b15416e3abe55d2fabdab9aede1f157dd37e1", + "0xb6d6482ad7b9b412ffbefbbdcc28eb3d091b1291f54f77bdd53c4ac85f705c454940f466dc272dde7b03c26f0cd6ecb3", + "0x8391e3ad6ec2686bdc686671d579edac2d5efa8cf0923577df28fe0735e4d5103173d44452816e3c2b2a7fcc1fcc20d9", + "0x818202d7cb60e4148c71633ccbe1ce311de7b7ff93a1988e86ba29cc58037189f0f275b3323a6719dc9bdcfbc49c35c3", + "0xa7c0fcc422c6da878926cc6763ae6ec685a5d8fd1afe61269957be6bfb3f1705a8e4c6e6d85bd15636521f5a2ceb3a00", + "0x8f7bbaaac458bada6d852fe665c87c646133bab16c0d5136c3dc922095b9d647d93a9de7671cb7bfd4cbd138ae0709d1", + "0xb6e9fe9fa3d4c833c3beae7f798f30f07e3cdf6f6c8eb8e2b70cad51b37af2549dc9f2e7f97f194e5897d4dedb904a45", + "0xb455f751232de0a48440d09983f4f4718b6169907979c9f282acf7177ab5b1f338fe1f2acd8d0bee4b4aad61d0340839", + "0x8aadfcf3562f1c357068323352cb1745349a27a7362358d869e617c2410db747149b993ee9e881e252ecdd42fd75f351", + "0x91bf4c32fa8888d3829d3c33e12550d2ecb70762d5eeecd044d4902e4a7f8b7a2592cf6cb7736eb6bd9d312f85c2777c", + "0x859426bf6211e68924eefdb26cdc168ac0deab291aaff7036163997bff34d45809932f91e12d113784c05553ca773b15", + "0x81730b4bc5f755e5b99c321a6996c65e57ea2ebe6c0e4e404ed30920194fd76db65304635ad054a8b25bfd982cead47a", + "0xb26f5ed09f7d5bb640ec94ddd1df0b76466f69a943b4699f53d45296d5d6b8010bb61477539bc377d1a673d89074d22f", + "0xaa65c11071be23c9bddaa5203f3166e5cf043efe5fb8f4b26f8a9cabe71db701a450e79eb001c401da5752755d9cf1af", + "0xa019370ca799c2c98a605850910cf43531bfb616393039fdfc370848feedd3339b2427b750ccc91952b03a09f690e9ed", + "0x8f84cba7ceb7652023fc8ebde4b00ecde1f550935bab12feb630d6f49517b4148f3cde184bf55d4f6ec99a849fc6f862", + "0x838733220d1559c800cf1714db8a43a67a0c0d1d3a9fc1e2cdcf615d20406501e5146fe8b59bf64f4c5daa1a6d74f15c", + "0x9708cfcc9ff95cf23f544119e17518a338575018f153b1ef50118da0681304919a226b2089a417c2ab7b4320dffafc2a", + "0xa988cfed9f481bc98beb5fc188ed3f6893a3ebba27c3ebace669792f6abf0997727023c3b6930a6421224f5b257b8b49", + "0x812d3ded3a3c9e58eecf13a29bb4cc13b01b2a0af322423a29bb0e4f6d9021d1d87ac4af7a2a6b88d34f44a8bc1b3c55", + "0xb2baa7eba496ac4ef60ad8ef27a9677f9507820d95a1c572d322621c4d0226b36146bfc3a9ca1645d123acbd945de3f4", + "0x89ab1e5c2565f154f92c9b3554160832d176613f1a2f872b6ed62ed925a33fb0b40b71b7443eaaa15099ab24693c8d13", + "0x8982534f2c343dda20cccf5a9c8bf98240bba5f4e8eb2206e63a1847097deadb6bf0d24b358014d564c5ef1d0448c43e", + "0xa1e47798a782a024da340d6d6a1b1e5e15a0f2d8668adf349ca375086964414a563cc1eea3226ae637f87e78c0a630b3", + "0x847b58626f306ef2d785e3fe1b6515f98d9f72037eea0604d92e891a0219142fec485323bec4e93a4ee132af61026b80", + "0x8368a0f17c8427beb71dbf11a09a2fe8495a33f08c29c74a9a996a88aa01c0a09f9555abeb1ef1592cab99a9e05875cf", + "0xb38e558a5e62ad196be361651264f5c28ced6ab7c2229d7e33fb04b7f4e441e9dcb82b463b118e73e05055dcc9ce64b6", + "0x8018499ef720e28759133033833edfe17ed23e42f99058bb79fe844ddee823cfdc43916be2dc9724d18f9726e6f1b409", + "0xaa9b9cc039d147677aedd1e47ad9013fcc0da0164070ff7305b18e5786c7fac0471368637a3adbb78f3af174a5c1592a", + "0xa5c0e42851b769d2d822e39222e708068455aae3bdf782975b59d3201e67a58fd66e16d380558bf2086bcab890a92dd5", + "0xaf3f765fd293c253072b33a780ed68933f78d7e079d9a2079b6232755bedf6ebcbce9ba65c01f695602fa8ee17899867", + "0x8a0192ef0903d7a5ed2e5614a715901f2554b324ee72390974dc90727ff08dafa580041a21a8e6c48a3e08e1b042afab", + "0x907c827a4fb5f698bf0e6f10ca07741c5b8e3ecb26aa53f938ba34ceb50c01be80c4afc5ac4358a5fda88eadea0cbe73", + "0xa35ee5c2d7800489723c78008b495e1742f0542dbb487172ef438f60424c81aa41c2397095821248066140662133f6f4", + "0xb1925ee53c9228cf80e2f5ac0117008a91e98d878f69bf03d00d873ef45f4351cb6988772d89d4ccddb40778d11e0dd6", + "0x95aafa379cc6a2b4bdd0cad30b7f0a47839952af41f584219ec201c6c4d54610eb2c04b67b29080acb8cecc5e7543fbc", + "0x8f44c43b80a3c5f488118859fab054745cfe5b0824821944b82fcf870fda6d93489ea9ca4220c24db2f4ad09c6080cb7", + "0xaf861bb21f84c3e7cab55370839d18ac24c475a9e833607fcd7e65c773ee9d64bea203ee9e8fd9d337f1cd28d5ca0d90", + "0x8f6fde2ebbd7682c69026069cfe93aa5410071f05de9ccd7070c8c3299a6539b39b3798f01a0b4e9b1330510bdb51de7", + "0xa35d9d6d5dd5428cce7616842203b5fa3721cb4b20f50c0113f138604954fe0cf214ca3d065b578f921054b9efe823df", + "0x8d562d6c0e0d8325032e1fbf836022c82a8f600a6fbb56c553ee5d1fac0f052c7ce2504c0fd48c9fa6494a6bff63c9fc", + "0xb02ce594310f1eb8acc92bb80de524a43e663e12fb64fc28291ff207f9d8ae761631416410c3c8f4d6890b8b7e6ed24d", + "0xa258f8c0eff666c2bb70e505544c3d10d6b258310e4fb2206fd0999f69bfb739a1e232d1e810e7206f490f6c44f6934a", + "0xa8a77936ca91df3b2ee7394ea821f2bfe91c6ad8193f44651466c170b6ecca97ab356fa7d947ebb4b767e8967092f143", + "0x88ad79a0320a896415e15b827a89969b4590d4dfa269b662bdc8f4633618f67b249f7e35a35884b131772d08025bfc32", + "0xa3c66439724d737d20a640bceed8671b20cf6795671b6d442ed1ea5eda6723ae559396c24f44e982ba7751dcc6adef5c", + "0x8d0e6475acfa2b904e7d53bc7acd070a2ee4894ff5720a20e560e9ecb7872ea442a51cf2f2eee4bef66604a5c08ad9eb", + "0x804c021152c3304853941847e80480fdaceba3b9676fbe018268cf77d1a1856966c2f9686bb4d4aa0c4118a7e85f83cc", + "0xa6565a060dc98e2bfab26b59aff2e494777654015c3292653ecdcefbeeebd2ce9091a4f3d1da10f0a4061f81d721f6ec", + "0x8d5de60e934ea0471d9e0a46489f21e03abb9722f5b3633631a9a099b9524beac5d67716969c83d824498796d9c106b7", + "0x8c5a9f6eb0a3ea95e75362b06e5cd23968447a212cf22e1419c984d74432c51d290b717f80e8ed3e76b1232216f99758", + "0x918ebb73eef984d0ce28083306626d04817038056aab4a82ff9ac8176ffdfbf3173c0b05e936daf553248b323fe54f56", + "0x8f9aededb605db4e499d3c383b0984b1322007c748dea18dc2f1c73da104a5c0bece6bb41d83abdfac594954801b6b62", + "0xadb198f70a7f1969ed0958be4a9a60dcc1806bced79c63692b9aad6c5648ffea1fed60b24bf4b1862e817cf229e93e83", + "0xb118f77f99ac947df97e7682f0fb446175185b842380af4ee7394531e4f93002c72b41a57a7c1b923a4f24b10924c84f", + "0x944f722d9a4879b5997dc3a3b06299182d8f68d767229220a2c9e369c00539a7a076c95f998bea86595e8ec9f1b957bb", + "0xb7270f33011db1bad18e076a162d6e53d9123808609773eb46e3a4ac69c84c257407907bd5d05b6eb5e926b8d8c6d884", + "0xb09c0a505457c6b473fc7b2d634222905b36a6ffcc015dbdffa3bd62218c94e891615e77f28e6e18dd8474be8c156695", + "0x97d076617cf0a64ab3d1f030cfd72a303b6b252c0a7b96157ff7fc8af5970f00d14492c46e8f6f37caafe837d0dc95c7", + "0xb405520ef829a2a3b8947f1687ab56a7af4026c1a6f99f59aa192bc4f3b12a2de407862ff74ba1b2c51889b8d6b090c7", + "0x8bb045e7482b7abe670d72eb2f7afe4207b5a3d488364ff7bb4266f8784ea41893553a4bf7d01e78c99ed9008e2c13bb", + "0xb2df29442b469c8e9e85a03cb8ea6544598efe3e35109b14c8101a0d2da5837a0427d5559f4e48ae302dec73464fec04", + "0x99daf03fa434a482d9aa4d090884c99b7208c1f5380b9acbf304e1bc33d3d6902afa5d248d20ccf03795e26901356ede", + "0xb60df25a7ac1ad14aef7e8809c4bfc190b715f94f14b0534cc2e4015ff6c322883cbdc5309e05d67dca4bc641c69725a", + "0xb46a818f3e492e231d8fa8de8848c16f0d648a2e0d1c816adf9306a8596fdf45922e59cbf745430570a19e54f45e28f7", + "0xb3ca2ab7d64b71e40693bd3e2288a1f78741a139403c783d259cb9dc9c29f16c00796b6302cdcea4a4314e132b4f9d1c", + "0xaf3d3dffbe55842dfb4417295a6ed1a82d26a579199494b305445215045785759be4cb57dc870c7ddaffbc101a854a92", + "0xb21785008910a949804d1291e7533752641d31beae3cb518806488f81d58c38a5efe5ed9534ac692e68c3121e2f9d97d", + "0xab7eff4ef8696db334bce564bc273af0412bb4de547056326dff2037e1eca7abde039a51953948dd61d3d15925cd92f6", + "0x8bb4d08318386c91a0136d980a42da18c05743a5c52a861ce52a436e66a8ebe472dac7f7461db32ea5da59a23e9bd6c9", + "0xa1c84730a5c41dcab9a5ef9e1508a48213dbc69b00c8f814baf3f5e676355fc0b432d58a23ad542b55b527a3909b3af6", + "0x948f808c6b8e3e109a999657ef966e1e02c96a7aae6eecaf912344e1c7bf7ea51c911cecd3cea2b41ff55acc31df9454", + "0x8d264fbfeeebb6c4df37ff02224e75e245e508f53fb3446192cd786ecf10d0f704c4fc2e53e7f7318ae1407e46fc0fb8", + "0x8d47a7c2c62b459b91e8f67e9841b34a282ceb11e2c4b0549883b627c8526d9e0ebd7333ba70630bc0ec2478114b6ae8", + "0xa4348ad30c12bb7dd03dd014cca599c3499ddf348e7795b0392a18f998289979478374e374a8297b5b6c427441e2b5af", + "0x92ec1aeb2aa24c51cd5f724972c8b6095e77b237d83f93ed34ca0bc91a1dbf1ad95adccc59e0f0abbfef33f331f3298c", + "0x941f73b2138b4347ecafcc7b8c3d03f2a54dc49f580394ed08f22b0878ee7cb63d42978f1d320c09e7dbc67648c06f8c", + "0xa308ed8737b3a9346ff20dc9f112efccc193472e6fde6aa218ceae11e288bbd2c35fa45c1d8bb238696a96767cd68b46", + "0x8eb03001ac9e22c6956a682ed458e650785c36d23ddbcd51ac4d9cc991325c02519ff1958987a08eb29ff56ff6e2c293", + "0x80637db55287f891baa0e865d2423191b9a575620bc4493ea76166d47b99fd89ad8625c21f446b01e3ae17292c78f7ef", + "0xa5b3da08aad945effdb645c797a0a8bfa828c9d658df2783a214597acebda3ffc07ee48d0ce1147d77540b557d9ada91", + "0x8d5e0b8cde1f62cc8f15d9f596e31de09c221da91b10335b92ef1155802e742442def161223333573158723f3408bbd3", + "0x931923f0c1f75a197e6244d67525b524ceb07510a6aae8cb3d56167cc1aacc76d26fadfa1bdfc55d8439c6ee4d4d8174", + "0x963a298fc8876b702424a697929c7a1938d298075e38b616c8711f1c7116f74868113a7617e0b4783fc00f88c614e72d", + "0x91ead7dacf43905eb5d4b179af29f945479ed074126bad3b5a2bbc1663af5f664fe53a36684e9389ab5819e53f1344fc", + "0xb8a6c999068c13fb71a99d75eabadf7edd2d32e28607baf001a0aeec412fdd3575602c68d3feb4d743b90396705e37f3", + "0x938bbaa0ba14597067ff4c0a7cfc1529c44160d6f61cfad12246526d84fb7a1ba964d3bbb065a348cf7a98356ee15234", + "0x80e44d3577f12cabaed7074feeb57162ff80b61f86cce8f41d1d1250bc455070b09f6ea9d0c263b7b4824701480f4c14", + "0x8d74f4c192561ce3acf87ffadc523294197831f2c9ff764734baa61cbad179f8c59ef81c437faaf0480f2b1f0ba1d4c8", + "0xa0133deca5ae8f1100df8db69920b2d0c31aa21bd3849dbaf4c264eaeaec8937ab8f982770ce1ea17e0e258910a56d02", + "0xb6a25d493d708b035b853f1f7a6628d8e0b205d2678293f763d7ea4da11d298539533b22b43ed2e5f708648556f3094e", + "0xa58c3a4ba86d0d6b81c8411bb73a528b4f3bc2debac0e0208f788c080a3a96541d57c927143c165f595070afe14b0517", + "0xa52c15840b89d92897d1e140b2b8468a88886c5e1092861e598b3a433b340ded5b35b3d632a9879820fd56f20ca3a68b", + "0x8c122bea78deee98f00a86184ded61c10c97335bd672dadddc8224a1da21a325e221f8a7cfd4e723608ebcd85a2f19fe", + "0x87a51e0011dd0488009baac9c611fbde01878f9cf1584ea407599742bb32ef10586d9040dae3e9800a125de54f80c047", + "0x98181e9291622f3f3f72937c3828cee9a1661ca522250dfbbe1c39cda23b23be5b6e970faf400c6c7f15c9ca1d563868", + "0xb01a30d439def99e676c097e5f4b2aa249aa4d184eaace81819a698cb37d33f5a24089339916ee0acb539f0e62936d83", + "0x830e70476c6093d8b9c621ddf0468a7890942589cae744300416639a8b3bc59a57a7e1150b8207b6ab83dafcc5b65d3c", + "0x83ca733849830cb8fc2ef469e7e464fd94def561ce49ff0aa352a6ecd0e52c7aefcd69ab59f3d1ed2d5b8536d0a7895d", + "0xb76cb8cb446eb3cb4f682a5cd884f6c93086a8bf626c5b5c557a06499de9c13315618d48a0c5693512a3dc143a799c07", + "0x8b027c14affe47f83ee59b504d83b2fd2d9303de2c03ee59d169bb199d9f4bd6533d7f8c812dd7a6f1e8155e3e185689", + "0x8e6b888197010ebadd216da35b9716daa8675d93b3c33a96a19fd9ca42624f6b430b2ff115cd0f5b717341605dda24bf", + "0xb6652440bd01316523feefceb460158cd9ba268dd8dbe860a0271f0176230f057767597e4197885ba907318ca202ba06", + "0xa0b3dff15982a38a2f56d8c6cfc5c5543c045bf2db24571d23387ccab42abe2756f34d5f0bf6a426bbad3c358b8bdb00", + "0xa8b593de2c6c90392325b2d7a6cb3f54ec441b33ed584076cc9da4ec6012e3aaf02cec64cc1fd222df32bf1c452cc024", + "0x96b478b1e5e49d4ea3fd97c4846ae0f781dcc9f9ff61ee022ca92c3d8dfba89c513c46e8bb38b73e6b678a79b9b12177", + "0x946d585d7aa452d37a8c89d404757c3cce2adf2410e18613483c19199abd88f7a12e206f87a43f6009e42f4e31ed20c0", + "0x8c432e044af778fb5e5e5677dbd29cd52d6574a66b09b0cd6e2a5812e71c91559c3f257587bfc557b4b072a822973a60", + "0xad2cdae4ce412c92c6d0e6d7401639eecb9e31de949b5e6c09941aeafb89753a00ea1eb79fa70b54699acbfa31eda6b7", + "0xb504cb87a024fd71b7ee7bed2833115567461d1ae8902cccd26809005c4a56078617ec5d3fa5b29a1c5954adc3867a26", + "0xb8876bda1e709ab16e1347a1107852a7898a334a84af978de39920790b4d82eb0739cbfc34da1c7154dd6e9f7674759c", + "0x973dcf44ab60f55f5d10a8753ea16db9faedd839466a130729538f3a0724f00f74b3ca1de16987d7c6e24e9467f62bc7", + "0x94df5fe87661101a89b49091a3d4de89331cdbd88531ebb08a95f2629886ee53b3dcbcc26bb6bc68b443303d8d397141", + "0xa92beb343caf6a945990adcf84302c55d1fccdef96c34a21f2c00d3e206a9b2c6c6b412f66e5d4fafe26ef6446cde705", + "0xb298aa927713c86adfe0de1a8d6f4083b718c8be27156da9fd11abd8edb3a54a926ad487801eb39cfc9363a0a3be0d44", + "0xb34d4d2e15079e7e80fdba30cddf4fc0e6c9a61f7ab06a6ea0a4e55fd5bf632c6d72e021d6264d935439d321de883bb6", + "0xb4a86fb5b0049718caead1bc036833a2caeb88e1afadbbbcb0cd021d95e1f33fcc916f0b97fc1b9226c37050e3463796", + "0xb6cec65e5268818c82c0a4a029b02f8d23de98b68730a445119fee670118eb34027c23c987fac950f9b0151631328a4e", + "0x880b4ef2b278e1b2cccf36a3b5b7fbce94f106ed9fa2820cb9099a7a540a57e9fdeef5c0fb0a743049828fc2b8c46163", + "0xab2053c376c6bd113b89fdb2ae3b8401aa891135345885730c61cac7813f69ea7d906c531be752e28657f73af92d1f4e", + "0x8fa2d7b22af8e6b82679ebdfa13efdcb34289a554653ea6c1b16efb9f957f7fe64df787e7b03d8cdc8a732b91c916bd1", + "0x8e825c03c8409a3302266dc5f47fbfc381dfbafbadc37bd8d40f079ca8963d4c5ae6ef0d0ba6aef2d4688736f5f6bb45", + "0xa40ef3d2291d8782540961ce285054678b3d322d3cf7fc154207228c290708b1abfc37a4d7762dab3dfea582a112444a", + "0x8dbe8fcbcc414eb352245c52549973f73d987012de9d5f2b2f55dfdc43cf8cc9ea6b147abf149817f80f9e15aea566c6", + "0xa7e8775e04214e3b9898ffb9625dc8bcd1b683e333acdceddb8ca6db241df08a7b80e9d476a711b8b7d66aefca81e9cd", + "0x8b6ed54668f78a4a7624683b9bf3abf2bb0b6dccffccd8c0967df6297dadaf51732800fb9832b069437a6bf82ed7e6ae", + "0x9437ce85146202d3815df7f341a182678665dfb74b96006dc9d6acc16110d00b4a02717b702a765566457710ff5a7280", + "0x86a790072efa2cafa97be4b6b31f8c533f3b20cf3922fc0285fd403da436e4c49c65c5f08d77bfe823526c67bb58fab6", + "0x8ee8873de7cd28a54ba2c63a80b63399effed76b154e96ed26e7c0668b9f2476e298688b6a00c4b2ab9d020a897695d7", + "0x975c3261f0f32d59473e588f89593be38f5694cfa09394a861e4330b7800fb2528ea832106a928c54c76a303d49140e2", + "0xb5222582ed6604b9856a48039bd643340f4bf1bf0fc805e8453a9eb7630d6cea1452d28536706d6fa3ec16617617991c", + "0xb75c28941ee3f91b3535b4eaa0fb17b59ca65b5256601a1f6d0cf2bb4d66837fd16e51d6942856679012a5730a66e519", + "0x97b510f9f46bdf77a002b2403d8e42b6d6ad5329ea080940844429763ad3efd592652789c8d3d4fac0903c705f533cf7", + "0xa3fd9d8bbdc98394883022299fd9793e0c4f374d8e40d6ce89b2869d3173cb6a5476371d6095dad068ff217729f60af4", + "0xa57d5de556853484b1d88808d2529450238bc467376ded84cfd7b4a1ba258f6d43b5958220f962c57b033abcef1d5158", + "0x8465bd8be9bd9c2c6116d4ae44ec6618c109cb9aaee2d241e7a6ed906d398ef15a6fc18bc8b1d3398184241405954bba", + "0xab1cc44983e46a6ea2430aa6616ab28614f43624665e3e6ae31a9357c0c5434f34e56c720906e184327693cc4ebe1fa2", + "0xaafe14dd3b680f096010788226d8413ca628feedad79a2bc78cb04d47c6ad910f7f46ca87b8f8281744625d8f42d5eea", + "0x86a533b02ae929f67c301649a2d58651b98cdffe731b63fa32aa1013c271634bbb088c0d02865913c11bbb1bf57c0e12", + "0xb28df3e04bde4ec373171401dbd0546f4cb6fa8e9a4a8019aadc653d4e05e0b5b9a64417715dd87f6df9e7b3145f6659", + "0xac63fc758c1a3bc5cbff0f5e0b5a07a5aa801363b129d4e0360165c7dc1057ec37b0d808e9fd6b179e2c1e66bbc6090e", + "0x93f941b4fe6c05621e7a651b87669eefd60b6e8a4a8e630a51fa3fee27417b9eebce39f80a5bade9ca779133ad8388f6", + "0x96d7a69eaf2761bf0e5ebcd607b134d5dedba8e262ca1d6d3e8fbf23e6419a8ce1bbe4cd23b9e4b5f80db54a802a9795", + "0x8b62902fb2855300580e94830a4bc825d997ede33bf356fe3b7c08d6a8bd85a37879433fc6bee58f9b44ca280f4e8dfd", + "0xb043156fcd02b75dbe940c763fa8e8a7c7f6d74c1d5395db5ce544af3b6097eab61686950535a810aa95889ced12f74d", + "0x8614a7599c8d97aa9ca63b876f677977cf0daa969ff2a9a153f297a4a46e08fa5d91492995de94dc32cf009ce6bb5b5f", + "0x81351fd284d6d07092875f366bc5e53bfd7944b81eece85eab71a00443d1d2a9fc0337aaf34c980f6778dd211caa9f64", + "0x8c722aaf5d5dad1845056bf5e56dbff0f8b501f4846610f99da01130a49c96db9962bfd9be20670658cf276cc308be08", + "0x8effe3fb27c9f76bbd78687b743b52e6f3330eddc81bc9006ca81fd640f149d73630af578694f4530833c2151522dcc1", + "0xa3d327f48eb34998a3b19a745bca3fade6a71360022c9180efb60d5a6f4126c3f4dfa498f45b9a626ca567fdd66ffbff", + "0xa59a59db246f981e9c8e54aba52898c714d9787fef8969a6d8677fe6dec82950ff22a1364393b579f3e596cdf5bcd7b1", + "0xa15ebe9ab6de62a4d1ff30b7fc58acfb14ea54d7fa513cbcb045af3070db22bf9c1e987fa26c0c54356b9e38fa412626", + "0xb58396bce7d32ba6c70adbd37156d859e153c1932d2b0c7c874a1182ba831439e80d6fc6d7d88a870e193f515aef2264", + "0xb666dae42ea858c9b7d903ea3ca5279f619c71ac6e3fda7469e2bbba08c7e8e12d6a3c35ff2c6383673b1b7c21db5e0e", + "0x8eaaa21c8955f15bbcfd5756421a045e7b4825576379cc6229fe9751f7a7738b90be19ba52261db01c1e13af955675b0", + "0x8027bc62b59f9f15613e38da74ccc71fc3eaee26f096d187c613068195ce6eb64176013f2d86b00c4b0b6a7c11b9a9e5", + "0x8275eb1a7356f403d4e67a5a70d49e0e1ad13f368ab12527f8a84e71944f71dd0d725352157dbf09732160ec99f7b3b0", + "0xb8c41c09c228da62a548e49cfa107630166ac5c1469abf6d8aab55938ed1d142d5ddbc4f1043eed9496e9002cac99945", + "0x912750d2f1b21756662a400236f797b8ba76c73e5af95941a8c6ef9427838c4826715c80942cf8cb7ed01566bc490754", + "0x862af7dbb38ad7293a4e598cb52a8ac84dacee3d9bf007b5cb6a18a1acead0aa33f6dba796ce630e632c97aeb7100d68", + "0x890def696fc04bbb9e9ed87a2a4965b896a9ae127bc0e1cc515549b88ddbcbc02647e983561cab691f7d25cf7c7eb254", + "0xb835ffaf54c8b878d3c4262ca2bf5e6be2c691adced622b35d998ed72e1467ba907f4fde8d64ce43b43a8196f48e55db", + "0xa6d7e65bf9f889532090ae4f9067bb63f15b21f05f22c2540ff1bb5b0b5d98f205e150b1b1690e9aa13d0dee37222143", + "0x8ebfbcaccddd2489c4a29a374a2babc26987c3312607eadb2c4b0a53a17de97107c54eab34def09144b3098c082c286b", + "0x900b9972180a2c8753f5ff49fdd2cfe18c700d9927b3c3e16deb6376ad6ee665c698be72d4837b94911a0b4c183cb140", + "0xaa9679c01ecf1f1452c54688e01cb25bf157bde6b09b1ed460b8c175d65eba439c7ad4b7c1d72415f5622f3fbc068dc8", + "0x887a4277ee8754733f3692a90416eeac1ebee52ff23173a827f0ba569bd84efd806eb9139049f66cc577e370d3f0962d", + "0x951b27456e2af80436608aadec54ebd03bda37fa58452631da63bc5ff3eecb5ffb73d356b19f6c9c4225fcb0da8fda20", + "0x9104b5af82dbca914370eadb5518b26bee7ed7edeca74b741585ba8b249204e2c998bd47a02cef4335e236f8efafef94", + "0x8757e9a6a2dac742ab66011c53fa76edb5ebc3c2fbd9a7265529a3e5608b5c24b4482fed095725e9b8fed5a8319c17a4", + "0xa7acf82999de75f231fd80770bcb0f4c720d6b1e4a2558fa1ce854382fda92beb89fea5b5d229dad85fafee7a9e98329", + "0x8fb74891a8642f25a55b5eda5818367aac2fdf9663ad1e3dbc0166b484c0cda581b243cc75131167f1afa9caaf6705a0", + "0x897d7a19b70dcef1af006df3365981d73068c81f18017f32fb9966599481496efd5f6caceef943b31c52750c46d9590d", + "0x87ac804ccfe7f1fa156b8666664a397236832569f8945e11d4688a9e43ada4d4104efb3fda750f48ef655a29357c5e7d", + "0xaf18cf1e3d094b4d8423da072f98b3023d296f6a1f2a35d500f02bde522bb81dc65e9741c5bc74f7d5613bd78ce6bc03", + "0x9752561179783f336937757b619b2fdcb9dfce05aa3c4fce6d582dc966182eb85ab4ccb63e7e1736a7c5fad9d33cccd2", + "0x89e19b665ce7f6617884afaf854e88bb7b501ecdd195a5662c79802d721f5340eca8c48341ad1d6c78f519f82e5a9836", + "0x94402d05dbe02a7505da715c5b26438880d086e3130dce7d6c59a9cca1943fe88c44771619303ec71736774b3cc5b1f6", + "0xa76adeddf2454d131c91d5e2e3a464ef5d3c40ee6a2ab95e70ef2e49e0920d24f9b09276250ed7b29851affbdbc7885a", + "0x8934e9a3feababa12ed142daa30e91bd6d28b432d182ac625501fe1dc82f973c67f0fe82d39c9b1da3613bb8bfe2f77b", + "0xa5c11337eb91ce0e9b6d61bbdadea0a063beee1bc471cc02dc1d81c5dd2095315c400cbc6c33d23c77e98bba6bdf5439", + "0x92d00e64ed711951aeb852908aeb6fd379ea516872dd512384b1e773ef078e52e6d618beb202d437d2a46bcb78087f7a", + "0x97f1a7370b4f5acf83b466f519da361c366915f560385dd7eff9d53700ad81b25c9862bc71d35428e82372a5ae555ea0", + "0x95614544f65808f096c8297d7cf45b274fc9b2b1bd63f8c3a95d84393f1d0784d18cacb59a7ddd2caf2764b675fba272", + "0x8d474636a638e7b398566a39b3f939a314f1cf88e64d81db0f556ca60951ec1dca1b93e3906a6654ed9ba06f2c31d4ea", + "0xb87e5f481b938ac8a481b775cc58be2a06604549e3c810fc4734bab76099e5c617f0243c4c140cb7dd6d36a6dc2286bf", + "0x806efb61d1c948efc10dbf9bef30197d1c269e5e7fcf20a84367b26223d33fade413a0bbf4e33f0d1f1a00967289015e", + "0x880b99e77a6efb26c0a69583abb8e1e09a5307ac037962ddf752407cacaf8f46b5a67faf9126bdbcb9b75abf854f1c89", + "0x82ffe4de0e474109c9d99ad861f90afd33c99eae86ea7930551be40f08f0a6b44cad094cdfc9ed7dd165065b390579d0", + "0x941cd102228aa81ef99506313a4492a17c506e7169808c6b14dd330164e9e8b71b757cbe6e1bb02184372a8c26f7ad1f", + "0xae96dc808c316a677977831bad1e529ef965dadb5d6aea25ab008fe7bb1543e596e33052cfbe4279fa060201199d2c34", + "0xa2053719da2b7501dab42011ae144b3c8d72bd17493181bf3ae79a678068dc3ee2f19d29a60b5a323692c3f684f96392", + "0xb17171939519d90e243d41839c3c5ce7ac7e6a978e4a7e56b2c8e6a2b1b587c7eacea47f2e31a55d88555d252c810ebd", + "0xa958987c2b3c84df8176b600f5b75a8badef9653c71eff967e76648937def38826eaab4027a639f4f300b20019166250", + "0x854aafa329e2b2563355641eba95f2aba5b33d443ab16f5e342048f97d97c4e2812ff27c6f4180b8110272f3151be690", + "0x94d4a1e3a3d28a948f14d1507372701ac6fc884a4905405a63663e170831578a2719714ef56f920baa0ca27954823e39", + "0x826be957cf66db958028fa95655b54b2337f78fb6ef26bd29e2e3a64b130b90521333f31d132c04779e4b23a6b6cd951", + "0x8261f7e644b929d18197b3a5dcbba5897e03dea3f6270a7218119bd6ec3955591f369b693daff58133b62a07f4031394", + "0x84926cf2265981e5531d90d8f2da1041cb73bdb1a7e11eb8ab21dbe94fefad5bbd674f6cafbcaa597480567edf0b2029", + "0x8fb51e3ef3c1047ae7c527dc24dc8824b2655faff2c4c78da1fcedde48b531d19abaf517363bf30605a87336b8642073", + "0x8ba45888012549a343983c43cea12a0c268d2f7884fcf563d98e8c0e08686064a9231ae83680f225e46d021a4e7959bb", + "0x973ab82026d360e2cf5676d883906186bc61b43f60767ca58f11d0995e40780b163961e6e096299ccf1c86175203abde", + "0xb77416ea9a6b819e63ae427057d5741788bd6301b02d180083c7aa662200f5ebed14a486efae63c3de81572fe0d92a9c", + "0x820cc2ac3eed5bce7dc72df2aa3214e71690b91445d8bb1634c0488a671e3669028efbe1eae52f7132bde29b16a020b7", + "0xa6b434ac201b511dceeed63b731111d2b985934884f07d65c9d7642075b581604e8a66afc7164fbc0eb556282e8d83d2", + "0xb81821a79c9148b41d24d85dc997336a1e1719da0e31e42af30812b97a5af31708ca3e7bc2e803c3751cff23af5c509d", + "0xa013cc5e3fbb47951637426581c1d72764556798f93e413e1317849efd60f3ecb64c762f92544201eb5d6cfb68233050", + "0xb5f32034d0f66bcbccefe2a177a60f31132d98c0899aa1ffff5ebf807546ff3104103077b1435fa6587bfe3e67ac0266", + "0x86ca8ed7c475d33455fae4242b05b1b3576e6ec05ac512ca7d3f9c8d44376e909c734c25cd0e33f0f6b4857d40452024", + "0xb781956110d24e4510a8b5500b71529f8635aa419a009d314898e8c572a4f923ba643ae94bdfdf9224509177aa8e6b73", + "0xa3f9dcc48290883d233100b69404b0b05cf34df5f6e6f6833a17cc7b23a2612b85c39df03c1e6e3cd380f259402c6120", + "0xa104d4bad69f1720307ed12363d1ec97952acfe09d9e3650034c33f3f20c763271ebe0d5b50b1d3bd15c469f4573b09d", + "0x94bbc6b2742d21eff4fae77c720313015dd4bbcc5add8146bf1c4b89e32f6f5df46ca770e1f385fdd29dc5c7b9653361", + "0x951aa38464912a29df2101c60771d6de7fadb63f2db3f13527f8bdacb66e9e8a97aaac7b81b19e3d1025b54e2c8facff", + "0x919b5187af7dae210f151dc64a9cbd396d1ae04acadebf542a7123004efc7ce00d6e14c170d876fbc64dc1b5d141a5f4", + "0x88e1e459ee5aeb8b36ed004f6d03da296101106fbe1b18f9bbf63e92321db51670c34050fd3b7dc56a4bad76403823ee", + "0x86b3ec14a8ffb811a0ecc3771f600d8b08c098537d100fba66def19e7ee4d1c397a311977bf37e6cd2d47a8a2ee8c223", + "0x898c4873bd356ba8015f6f686d57088fa8f79f38a187a0ef177a6a5f2bc470f263454ee63d0863b62fca37e5a0292987", + "0xb471c72bd2971353f4b44248b8e6cf5316812861a88ccfc20fd0d89a5e010428c387228b2f6f14c12f79e31afc9d0753", + "0x8b7cb5b8de09a6dfceddcbaa498bc65f86297bcf95d107880c08854ed2289441a67721340285cfe1749c62e8ef0f3c58", + "0x983cb6bbfe83bce8326e699e83fca01ea2958c09808c703cac97a0ea777e5a5f3f5bba9169a47732de7459a3c7af47d2", + "0x8235a3f09078dd34ce2fc17cc625e061298713b113dda12d354b3d2ba80e11c443b1dd59c9eb5a29513a909645ae97d4", + "0x8bb51b380a8a52d61a94e7b382ff6ce601260fa9b8c5d616764a3df719b382ec43aec9266444a16951e102d8b1fb2f38", + "0x9579973ee2559da09b327c62b1cc0177f2859872885dca709e24dcfbb9bdf9224a6d26869aafce498f44c0e6bd8a996c", + "0x842ba3c847c99532bf3a9339380e84839326d39d404f9c2994821eaf265185c1ac87d3dc04a7f851df4961e540330323", + "0x99dad12f78e1a554f2163afc50aa26ee2a3067fc30f9c2382975d7da40c738313eaae7adbc2521f34c1c708f3a7475b7", + "0xb96e3ff8bdae47aa13067c29318b1e96a7fe3941869c17ce6662183b7b064bf261e1cea03e2a4643c993728a2606b5b5", + "0x955bc897171aa65d0159aa6e5d51855833f83d8bd5e65f93ad26c27781171783f3988a12bf987472edb39994bd071ea5", + "0xa59249e4dfb674dfdc648ae00b4226f85f8374076ecfccb43dfde2b9b299bb880943181e8b908ddeba2411843e288085", + "0xac2955c1d48354e1f95f1b36e085b9ea9829e8de4f2a3e2418a403cb1286e2599ba00a6b82609dd489eda370218dcf4c", + "0xb2eedff11e346518fa54e161be1d45db77136b724d497e337a55edfc896417de3a180bf90dd5f9d92c19db48e8574760", + "0x976eb5543e043b88d87fda18634470911dfe0e0cabab874ca38c1009e64d43026d9637d39dcd777bc7f809bbfc3e2110", + "0x8ea5f88a79f4eb9e7c0b6b29f8ef2d1cc4c15ed0ed798ab11a13d28b17ab99278d16cd59c3fa8217776c6dfae3aedf88", + "0xb7f146a357e02a63cd79ca47bf93998b193ce1174446953f12fa751f85dc2a54c9ed00c01a9308509152b3bad21d7230", + "0x87fd7e26a0749350ebdcd7c5d30e4b969a76bda530c831262fc98b36be932a4d025310f695d5b210ead89ee70eb7e53b", + "0xb9445bafb56298082c43ccbdabac4b0bf5c2f0a60a3f9e65916af4108d773d62ffc898a35b0b8efb72ea846e214faa02", + "0xb106c6d13ca17a4c8ea599306e84918127cf2de21027ac3fe5a57d35cf6f3b1d7671c70b866f6e02168ae4e7adb56860", + "0x9276e8051bed8f5dbfc6b35765aac577dd9351d9d6ac1bb14496bd98091005b9a4737b213e347336413743f681f5043b", + "0xaefc682f8784b18d36202a069269be7dba8ab67ae3543838e6d473fbc5713d103abcc8da1729a288503b786baac182d3", + "0x97578474be98726192cb0eac3cb9195a54c7315e9c619d5c44c56b3f98671636c383416f73605d4ea7ca9fbeff8dd699", + "0x99c34f9bd0fcb18b3d931e562988cf91886a417f8678f22651bf3cf138df2bbec3f675de90f62dda769e0eda03d72b7e", + "0xa0047e03c89a95248543618e6b7ca2c7aad7acda3c9f85771ec5c93fa898c651e8b2ea3b6b799d8cd592290a986cdd7d", + "0x993726e0b1c2277b97b83c80192e14b67977bf21b6ebcde2bda30261aa1897251cd2e277cfcb6193517f1eb156d2fe86", + "0x974a5180e55eab23d4c973fbee6ad1010335161ecdb849fe6520b34c1f96530a4faff80bd738fe281019b79d968c472c", + "0x8f1d90034f998018c3f4b5947b40b139fcead2e40aa80fdec6a4337c60e9d5ff1923dda7f0b5b1731ff16f55027d41bf", + "0xa7d9ae9621dd1f3da3cd2d435e891cc3579c4c0d60d6a4565cac86c315cea21a9ad883559fe7b897ae6e05f1aa989ad9", + "0x800f6be579b31ea950a50be65f7de8f678b23b7466579c01ac26ebf9c19599fb2b446da40ad4fc92c6109fcd6793303f", + "0x86fa3d4b60e8282827115c50b1b49b29a371b52aa9c9b8f83cd5268b535859f86e1a60aade6bf4f52e234777bea30bda", + "0xa80ac2a197002879ef4db6e2b1e1b9c239e4f6c0f0abf1cc9b9b7bf3da7e078a21893c01eaaab236a7e8618ac146b4a6", + "0xb4bf70468eff528bf8815a8d07080a7e98d1b03da1b499573e0dbbd9846408654535657062e7a87a54773d5493fc5079", + "0xae0e15a09238508b769de83b30582cc224b31cd854d04fdb7b8008d5d8d936dbdd3f4a70fff560a8be634c141772561b", + "0x936f7e20c96b97548fef667aa9fa9e6cfdc578f392774586abe124e7afc36be3a484735e88cc0d6de6d69cf4548b1227", + "0x8163eea18eacc062e71bb9f7406c58ebe1ce42a8b93656077dd781c2772e37775fe20e8d5b980dd52fdad98b72f10b71", + "0x86a6560763e95ba0b4c3aa16efd240b1873813386871681d075266511063b2f5077779a4fe49ffc35e1f320b613b8c94", + "0xb156d9d22722bb6e3b75b3b885b64642fa510ba7e6057657cd61bac43fb9c284d05bb09e2d4b78a2a4ddada85da9c702", + "0x9779ca2759dbed8081f0cbbfffcb3b842ba335e3ae48a60c5e5c77c7a2a0623e4c415ec3a023cc4e216885fcbac3ce52", + "0xb8137fd57ce7d3cfaf8bdbaa28704734d567d0e7a2d87fb84716722c524bb93acb2c1284249027f3c87bccc264c01f4e", + "0x8cf06b34e7021e9401eb705dde411ecf7e7e7185f8c0b0aeed949097df31812a9fdd4db7d18f9383a8a5a8d2d58fa176", + "0x8c65aa29a9ee9066b81cf24cf9e0beca3e8e8926e3df22d5ff1236297e158cc8bc7970a2c7016009cc4efa8f14b14347", + "0xac7e49f2059e99ff65505742978f8d61a03f73f40141a2bd46fde5a2346f36ce5366e01ed7f0b7e807a5ce0730e9eaa9", + "0xa1c25eb9b73723982be78180770aa63c5f7b23c2e54a2ed7e75a860c4512d273008066f1124ac8a43c60fe1e2a8bf03c", + "0x9310722e360a5652737362f6b9cb6e9c3969a0c9bb79b488b3c7d19d9e8c42ebd841df346258ded2e393895c99b413cf", + "0x893272a63650b08e5b8f9b3f17f8547b456192ad649c168bafd7166b4c08c5adf795c508b88fd2425f7be8334592afb2", + "0xb576c49c2a7b7c3445bbf9ba8eac10e685cc3760d6819de43b7d1e20769772bcab9f557df96f28fd24409ac8c84d05c4", + "0xaf17532b35bcb373ce1deebce1c84abe34f88a412082b97795b0c73570cb6b88ea4ba52e7f5eb5ca181277cdba7a2d6d", + "0x8b8813bd2c07001a4d745cd6d9491bc2c4a9177512459a75dc2a0fa989680d173de638f76f887de3303a266b1ede9480", + "0xab73a043ccdfe63437a339e6ee96ef1241264e04dd4d917f6d6bc99396006de54e1e156d38596ba3d15cb1aaa329f8f5", + "0xb67146b202afec0132ac0070c005cf664081e860339f8f4d45ac3e630dda05560936e646673e652d08cecd8d18fc64da", + "0xa750404e9d4b1a48f767d2b6aa699200c92c3b8102597f8c5c1dbaaf08112a0587c05801dfebb3612fb6dfd76ddc9ccb", + "0xb0d4231814e40e53ab4eed8333d418a6e2e4bd3910148b610dec5f91961df1ad63f4661d533137a503d809ea1ad576fa", + "0x81fc724846b5781f3736795c32b217458bb29972af36cc4483dd98ab91680d3d9bc18842db2661487d3a85430dc9e326", + "0xa5cf6f4fd67aecb845eebc8d7304c98c69806d774d4c468350f7f82ff0f5baeecc56837705e39432a8d246aa2a7075ed", + "0xa71d2c8374776f773bad4de6edfc5f3ff1ea41f06eb807787d3fba5b1f0f741aae63503dbca533e7d4d7d46ab8e4988a", + "0x825359cfe68ad6a75578a94be6419179e0aa088170b6c20fc5c249dc3be7a260d687c93d8d8a343c7c72c2ed6a716de3", + "0xb6aeb7a9b934a54e811921494f271d5d717924c561cd7a23ab3ef3dd3e86184d211c53c418f0746cdb3a12a26a334fc8", + "0x8c6fc89428c74f0c025e980c5a1e576deadf8685f57136e50600175fa2d19389c853d532bb45a3e22b4a879fab1fcb0d", + "0xae95ddcf3db88f6b107dcf5d8aa907b2035e0250f7d664027656146395a794349d08a6a306ce7317b728ca83f70f3eaf", + "0x8c03fb67dd8c11034bd03c74a53a3d55a75a5752ea390bd2e7f74090bf30c271541b83c984d495871d32c98018088939", + "0xb8d68610fdee190ec5a1f4be4c4f750b00ad78d3e9c96b576c6913eab9e7a81e1d6d6a675ee3c6efac5d02ed4b3c093a", + "0x87d4b20bbe2dcd4f65f4e1087f58532d5140b39a5288e1a63fc0b7e97a6a56946eafdd90ba09300c3d1fef6356ac6b7c", + "0x83e264b1d3d4622826ab98d06f28bbbd03014cc55a41aaf3f2a30eec50430877d62b28c9d6d4be98cb83e1e20f3b13db", + "0x97ffcbf88b668cde86b2839c7f14d19cb7f634a4cf05d977e65f3cd0e8051b2670e521ae74edc572d88201cff225e38a", + "0x91efdbcaad9931312d7c41d24de977f94d7f3f7b88090a1f72d9a097a1e30cc805c5ea16180f463022d9b26b8863f958", + "0xa4b507a4bc2bc424297bf8968bf385fae3acc686cff4b7933b4f5b6ef3149995393d5331dbac4b629e8adce01a91a4cc", + "0xa76a26c30d8abbbd4bf982bb8bd2066a2ec823a5eb6fbe37c664e67efbe2f72d8ce2d00223b900699149f8441bff5ada", + "0xb3a5497365bd40a81202b8a94a5e28a8a039cc2e639d73de289294cbda2c0e987c1f9468daba09ea4390f8e4e806f3c8", + "0xa09b2a07d861e01645accfb088f7f9ad524186bd439712775459a60f8a1fbbd43ee084e4d6e23ffce06daa189cd1e654", + "0xa41cf5d678a007044005d62f5368b55958b733e3fdde302ba699842b1c4ecc000036eda22174a8e0c6d3e7ef93663659", + "0xa698b04227e8593a6fed6a1f6f6d1eafe186b9e73f87e42e7997f264d97225165c3f76e929a3c562ec93ee2babe953ed", + "0x8bc66e370296649989a27117c17fbc705d5ac2bda37c5dad0e4990d44fcc40d3e1872945f8b11195538af97961b5c496", + "0x8bff10f91b8c0abb6c9542588da17fa0118ffda4c82626a754887e333d7d69661b3ae4e400da15c49565f8d10a77d0d7", + "0xac715c7b3d794860a61d9c7bd224a2b14a6023f696afa30345aad2ce0a6ea6dbc142f34af1ffe7f783542851a28e8ece", + "0x91c5e0b9146fe5403fcc309b8c0eede5933b0ab1de71ab02fac6614753caac5d1097369bdeed3a101f62bbcae258e927", + "0x8553748da4e0b695967e843277d0f6efeb8ba24b44aa9fa3230f4b731caec6ed5e87d3a2fcd31d8ee206e2e4414d6cf4", + "0xac722bd742374f925185ea7d4d62d7510b2d8a6ebf5c750af6ce83e2d8a28c95a3e298870ec8254ab2d1d0aa2a063c60", + "0xb083c4cefb555576bb37b71f30532822cb4b1e1998e35cb00ffb80ca14e2853193c16a6756417853d4a74d625744dd76", + "0x85745bd84c92ddfc55df11fe134cf70e3c340aa1c7cdd6188a03308cf3a840f4f19629f9730b2e6426424989ff03000d", + "0x845b4531dee808b583645f56fa98cbdecce3ea100db60524b64f68e29866173791f01137714f4dc7fb8612f7f7943263", + "0x93f03495d53c781be8b76e37e68b64aa260523004eff6455ddc8a8552af39854e5181f8c5365812b1f65926534fba5dd", + "0x801c126abff96fe9b042be8869d2907d0c6963a79901f9db46577a445418b7465a1f4b346933d433e539536a9a2df01c", + "0x952cf6782b0ad3e85625391cc5f486a16bb5b1f8ea20defcb6857bd7d068dcd2701bc7ed5c3b773a869180d9042f772b", + "0xb3b6eccb2ec8509b4eea8392877887180841ab5794c512b2447be5df7165466d7e293696deaabf063173e5f2238ce763", + "0xb63fd45023f850985813a3f54eceaccb523d98d4c2ba77310a21f396e19a47c4f655f906783b4891de32b61a05dc7933", + "0xa113b889be5dcc859a7f50421614a51516b3aadc60489a8c52f668e035c59d61640da74ba1a608856db4ff1fa1fe2dfd", + "0x87fec026beda4217b0a2014a2e86f5920e6113b54ac79ab727da2666f57ff8a9bc3a21b327ad7e091a07720a30c507c9", + "0xa3ee8fd53158dad3b6d9757033abf2f3d1d78a4da4022643920c233711ff5378ac4a94eadcaf0416fdcca525391d0c64", + "0x8d6bed5f6b3f47b1428f00c306df550784cd24212ebac7e6384a0b1226ab50129c0341d0a10d990bd59b229869e7665a", + "0xb549cef11bf7c8bcf4bb11e5cdf5a289fc4bf145826e96a446fb4c729a2c839a4d8d38629cc599eda7efa05f3cf3425b", + "0x982691766a549df56436acd0fe76da78132e027515f27174c10d117bfcc20ed73fc31f5465bd7a22a101094fe913e221", + "0x985af1d441b93fa2a86c86b6d7b70b16973d3971e4e89e093b65f0ae626d702202336869af8e3af3923e287547d5384b", + "0x994b7baecc8bb68d270a3a88c58e4054afdbd713b4472f9522b27c1762c637ef8f013d745ce9d1dc8fc4d986d4c9338c", + "0x827dabda84c7f7b1adc0f5ca0fccf0729e9d7f78e1ffa7c5e9c4f66610ff0ab776c880b00c77137cf7abe14df977febc", + "0xacd17cba1203748b55bd9d7b940a16bb7c02988c93007a80b87e0bdb049b91f5ecce577e3e4ea68a0abe998a72cd300d", + "0x989fa046d04b41fc95a04dabb7ab8b64e84afaa85c0aa49e1c6878d7b2814094402d62ae42dfbf3ac72e6770ee0926a8", + "0x99dc48a054f448792523dcdeec819e1b928b1bd66f60f457261f0554f8532eedd7152792df70ae5316ab2f9c02a57cdc", + "0xab33c65587ecb3278325948c706aed26547e47ed2b4bc027e9119bb37bec67ddf5489fbc30304ef6c80699c10662d392", + "0xae89e41d8cfbf26057a4078f8a5146978e658801b08814190cbce017d79beaeb71558231a72bde726fa592fb0828c01c", + "0xa9901df92e2d3abbb25f3bf4b913692c4cd57da327b01c8ee2362c02fbefcf66cdb792c17a81dcbde3c9b9dba313e4a1", + "0x8ee41011424da5e2ecea941cbf069ea32420749f2519434d3d8f9725ac789753404687a6745cffe4bd5dfc8fec71a719", + "0x8cfcdfa192b17321be4e447204e1a49ecaadca70a3b5dd96b0c70ab64d1a927d1f8c11a7e596367e5fa34e2307af86fc", + "0xb8a0003e949cf994b1bb25e270cb61358200c93b1c6f611a041cf8536e2e0de59342453c5a8d13c6d4cc95ed8ce058f3", + "0xadc806dfa5fbf8ce659aab56fe6cfe0b9162ddd5874b6dcf6d658bd2a626379baeb7df80d765846fa16ad6aad0320540", + "0xa83b036b01e12cadd7260b00a750093388666aff6d9b639e2ce7dfc771504ef8b2090da28ec4613988f2ec553d1d749e", + "0x825aca3d3dfa1d0b914e59fc3eeab6afcc5dc7e30fccd4879c592da4ea9a4e8a7a1057fc5b3faab12086e587126aa443", + "0x845a4a09941f48677e6c03699770f9a56ba72695089e432a6f232294dd8da6d34e394116a9a87f3b0902c78332af9439", + "0xb2f168afc35ed9b308ab86c8c4aaf1dcd6833ce09153bb5e124dad198b006e86a941832d387b1bd34b63c261c6b88678", + "0xa094cca9d120d92c0e92ce740bc774a89667c6f796b438b0d98df0b7aef0935d8c915d5b0dad4b53e383dc9f095c29fa", + "0x956ecb233b3529b2d9cb80ae49e48667f2a3120e4a0d7131d1e9ec36db3a59dc2ef2a579cbb99d6f14880ca83f02b64c", + "0x906cde18b34f777027d0c64b16c94c9d8f94250449d353e94972d42c94dd4d915aa1b6c73a581da2986e09f336af9673", + "0x824c8a1399ab199498f84e4baa49ff2c905cf94d6ac176e27ec5e2c7985140dbaa9cc6303d906a07ab5d8e19adf25d8a", + "0x889a5cf9315383bf64dfe88e562d772213c256b0eed15ce27c41c3767c048afe06410d7675e5d59a2302993e7dc45d83", + "0x95791fb6b08443445b8757906f3a2b1a8414a9016b5f8059c577752b701d6dc1fe9b784bac1fa57a1446b7adfd11c868", + "0x99049e9a23c59bb5e8df27976b9e09067d66e4a248926d28171d6c3fdd1ab338944a8b428b2eaae5e491932c68711c7c", + "0x95c810431c8d4af4aa2b889f9ab3d87892c65a3df793f2bfd35df5cfdb604ca0129010fa9f8acae594700bece707d67f", + "0x841d77b358c4567396925040dffe17b3b82c6f199285ac621b2a95aa401ddb2bc6f07ebd5fa500af01f64d3bb44de2df", + "0x90c402a39cd1237c1c91ff04548d6af806663cbc57ff338ed309419c44121108d1fbe23f3166f61e4ab7502e728e31fd", + "0x968d44188e2d9d1508b0659e96d6dabd0b46aa22df8d182e977c7f59e13aa05d5da09f293f14f6f2ee1b996071cd2f25", + "0x8ae9585caa3c73e679fe9b00f2c691732f7b7ca096e22d88c475a89d4d55cb9fba3cd0fe0cedd64ce75c591211664955", + "0x94b81d5ad72efb4dd60867e71afcd8e87e1f24bf958d42fc07db66f6185a1e610987ab9ceef63109a36fe5544a0cf826", + "0x8499a8c3d67d1f6eccf1c69274393dc498cff862ea8e6c11ffb8107ae190d258ddc1d294f2a8f050488df0212063ece2", + "0x921109a390e4d7fbc94dff3228db755f71cb00df70a1d48f92d1a6352f5169025bb68bcd04d96ac72f40000cc140f863", + "0xb464d763e5ef724ab7ee13a60015df5c9a7809a79188ff6a7e0d5e5400febd42ad7330406a59704a44a08f2289d659c8", + "0x96f1a36134e0d4137a7fe8bbb354f50aaa67f28f194ae2fdbe8be3eb24596678d8c9287765ee90c1f2778d0d607931e0", + "0xb031d93b8f119211af76cfafee7c157d3759b2167ee1495d79ad5f83647d38248b4345917309ef1a10ecaa579af34760", + "0x88a7dc337d89324f025f686f37d21240c7da9a1cb802259ea8d8a83e246dcc2adceca7ca3534bc7bf8f3ae1cbeafb5c0", + "0xb30e022b8a563655074e08e123b5f96956bbf0fe221cc629c5fedd2764a66b475916ceb98867f935b4a47212e53ae9f3", + "0xab6e3180dae399d41243f23545e5e6d118844f9b8edba502a3503fd1162ed826f9fc610889a1d685d374b6c21e86067d", + "0x96cf5760c79cfc830d1d5bd6df6cfd67596bef24e22eed52cee04c290ad418add74e77965ea5748b7f0fb34ee4f43232", + "0xa5817c74a394b0359a4376ef7e9e8f7dfa6a7829602da225074fb392b715e1fd52c50cae0f128a7006f28b22f233fbf5", + "0xa50ab79cf3f6777a45f28d1b5cdad2c7ea718c60efeeb4c828d6307b29ef319445e6a9f98aa90f351c78b496575150c1", + "0x8b300dea07e73dd2f07b05d477e51f8424589f6b2fa6f461240e1322a3a7ab5bf227b74544bb5d66a297702cdbf6c6bf", + "0xb13b5cb86dc8b8fe87125f1a51fe98db36bdde4f600401408b75059a44e70b1bbfefd874e539691f3f1bf6f54db883c8", + "0x8d06205cd66703ce6776b38b98c32b27f45c7b3f65ea2d05e2b702c24d553f51c69bf0b17e8db7382475e3d370d2e8d6", + "0xa11a7496c712734aec80738e30d2bf245758b34245076149854eb209fa6403be8bb0d4e515becc881b7f3610749260c0", + "0x9615800f8c95f95bf25055ae079b964e0a64fa0176cc98da272662014f57e7cd2745929daf838df0094b9f54be18b415", + "0xb19ca6e55f349bbb2dc3e429520ff5b2e817972470794f35c1aac8c118b37a694cfcc875b6d72225343799825d2f5c39", + "0xa650864b7eb6769aaf0625c254891447351e702e40d2be34dfd25f3b5367370de354318d8935ba18db7929270455ae6a", + "0xa649208372f44f32eb1cd895de458ca1b8be782746356f08ac8ef629429d0780a0799fcff85736e19aead0b79bfff261", + "0x89461cb2dadf51d6f1208b0965c8eabec895d7b19b7d90d3c6e49dbe75a75c30fd26db3dfb169dd46a4342280225032a", + "0xb5d6f664ec92e5343792d5d6b629919c5fd8cfb874677df2264daf02bcd9d12facf9b859d5402839c9022396e20d260b", + "0xa7179d338fe5a0e4669364a364e17f8d00cb6c59a80a069afd5f4f14510df2eee90c07826553e4f7fe46d28f72b2903e", + "0x8ded37d67b5368619a090266e9b5585fbff60319a90a4244a3c3342641f5bfa5130998dd97d7a42505cd896c29255530", + "0xa3fd63e87a00b48ba46a646a26187ae6dcb16779721973ada13a545853e2e51b5e4df04630d670884ad4a2304cc60c67", + "0x92761b7e31f0c758b3b1f5b43a194b25aabec668101946eb6511132863d3afb9d18f833d43a8338d0e7bc78d8689e523", + "0xab8a8769c754008a7976b6799e81d7bfe97413d0a79b90715703c1f8f567675463ec93aabee59277121fc4df88b5c7a9", + "0xb354d0d1bd942f79002a2eaf37eb99dab650170e7040c13c824803ed7c1670dc910ccae13bbe58bde003829b140b45ea", + "0xb9eed89e003894ad2cc9d9b93a45247e1367ac69a00b0ed5e3280c1188b4cb90eb870d449b83a852a798bd02f9d0c813", + "0xb900a55013d0427e5da6b21611d6ae3e648f54f794cb099b2d2beebae0a957477a94dc415e8ec5e68e9029ce50d43843", + "0xafbf44071c2c905f7c8ef396eaed7f13deb7a91719cb5e8b9226aaceb876d81a10076383edc6216bc2f5c38a480b2957", + "0x80bdb82b7d583bf1e41653966b0ba3b4fec0e7df2ff08e3fa06fd9064bca0364263e075e1582741a5243bde786c9c32e", + "0xa841fe9ff26db21ade698f6dbfba025d90ae9f81f02af9e008fa0a429b993fb04d06acb93e40a9f81c78f73334555a17", + "0x8cd49711b42af58a5aae75a38fea9ddc5e4183c467a3159b5b0629f01ba548513c577456d34c861911e85782e52c3b1b", + "0xa322b5d2a6e3cb98b8aaa4c068e097188affef5dec2f08c3e9ce29e73687340d4e5a743a8be5f10e138f9cabbe0c7211", + "0x942772b7c7c47d4e5957ccf1d6f1450070930af3e2b7eaab0dd7699372445df0cc910e6c0efcf501887dd1adabdaee23", + "0x9834f66e5c946c3a8241ca2bbde046a7e88072124911d5d15c037a95b61e82b88b5c2058fa4a3721537dee39dee5da18", + "0xa90cc5b9c4d84f36962d0d55d5bc123dbe5ec5f4fe7b6bf0d009028b3cf14e36c11bc5365391cb4ae548d5eb04fe371b", + "0xa7c2174eea2b66b2a71cc8095fae39c423a353c7d5020ec2d0551317a66202fcf082c6119ba768755523fff49791bb4e", + "0xab92b2a177dfa55d202a653532f0e04d1339ca301aebe6a0e8419bf45be3e573b6b9ae4d3d822cc8279367a3d2c39b06", + "0x8a9ad977988eb8d98d9f549e4fd2305348a34e6874674bcd6e467c793bba6d7a2f3c20fa44aabbf7151ca53ecb1612f6", + "0xa7d1676816e81a752267d309014de1772b571b109c2901dc7c9810f45417faa18c81965c114be489ed178e54ac3687a1", + "0xa575be185551c40eb8edbdb21a0df381c801b6e99467fcf5882dd7cb34916960ce47ac732c1920ad3218f497b690cef4", + "0xb50c306f78143b37986e68efa10dbe1fb047d58562e9b5c5439b341dd8f1896c7ae586afac0a3213759784a905c1caaa", + "0xb31e89b4a034c1b73d43b3d63ea3bddea682a6a5327eff389c70b13e9e72185b0327682a0cb1ff3c4a4f8ba08b13d898" + ], + "aggregate_pubkey": "0x948a4b8d91bd29969cd4470b1bc24d34586d38e73d5be71c98a9894899471a5f708747563276b4b6d2716fdb72860267" + }, + "next_sync_committee_branch": [ + "0xcb3fea582872d90706ddc6d029bac0d791ea75d43c3ab04f056f62a11b89d27b", + "0xf26b4bb68eb7e6906c8ef4a9958398a48e4450bf9c8a462fafa4fde51cd5628f", + "0x690925f92c1d322d2ff2a5636539094825dfd2c9bf7538fe111b2358e03a71de", + "0x51d977e358166401c7cd3f6185468c1a8c69a4c3d8577535dd583bc427692e02", + "0x88d2089aaf2f6fd8f6e4ae499c6fe33cc34289eb9310780861e772204f07b670" + ] + }, + "finalized_header": { + "slot": 4055040, + "proposer_index": 854, + "parent_root": "0x8adf3b288deb17566a553fa7a06a2f63f4ac4cea4868af4d89ddca41f73ae9b9", + "state_root": "0x595e9ebaaa23f027672b4d2a33173a22b2839baac709c7f8e66d3219f492ee9f", + "body_root": "0xacf37b466d4f6b5d1db5b6ffe5d77c13972d116c2b0809de924427fd597d391a" + }, + "finality_branch": [ + "0x00ef010000000000000000000000000000000000000000000000000000000000", + "0x3d4be5d019ba15ea3ef304a83b8a067f2e79f46a3fac8069306a6c814a0a35eb", + "0xa2e2a28c0bb0ad56c25f3c461a4bfe4f3b3b894bc0105a62e85f43a4ae1adc3f", + "0x690925f92c1d322d2ff2a5636539094825dfd2c9bf7538fe111b2358e03a71de", + "0x51d977e358166401c7cd3f6185468c1a8c69a4c3d8577535dd583bc427692e02", + "0x88d2089aaf2f6fd8f6e4ae499c6fe33cc34289eb9310780861e772204f07b670" + ], + "block_roots_root": "0x7054ba439f83e9b2223911e25fad48eb28f5c362d94c0de2455a45436cc93897", + "block_roots_branch": [ + "0xc99a842c81d0b956eef988dbcd90499457d61f942375c6cbf67262909b708db5", + "0x5d32345aeb10aa3ede4be021d2231dac47cc2074f74b72466f0b042e69adf70f", + "0xb69608a2377956c1a39c3423d3399ccfb12307623c9df6358f5fcfca64a80102", + "0xcefd9b668e49ece82bd4b0ee2f1efc88ecaf0d9af464fb622735663aaf106c4c", + "0xc113ad1c971779b15c64772ab69cd775edfb926a60447974913bb6f58fbd12fb" + ] +} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/outbound-queue/src/lib.rs b/snowbridge/parachain/pallets/outbound-queue/src/lib.rs index 201e524fb91..c3401c4dc94 100644 --- a/snowbridge/parachain/pallets/outbound-queue/src/lib.rs +++ b/snowbridge/parachain/pallets/outbound-queue/src/lib.rs @@ -109,7 +109,7 @@ use sp_runtime::{ DigestItem, }; use sp_std::prelude::*; -pub use types::{CommittedMessage, FeeConfigRecord, ProcessMessageOriginOf}; +pub use types::{CommittedMessage, ProcessMessageOriginOf}; pub use weights::WeightInfo; pub use pallet::*; @@ -186,12 +186,7 @@ pub mod pallet { count: u64, }, /// Set OperatingMode - OperatingModeChanged { - mode: BasicOperatingMode, - }, - FeeConfigChanged { - fee_config: FeeConfigRecord, - }, + OperatingModeChanged { mode: BasicOperatingMode }, } #[pallet::error] @@ -200,8 +195,6 @@ pub mod pallet { MessageTooLarge, /// The pallet is halted Halted, - // Invalid fee config - InvalidFeeConfig, /// Invalid Channel InvalidChannel, } diff --git a/snowbridge/parachain/pallets/outbound-queue/src/types.rs b/snowbridge/parachain/pallets/outbound-queue/src/types.rs index 07803ed9b73..28d400bb9d4 100644 --- a/snowbridge/parachain/pallets/outbound-queue/src/types.rs +++ b/snowbridge/parachain/pallets/outbound-queue/src/types.rs @@ -1,11 +1,9 @@ -use codec::{Decode, Encode, MaxEncodedLen}; +use codec::{Decode, Encode}; use ethabi::Token; use frame_support::traits::ProcessMessage; use scale_info::TypeInfo; -use serde::{Deserialize, Serialize}; -use sp_arithmetic::FixedU128; use sp_core::H256; -use sp_runtime::{traits::Zero, RuntimeDebug}; +use sp_runtime::RuntimeDebug; use sp_std::prelude::*; use super::Pallet; @@ -57,43 +55,3 @@ impl From for Token { ]) } } - -/// Configuration for fee calculations -#[derive( - Encode, - Decode, - Copy, - Clone, - PartialEq, - RuntimeDebug, - MaxEncodedLen, - TypeInfo, - Serialize, - Deserialize, -)] -pub struct FeeConfigRecord { - /// ETH/DOT exchange rate - pub exchange_rate: FixedU128, - /// Ether fee per unit of gas - pub fee_per_gas: u128, - /// Ether reward for delivering message - pub reward: u128, -} - -#[derive(RuntimeDebug)] -pub struct InvalidFeeConfig; - -impl FeeConfigRecord { - pub fn validate(&self) -> Result<(), InvalidFeeConfig> { - if self.exchange_rate == FixedU128::zero() { - return Err(InvalidFeeConfig) - } - if self.fee_per_gas == 0 { - return Err(InvalidFeeConfig) - } - if self.reward == 0 { - return Err(InvalidFeeConfig) - } - Ok(()) - } -} diff --git a/snowbridge/parachain/runtime/tests/Cargo.toml b/snowbridge/parachain/runtime/tests/Cargo.toml index 9b5000b56cd..0a09f89c6b9 100644 --- a/snowbridge/parachain/runtime/tests/Cargo.toml +++ b/snowbridge/parachain/runtime/tests/Cargo.toml @@ -233,8 +233,8 @@ try-runtime = [ "snowbridge-system/try-runtime", "sp-runtime/try-runtime", ] -beacon-spec-mainnet = [ - "snowbridge-ethereum-beacon-client/beacon-spec-mainnet", +fast-runtime = [ + "bridge-hub-rococo-runtime/fast-runtime", ] experimental = ["pallet-aura/experimental"] diff --git a/snowbridge/parachain/scripts/verify-pallets-build.sh b/snowbridge/parachain/scripts/verify-pallets-build.sh index f060cf958b7..74cec954832 100755 --- a/snowbridge/parachain/scripts/verify-pallets-build.sh +++ b/snowbridge/parachain/scripts/verify-pallets-build.sh @@ -57,6 +57,8 @@ rm -rf $SNOWBRIDGE_FOLDER/codecov.yml rm -rf $SNOWBRIDGE_FOLDER/docs rm -rf $SNOWBRIDGE_FOLDER/hooks rm -rf $SNOWBRIDGE_FOLDER/relayer +rm -rf $SNOWBRIDGE_FOLDER/scripts +rm -rf $SNOWBRIDGE_FOLDER/SECURITY.md rm -rf $SNOWBRIDGE_FOLDER/smoketest rm -rf $SNOWBRIDGE_FOLDER/web rm -rf $SNOWBRIDGE_FOLDER/.envrc-example @@ -74,6 +76,7 @@ rm -rf $SNOWBRIDGE_FOLDER/rust-toolchain.toml rm -rf $SNOWBRIDGE_FOLDER/parachain/rustfmt.toml rm -rf $SNOWBRIDGE_FOLDER/parachain/.gitignore rm -rf $SNOWBRIDGE_FOLDER/parachain/templates +rm -rf $SNOWBRIDGE_FOLDER/parachain/.cargo rm -rf $SNOWBRIDGE_FOLDER/parachain/.config rm -rf $SNOWBRIDGE_FOLDER/parachain/pallets/ethereum-beacon-client/fuzz From b17b01e5b354ddb8557e8536c58f906ed2392cdf Mon Sep 17 00:00:00 2001 From: Clara van Staden Date: Wed, 10 Jan 2024 18:51:27 +0200 Subject: [PATCH 08/15] Update Snowbridge versions and prep for publishing (#2894) - updates snowbridge crates to `0.9.0` - updates Cargo.toml files in preparation for publishing to crates.io - adds Kusama and Polkadot Snowbridge runtime config crates - moves runtime tests from the Snowbridge subtree into the bridge hub tests dir --------- Co-authored-by: claravanstaden Co-authored-by: Ron --- .../Cargo.toml | 14 ++- .../pallets/ethereum-client/README.md | 3 + .../benchmark.md | 16 ++-- .../src/benchmarking/fixtures_mainnet.rs | 0 .../src/benchmarking/fixtures_minimal.rs | 0 .../src/benchmarking/mod.rs | 0 .../src/benchmarking/util.rs | 0 .../src/config/mainnet.rs | 0 .../src/config/minimal.rs | 0 .../src/config/mod.rs | 0 .../src/functions.rs | 0 .../src/impls.rs | 12 +-- .../src/lib.rs | 4 +- .../src/mock.rs | 29 +----- .../src/tests.rs | 0 .../src/types.rs | 0 .../src/weights.rs | 2 +- .../execution-header-update.mainnet.json | 0 .../execution-header-update.minimal.json | 0 .../finalized-header-update.mainnet.json | 0 .../finalized-header-update.minimal.json | 0 .../fixtures/initial-checkpoint.mainnet.json | 0 .../fixtures/initial-checkpoint.minimal.json | 0 .../next-finalized-header-update.mainnet.json | 0 .../next-finalized-header-update.minimal.json | 0 .../next-sync-committee-update.mainnet.json | 0 .../next-sync-committee-update.minimal.json | 0 .../sync-committee-update.mainnet.json | 0 .../sync-committee-update.minimal.json | 0 .../pallets/inbound-queue/Cargo.toml | 23 +++-- .../parachain/pallets/inbound-queue/README.md | 3 + .../pallets/inbound-queue/src/lib.rs | 52 +++++++--- .../pallets/inbound-queue/src/mock.rs | 52 +++++++++- .../pallets/inbound-queue/src/test.rs | 1 + .../pallets/outbound-queue/Cargo.toml | 14 ++- .../pallets/outbound-queue/README.md | 3 + .../outbound-queue/merkle-tree/Cargo.toml | 10 +- .../outbound-queue/merkle-tree/README.md | 4 + .../outbound-queue/runtime-api/Cargo.toml | 10 +- .../outbound-queue/runtime-api/README.md | 6 ++ .../pallets/outbound-queue/src/lib.rs | 4 +- .../pallets/outbound-queue/src/test.rs | 4 +- .../pallets/outbound-queue/src/weights.rs | 6 +- .../parachain/pallets/system/Cargo.toml | 20 ++-- snowbridge/parachain/pallets/system/README.md | 4 +- .../pallets/system/runtime-api/Cargo.toml | 10 +- .../pallets/system/runtime-api/README.md | 3 + .../parachain/pallets/system/src/lib.rs | 2 + .../parachain/pallets/system/src/mock.rs | 4 +- .../parachain/primitives/beacon/Cargo.toml | 9 +- .../parachain/primitives/beacon/README.md | 10 ++ .../parachain/primitives/core/Cargo.toml | 9 +- .../parachain/primitives/core/README.md | 4 + .../parachain/primitives/ethereum/Cargo.toml | 9 +- .../parachain/primitives/ethereum/README.md | 4 + .../parachain/primitives/router/Cargo.toml | 9 +- .../parachain/primitives/router/README.md | 4 + .../runtime/rococo-common/Cargo.toml | 26 ----- .../runtime/rococo-common/src/lib.rs | 16 ---- .../runtime/runtime-common/Cargo.toml | 9 +- .../runtime/runtime-common/README.md | 3 + .../runtime/{tests => test-common}/Cargo.toml | 81 ++++------------ .../parachain/runtime/test-common/README.md | 3 + .../test_cases.rs => test-common/src/lib.rs} | 49 +++++----- snowbridge/parachain/runtime/tests/src/lib.rs | 94 ------------------- snowbridge/parachain/scripts/benchmark.sh | 4 +- .../parachain/scripts/verify-pallets-build.sh | 26 ++--- 67 files changed, 336 insertions(+), 348 deletions(-) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/Cargo.toml (93%) create mode 100644 snowbridge/parachain/pallets/ethereum-client/README.md rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/benchmark.md (88%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/src/benchmarking/fixtures_mainnet.rs (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/src/benchmarking/fixtures_minimal.rs (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/src/benchmarking/mod.rs (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/src/benchmarking/util.rs (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/src/config/mainnet.rs (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/src/config/minimal.rs (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/src/config/mod.rs (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/src/functions.rs (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/src/impls.rs (91%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/src/lib.rs (99%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/src/mock.rs (92%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/src/tests.rs (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/src/types.rs (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/src/weights.rs (97%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/tests/fixtures/execution-header-update.mainnet.json (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/tests/fixtures/execution-header-update.minimal.json (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/tests/fixtures/finalized-header-update.mainnet.json (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/tests/fixtures/finalized-header-update.minimal.json (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/tests/fixtures/initial-checkpoint.mainnet.json (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/tests/fixtures/initial-checkpoint.minimal.json (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/tests/fixtures/next-finalized-header-update.mainnet.json (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/tests/fixtures/next-finalized-header-update.minimal.json (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/tests/fixtures/next-sync-committee-update.mainnet.json (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/tests/fixtures/next-sync-committee-update.minimal.json (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/tests/fixtures/sync-committee-update.mainnet.json (100%) rename snowbridge/parachain/pallets/{ethereum-beacon-client => ethereum-client}/tests/fixtures/sync-committee-update.minimal.json (100%) create mode 100644 snowbridge/parachain/pallets/inbound-queue/README.md create mode 100644 snowbridge/parachain/pallets/outbound-queue/README.md create mode 100644 snowbridge/parachain/pallets/outbound-queue/merkle-tree/README.md create mode 100644 snowbridge/parachain/pallets/outbound-queue/runtime-api/README.md create mode 100644 snowbridge/parachain/pallets/system/runtime-api/README.md create mode 100644 snowbridge/parachain/primitives/beacon/README.md create mode 100644 snowbridge/parachain/primitives/core/README.md create mode 100644 snowbridge/parachain/primitives/ethereum/README.md create mode 100644 snowbridge/parachain/primitives/router/README.md delete mode 100644 snowbridge/parachain/runtime/rococo-common/Cargo.toml delete mode 100644 snowbridge/parachain/runtime/rococo-common/src/lib.rs create mode 100644 snowbridge/parachain/runtime/runtime-common/README.md rename snowbridge/parachain/runtime/{tests => test-common}/Cargo.toml (78%) create mode 100644 snowbridge/parachain/runtime/test-common/README.md rename snowbridge/parachain/runtime/{tests/src/test_cases.rs => test-common/src/lib.rs} (88%) delete mode 100644 snowbridge/parachain/runtime/tests/src/lib.rs diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml b/snowbridge/parachain/pallets/ethereum-client/Cargo.toml similarity index 93% rename from snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml rename to snowbridge/parachain/pallets/ethereum-client/Cargo.toml index 9f8749c89da..59efcf91fd0 100644 --- a/snowbridge/parachain/pallets/ethereum-beacon-client/Cargo.toml +++ b/snowbridge/parachain/pallets/ethereum-client/Cargo.toml @@ -1,11 +1,15 @@ [package] -name = "snowbridge-ethereum-beacon-client" -description = "Snowbridge Beacon Client Pallet" -version = "0.0.1" -edition = "2021" +name = "snowbridge-pallet-ethereum-client" +description = "Snowbridge Ethereum Client Pallet" +version = "0.9.0" authors = ["Snowfork "] -repository = "https://github.com/Snowfork/snowbridge" +edition.workspace = true +repository.workspace = true license = "Apache-2.0" +categories = ["cryptography::cryptocurrencies"] + +[lints] +workspace = true [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/snowbridge/parachain/pallets/ethereum-client/README.md b/snowbridge/parachain/pallets/ethereum-client/README.md new file mode 100644 index 00000000000..0cd3b9f8558 --- /dev/null +++ b/snowbridge/parachain/pallets/ethereum-client/README.md @@ -0,0 +1,3 @@ +# Ethereum Beacon Client + +The Ethereum Beacon Client is an on-chain light client that tracks Ethereum consensus using the beacon chain. diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/benchmark.md b/snowbridge/parachain/pallets/ethereum-client/benchmark.md similarity index 88% rename from snowbridge/parachain/pallets/ethereum-beacon-client/benchmark.md rename to snowbridge/parachain/pallets/ethereum-client/benchmark.md index de976e12149..2e19fece7cb 100644 --- a/snowbridge/parachain/pallets/ethereum-beacon-client/benchmark.md +++ b/snowbridge/parachain/pallets/ethereum-client/benchmark.md @@ -7,15 +7,15 @@ for it is super helpful. # Benchmark We add several benchmarks -[here](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/benchmarking/mod.rs#L98-L124) +[here](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-client/src/benchmarking/mod.rs#L98-L124) as following to demonstrate -[bls_fast_aggregate_verify](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/lib.rs#L764) +[bls_fast_aggregate_verify](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-client/src/lib.rs#L764) is the main bottleneck. Test data -[here](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/benchmarking/data_mainnet.rs#L553-L1120) +[here](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-client/src/benchmarking/data_mainnet.rs#L553-L1120) is real from goerli network which contains 512 public keys from sync committee. ## sync_committee_period_update -Base line benchmark for extrinsic [sync_committee_period_update](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/lib.rs#L233) +Base line benchmark for extrinsic [sync_committee_period_update](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-client/src/lib.rs#L233) ## bls_fast_aggregate_verify Subfunction of extrinsic `sync_committee_period_update` which does what @@ -59,14 +59,14 @@ cargo run --release --bin polkadot-parachain \ benchmark pallet \ --base-path /mnt/scratch/benchmark \ --chain=bridge-hub-rococo-dev \ ---pallet=snowbridge_ethereum_beacon_client \ +--pallet=snowbridge_pallet_ethereum_client \ --extrinsic="*" \ --execution=wasm --wasm-execution=compiled \ --steps 50 --repeat 20 \ ---output ./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_ethereum_beacon_client.rs +--output ./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs ``` -### [Weights](https://github.com/Snowfork/cumulus/blob/ron/benchmark-beacon-bridge/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_ethereum_beacon_client.rs) +### [Weights](https://github.com/Snowfork/cumulus/blob/ron/benchmark-beacon-bridge/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs) |extrinsic | minimum execution time benchmarked(us) | | --------------------------------------- |----------------------------------------| @@ -84,5 +84,5 @@ benchmark pallet \ # Conclusion A high level host function specific for -[bls_fast_aggregate_verify](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-beacon-client/src/lib.rs#L764) +[bls_fast_aggregate_verify](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-client/src/lib.rs#L764) is super helpful. diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures_mainnet.rs b/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/fixtures_mainnet.rs similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures_mainnet.rs rename to snowbridge/parachain/pallets/ethereum-client/src/benchmarking/fixtures_mainnet.rs diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures_minimal.rs b/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/fixtures_minimal.rs similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/fixtures_minimal.rs rename to snowbridge/parachain/pallets/ethereum-client/src/benchmarking/fixtures_minimal.rs diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/mod.rs b/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/mod.rs similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/mod.rs rename to snowbridge/parachain/pallets/ethereum-client/src/benchmarking/mod.rs diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/util.rs b/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/util.rs similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/src/benchmarking/util.rs rename to snowbridge/parachain/pallets/ethereum-client/src/benchmarking/util.rs diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mainnet.rs b/snowbridge/parachain/pallets/ethereum-client/src/config/mainnet.rs similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mainnet.rs rename to snowbridge/parachain/pallets/ethereum-client/src/config/mainnet.rs diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/minimal.rs b/snowbridge/parachain/pallets/ethereum-client/src/config/minimal.rs similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/src/config/minimal.rs rename to snowbridge/parachain/pallets/ethereum-client/src/config/minimal.rs diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mod.rs b/snowbridge/parachain/pallets/ethereum-client/src/config/mod.rs similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/src/config/mod.rs rename to snowbridge/parachain/pallets/ethereum-client/src/config/mod.rs diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/functions.rs b/snowbridge/parachain/pallets/ethereum-client/src/functions.rs similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/src/functions.rs rename to snowbridge/parachain/pallets/ethereum-client/src/functions.rs diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/impls.rs b/snowbridge/parachain/pallets/ethereum-client/src/impls.rs similarity index 91% rename from snowbridge/parachain/pallets/ethereum-beacon-client/src/impls.rs rename to snowbridge/parachain/pallets/ethereum-client/src/impls.rs index 7e72b12631c..300431d8770 100644 --- a/snowbridge/parachain/pallets/ethereum-beacon-client/src/impls.rs +++ b/snowbridge/parachain/pallets/ethereum-client/src/impls.rs @@ -15,7 +15,7 @@ impl Verifier for Pallet { /// ancestor of a finalized beacon block. fn verify(event_log: &Log, proof: &Proof) -> Result<(), VerificationError> { log::info!( - target: "ethereum-beacon-client", + target: "ethereum-client", "💫 Verifying message with block hash {}", proof.block_hash, ); @@ -26,7 +26,7 @@ impl Verifier for Pallet { Ok(receipt) => receipt, Err(err) => { log::error!( - target: "ethereum-beacon-client", + target: "ethereum-client", "💫 Verification of receipt inclusion failed for block {}: {:?}", proof.block_hash, err @@ -36,7 +36,7 @@ impl Verifier for Pallet { }; log::trace!( - target: "ethereum-beacon-client", + target: "ethereum-client", "💫 Verified receipt inclusion for transaction at index {} in block {}", proof.tx_index, proof.block_hash, ); @@ -52,7 +52,7 @@ impl Verifier for Pallet { if !receipt.contains_log(&event_log) { log::error!( - target: "ethereum-beacon-client", + target: "ethereum-client", "💫 Event log not found in receipt for transaction at index {} in block {}", proof.tx_index, proof.block_hash, ); @@ -60,7 +60,7 @@ impl Verifier for Pallet { } log::info!( - target: "ethereum-beacon-client", + target: "ethereum-client", "💫 Receipt verification successful for {}", proof.block_hash, ); @@ -82,7 +82,7 @@ impl Pallet { Ok(receipt) => Ok(receipt), Err(err) => { log::trace!( - target: "ethereum-beacon-client", + target: "ethereum-client", "💫 Failed to decode transaction receipt: {}", err ); diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/lib.rs b/snowbridge/parachain/pallets/ethereum-client/src/lib.rs similarity index 99% rename from snowbridge/parachain/pallets/ethereum-beacon-client/src/lib.rs rename to snowbridge/parachain/pallets/ethereum-client/src/lib.rs index 53877ea58fe..c99458441a5 100644 --- a/snowbridge/parachain/pallets/ethereum-beacon-client/src/lib.rs +++ b/snowbridge/parachain/pallets/ethereum-client/src/lib.rs @@ -61,7 +61,7 @@ pub use pallet::*; pub use config::SLOTS_PER_HISTORICAL_ROOT; -pub const LOG_TARGET: &str = "ethereum-beacon-client"; +pub const LOG_TARGET: &str = "ethereum-client"; #[frame_support::pallet] pub mod pallet { @@ -692,7 +692,7 @@ pub mod pallet { /// Stores the provided execution header in pallet storage. The header is stored /// in a ring buffer map, with the block hash as map key. The last imported execution /// header is also kept in storage, for the relayer to check import progress. - pub(crate) fn store_execution_header( + pub fn store_execution_header( block_hash: H256, header: CompactExecutionHeader, beacon_slot: u64, diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs b/snowbridge/parachain/pallets/ethereum-client/src/mock.rs similarity index 92% rename from snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs rename to snowbridge/parachain/pallets/ethereum-client/src/mock.rs index b25e8b0e813..217d37db8df 100644 --- a/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs +++ b/snowbridge/parachain/pallets/ethereum-client/src/mock.rs @@ -11,6 +11,11 @@ use sp_core::H256; use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; use std::{fs::File, path::PathBuf}; +#[cfg(feature = "beacon-spec-minimal")] +const SPEC: &str = "minimal"; +#[cfg(not(feature = "beacon-spec-minimal"))] +const SPEC: &str = "mainnet"; + fn load_fixture(basename: String) -> Result where T: for<'de> serde::Deserialize<'de>, @@ -21,60 +26,36 @@ where } pub fn load_execution_header_update_fixture() -> primitives::ExecutionHeaderUpdate { - #[cfg(feature = "beacon-spec-minimal")] - const SPEC: &str = "minimal"; - #[cfg(not(feature = "beacon-spec-minimal"))] - const SPEC: &str = "mainnet"; let basename = format!("execution-header-update.{}.json", SPEC); load_fixture(basename).unwrap() } pub fn load_checkpoint_update_fixture( ) -> primitives::CheckpointUpdate<{ config::SYNC_COMMITTEE_SIZE }> { - #[cfg(feature = "beacon-spec-minimal")] - const SPEC: &str = "minimal"; - #[cfg(not(feature = "beacon-spec-minimal"))] - const SPEC: &str = "mainnet"; let basename = format!("initial-checkpoint.{}.json", SPEC); load_fixture(basename).unwrap() } pub fn load_sync_committee_update_fixture( ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { - #[cfg(feature = "beacon-spec-minimal")] - const SPEC: &str = "minimal"; - #[cfg(not(feature = "beacon-spec-minimal"))] - const SPEC: &str = "mainnet"; let basename = format!("sync-committee-update.{}.json", SPEC); load_fixture(basename).unwrap() } pub fn load_finalized_header_update_fixture( ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { - #[cfg(feature = "beacon-spec-minimal")] - const SPEC: &str = "minimal"; - #[cfg(not(feature = "beacon-spec-minimal"))] - const SPEC: &str = "mainnet"; let basename = format!("finalized-header-update.{}.json", SPEC); load_fixture(basename).unwrap() } pub fn load_next_sync_committee_update_fixture( ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { - #[cfg(feature = "beacon-spec-minimal")] - const SPEC: &str = "minimal"; - #[cfg(not(feature = "beacon-spec-minimal"))] - const SPEC: &str = "mainnet"; let basename = format!("next-sync-committee-update.{}.json", SPEC); load_fixture(basename).unwrap() } pub fn load_next_finalized_header_update_fixture( ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { - #[cfg(feature = "beacon-spec-minimal")] - const SPEC: &str = "minimal"; - #[cfg(not(feature = "beacon-spec-minimal"))] - const SPEC: &str = "mainnet"; let basename = format!("next-finalized-header-update.{}.json", SPEC); load_fixture(basename).unwrap() } diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/tests.rs b/snowbridge/parachain/pallets/ethereum-client/src/tests.rs similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/src/tests.rs rename to snowbridge/parachain/pallets/ethereum-client/src/tests.rs diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/types.rs b/snowbridge/parachain/pallets/ethereum-client/src/types.rs similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/src/types.rs rename to snowbridge/parachain/pallets/ethereum-client/src/types.rs diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/src/weights.rs b/snowbridge/parachain/pallets/ethereum-client/src/weights.rs similarity index 97% rename from snowbridge/parachain/pallets/ethereum-beacon-client/src/weights.rs rename to snowbridge/parachain/pallets/ethereum-client/src/weights.rs index 69d3e809986..e1a5578f466 100644 --- a/snowbridge/parachain/pallets/ethereum-beacon-client/src/weights.rs +++ b/snowbridge/parachain/pallets/ethereum-client/src/weights.rs @@ -20,7 +20,7 @@ // --repeat // 10 // --output -// pallets/ethereum-beacon-client/src/weights.rs +// pallets/ethereum-client/src/weights.rs // --template // templates/module-weight-template.hbs diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/execution-header-update.mainnet.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/execution-header-update.mainnet.json similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/execution-header-update.mainnet.json rename to snowbridge/parachain/pallets/ethereum-client/tests/fixtures/execution-header-update.mainnet.json diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/execution-header-update.minimal.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/execution-header-update.minimal.json similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/execution-header-update.minimal.json rename to snowbridge/parachain/pallets/ethereum-client/tests/fixtures/execution-header-update.minimal.json diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/finalized-header-update.mainnet.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/finalized-header-update.mainnet.json similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/finalized-header-update.mainnet.json rename to snowbridge/parachain/pallets/ethereum-client/tests/fixtures/finalized-header-update.mainnet.json diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/finalized-header-update.minimal.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/finalized-header-update.minimal.json similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/finalized-header-update.minimal.json rename to snowbridge/parachain/pallets/ethereum-client/tests/fixtures/finalized-header-update.minimal.json diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/initial-checkpoint.mainnet.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/initial-checkpoint.mainnet.json similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/initial-checkpoint.mainnet.json rename to snowbridge/parachain/pallets/ethereum-client/tests/fixtures/initial-checkpoint.mainnet.json diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/initial-checkpoint.minimal.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/initial-checkpoint.minimal.json similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/initial-checkpoint.minimal.json rename to snowbridge/parachain/pallets/ethereum-client/tests/fixtures/initial-checkpoint.minimal.json diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-finalized-header-update.mainnet.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-finalized-header-update.mainnet.json similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-finalized-header-update.mainnet.json rename to snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-finalized-header-update.mainnet.json diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-finalized-header-update.minimal.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-finalized-header-update.minimal.json similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-finalized-header-update.minimal.json rename to snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-finalized-header-update.minimal.json diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-sync-committee-update.mainnet.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-sync-committee-update.mainnet.json similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-sync-committee-update.mainnet.json rename to snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-sync-committee-update.mainnet.json diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-sync-committee-update.minimal.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-sync-committee-update.minimal.json similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/next-sync-committee-update.minimal.json rename to snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-sync-committee-update.minimal.json diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/sync-committee-update.mainnet.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/sync-committee-update.mainnet.json similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/sync-committee-update.mainnet.json rename to snowbridge/parachain/pallets/ethereum-client/tests/fixtures/sync-committee-update.mainnet.json diff --git a/snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/sync-committee-update.minimal.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/sync-committee-update.minimal.json similarity index 100% rename from snowbridge/parachain/pallets/ethereum-beacon-client/tests/fixtures/sync-committee-update.minimal.json rename to snowbridge/parachain/pallets/ethereum-client/tests/fixtures/sync-committee-update.minimal.json diff --git a/snowbridge/parachain/pallets/inbound-queue/Cargo.toml b/snowbridge/parachain/pallets/inbound-queue/Cargo.toml index 6a5ea6f8222..f645b4224d1 100644 --- a/snowbridge/parachain/pallets/inbound-queue/Cargo.toml +++ b/snowbridge/parachain/pallets/inbound-queue/Cargo.toml @@ -1,11 +1,15 @@ [package] -name = "snowbridge-inbound-queue" -description = "Snowbridge Inbound Queue" -version = "0.1.1" -edition = "2021" +name = "snowbridge-pallet-inbound-queue" +description = "Snowbridge Inbound Queue Pallet" +version = "0.9.0" authors = ["Snowfork "] -repository = "https://github.com/Snowfork/snowbridge" +edition.workspace = true +repository.workspace = true license = "Apache-2.0" +categories = ["cryptography::cryptocurrencies"] + +[lints] +workspace = true [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] @@ -32,6 +36,7 @@ sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-fea xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false } +xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false } snowbridge-core = { path = "../../primitives/core", default-features = false } snowbridge-ethereum = { path = "../../primitives/ethereum", default-features = false } @@ -42,7 +47,7 @@ snowbridge-beacon-primitives = { path = "../../primitives/beacon", default-featu frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking" } sp-keyring = { path = "../../../../../substrate/primitives/keyring" } snowbridge-beacon-primitives = { path = "../../primitives/beacon" } -snowbridge-ethereum-beacon-client = { path = "../../pallets/ethereum-beacon-client" } +snowbridge-pallet-ethereum-client = { path = "../../pallets/ethereum-client" } hex-literal = { version = "0.4.1" } [features] @@ -68,6 +73,7 @@ std = [ "sp-runtime/std", "sp-std/std", "xcm-builder/std", + "xcm-executor/std", "xcm/std", ] runtime-benchmarks = [ @@ -79,15 +85,16 @@ runtime-benchmarks = [ "pallet-balances/runtime-benchmarks", "snowbridge-beacon-primitives", "snowbridge-core/runtime-benchmarks", - "snowbridge-ethereum-beacon-client/runtime-benchmarks", + "snowbridge-pallet-ethereum-client/runtime-benchmarks", "snowbridge-router-primitives/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", ] try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", "pallet-balances/try-runtime", - "snowbridge-ethereum-beacon-client/try-runtime", + "snowbridge-pallet-ethereum-client/try-runtime", "sp-runtime/try-runtime", ] diff --git a/snowbridge/parachain/pallets/inbound-queue/README.md b/snowbridge/parachain/pallets/inbound-queue/README.md new file mode 100644 index 00000000000..cc2f7c636e6 --- /dev/null +++ b/snowbridge/parachain/pallets/inbound-queue/README.md @@ -0,0 +1,3 @@ +# Ethereum Inbound Queue + +Reads messages from Ethereum and sends it to intended destination on Polkadot, using XCM. diff --git a/snowbridge/parachain/pallets/inbound-queue/src/lib.rs b/snowbridge/parachain/pallets/inbound-queue/src/lib.rs index 834e805fbef..f7eea0aadfa 100644 --- a/snowbridge/parachain/pallets/inbound-queue/src/lib.rs +++ b/snowbridge/parachain/pallets/inbound-queue/src/lib.rs @@ -44,7 +44,7 @@ use envelope::Envelope; use frame_support::{ traits::{ fungible::{Inspect, Mutate}, - tokens::{Fortitude, Precision, Preservation}, + tokens::Preservation, }, weights::WeightToFee, PalletError, @@ -55,18 +55,20 @@ use sp_core::{H160, H256}; use sp_std::{convert::TryFrom, vec}; use xcm::prelude::{ send_xcm, Instruction::SetTopic, Junction::*, Junctions::*, MultiLocation, - SendError as XcmpSendError, SendXcm, Xcm, XcmHash, + SendError as XcmpSendError, SendXcm, Xcm, XcmContext, XcmHash, }; +use xcm_executor::traits::TransactAsset; use snowbridge_core::{ inbound::{Message, VerificationError, Verifier}, - sibling_sovereign_account, BasicOperatingMode, Channel, ChannelId, ParaId, StaticLookup, + sibling_sovereign_account, BasicOperatingMode, Channel, ChannelId, ParaId, PricingParameters, + StaticLookup, }; use snowbridge_router_primitives::{ inbound, inbound::{ConvertMessage, ConvertMessageError}, }; -use sp_runtime::traits::Saturating; +use sp_runtime::{traits::Saturating, SaturatedConversion, TokenError}; pub use weights::WeightInfo; @@ -83,7 +85,6 @@ pub mod pallet { use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; - use snowbridge_core::PricingParameters; #[pallet::pallet] pub struct Pallet(_); @@ -135,6 +136,9 @@ pub mod pallet { /// The upper limit here only used to estimate delivery cost type MaxMessageSize: Get; + + /// To withdraw and deposit an asset. + type AssetTransactor: TransactAsset; } #[pallet::hooks] @@ -142,7 +146,7 @@ pub mod pallet { #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] - pub enum Event { + pub enum Event { /// A message was received from Ethereum MessageReceived { /// The message channel @@ -151,6 +155,8 @@ pub mod pallet { nonce: u64, /// ID of the XCM message which was forwarded to the final destination parachain message_id: [u8; 32], + /// Fee burned for the teleport + fee_burned: BalanceOf, }, /// Set OperatingMode OperatingModeChanged { mode: BasicOperatingMode }, @@ -268,17 +274,16 @@ pub mod pallet { Err(_) => return Err(Error::::InvalidPayload.into()), }; - // We embed fees for xcm execution inside the xcm program using teleports - // so we must burn the amount of the fee embedded into the XCM script. - T::Token::burn_from(&sovereign_account, fee, Precision::Exact, Fortitude::Polite)?; - log::info!( target: LOG_TARGET, - "💫 xcm {:?} sent with fee {:?}", + "💫 xcm decoded as {:?} with fee {:?}", xcm, fee ); + // Burning fees for teleport + Self::burn_fees(channel.para_id, fee)?; + // Attempt to send XCM to a dest parachain let message_id = Self::send_xcm(xcm, channel.para_id)?; @@ -286,6 +291,7 @@ pub mod pallet { channel_id: envelope.channel_id, nonce: envelope.nonce, message_id, + fee_burned: fee, }); Ok(()) @@ -330,6 +336,30 @@ pub mod pallet { .saturating_add(len_fee) .saturating_add(T::PricingParameters::get().rewards.local) } + + /// Burn the amount of the fee embedded into the XCM for teleports + pub fn burn_fees(para_id: ParaId, fee: BalanceOf) -> DispatchResult { + let dummy_context = + XcmContext { origin: None, message_id: Default::default(), topic: None }; + let dest = MultiLocation { parents: 1, interior: X1(Parachain(para_id.into())) }; + let fees = (MultiLocation::parent(), fee.saturated_into::()).into(); + T::AssetTransactor::can_check_out(&dest, &fees, &dummy_context).map_err(|error| { + log::error!( + target: LOG_TARGET, + "XCM asset check out failed with error {:?}", error + ); + TokenError::FundsUnavailable + })?; + T::AssetTransactor::check_out(&dest, &fees, &dummy_context); + T::AssetTransactor::withdraw_asset(&fees, &dest, None).map_err(|error| { + log::error!( + target: LOG_TARGET, + "XCM asset withdraw failed with error {:?}", error + ); + TokenError::FundsUnavailable + })?; + Ok(()) + } } /// API for accessing the delivery cost of a message diff --git a/snowbridge/parachain/pallets/inbound-queue/src/mock.rs b/snowbridge/parachain/pallets/inbound-queue/src/mock.rs index 6b79a55e3c9..b031a46e219 100644 --- a/snowbridge/parachain/pallets/inbound-queue/src/mock.rs +++ b/snowbridge/parachain/pallets/inbound-queue/src/mock.rs @@ -22,6 +22,7 @@ use sp_runtime::{ }; use sp_std::convert::From; use xcm::v3::{prelude::*, MultiAssets, SendXcm}; +use xcm_executor::Assets; use crate::{self as inbound_queue}; @@ -32,7 +33,7 @@ frame_support::construct_runtime!( { System: frame_system::{Pallet, Call, Storage, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - EthereumBeaconClient: snowbridge_ethereum_beacon_client::{Pallet, Call, Storage, Event}, + EthereumBeaconClient: snowbridge_pallet_ethereum_client::{Pallet, Call, Storage, Event}, InboundQueue: inbound_queue::{Pallet, Call, Storage, Event}, } ); @@ -112,7 +113,7 @@ parameter_types! { }; } -impl snowbridge_ethereum_beacon_client::Config for Test { +impl snowbridge_pallet_ethereum_client::Config for Test { type RuntimeEvent = RuntimeEvent; type ForkVersions = ChainForkVersions; type MaxExecutionHeadersToKeep = ExecutionHeadersPruneThreshold; @@ -142,7 +143,7 @@ parameter_types! { } #[cfg(feature = "runtime-benchmarks")] -impl BenchmarkHelper for Test { +impl BenchmarkHelper for Test { // not implemented since the MockVerifier is used for tests fn initialize_storage(_: H256, _: CompactExecutionHeader) {} } @@ -200,6 +201,50 @@ impl StaticLookup for MockChannelLookup { } } +pub struct SuccessfulTransactor; +impl TransactAsset for SuccessfulTransactor { + fn can_check_in( + _origin: &MultiLocation, + _what: &MultiAsset, + _context: &XcmContext, + ) -> XcmResult { + Ok(()) + } + + fn can_check_out( + _dest: &MultiLocation, + _what: &MultiAsset, + _context: &XcmContext, + ) -> XcmResult { + Ok(()) + } + + fn deposit_asset( + _what: &MultiAsset, + _who: &MultiLocation, + _context: Option<&XcmContext>, + ) -> XcmResult { + Ok(()) + } + + fn withdraw_asset( + _what: &MultiAsset, + _who: &MultiLocation, + _context: Option<&XcmContext>, + ) -> Result { + Ok(Assets::default()) + } + + fn internal_transfer_asset( + _what: &MultiAsset, + _from: &MultiLocation, + _to: &MultiLocation, + _context: &XcmContext, + ) -> Result { + Ok(Assets::default()) + } +} + impl inbound_queue::Config for Test { type RuntimeEvent = RuntimeEvent; type Verifier = MockVerifier; @@ -221,6 +266,7 @@ impl inbound_queue::Config for Test { type WeightToFee = IdentityFee; type LengthToFee = IdentityFee; type MaxMessageSize = ConstU32<1024>; + type AssetTransactor = SuccessfulTransactor; } pub fn last_events(n: usize) -> Vec { diff --git a/snowbridge/parachain/pallets/inbound-queue/src/test.rs b/snowbridge/parachain/pallets/inbound-queue/src/test.rs index 6dc3ac45374..17ebeb39446 100644 --- a/snowbridge/parachain/pallets/inbound-queue/src/test.rs +++ b/snowbridge/parachain/pallets/inbound-queue/src/test.rs @@ -44,6 +44,7 @@ fn test_submit_happy_path() { 27, 217, 88, 127, 46, 143, 199, 70, 236, 66, 212, 244, 85, 221, 153, 104, 175, 37, 224, 20, 140, 95, 140, 7, 27, 74, 182, 199, 77, 12, 194, 236, ], + fee_burned: 110000000000, } .into()]); diff --git a/snowbridge/parachain/pallets/outbound-queue/Cargo.toml b/snowbridge/parachain/pallets/outbound-queue/Cargo.toml index f99fcc72e19..de4487553cb 100644 --- a/snowbridge/parachain/pallets/outbound-queue/Cargo.toml +++ b/snowbridge/parachain/pallets/outbound-queue/Cargo.toml @@ -1,11 +1,15 @@ [package] -name = "snowbridge-outbound-queue" -description = "Snowbridge Outbound Queue" -version = "0.1.1" -edition = "2021" +name = "snowbridge-pallet-outbound-queue" +description = "Snowbridge Outbound Queue Pallet" +version = "0.9.0" authors = ["Snowfork "] -repository = "https://github.com/Snowfork/snowbridge" +edition.workspace = true +repository.workspace = true license = "Apache-2.0" +categories = ["cryptography::cryptocurrencies"] + +[lints] +workspace = true [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/snowbridge/parachain/pallets/outbound-queue/README.md b/snowbridge/parachain/pallets/outbound-queue/README.md new file mode 100644 index 00000000000..19638f90e6a --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/README.md @@ -0,0 +1,3 @@ +# Ethereum Outbound Queue + +Sends messages from an origin in the Polkadot ecosystem to Ethereum. diff --git a/snowbridge/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml b/snowbridge/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml index a3432163622..27c4ae02e52 100644 --- a/snowbridge/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml +++ b/snowbridge/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml @@ -1,11 +1,15 @@ [package] name = "snowbridge-outbound-queue-merkle-tree" description = "Snowbridge Outbound Queue Merkle Tree" -version = "0.1.1" -edition = "2021" +version = "0.9.0" authors = ["Snowfork "] -repository = "https://github.com/Snowfork/snowbridge" +edition.workspace = true +repository.workspace = true license = "Apache-2.0" +categories = ["cryptography::cryptocurrencies"] + +[lints] +workspace = true [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/snowbridge/parachain/pallets/outbound-queue/merkle-tree/README.md b/snowbridge/parachain/pallets/outbound-queue/merkle-tree/README.md new file mode 100644 index 00000000000..a3afef1d671 --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/merkle-tree/README.md @@ -0,0 +1,4 @@ +# Snowbridge Outbound Queue Merkle Tree + +This crate implements a simple binary Merkle Tree utilities required for inter-op with Ethereum +bridge & Solidity contract. diff --git a/snowbridge/parachain/pallets/outbound-queue/runtime-api/Cargo.toml b/snowbridge/parachain/pallets/outbound-queue/runtime-api/Cargo.toml index c92e725c60d..1f2b51a6752 100644 --- a/snowbridge/parachain/pallets/outbound-queue/runtime-api/Cargo.toml +++ b/snowbridge/parachain/pallets/outbound-queue/runtime-api/Cargo.toml @@ -1,11 +1,15 @@ [package] name = "snowbridge-outbound-queue-runtime-api" description = "Snowbridge Outbound Queue Runtime API" -version = "0.1.0" -edition = "2021" +version = "0.9.0" authors = ["Snowfork "] -repository = "https://github.com/Snowfork/snowbridge" +edition.workspace = true +repository.workspace = true license = "Apache-2.0" +categories = ["cryptography::cryptocurrencies"] + +[lints] +workspace = true [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/snowbridge/parachain/pallets/outbound-queue/runtime-api/README.md b/snowbridge/parachain/pallets/outbound-queue/runtime-api/README.md new file mode 100644 index 00000000000..98ae01fb33d --- /dev/null +++ b/snowbridge/parachain/pallets/outbound-queue/runtime-api/README.md @@ -0,0 +1,6 @@ +# Ethereum Outbound Queue Runtime API + +Provides an API: + +- to generate merkle proofs for outbound messages +- calculate delivery fee for delivering messages to Ethereum diff --git a/snowbridge/parachain/pallets/outbound-queue/src/lib.rs b/snowbridge/parachain/pallets/outbound-queue/src/lib.rs index c3401c4dc94..9e949a4791a 100644 --- a/snowbridge/parachain/pallets/outbound-queue/src/lib.rs +++ b/snowbridge/parachain/pallets/outbound-queue/src/lib.rs @@ -5,10 +5,10 @@ //! # Overview //! //! Messages come either from sibling parachains via XCM, or BridgeHub itself -//! via the `snowbridge-system` pallet: +//! via the `snowbridge-pallet-system`: //! //! 1. `snowbridge_router_primitives::outbound::EthereumBlobExporter::deliver` -//! 2. `snowbridge_system::Pallet::send` +//! 2. `snowbridge_pallet_system::Pallet::send` //! //! The message submission pipeline works like this: //! 1. The message is first validated via the implementation for diff --git a/snowbridge/parachain/pallets/outbound-queue/src/test.rs b/snowbridge/parachain/pallets/outbound-queue/src/test.rs index 454a91d5df5..0028d75e7b7 100644 --- a/snowbridge/parachain/pallets/outbound-queue/src/test.rs +++ b/snowbridge/parachain/pallets/outbound-queue/src/test.rs @@ -110,7 +110,7 @@ fn process_message_fails_on_max_nonce_reached() { channel_id, command: mock_message(sibling_id).command, }; - let versioned_queued_message: VersionedQueuedMessage = message.into(); + let versioned_queued_message: VersionedQueuedMessage = message.try_into().unwrap(); let encoded = versioned_queued_message.encode(); let mut meter = WeightMeter::with_limit(Weight::MAX); @@ -134,7 +134,7 @@ fn process_message_fails_on_overweight_message() { channel_id, command: mock_message(sibling_id).command, }; - let versioned_queued_message: VersionedQueuedMessage = message.into(); + let versioned_queued_message: VersionedQueuedMessage = message.try_into().unwrap(); let encoded = versioned_queued_message.encode(); let mut meter = WeightMeter::with_limit(Weight::from_parts(1, 1)); assert_noop!( diff --git a/snowbridge/parachain/pallets/outbound-queue/src/weights.rs b/snowbridge/parachain/pallets/outbound-queue/src/weights.rs index e4b6f8439b0..87eee1a31e8 100644 --- a/snowbridge/parachain/pallets/outbound-queue/src/weights.rs +++ b/snowbridge/parachain/pallets/outbound-queue/src/weights.rs @@ -1,5 +1,5 @@ -//! Autogenerated weights for `snowbridge_outbound_queue` +//! Autogenerated weights for `snowbridge-pallet-outbound-queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! DATE: 2023-10-19, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -12,7 +12,7 @@ // benchmark // pallet // --chain=bridge-hub-rococo-dev -// --pallet=snowbridge_outbound_queue +// --pallet=snowbridge-pallet-outbound-queue // --extrinsic=* // --execution=wasm // --wasm-execution=compiled @@ -29,7 +29,7 @@ use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use core::marker::PhantomData; -/// Weight functions needed for `snowbridge_outbound_queue`. +/// Weight functions needed for `snowbridge-pallet-outbound-queue`. pub trait WeightInfo { fn do_process_message() -> Weight; fn commit() -> Weight; diff --git a/snowbridge/parachain/pallets/system/Cargo.toml b/snowbridge/parachain/pallets/system/Cargo.toml index 4356bf57220..70155370d19 100644 --- a/snowbridge/parachain/pallets/system/Cargo.toml +++ b/snowbridge/parachain/pallets/system/Cargo.toml @@ -1,11 +1,15 @@ [package] -name = "snowbridge-system" -description = "Snowbridge System" -version = "0.1.1" +name = "snowbridge-pallet-system" +description = "Snowbridge System Pallet" +version = "0.9.0" authors = ["Snowfork "] -edition = "2021" -repository = "https://github.com/Snowfork/snowbridge" +edition.workspace = true +repository.workspace = true license = "Apache-2.0" +categories = ["cryptography::cryptocurrencies"] + +[lints] +workspace = true [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] @@ -39,7 +43,7 @@ pallet-balances = { path = "../../../../../substrate/frame/balances" } sp-keyring = { path = "../../../../../substrate/primitives/keyring" } polkadot-primitives = { path = "../../../../../polkadot/primitives" } pallet-message-queue = { path = "../../../../../substrate/frame/message-queue" } -snowbridge-outbound-queue = { path = "../outbound-queue" } +snowbridge-pallet-outbound-queue = { path = "../outbound-queue" } [features] default = ["std"] @@ -68,7 +72,7 @@ runtime-benchmarks = [ "pallet-message-queue/runtime-benchmarks", "polkadot-primitives/runtime-benchmarks", "snowbridge-core/runtime-benchmarks", - "snowbridge-outbound-queue/runtime-benchmarks", + "snowbridge-pallet-outbound-queue/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", @@ -78,6 +82,6 @@ try-runtime = [ "frame-system/try-runtime", "pallet-balances/try-runtime", "pallet-message-queue/try-runtime", - "snowbridge-outbound-queue/try-runtime", + "snowbridge-pallet-outbound-queue/try-runtime", "sp-runtime/try-runtime", ] diff --git a/snowbridge/parachain/pallets/system/README.md b/snowbridge/parachain/pallets/system/README.md index 9e4dc55267d..5ab11d45eae 100644 --- a/snowbridge/parachain/pallets/system/README.md +++ b/snowbridge/parachain/pallets/system/README.md @@ -1 +1,3 @@ -License: MIT-0 +# Ethereum System + +Contains management functions to manage functions on Ethereum. For example, creating agents and channels. diff --git a/snowbridge/parachain/pallets/system/runtime-api/Cargo.toml b/snowbridge/parachain/pallets/system/runtime-api/Cargo.toml index 97d0735bf63..96d5aa522c0 100644 --- a/snowbridge/parachain/pallets/system/runtime-api/Cargo.toml +++ b/snowbridge/parachain/pallets/system/runtime-api/Cargo.toml @@ -1,11 +1,15 @@ [package] name = "snowbridge-system-runtime-api" description = "Snowbridge System Runtime API" -version = "0.1.0" -edition = "2021" +version = "0.9.0" authors = ["Snowfork "] -repository = "https://github.com/Snowfork/snowbridge" +edition.workspace = true +repository.workspace = true license = "Apache-2.0" +categories = ["cryptography::cryptocurrencies"] + +[lints] +workspace = true [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/snowbridge/parachain/pallets/system/runtime-api/README.md b/snowbridge/parachain/pallets/system/runtime-api/README.md new file mode 100644 index 00000000000..99827c9c2fc --- /dev/null +++ b/snowbridge/parachain/pallets/system/runtime-api/README.md @@ -0,0 +1,3 @@ +# Ethereum System Runtime API + +Provides an API for looking up an agent ID on Ethereum. diff --git a/snowbridge/parachain/pallets/system/src/lib.rs b/snowbridge/parachain/pallets/system/src/lib.rs index e5077abd921..0042093ee66 100644 --- a/snowbridge/parachain/pallets/system/src/lib.rs +++ b/snowbridge/parachain/pallets/system/src/lib.rs @@ -79,6 +79,8 @@ use xcm_executor::traits::ConvertLocation; #[cfg(feature = "runtime-benchmarks")] use frame_support::traits::OriginTrait; +pub use pallet::*; + pub type BalanceOf = <::Token as Inspect<::AccountId>>::Balance; pub type AccountIdOf = ::AccountId; diff --git a/snowbridge/parachain/pallets/system/src/mock.rs b/snowbridge/parachain/pallets/system/src/mock.rs index 7a4f6118930..bb9bae6b56d 100644 --- a/snowbridge/parachain/pallets/system/src/mock.rs +++ b/snowbridge/parachain/pallets/system/src/mock.rs @@ -89,7 +89,7 @@ frame_support::construct_runtime!( System: frame_system, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, XcmOrigin: pallet_xcm_origin::{Pallet, Origin}, - OutboundQueue: snowbridge_outbound_queue::{Pallet, Call, Storage, Event}, + OutboundQueue: snowbridge_pallet_outbound_queue::{Pallet, Call, Storage, Event}, EthereumSystem: snowbridge_system, MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} } @@ -167,7 +167,7 @@ parameter_types! { pub const OwnParaId: ParaId = ParaId::new(1013); } -impl snowbridge_outbound_queue::Config for Test { +impl snowbridge_pallet_outbound_queue::Config for Test { type RuntimeEvent = RuntimeEvent; type Hashing = Keccak256; type MessageQueue = MessageQueue; diff --git a/snowbridge/parachain/primitives/beacon/Cargo.toml b/snowbridge/parachain/primitives/beacon/Cargo.toml index eb717325e8a..8294e903dfb 100644 --- a/snowbridge/parachain/primitives/beacon/Cargo.toml +++ b/snowbridge/parachain/primitives/beacon/Cargo.toml @@ -1,10 +1,15 @@ [package] name = "snowbridge-beacon-primitives" description = "Snowbridge Beacon Primitives" -version = "0.0.1" +version = "0.9.0" authors = ["Snowfork "] -edition = "2021" +edition.workspace = true +repository.workspace = true license = "Apache-2.0" +categories = ["cryptography::cryptocurrencies"] + +[lints] +workspace = true [dependencies] serde = { version = "1.0.195", optional = true, features = ["derive"] } diff --git a/snowbridge/parachain/primitives/beacon/README.md b/snowbridge/parachain/primitives/beacon/README.md new file mode 100644 index 00000000000..658d7c5be7d --- /dev/null +++ b/snowbridge/parachain/primitives/beacon/README.md @@ -0,0 +1,10 @@ +# Beacon Primitives + +Crate with low-level supporting functions for the beacon client, including: + +- bls12-381 signature handling to verify signatures on the beacon chain +- merkle proofs +- receipt verification +- ssz types + +The code in this crate relates to the Ethereum consensus chain, commonly referred to as the beacon chain. diff --git a/snowbridge/parachain/primitives/core/Cargo.toml b/snowbridge/parachain/primitives/core/Cargo.toml index 706c508363d..1cb28eb3e50 100644 --- a/snowbridge/parachain/primitives/core/Cargo.toml +++ b/snowbridge/parachain/primitives/core/Cargo.toml @@ -1,10 +1,15 @@ [package] name = "snowbridge-core" description = "Snowbridge Core" -version = "0.1.1" +version = "0.9.0" authors = ["Snowfork "] -edition = "2021" +edition.workspace = true +repository.workspace = true license = "Apache-2.0" +categories = ["cryptography::cryptocurrencies"] + +[lints] +workspace = true [dependencies] serde = { version = "1.0.195", optional = true, features = ["alloc", "derive"], default-features = false } diff --git a/snowbridge/parachain/primitives/core/README.md b/snowbridge/parachain/primitives/core/README.md new file mode 100644 index 00000000000..0126be63aeb --- /dev/null +++ b/snowbridge/parachain/primitives/core/README.md @@ -0,0 +1,4 @@ +# Core Primitives + +Contains common code core to Snowbridge, such as inbound and outbound queue types, pricing structs, ringbuffer data +types (used in the beacon client). diff --git a/snowbridge/parachain/primitives/ethereum/Cargo.toml b/snowbridge/parachain/primitives/ethereum/Cargo.toml index 3624044f86a..016f16ce0e6 100644 --- a/snowbridge/parachain/primitives/ethereum/Cargo.toml +++ b/snowbridge/parachain/primitives/ethereum/Cargo.toml @@ -1,10 +1,15 @@ [package] name = "snowbridge-ethereum" description = "Snowbridge Ethereum" -version = "0.1.0" +version = "0.9.0" authors = ["Snowfork "] -edition = "2021" +edition.workspace = true +repository.workspace = true license = "Apache-2.0" +categories = ["cryptography::cryptocurrencies"] + +[lints] +workspace = true [dependencies] serde = { version = "1.0.195", optional = true, features = ["derive"] } diff --git a/snowbridge/parachain/primitives/ethereum/README.md b/snowbridge/parachain/primitives/ethereum/README.md new file mode 100644 index 00000000000..c295aad9040 --- /dev/null +++ b/snowbridge/parachain/primitives/ethereum/README.md @@ -0,0 +1,4 @@ +# Ethereum Primitives + +Contains code necessary to decode RLP encoded data (like the Ethereum log), structs for Ethereum execution headers. The +code in this crate relates to the Ethereum execution chain. diff --git a/snowbridge/parachain/primitives/router/Cargo.toml b/snowbridge/parachain/primitives/router/Cargo.toml index 40ae12920e7..65133128ef4 100644 --- a/snowbridge/parachain/primitives/router/Cargo.toml +++ b/snowbridge/parachain/primitives/router/Cargo.toml @@ -1,10 +1,15 @@ [package] name = "snowbridge-router-primitives" description = "Snowbridge Router Primitives" -version = "0.1.1" +version = "0.9.0" authors = ["Snowfork "] -edition = "2021" +edition.workspace = true +repository.workspace = true license = "Apache-2.0" +categories = ["cryptography::cryptocurrencies"] + +[lints] +workspace = true [dependencies] serde = { version = "1.0.195", optional = true, features = ["derive"] } diff --git a/snowbridge/parachain/primitives/router/README.md b/snowbridge/parachain/primitives/router/README.md new file mode 100644 index 00000000000..45967cbf76c --- /dev/null +++ b/snowbridge/parachain/primitives/router/README.md @@ -0,0 +1,4 @@ +# Router Primitives + +Inbound and outbound router logic. Does XCM conversion to a lowered, simpler format the Ethereum contracts can +understand. diff --git a/snowbridge/parachain/runtime/rococo-common/Cargo.toml b/snowbridge/parachain/runtime/rococo-common/Cargo.toml deleted file mode 100644 index 656ed6de26e..00000000000 --- a/snowbridge/parachain/runtime/rococo-common/Cargo.toml +++ /dev/null @@ -1,26 +0,0 @@ -[package] -name = "snowbridge-rococo-common" -description = "Snowbridge Rococo Common" -version = "0.0.1" -authors = ["Snowfork "] -edition = "2021" -license = "Apache-2.0" - -[dependencies] -log = { version = "0.4.20", default-features = false } - -frame-support = { path = "../../../../../substrate/frame/support", default-features = false } -xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } - -[dev-dependencies] - -[features] -default = ["std"] -std = [ - "frame-support/std", - "log/std", - "xcm/std", -] -runtime-benchmarks = [ - "frame-support/runtime-benchmarks", -] diff --git a/snowbridge/parachain/runtime/rococo-common/src/lib.rs b/snowbridge/parachain/runtime/rococo-common/src/lib.rs deleted file mode 100644 index 97f0332fe66..00000000000 --- a/snowbridge/parachain/runtime/rococo-common/src/lib.rs +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! # Rococo Common -//! -//! Config used for the Rococo asset hub and bridge hub runtimes. -#![cfg_attr(not(feature = "std"), no_std)] - -use frame_support::parameter_types; -use xcm::opaque::lts::NetworkId; - -pub const INBOUND_QUEUE_MESSAGES_PALLET_INDEX: u8 = 80; - -parameter_types! { - // Network and location for the Ethereum chain. - pub EthereumNetwork: NetworkId = NetworkId::Ethereum { chain_id: 11155111 }; -} diff --git a/snowbridge/parachain/runtime/runtime-common/Cargo.toml b/snowbridge/parachain/runtime/runtime-common/Cargo.toml index b835152cac0..b81c5d496e8 100644 --- a/snowbridge/parachain/runtime/runtime-common/Cargo.toml +++ b/snowbridge/parachain/runtime/runtime-common/Cargo.toml @@ -1,10 +1,15 @@ [package] name = "snowbridge-runtime-common" description = "Snowbridge Runtime Common" -version = "0.1.1" +version = "0.9.0" authors = ["Snowfork "] -edition = "2021" +edition.workspace = true +repository.workspace = true license = "Apache-2.0" +categories = ["cryptography::cryptocurrencies"] + +[lints] +workspace = true [dependencies] log = { version = "0.4.20", default-features = false } diff --git a/snowbridge/parachain/runtime/runtime-common/README.md b/snowbridge/parachain/runtime/runtime-common/README.md new file mode 100644 index 00000000000..57d178ea2d2 --- /dev/null +++ b/snowbridge/parachain/runtime/runtime-common/README.md @@ -0,0 +1,3 @@ +# Snowbridge Runtime Common + +Common crate to contain runtime related structs and implementations for Snowbridge. diff --git a/snowbridge/parachain/runtime/tests/Cargo.toml b/snowbridge/parachain/runtime/test-common/Cargo.toml similarity index 78% rename from snowbridge/parachain/runtime/tests/Cargo.toml rename to snowbridge/parachain/runtime/test-common/Cargo.toml index 0a09f89c6b9..ae72de406fc 100644 --- a/snowbridge/parachain/runtime/tests/Cargo.toml +++ b/snowbridge/parachain/runtime/test-common/Cargo.toml @@ -1,10 +1,14 @@ [package] -name = "snowbridge-runtime-tests" +name = "snowbridge-runtime-test-common" description = "Snowbridge Runtime Tests" -version = "0.1.0" +version = "0.9.0" authors = ["Snowfork "] edition = "2021" license = "Apache-2.0" +categories = ["cryptography::cryptocurrencies"] + +[lints] +workspace = true [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } @@ -48,7 +52,6 @@ sp-transaction-pool = { path = "../../../../../substrate/primitives/transaction- sp-version = { path = "../../../../../substrate/primitives/version", default-features = false } # Polkadot -rococo-runtime-constants = { path = "../../../../../polkadot/runtime/rococo/constants", default-features = false } pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false } pallet-xcm-benchmarks = { path = "../../../../../polkadot/xcm/pallet-xcm-benchmarks", default-features = false, optional = true } polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false } @@ -71,19 +74,17 @@ pallet-collator-selection = { path = "../../../../../cumulus/pallets/collator-se parachain-info = { package = "staging-parachain-info", path = "../../../../../cumulus/parachains/pallets/parachain-info", default-features = false } parachains-common = { path = "../../../../../cumulus/parachains/common", default-features = false } parachains-runtimes-test-utils = { path = "../../../../../cumulus/parachains/runtimes/test-utils", default-features = false } -bridge-hub-rococo-runtime = { path = "../../../../../cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo", default-features = false } -asset-hub-rococo-runtime = { path = "../../../../../cumulus/parachains/runtimes/assets/asset-hub-rococo", default-features = false } assets-common = { path = "../../../../../cumulus/parachains/runtimes/assets/common", default-features = false } # Ethereum Bridge (Snowbridge) snowbridge-core = { path = "../../primitives/core", default-features = false } snowbridge-beacon-primitives = { path = "../../primitives/beacon", default-features = false } snowbridge-router-primitives = { path = "../../primitives/router", default-features = false } -snowbridge-ethereum-beacon-client = { path = "../../pallets/ethereum-beacon-client", default-features = false } -snowbridge-inbound-queue = { path = "../../pallets/inbound-queue", default-features = false } -snowbridge-outbound-queue = { path = "../../pallets/outbound-queue", default-features = false } +snowbridge-pallet-ethereum-client = { path = "../../pallets/ethereum-client", default-features = false } +snowbridge-pallet-inbound-queue = { path = "../../pallets/inbound-queue", default-features = false } +snowbridge-pallet-outbound-queue = { path = "../../pallets/outbound-queue", default-features = false } snowbridge-outbound-queue-runtime-api = { path = "../../pallets/outbound-queue/runtime-api", default-features = false } -snowbridge-system = { path = "../../pallets/system", default-features = false } +snowbridge-pallet-system = { path = "../../pallets/system", default-features = false } snowbridge-system-runtime-api = { path = "../../pallets/system/runtime-api", default-features = false } [dev-dependencies] @@ -95,9 +96,7 @@ sp-keyring = { path = "../../../../../substrate/primitives/keyring" } [features] default = ["std"] std = [ - "asset-hub-rococo-runtime/std", "assets-common/std", - "bridge-hub-rococo-runtime/std", "codec/std", "cumulus-pallet-aura-ext/std", "cumulus-pallet-dmp-queue/std", @@ -134,18 +133,17 @@ std = [ "polkadot-core-primitives/std", "polkadot-parachain-primitives/std", "polkadot-runtime-common/std", - "rococo-runtime-constants/std", "scale-info/std", "serde", "snowbridge-beacon-primitives/std", "snowbridge-core/std", - "snowbridge-ethereum-beacon-client/std", - "snowbridge-inbound-queue/std", "snowbridge-outbound-queue-runtime-api/std", - "snowbridge-outbound-queue/std", + "snowbridge-pallet-ethereum-client/std", + "snowbridge-pallet-inbound-queue/std", + "snowbridge-pallet-outbound-queue/std", + "snowbridge-pallet-system/std", "snowbridge-router-primitives/std", "snowbridge-system-runtime-api/std", - "snowbridge-system/std", "sp-api/std", "sp-block-builder/std", "sp-consensus-aura/std", @@ -166,9 +164,7 @@ std = [ ] runtime-benchmarks = [ - "asset-hub-rococo-runtime/runtime-benchmarks", "assets-common/runtime-benchmarks", - "bridge-hub-rococo-runtime/runtime-benchmarks", "bridge-runtime-common/runtime-benchmarks", "cumulus-pallet-dmp-queue/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", @@ -192,53 +188,12 @@ runtime-benchmarks = [ "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "snowbridge-core/runtime-benchmarks", - "snowbridge-ethereum-beacon-client/runtime-benchmarks", - "snowbridge-inbound-queue/runtime-benchmarks", - "snowbridge-outbound-queue/runtime-benchmarks", + "snowbridge-pallet-ethereum-client/runtime-benchmarks", + "snowbridge-pallet-inbound-queue/runtime-benchmarks", + "snowbridge-pallet-outbound-queue/runtime-benchmarks", + "snowbridge-pallet-system/runtime-benchmarks", "snowbridge-router-primitives/runtime-benchmarks", - "snowbridge-system/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", ] - -try-runtime = [ - "asset-hub-rococo-runtime/try-runtime", - "bridge-hub-rococo-runtime/try-runtime", - "cumulus-pallet-aura-ext/try-runtime", - "cumulus-pallet-dmp-queue/try-runtime", - "cumulus-pallet-parachain-system/try-runtime", - "cumulus-pallet-xcm/try-runtime", - "cumulus-pallet-xcmp-queue/try-runtime", - "frame-executive/try-runtime", - "frame-support/try-runtime", - "frame-system/try-runtime", - "frame-try-runtime/try-runtime", - "pallet-aura/try-runtime", - "pallet-authorship/try-runtime", - "pallet-balances/try-runtime", - "pallet-collator-selection/try-runtime", - "pallet-message-queue/try-runtime", - "pallet-multisig/try-runtime", - "pallet-session/try-runtime", - "pallet-timestamp/try-runtime", - "pallet-transaction-payment/try-runtime", - "pallet-utility/try-runtime", - "pallet-xcm/try-runtime", - "parachain-info/try-runtime", - "polkadot-runtime-common/try-runtime", - "snowbridge-ethereum-beacon-client/try-runtime", - "snowbridge-inbound-queue/try-runtime", - "snowbridge-outbound-queue/try-runtime", - "snowbridge-system/try-runtime", - "sp-runtime/try-runtime", -] -fast-runtime = [ - "bridge-hub-rococo-runtime/fast-runtime", -] -experimental = ["pallet-aura/experimental"] - -# A feature that should be enabled when the runtime should be built for on-chain -# deployment. This will disable stuff that shouldn't be part of the on-chain wasm -# to make it smaller like logging for example. -on-chain-release-build = ["sp-api/disable-logging"] diff --git a/snowbridge/parachain/runtime/test-common/README.md b/snowbridge/parachain/runtime/test-common/README.md new file mode 100644 index 00000000000..d582f87142b --- /dev/null +++ b/snowbridge/parachain/runtime/test-common/README.md @@ -0,0 +1,3 @@ +# Runtime Tests + +Tests runtime config and bridge functionality in the boundaries of a runtime. diff --git a/snowbridge/parachain/runtime/tests/src/test_cases.rs b/snowbridge/parachain/runtime/test-common/src/lib.rs similarity index 88% rename from snowbridge/parachain/runtime/tests/src/test_cases.rs rename to snowbridge/parachain/runtime/test-common/src/lib.rs index e5a45cdc92b..8a6834db2e4 100644 --- a/snowbridge/parachain/runtime/tests/src/test_cases.rs +++ b/snowbridge/parachain/runtime/test-common/src/lib.rs @@ -1,12 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: 2023 Snowfork -//! Module contains predefined test-case scenarios for `Runtime` with bridging capabilities. - -use asset_hub_rococo_runtime::xcm_config::bridging::to_ethereum::DefaultBridgeHubEthereumBaseFee; -use bridge_hub_rococo_runtime::EthereumSystem; use codec::Encode; use frame_support::{assert_err, assert_ok, traits::fungible::Mutate}; +pub use parachains_runtimes_test_utils::test_cases::change_storage_constant_by_governance_works; use parachains_runtimes_test_utils::{ AccountIdOf, BalanceOf, CollatorSessionKeys, ExtBuilder, ValidatorIdOf, XcmReceivedFrom, }; @@ -49,7 +46,7 @@ where + parachain_info::Config + pallet_collator_selection::Config + cumulus_pallet_parachain_system::Config - + snowbridge_outbound_queue::Config, + + snowbridge_pallet_outbound_queue::Config, XcmConfig: xcm_executor::Config, { let assethub_parachain_location = MultiLocation::new(1, Parachain(assethub_parachain_id)); @@ -109,8 +106,8 @@ pub fn send_transfer_token_message_success( weth_contract_address: H160, destination_address: H160, fee_amount: u128, - snowbridge_outbound_queue: Box< - dyn Fn(Vec) -> Option>, + snowbridge_pallet_outbound_queue: Box< + dyn Fn(Vec) -> Option>, >, ) where Runtime: frame_system::Config @@ -120,8 +117,8 @@ pub fn send_transfer_token_message_success( + parachain_info::Config + pallet_collator_selection::Config + cumulus_pallet_parachain_system::Config - + snowbridge_outbound_queue::Config - + snowbridge_system::Config, + + snowbridge_pallet_outbound_queue::Config + + snowbridge_pallet_system::Config, XcmConfig: xcm_executor::Config, ValidatorIdOf: From>, { @@ -132,14 +129,14 @@ pub fn send_transfer_token_message_success( .with_tracing() .build() .execute_with(|| { - EthereumSystem::initialize(runtime_para_id.into(), assethub_parachain_id.into()) - .unwrap(); + >::initialize( + runtime_para_id.into(), + assethub_parachain_id.into(), + ) + .unwrap(); // fund asset hub sovereign account enough so it can pay fees - initial_fund::( - assethub_parachain_id, - DefaultBridgeHubEthereumBaseFee::get() + 1_000_000_000, - ); + initial_fund::(assethub_parachain_id, 5_000_000_000_000); let outcome = send_transfer_token_message::( assethub_parachain_id, @@ -153,10 +150,11 @@ pub fn send_transfer_token_message_success( // check events let mut events = >::events() .into_iter() - .filter_map(|e| snowbridge_outbound_queue(e.event.encode())); - assert!( - events.any(|e| matches!(e, snowbridge_outbound_queue::Event::MessageQueued { .. })) - ); + .filter_map(|e| snowbridge_pallet_outbound_queue(e.event.encode())); + assert!(events.any(|e| matches!( + e, + snowbridge_pallet_outbound_queue::Event::MessageQueued { .. } + ))); }); } @@ -174,7 +172,7 @@ pub fn send_unpaid_transfer_token_message( + parachain_info::Config + pallet_collator_selection::Config + cumulus_pallet_parachain_system::Config - + snowbridge_outbound_queue::Config, + + snowbridge_pallet_outbound_queue::Config, XcmConfig: xcm_executor::Config, ValidatorIdOf: From>, { @@ -263,8 +261,8 @@ pub fn send_transfer_token_message_failure( + parachain_info::Config + pallet_collator_selection::Config + cumulus_pallet_parachain_system::Config - + snowbridge_outbound_queue::Config - + snowbridge_system::Config, + + snowbridge_pallet_outbound_queue::Config + + snowbridge_pallet_system::Config, XcmConfig: xcm_executor::Config, ValidatorIdOf: From>, { @@ -275,8 +273,11 @@ pub fn send_transfer_token_message_failure( .with_tracing() .build() .execute_with(|| { - EthereumSystem::initialize(runtime_para_id.into(), assethub_parachain_id.into()) - .unwrap(); + >::initialize( + runtime_para_id.into(), + assethub_parachain_id.into(), + ) + .unwrap(); // fund asset hub sovereign account enough so it can pay fees initial_fund::(assethub_parachain_id, initial_amount); diff --git a/snowbridge/parachain/runtime/tests/src/lib.rs b/snowbridge/parachain/runtime/tests/src/lib.rs deleted file mode 100644 index 9a5d12e2892..00000000000 --- a/snowbridge/parachain/runtime/tests/src/lib.rs +++ /dev/null @@ -1,94 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork - -#![cfg(test)] - -mod test_cases; - -use asset_hub_rococo_runtime::xcm_config::bridging::to_ethereum::DefaultBridgeHubEthereumBaseFee; -use bridge_hub_rococo_runtime::{ - xcm_config::XcmConfig, MessageQueueServiceWeight, Runtime, RuntimeEvent, SessionKeys, -}; -use codec::Decode; -use cumulus_primitives_core::XcmError::{FailedToTransactAsset, NotHoldingFees}; -use parachains_common::{AccountId, AuraId}; -use snowbridge_ethereum_beacon_client::WeightInfo; -use sp_core::H160; -use sp_keyring::AccountKeyring::Alice; - -pub fn collator_session_keys() -> bridge_hub_test_utils::CollatorSessionKeys { - bridge_hub_test_utils::CollatorSessionKeys::new( - AccountId::from(Alice), - AccountId::from(Alice), - SessionKeys { aura: AuraId::from(Alice.public()) }, - ) -} - -#[test] -pub fn transfer_token_to_ethereum_works() { - test_cases::send_transfer_token_message_success::( - collator_session_keys(), - 1013, - 1000, - H160::random(), - H160::random(), - DefaultBridgeHubEthereumBaseFee::get(), - Box::new(|runtime_event_encoded: Vec| { - match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { - Ok(RuntimeEvent::EthereumOutboundQueue(event)) => Some(event), - _ => None, - } - }), - ) -} - -#[test] -pub fn unpaid_transfer_token_to_ethereum_fails_with_barrier() { - test_cases::send_unpaid_transfer_token_message::( - collator_session_keys(), - 1013, - 1000, - H160::random(), - H160::random(), - ) -} - -#[test] -pub fn transfer_token_to_ethereum_fee_not_enough() { - test_cases::send_transfer_token_message_failure::( - collator_session_keys(), - 1013, - 1000, - DefaultBridgeHubEthereumBaseFee::get() + 1_000_000_000, - H160::random(), - H160::random(), - // fee not enough - 1_000_000_000, - NotHoldingFees, - ) -} - -#[test] -pub fn transfer_token_to_ethereum_insufficient_fund() { - test_cases::send_transfer_token_message_failure::( - collator_session_keys(), - 1013, - 1000, - 1_000_000_000, - H160::random(), - H160::random(), - DefaultBridgeHubEthereumBaseFee::get(), - FailedToTransactAsset("InsufficientBalance"), - ) -} - -#[test] -fn max_message_queue_service_weight_is_more_than_beacon_extrinsic_weights() { - let max_message_queue_weight = MessageQueueServiceWeight::get(); - let force_checkpoint = - ::WeightInfo::force_checkpoint(); - let submit_checkpoint = - ::WeightInfo::submit(); - max_message_queue_weight.all_gt(force_checkpoint); - max_message_queue_weight.all_gt(submit_checkpoint); -} diff --git a/snowbridge/parachain/scripts/benchmark.sh b/snowbridge/parachain/scripts/benchmark.sh index c47649b2eeb..c9a561b33c4 100755 --- a/snowbridge/parachain/scripts/benchmark.sh +++ b/snowbridge/parachain/scripts/benchmark.sh @@ -7,9 +7,9 @@ cargo run --release --bin polkadot-parachain \ -- \ benchmark pallet \ --chain=bridge-hub-rococo-dev \ ---pallet=snowbridge_ethereum_beacon_client \ +--pallet=snowbridge_pallet_ethereum_client \ --extrinsic="*" \ --execution=wasm --wasm-execution=compiled \ --steps 50 --repeat 20 \ ---output ./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_ethereum_beacon_client.rs +--output ./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs popd diff --git a/snowbridge/parachain/scripts/verify-pallets-build.sh b/snowbridge/parachain/scripts/verify-pallets-build.sh index 74cec954832..a62f48c84d4 100755 --- a/snowbridge/parachain/scripts/verify-pallets-build.sh +++ b/snowbridge/parachain/scripts/verify-pallets-build.sh @@ -78,7 +78,7 @@ rm -rf $SNOWBRIDGE_FOLDER/parachain/.gitignore rm -rf $SNOWBRIDGE_FOLDER/parachain/templates rm -rf $SNOWBRIDGE_FOLDER/parachain/.cargo rm -rf $SNOWBRIDGE_FOLDER/parachain/.config -rm -rf $SNOWBRIDGE_FOLDER/parachain/pallets/ethereum-beacon-client/fuzz +rm -rf $SNOWBRIDGE_FOLDER/parachain/pallets/ethereum-client/fuzz cd bridges/snowbridge/parachain @@ -93,18 +93,18 @@ find "." -name 'Cargo.toml' | while read -r file; do done # let's test if everything we need compiles -cargo check -p snowbridge-ethereum-beacon-client -cargo check -p snowbridge-ethereum-beacon-client --features runtime-benchmarks -cargo check -p snowbridge-ethereum-beacon-client --features try-runtime -cargo check -p snowbridge-inbound-queue -cargo check -p snowbridge-inbound-queue --features runtime-benchmarks -cargo check -p snowbridge-inbound-queue --features try-runtime -cargo check -p snowbridge-outbound-queue -cargo check -p snowbridge-outbound-queue --features runtime-benchmarks -cargo check -p snowbridge-outbound-queue --features try-runtime -cargo check -p snowbridge-system -cargo check -p snowbridge-system --features runtime-benchmarks -cargo check -p snowbridge-system --features try-runtime +cargo check -p snowbridge-pallet-ethereum-client +cargo check -p snowbridge-pallet-ethereum-client --features runtime-benchmarks +cargo check -p snowbridge-pallet-ethereum-client --features try-runtime +cargo check -p snowbridge-pallet-inbound-queue +cargo check -p snowbridge-pallet-inbound-queue --features runtime-benchmarks +cargo check -p snowbridge-pallet-inbound-queue --features try-runtime +cargo check -p snowbridge-pallet-outbound-queue +cargo check -p snowbridge-pallet-outbound-queue --features runtime-benchmarks +cargo check -p snowbridge-pallet-outbound-queue --features try-runtime +cargo check -p snowbridge-pallet-system +cargo check -p snowbridge-pallet-system --features runtime-benchmarks +cargo check -p snowbridge-pallet-system --features try-runtime cd - From 266349e2043722a9a9d315fa6cb315cfe8be5957 Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Fri, 12 Jan 2024 16:49:16 +0300 Subject: [PATCH 09/15] Run bridges zombienet tests on CI (#2439) Brridges zombienet tests are non-standard - zombienet currently missing multiple relay chains support (see e.g. https://github.com/paritytech/zombienet/pull/796), so we need to go live with two relay networks, their parachains + custom test runner (which e.g. doesn't shutdown net when its tests are finished and instead waits for both networks tests to complete). So we are stuck with native zombienet provider => this PR is an attempt to gather everything in a single docker container and run tests there ~Draft, because it is far from finishing - what I want now is to see how it works on CI~ --- zombienet/run-tests.sh | 50 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/zombienet/run-tests.sh b/zombienet/run-tests.sh index 4f80e06650e..34487e13261 100755 --- a/zombienet/run-tests.sh +++ b/zombienet/run-tests.sh @@ -1,18 +1,49 @@ #!/bin/bash #set -eu +set -x shopt -s nullglob -trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT +trap "trap - SIGINT SIGTERM EXIT && kill -- -$$" SIGINT SIGTERM EXIT + +# whether to use paths for zombienet+bridges tests container or for local testing +ZOMBIENET_DOCKER_PATHS=0 +while [ $# -ne 0 ] +do + arg="$1" + case "$arg" in + --docker) + ZOMBIENET_DOCKER_PATHS=1 + ;; + esac + shift +done # assuming that we'll be using native provide && all processes will be executing locally # (we need absolute paths here, because they're used when scripts are called by zombienet from tmp folders) export POLKADOT_SDK_FOLDER=`realpath $(dirname "$0")/../..` export BRIDGE_TESTS_FOLDER=$POLKADOT_SDK_FOLDER/bridges/zombienet/tests -export POLKADOT_BINARY_PATH=$POLKADOT_SDK_FOLDER/target/release/polkadot -export POLKADOT_PARACHAIN_BINARY_PATH=$POLKADOT_SDK_FOLDER/target/release/polkadot-parachain -export POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_ROCOCO=$POLKADOT_PARACHAIN_BINARY_PATH -export POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_WESTEND=$POLKADOT_PARACHAIN_BINARY_PATH -export ZOMBIENET_BINARY_PATH=~/local_bridge_testing/bin/zombienet-linux + +# set pathc to binaries +if [ "$ZOMBIENET_DOCKER_PATHS" -eq 1 ]; then + export POLKADOT_BINARY_PATH=/usr/local/bin/polkadot + export POLKADOT_PARACHAIN_BINARY_PATH=/usr/local/bin/polkadot-parachain + export POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_ROCOCO=/usr/local/bin/polkadot-parachain + export POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_WESTEND=/usr/local/bin/polkadot-parachain + + export SUBSTRATE_RELAY_PATH=/usr/local/bin/substrate-relay + export ZOMBIENET_BINARY_PATH=/usr/local/bin/zombie +else + export POLKADOT_BINARY_PATH=$POLKADOT_SDK_FOLDER/target/release/polkadot + export POLKADOT_PARACHAIN_BINARY_PATH=$POLKADOT_SDK_FOLDER/target/release/polkadot-parachain + export POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_ROCOCO=$POLKADOT_PARACHAIN_BINARY_PATH + export POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_WESTEND=$POLKADOT_PARACHAIN_BINARY_PATH + + export SUBSTRATE_RELAY_PATH=~/local_bridge_testing/bin/substrate-relay + export ZOMBIENET_BINARY_PATH=~/local_bridge_testing/bin/zombienet-linux +fi + +# check if `wait` supports -p flag +if [ `printf "$BASH_VERSION\n5.1" | sort -V | head -n 1` = "5.1" ]; then IS_BASH_5_1=1; else IS_BASH_5_1=0; fi # check if `wait` supports -p flag if [ `printf "$BASH_VERSION\n5.1" | sort -V | head -n 1` = "5.1" ]; then IS_BASH_5_1=1; else IS_BASH_5_1=0; fi @@ -21,13 +52,17 @@ if [ `printf "$BASH_VERSION\n5.1" | sort -V | head -n 1` = "5.1" ]; then IS_BASH export LANE_ID="00000002" # tests configuration -ALL_TESTS_FOLDER=`mktemp -d` +ALL_TESTS_FOLDER=`mktemp -d /tmp/bridges-zombienet-tests.XXXXX` function start_coproc() { local command=$1 local name=$2 local coproc_log=`mktemp -p $TEST_FOLDER` coproc COPROC { + # otherwise zombienet uses some hardcoded paths + unset RUN_IN_CONTAINER + unset ZOMBIENET_IMAGE + $command >$coproc_log 2>&1 } TEST_COPROCS[$COPROC_PID, 0]=$name @@ -90,6 +125,7 @@ do echo "=== Shutting down. Log of failed process below ===" echo "=====================================================================" echo $coproc_stdout + exit 1 fi From d9850b05b7775202d464da8789a97dce31e8d631 Mon Sep 17 00:00:00 2001 From: Francisco Aguirre Date: Tue, 16 Jan 2024 19:18:04 +0100 Subject: [PATCH 10/15] XCMv4 (#1230) # Note for reviewer Most changes are just syntax changes necessary for the new version. Most important files should be the ones under the `xcm` folder. # Description Added XCMv4. ## Removed `Multi` prefix The following types have been renamed: - MultiLocation -> Location - MultiAsset -> Asset - MultiAssets -> Assets - InteriorMultiLocation -> InteriorLocation - MultiAssetFilter -> AssetFilter - VersionedMultiAsset -> VersionedAsset - WildMultiAsset -> WildAsset - VersionedMultiLocation -> VersionedLocation In order to fix a name conflict, the `Assets` in `xcm-executor` were renamed to `HoldingAssets`, as they represent assets in holding. ## Removed `Abstract` asset id It was not being used anywhere and this simplifies the code. Now assets are just constructed as follows: ```rust let asset: Asset = (AssetId(Location::new(1, Here)), 100u128).into(); ``` No need for specifying `Concrete` anymore. ## Outcome is now a named fields struct Instead of ```rust pub enum Outcome { Complete(Weight), Incomplete(Weight, Error), Error(Error), } ``` we now have ```rust pub enum Outcome { Complete { used: Weight }, Incomplete { used: Weight, error: Error }, Error { error: Error }, } ``` ## Added Reanchorable trait Now both locations and assets implement this trait, making it easier to reanchor both. ## New syntax for building locations and junctions Now junctions are built using the following methods: ```rust let location = Location { parents: 1, interior: [Parachain(1000), PalletInstance(50), GeneralIndex(1984)].into() }; ``` or ```rust let location = Location::new(1, [Parachain(1000), PalletInstance(50), GeneralIndex(1984)]); ``` And they are matched like so: ```rust match location.unpack() { (1, [Parachain(id)]) => ... (0, Here) => ..., (1, [_]) => ..., } ``` This syntax is mandatory in v4, and has been also implemented for v2 and v3 for easier migration. This was needed to make all sizes smaller. # TODO - [x] Scaffold v4 - [x] Port github.com/paritytech/polkadot/pull/7236 - [x] Remove `Multi` prefix - [x] Remove `Abstract` asset id --------- Co-authored-by: command-bot <> Co-authored-by: Keith Yeung --- .../src/messages_benchmarking.rs | 12 +- .../src/messages_xcm_extension.rs | 22 +- .../xcm-bridge-hub-router/src/benchmarking.rs | 6 +- modules/xcm-bridge-hub-router/src/lib.rs | 33 +- modules/xcm-bridge-hub-router/src/mock.rs | 18 +- modules/xcm-bridge-hub/src/exporter.rs | 12 +- modules/xcm-bridge-hub/src/lib.rs | 14 +- modules/xcm-bridge-hub/src/mock.rs | 17 +- .../pallets/inbound-queue/src/lib.rs | 10 +- .../pallets/inbound-queue/src/mock.rs | 59 ++-- .../pallets/inbound-queue/src/test.rs | 4 +- .../pallets/system/runtime-api/src/lib.rs | 4 +- .../parachain/pallets/system/src/api.rs | 6 +- .../pallets/system/src/benchmarking.rs | 16 +- .../parachain/pallets/system/src/lib.rs | 44 +-- .../parachain/pallets/system/src/mock.rs | 26 +- .../parachain/pallets/system/src/tests.rs | 107 +++---- .../parachain/primitives/core/src/lib.rs | 22 +- .../parachain/primitives/core/tests/mod.rs | 6 +- .../primitives/router/src/inbound/mod.rs | 60 ++-- .../primitives/router/src/inbound/tests.rs | 7 +- .../primitives/router/src/outbound/mod.rs | 39 +-- .../primitives/router/src/outbound/tests.rs | 283 +++++++++--------- .../runtime/runtime-common/src/lib.rs | 47 ++- .../parachain/runtime/test-common/src/lib.rs | 69 ++--- 25 files changed, 439 insertions(+), 504 deletions(-) diff --git a/bin/runtime-common/src/messages_benchmarking.rs b/bin/runtime-common/src/messages_benchmarking.rs index e7e7891461b..0c7a9ad1a83 100644 --- a/bin/runtime-common/src/messages_benchmarking.rs +++ b/bin/runtime-common/src/messages_benchmarking.rs @@ -38,7 +38,7 @@ use frame_support::weights::Weight; use pallet_bridge_messages::benchmarking::{MessageDeliveryProofParams, MessageProofParams}; use sp_runtime::traits::{Header, Zero}; use sp_std::prelude::*; -use xcm::v3::prelude::*; +use xcm::latest::prelude::*; /// Prepare inbound bridge message according to given message proof parameters. fn prepare_inbound_message( @@ -266,19 +266,19 @@ where /// Returns callback which generates `BridgeMessage` from Polkadot XCM builder based on /// `expected_message_size` for benchmark. pub fn generate_xcm_builder_bridge_message_sample( - destination: InteriorMultiLocation, + destination: InteriorLocation, ) -> impl Fn(usize) -> MessagePayload { move |expected_message_size| -> MessagePayload { // For XCM bridge hubs, it is the message that // will be pushed further to some XCM queue (XCMP/UMP) - let location = xcm::VersionedInteriorMultiLocation::V3(destination); + let location = xcm::VersionedInteriorLocation::V4(destination.clone()); let location_encoded_size = location.encoded_size(); // we don't need to be super-precise with `expected_size` here let xcm_size = expected_message_size.saturating_sub(location_encoded_size); let xcm_data_size = xcm_size.saturating_sub( // minus empty instruction size - xcm::v3::Instruction::<()>::ExpectPallet { + Instruction::<()>::ExpectPallet { index: 0, name: vec![], module_name: vec![], @@ -294,8 +294,8 @@ pub fn generate_xcm_builder_bridge_message_sample( expected_message_size, location_encoded_size, xcm_size, xcm_data_size, ); - let xcm = xcm::VersionedXcm::<()>::V3( - vec![xcm::v3::Instruction::<()>::ExpectPallet { + let xcm = xcm::VersionedXcm::<()>::V4( + vec![Instruction::<()>::ExpectPallet { index: 0, name: vec![42; xcm_data_size], module_name: vec![], diff --git a/bin/runtime-common/src/messages_xcm_extension.rs b/bin/runtime-common/src/messages_xcm_extension.rs index 4892297a3df..e3da6155f08 100644 --- a/bin/runtime-common/src/messages_xcm_extension.rs +++ b/bin/runtime-common/src/messages_xcm_extension.rs @@ -126,14 +126,14 @@ impl< #[cfg_attr(feature = "std", derive(Debug, Eq, PartialEq))] pub struct SenderAndLane { /// Sending chain relative location. - pub location: MultiLocation, + pub location: Location, /// Message lane, used by the sending chain. pub lane: LaneId, } impl SenderAndLane { /// Create new object using provided location and lane. - pub fn new(location: MultiLocation, lane: LaneId) -> Self { + pub fn new(location: Location, lane: LaneId) -> Self { SenderAndLane { location, lane } } } @@ -171,7 +171,7 @@ pub struct XcmBlobHaulerAdapter( impl< H: XcmBlobHauler, - Lanes: Get>, + Lanes: Get>, > OnMessagesDelivered for XcmBlobHaulerAdapter { fn on_messages_delivered(lane: LaneId, enqueued_messages: MessageNonce) { @@ -291,7 +291,7 @@ impl LocalXcmQueueManager { /// Send congested signal to the `sending_chain_location`. fn send_congested_signal(sender_and_lane: &SenderAndLane) -> Result<(), SendError> { if let Some(msg) = H::CongestedMessage::get() { - send_xcm::(sender_and_lane.location, msg)?; + send_xcm::(sender_and_lane.location.clone(), msg)?; OutboundLanesCongestedSignals::::insert( sender_and_lane.lane, true, @@ -303,7 +303,7 @@ impl LocalXcmQueueManager { /// Send `uncongested` signal to the `sending_chain_location`. fn send_uncongested_signal(sender_and_lane: &SenderAndLane) -> Result<(), SendError> { if let Some(msg) = H::UncongestedMessage::get() { - send_xcm::(sender_and_lane.location, msg)?; + send_xcm::(sender_and_lane.location.clone(), msg)?; OutboundLanesCongestedSignals::::remove( sender_and_lane.lane, ); @@ -318,10 +318,10 @@ impl LocalXcmQueueManager { pub struct XcmVersionOfDestAndRemoteBridge( sp_std::marker::PhantomData<(Version, RemoteBridge)>, ); -impl> GetVersion +impl> GetVersion for XcmVersionOfDestAndRemoteBridge { - fn get_version_for(dest: &MultiLocation) -> Option { + fn get_version_for(dest: &Location) -> Option { let dest_version = Version::get_version_for(dest); let bridge_hub_version = Version::get_version_for(&RemoteBridge::get()); @@ -345,11 +345,11 @@ mod tests { parameter_types! { pub TestSenderAndLane: SenderAndLane = SenderAndLane { - location: MultiLocation::new(1, X1(Parachain(1000))), + location: Location::new(1, [Parachain(1000)]), lane: TEST_LANE_ID, }; - pub TestLanes: sp_std::vec::Vec<(SenderAndLane, (NetworkId, InteriorMultiLocation))> = sp_std::vec![ - (TestSenderAndLane::get(), (NetworkId::ByGenesis([0; 32]), InteriorMultiLocation::Here)) + pub TestLanes: sp_std::vec::Vec<(SenderAndLane, (NetworkId, InteriorLocation))> = sp_std::vec![ + (TestSenderAndLane::get(), (NetworkId::ByGenesis([0; 32]), InteriorLocation::Here)) ]; pub DummyXcmMessage: Xcm<()> = Xcm::new(); } @@ -366,7 +366,7 @@ mod tests { type Ticket = (); fn validate( - _destination: &mut Option, + _destination: &mut Option, _message: &mut Option>, ) -> SendResult { Ok(((), Default::default())) diff --git a/modules/xcm-bridge-hub-router/src/benchmarking.rs b/modules/xcm-bridge-hub-router/src/benchmarking.rs index 922e4bf94ba..c4f9f534c1a 100644 --- a/modules/xcm-bridge-hub-router/src/benchmarking.rs +++ b/modules/xcm-bridge-hub-router/src/benchmarking.rs @@ -37,10 +37,10 @@ pub trait Config: crate::Config { /// Returns destination which is valid for this router instance. /// (Needs to pass `T::Bridges`) /// Make sure that `SendXcm` will pass. - fn ensure_bridged_target_destination() -> Result { - Ok(MultiLocation::new( + fn ensure_bridged_target_destination() -> Result { + Ok(Location::new( Self::UniversalLocation::get().len() as u8, - X1(GlobalConsensus(Self::BridgedNetworkId::get().unwrap())), + [GlobalConsensus(Self::BridgedNetworkId::get().unwrap())], )) } } diff --git a/modules/xcm-bridge-hub-router/src/lib.rs b/modules/xcm-bridge-hub-router/src/lib.rs index 229628aedcb..f219be78f9e 100644 --- a/modules/xcm-bridge-hub-router/src/lib.rs +++ b/modules/xcm-bridge-hub-router/src/lib.rs @@ -80,7 +80,7 @@ pub mod pallet { type WeightInfo: WeightInfo; /// Universal location of this runtime. - type UniversalLocation: Get; + type UniversalLocation: Get; /// The bridged network that this config is for if specified. /// Also used for filtering `Bridges` by `BridgedNetworkId`. /// If not specified, allows all networks pass through. @@ -235,9 +235,9 @@ type ViaBridgeHubExporter = SovereignPaidRemoteExporter< impl, I: 'static> ExporterFor for Pallet { fn exporter_for( network: &NetworkId, - remote_location: &InteriorMultiLocation, + remote_location: &InteriorLocation, message: &Xcm<()>, - ) -> Option<(MultiLocation, Option)> { + ) -> Option<(Location, Option)> { // ensure that the message is sent to the expected bridged network (if specified). if let Some(bridged_network) = T::BridgedNetworkId::get() { if *network != bridged_network { @@ -268,7 +268,7 @@ impl, I: 'static> ExporterFor for Pallet { // take `base_fee` from `T::Brides`, but it has to be the same `T::FeeAsset` let base_fee = match maybe_payment { Some(payment) => match payment { - MultiAsset { fun: Fungible(amount), id } if id.eq(&T::FeeAsset::get()) => amount, + Asset { fun: Fungible(amount), id } if id.eq(&T::FeeAsset::get()) => amount, invalid_asset => { log::error!( target: LOG_TARGET, @@ -318,7 +318,7 @@ impl, I: 'static> SendXcm for Pallet { type Ticket = (u32, ::Ticket); fn validate( - dest: &mut Option, + dest: &mut Option, xcm: &mut Option>, ) -> SendResult { // `dest` and `xcm` are required here @@ -446,7 +446,7 @@ mod tests { run_test(|| { assert_eq!( send_xcm::( - MultiLocation::new(2, X2(GlobalConsensus(Rococo), Parachain(1000))), + Location::new(2, [GlobalConsensus(Rococo), Parachain(1000)]), vec![].into(), ), Err(SendError::NotApplicable), @@ -459,7 +459,7 @@ mod tests { run_test(|| { assert_eq!( send_xcm::( - MultiLocation::new(2, X2(GlobalConsensus(Rococo), Parachain(1000))), + Location::new(2, [GlobalConsensus(Rococo), Parachain(1000)]), vec![ClearOrigin; HARD_MESSAGE_SIZE_LIMIT as usize].into(), ), Err(SendError::ExceedsMaxMessageSize), @@ -483,14 +483,14 @@ mod tests { #[test] fn returns_proper_delivery_price() { run_test(|| { - let dest = MultiLocation::new(2, X1(GlobalConsensus(BridgedNetworkId::get()))); + let dest = Location::new(2, [GlobalConsensus(BridgedNetworkId::get())]); let xcm: Xcm<()> = vec![ClearOrigin].into(); let msg_size = xcm.encoded_size(); // initially the base fee is used: `BASE_FEE + BYTE_FEE * msg_size + HRMP_FEE` let expected_fee = BASE_FEE + BYTE_FEE * (msg_size as u128) + HRMP_FEE; assert_eq!( - XcmBridgeHubRouter::validate(&mut Some(dest), &mut Some(xcm.clone())) + XcmBridgeHubRouter::validate(&mut Some(dest.clone()), &mut Some(xcm.clone())) .unwrap() .1 .get(0), @@ -518,10 +518,7 @@ mod tests { run_test(|| { let old_bridge = XcmBridgeHubRouter::bridge(); assert_ok!(send_xcm::( - MultiLocation::new( - 2, - X2(GlobalConsensus(BridgedNetworkId::get()), Parachain(1000)) - ), + Location::new(2, [GlobalConsensus(BridgedNetworkId::get()), Parachain(1000)]), vec![ClearOrigin].into(), ) .map(drop)); @@ -538,10 +535,7 @@ mod tests { let old_bridge = XcmBridgeHubRouter::bridge(); assert_ok!(send_xcm::( - MultiLocation::new( - 2, - X2(GlobalConsensus(BridgedNetworkId::get()), Parachain(1000)) - ), + Location::new(2, [GlobalConsensus(BridgedNetworkId::get()), Parachain(1000)]), vec![ClearOrigin].into(), ) .map(drop)); @@ -560,10 +554,7 @@ mod tests { let old_bridge = XcmBridgeHubRouter::bridge(); assert_ok!(send_xcm::( - MultiLocation::new( - 2, - X2(GlobalConsensus(BridgedNetworkId::get()), Parachain(1000)) - ), + Location::new(2, [GlobalConsensus(BridgedNetworkId::get()), Parachain(1000)]), vec![ClearOrigin].into(), ) .map(drop)); diff --git a/modules/xcm-bridge-hub-router/src/mock.rs b/modules/xcm-bridge-hub-router/src/mock.rs index 9079f4b9c4c..6dbfba5f6fd 100644 --- a/modules/xcm-bridge-hub-router/src/mock.rs +++ b/modules/xcm-bridge-hub-router/src/mock.rs @@ -49,9 +49,9 @@ construct_runtime! { parameter_types! { pub ThisNetworkId: NetworkId = Polkadot; pub BridgedNetworkId: NetworkId = Kusama; - pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(ThisNetworkId::get()), Parachain(1000)); - pub SiblingBridgeHubLocation: MultiLocation = ParentThen(X1(Parachain(1002))).into(); - pub BridgeFeeAsset: AssetId = MultiLocation::parent().into(); + pub UniversalLocation: InteriorLocation = [GlobalConsensus(ThisNetworkId::get()), Parachain(1000)].into(); + pub SiblingBridgeHubLocation: Location = ParentThen([Parachain(1002)].into()).into(); + pub BridgeFeeAsset: AssetId = Location::parent().into(); pub BridgeTable: Vec = vec![ NetworkExportTableItem::new( @@ -61,7 +61,7 @@ parameter_types! { Some((BridgeFeeAsset::get(), BASE_FEE).into()) ) ]; - pub UnknownXcmVersionLocation: MultiLocation = MultiLocation::new(2, X2(GlobalConsensus(BridgedNetworkId::get()), Parachain(9999))); + pub UnknownXcmVersionLocation: Location = Location::new(2, [GlobalConsensus(BridgedNetworkId::get()), Parachain(9999)]); } #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] @@ -87,11 +87,11 @@ impl pallet_xcm_bridge_hub_router::Config<()> for TestRuntime { } pub struct LatestOrNoneForLocationVersionChecker(sp_std::marker::PhantomData); -impl> GetVersion - for LatestOrNoneForLocationVersionChecker +impl> GetVersion + for LatestOrNoneForLocationVersionChecker { - fn get_version_for(dest: &MultiLocation) -> Option { - if Location::contains(dest) { + fn get_version_for(dest: &Location) -> Option { + if LocationValue::contains(dest) { return None } Some(XCM_VERSION) @@ -110,7 +110,7 @@ impl SendXcm for TestToBridgeHubSender { type Ticket = (); fn validate( - _destination: &mut Option, + _destination: &mut Option, _message: &mut Option>, ) -> SendResult { Ok(((), (BridgeFeeAsset::get(), HRMP_FEE).into())) diff --git a/modules/xcm-bridge-hub/src/exporter.rs b/modules/xcm-bridge-hub/src/exporter.rs index 4e899dfa011..94ec8b5f106 100644 --- a/modules/xcm-bridge-hub/src/exporter.rs +++ b/modules/xcm-bridge-hub/src/exporter.rs @@ -53,10 +53,10 @@ where fn validate( network: NetworkId, channel: u32, - universal_source: &mut Option, - destination: &mut Option, + universal_source: &mut Option, + destination: &mut Option, message: &mut Option>, - ) -> Result<(Self::Ticket, MultiAssets), SendError> { + ) -> Result<(Self::Ticket, Assets), SendError> { // Find supported lane_id. let sender_and_lane = Self::lane_for( universal_source.as_ref().ok_or(SendError::MissingArgument)?, @@ -134,11 +134,11 @@ mod tests { use frame_support::assert_ok; use xcm_executor::traits::export_xcm; - fn universal_source() -> InteriorMultiLocation { - X2(GlobalConsensus(RelayNetwork::get()), Parachain(SIBLING_ASSET_HUB_ID)) + fn universal_source() -> InteriorLocation { + [GlobalConsensus(RelayNetwork::get()), Parachain(SIBLING_ASSET_HUB_ID)].into() } - fn universal_destination() -> InteriorMultiLocation { + fn universal_destination() -> InteriorLocation { BridgedDestination::get() } diff --git a/modules/xcm-bridge-hub/src/lib.rs b/modules/xcm-bridge-hub/src/lib.rs index 44f6903b018..60b988497fc 100644 --- a/modules/xcm-bridge-hub/src/lib.rs +++ b/modules/xcm-bridge-hub/src/lib.rs @@ -45,25 +45,25 @@ pub mod pallet { BridgeMessagesConfig { /// Runtime's universal location. - type UniversalLocation: Get; + type UniversalLocation: Get; // TODO: https://github.com/paritytech/parity-bridges-common/issues/1666 remove `ChainId` and // replace it with the `NetworkId` - then we'll be able to use // `T as pallet_bridge_messages::Config::BridgedChain::NetworkId` /// Bridged network as relative location of bridged `GlobalConsensus`. #[pallet::constant] - type BridgedNetwork: Get; + type BridgedNetwork: Get; /// Associated messages pallet instance that bridges us with the /// `BridgedNetworkId` consensus. type BridgeMessagesPalletInstance: 'static; /// Price of single message export to the bridged consensus (`Self::BridgedNetworkId`). - type MessageExportPrice: Get; + type MessageExportPrice: Get; /// Checks the XCM version for the destination. type DestinationVersion: GetVersion; /// Get point-to-point links with bridged consensus (`Self::BridgedNetworkId`). /// (this will be replaced with dynamic on-chain bridges - `Bridges V2`) - type Lanes: Get>; + type Lanes: Get>; /// Support for point-to-point links /// (this will be replaced with dynamic on-chain bridges - `Bridges V2`) type LanesSupport: XcmBlobHauler; @@ -86,10 +86,10 @@ pub mod pallet { impl, I: 'static> Pallet { /// Returns dedicated/configured lane identifier. pub(crate) fn lane_for( - source: &InteriorMultiLocation, - dest: (&NetworkId, &InteriorMultiLocation), + source: &InteriorLocation, + dest: (&NetworkId, &InteriorLocation), ) -> Option { - let source = source.relative_to(&T::UniversalLocation::get()); + let source = source.clone().relative_to(&T::UniversalLocation::get()); // Check that we have configured a point-to-point lane for 'source' and `dest`. T::Lanes::get() diff --git a/modules/xcm-bridge-hub/src/mock.rs b/modules/xcm-bridge-hub/src/mock.rs index 97fc7741e40..e40e1f9fb65 100644 --- a/modules/xcm-bridge-hub/src/mock.rs +++ b/modules/xcm-bridge-hub/src/mock.rs @@ -154,16 +154,13 @@ impl pallet_bridge_messages::WeightInfoExt for TestMessagesWeights { parameter_types! { pub const RelayNetwork: NetworkId = NetworkId::Kusama; pub const BridgedRelayNetwork: NetworkId = NetworkId::Polkadot; - pub const BridgedRelayNetworkLocation: MultiLocation = MultiLocation { - parents: 1, - interior: X1(GlobalConsensus(BridgedRelayNetwork::get())) - }; + pub BridgedRelayNetworkLocation: Location = (Parent, GlobalConsensus(BridgedRelayNetwork::get())).into(); pub const NonBridgedRelayNetwork: NetworkId = NetworkId::Rococo; pub const BridgeReserve: Balance = 100_000; - pub UniversalLocation: InteriorMultiLocation = X2( + pub UniversalLocation: InteriorLocation = [ GlobalConsensus(RelayNetwork::get()), Parachain(THIS_BRIDGE_HUB_ID), - ); + ].into(); pub const Penalty: Balance = 1_000; } @@ -181,13 +178,13 @@ impl pallet_xcm_bridge_hub::Config for TestRuntime { parameter_types! { pub TestSenderAndLane: SenderAndLane = SenderAndLane { - location: MultiLocation::new(1, X1(Parachain(SIBLING_ASSET_HUB_ID))), + location: Location::new(1, [Parachain(SIBLING_ASSET_HUB_ID)]), lane: TEST_LANE_ID, }; - pub const BridgedDestination: InteriorMultiLocation = X1( + pub BridgedDestination: InteriorLocation = [ Parachain(BRIDGED_ASSET_HUB_ID) - ); - pub TestLanes: sp_std::vec::Vec<(SenderAndLane, (NetworkId, InteriorMultiLocation))> = sp_std::vec![ + ].into(); + pub TestLanes: sp_std::vec::Vec<(SenderAndLane, (NetworkId, InteriorLocation))> = sp_std::vec![ (TestSenderAndLane::get(), (BridgedRelayNetwork::get(), BridgedDestination::get())) ]; } diff --git a/snowbridge/parachain/pallets/inbound-queue/src/lib.rs b/snowbridge/parachain/pallets/inbound-queue/src/lib.rs index f7eea0aadfa..bdc21fcf037 100644 --- a/snowbridge/parachain/pallets/inbound-queue/src/lib.rs +++ b/snowbridge/parachain/pallets/inbound-queue/src/lib.rs @@ -54,8 +54,8 @@ use scale_info::TypeInfo; use sp_core::{H160, H256}; use sp_std::{convert::TryFrom, vec}; use xcm::prelude::{ - send_xcm, Instruction::SetTopic, Junction::*, Junctions::*, MultiLocation, - SendError as XcmpSendError, SendXcm, Xcm, XcmContext, XcmHash, + send_xcm, Instruction::SetTopic, Junction::*, Location, SendError as XcmpSendError, SendXcm, + Xcm, XcmContext, XcmHash, }; use xcm_executor::traits::TransactAsset; @@ -324,7 +324,7 @@ pub mod pallet { } pub fn send_xcm(xcm: Xcm<()>, dest: ParaId) -> Result> { - let dest = MultiLocation { parents: 1, interior: X1(Parachain(dest.into())) }; + let dest = Location::new(1, [Parachain(dest.into())]); let (xcm_hash, _) = send_xcm::(dest, xcm).map_err(Error::::from)?; Ok(xcm_hash) } @@ -341,8 +341,8 @@ pub mod pallet { pub fn burn_fees(para_id: ParaId, fee: BalanceOf) -> DispatchResult { let dummy_context = XcmContext { origin: None, message_id: Default::default(), topic: None }; - let dest = MultiLocation { parents: 1, interior: X1(Parachain(para_id.into())) }; - let fees = (MultiLocation::parent(), fee.saturated_into::()).into(); + let dest = Location::new(1, [Parachain(para_id.into())]); + let fees = (Location::parent(), fee.saturated_into::()).into(); T::AssetTransactor::can_check_out(&dest, &fees, &dummy_context).map_err(|error| { log::error!( target: LOG_TARGET, diff --git a/snowbridge/parachain/pallets/inbound-queue/src/mock.rs b/snowbridge/parachain/pallets/inbound-queue/src/mock.rs index b031a46e219..39374aa3d71 100644 --- a/snowbridge/parachain/pallets/inbound-queue/src/mock.rs +++ b/snowbridge/parachain/pallets/inbound-queue/src/mock.rs @@ -21,8 +21,8 @@ use sp_runtime::{ BuildStorage, FixedU128, MultiSignature, }; use sp_std::convert::From; -use xcm::v3::{prelude::*, MultiAssets, SendXcm}; -use xcm_executor::Assets; +use xcm::v4::{prelude::*, SendXcm}; +use xcm_executor::AssetsInHolding; use crate::{self as inbound_queue}; @@ -155,17 +155,16 @@ impl SendXcm for MockXcmSender { type Ticket = Xcm<()>; fn validate( - dest: &mut Option, - xcm: &mut Option>, + dest: &mut Option, + xcm: &mut Option>, ) -> SendResult { - match dest { - Some(MultiLocation { interior, .. }) => { - if let X1(Parachain(1001)) = interior { - return Err(XcmpSendError::NotApplicable) - } - Ok((xcm.clone().unwrap(), MultiAssets::default())) - }, - _ => Ok((xcm.clone().unwrap(), MultiAssets::default())), + if let Some(location) = dest { + match location.unpack() { + (_, [Parachain(1001)]) => return Err(XcmpSendError::NotApplicable), + _ => Ok((xcm.clone().unwrap(), Assets::default())), + } + } else { + Ok((xcm.clone().unwrap(), Assets::default())) } } @@ -203,45 +202,33 @@ impl StaticLookup for MockChannelLookup { pub struct SuccessfulTransactor; impl TransactAsset for SuccessfulTransactor { - fn can_check_in( - _origin: &MultiLocation, - _what: &MultiAsset, - _context: &XcmContext, - ) -> XcmResult { + fn can_check_in(_origin: &Location, _what: &Asset, _context: &XcmContext) -> XcmResult { Ok(()) } - fn can_check_out( - _dest: &MultiLocation, - _what: &MultiAsset, - _context: &XcmContext, - ) -> XcmResult { + fn can_check_out(_dest: &Location, _what: &Asset, _context: &XcmContext) -> XcmResult { Ok(()) } - fn deposit_asset( - _what: &MultiAsset, - _who: &MultiLocation, - _context: Option<&XcmContext>, - ) -> XcmResult { + fn deposit_asset(_what: &Asset, _who: &Location, _context: Option<&XcmContext>) -> XcmResult { Ok(()) } fn withdraw_asset( - _what: &MultiAsset, - _who: &MultiLocation, + _what: &Asset, + _who: &Location, _context: Option<&XcmContext>, - ) -> Result { - Ok(Assets::default()) + ) -> Result { + Ok(AssetsInHolding::default()) } fn internal_transfer_asset( - _what: &MultiAsset, - _from: &MultiLocation, - _to: &MultiLocation, + _what: &Asset, + _from: &Location, + _to: &Location, _context: &XcmContext, - ) -> Result { - Ok(Assets::default()) + ) -> Result { + Ok(AssetsInHolding::default()) } } diff --git a/snowbridge/parachain/pallets/inbound-queue/src/test.rs b/snowbridge/parachain/pallets/inbound-queue/src/test.rs index 17ebeb39446..9a47e475b8c 100644 --- a/snowbridge/parachain/pallets/inbound-queue/src/test.rs +++ b/snowbridge/parachain/pallets/inbound-queue/src/test.rs @@ -41,8 +41,8 @@ fn test_submit_happy_path() { .into(), nonce: 1, message_id: [ - 27, 217, 88, 127, 46, 143, 199, 70, 236, 66, 212, 244, 85, 221, 153, 104, 175, 37, - 224, 20, 140, 95, 140, 7, 27, 74, 182, 199, 77, 12, 194, 236, + 57, 61, 232, 3, 66, 61, 25, 190, 234, 188, 193, 174, 13, 186, 1, 64, 237, 94, 73, + 83, 14, 18, 209, 213, 78, 121, 43, 108, 251, 245, 107, 67, ], fee_burned: 110000000000, } diff --git a/snowbridge/parachain/pallets/system/runtime-api/src/lib.rs b/snowbridge/parachain/pallets/system/runtime-api/src/lib.rs index d99b456c848..7f119809546 100644 --- a/snowbridge/parachain/pallets/system/runtime-api/src/lib.rs +++ b/snowbridge/parachain/pallets/system/runtime-api/src/lib.rs @@ -3,11 +3,11 @@ #![cfg_attr(not(feature = "std"), no_std)] use snowbridge_core::AgentId; -use xcm::VersionedMultiLocation; +use xcm::VersionedLocation; sp_api::decl_runtime_apis! { pub trait ControlApi { - fn agent_id(location: VersionedMultiLocation) -> Option; + fn agent_id(location: VersionedLocation) -> Option; } } diff --git a/snowbridge/parachain/pallets/system/src/api.rs b/snowbridge/parachain/pallets/system/src/api.rs index 245e6eea1c1..ef12b03e1d7 100644 --- a/snowbridge/parachain/pallets/system/src/api.rs +++ b/snowbridge/parachain/pallets/system/src/api.rs @@ -3,14 +3,14 @@ //! Helpers for implementing runtime api use snowbridge_core::AgentId; -use xcm::{prelude::*, VersionedMultiLocation}; +use xcm::{prelude::*, VersionedLocation}; use crate::{agent_id_of, Config}; -pub fn agent_id(location: VersionedMultiLocation) -> Option +pub fn agent_id(location: VersionedLocation) -> Option where Runtime: Config, { - let location: MultiLocation = location.try_into().ok()?; + let location: Location = location.try_into().ok()?; agent_id_of::(&location).ok() } diff --git a/snowbridge/parachain/pallets/system/src/benchmarking.rs b/snowbridge/parachain/pallets/system/src/benchmarking.rs index 8d26408b38e..ef908ad6a3f 100644 --- a/snowbridge/parachain/pallets/system/src/benchmarking.rs +++ b/snowbridge/parachain/pallets/system/src/benchmarking.rs @@ -63,7 +63,7 @@ mod benchmarks { #[benchmark] fn create_agent() -> Result<(), BenchmarkError> { let origin_para_id = 2000; - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let origin_location = Location::new(1, [Parachain(origin_para_id)]); let origin = T::Helper::make_xcm_origin(origin_location); fund_sovereign_account::(origin_para_id.into())?; @@ -76,7 +76,7 @@ mod benchmarks { #[benchmark] fn create_channel() -> Result<(), BenchmarkError> { let origin_para_id = 2000; - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let origin_location = Location::new(1, [Parachain(origin_para_id)]); let origin = T::Helper::make_xcm_origin(origin_location); fund_sovereign_account::(origin_para_id.into())?; @@ -91,7 +91,7 @@ mod benchmarks { #[benchmark] fn update_channel() -> Result<(), BenchmarkError> { let origin_para_id = 2000; - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let origin_location = Location::new(1, [Parachain(origin_para_id)]); let origin = T::Helper::make_xcm_origin(origin_location); fund_sovereign_account::(origin_para_id.into())?; SnowbridgeControl::::create_agent(origin.clone())?; @@ -106,7 +106,7 @@ mod benchmarks { #[benchmark] fn force_update_channel() -> Result<(), BenchmarkError> { let origin_para_id = 2000; - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let origin_location = Location::new(1, [Parachain(origin_para_id)]); let origin = T::Helper::make_xcm_origin(origin_location); let channel_id: ChannelId = ParaId::from(origin_para_id).into(); @@ -123,7 +123,7 @@ mod benchmarks { #[benchmark] fn transfer_native_from_agent() -> Result<(), BenchmarkError> { let origin_para_id = 2000; - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let origin_location = Location::new(1, [Parachain(origin_para_id)]); let origin = T::Helper::make_xcm_origin(origin_location); fund_sovereign_account::(origin_para_id.into())?; SnowbridgeControl::::create_agent(origin.clone())?; @@ -138,12 +138,12 @@ mod benchmarks { #[benchmark] fn force_transfer_native_from_agent() -> Result<(), BenchmarkError> { let origin_para_id = 2000; - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; - let origin = T::Helper::make_xcm_origin(origin_location); + let origin_location = Location::new(1, [Parachain(origin_para_id)]); + let origin = T::Helper::make_xcm_origin(origin_location.clone()); fund_sovereign_account::(origin_para_id.into())?; SnowbridgeControl::::create_agent(origin.clone())?; - let versioned_location: VersionedMultiLocation = origin_location.into(); + let versioned_location: VersionedLocation = origin_location.into(); #[extrinsic_call] _(RawOrigin::Root, Box::new(versioned_location), H160::default(), 1); diff --git a/snowbridge/parachain/pallets/system/src/lib.rs b/snowbridge/parachain/pallets/system/src/lib.rs index 0042093ee66..e742bd8e110 100644 --- a/snowbridge/parachain/pallets/system/src/lib.rs +++ b/snowbridge/parachain/pallets/system/src/lib.rs @@ -87,12 +87,12 @@ pub type AccountIdOf = ::AccountId; pub type PricingParametersOf = PricingParametersRecord>; /// Ensure origin location is a sibling -fn ensure_sibling(location: &MultiLocation) -> Result<(ParaId, H256), DispatchError> +fn ensure_sibling(location: &Location) -> Result<(ParaId, H256), DispatchError> where T: Config, { - match location { - MultiLocation { parents: 1, interior: X1(Parachain(para_id)) } => { + match location.unpack() { + (1, [Parachain(para_id)]) => { let agent_id = agent_id_of::(location)?; Ok(((*para_id).into(), agent_id)) }, @@ -101,7 +101,7 @@ where } /// Hash the location to produce an agent id -fn agent_id_of(location: &MultiLocation) -> Result { +fn agent_id_of(location: &Location) -> Result { T::AgentIdOf::convert_location(location).ok_or(Error::::LocationConversionFailed.into()) } @@ -110,7 +110,7 @@ pub trait BenchmarkHelper where O: OriginTrait, { - fn make_xcm_origin(location: MultiLocation) -> O; + fn make_xcm_origin(location: Location) -> O; } /// Whether a fee should be withdrawn to an account for sending an outbound message @@ -145,9 +145,9 @@ pub mod pallet { type OutboundQueue: SendMessage>; /// Origin check for XCM locations that can create agents - type SiblingOrigin: EnsureOrigin; + type SiblingOrigin: EnsureOrigin; - /// Converts MultiLocation to AgentId + /// Converts Location to AgentId type AgentIdOf: ConvertLocation; /// Token reserved for control operations @@ -180,7 +180,7 @@ pub mod pallet { }, /// An CreateAgent message was sent to the Gateway CreateAgent { - location: Box, + location: Box, agent_id: AgentId, }, /// An CreateChannel message was sent to the Gateway @@ -299,7 +299,7 @@ pub mod pallet { /// /// Fee required: No /// - /// - `origin`: Must be `MultiLocation` + /// - `origin`: Must be `Location` #[pallet::call_index(1)] #[pallet::weight((T::WeightInfo::set_operating_mode(), DispatchClass::Operational))] pub fn set_operating_mode(origin: OriginFor, mode: OperatingMode) -> DispatchResult { @@ -342,11 +342,11 @@ pub mod pallet { /// /// Fee required: Yes /// - /// - `origin`: Must be `MultiLocation` of a sibling parachain + /// - `origin`: Must be `Location` of a sibling parachain #[pallet::call_index(3)] #[pallet::weight(T::WeightInfo::create_agent())] pub fn create_agent(origin: OriginFor) -> DispatchResult { - let origin_location: MultiLocation = T::SiblingOrigin::ensure_origin(origin)?; + let origin_location: Location = T::SiblingOrigin::ensure_origin(origin)?; // Ensure that origin location is some consensus system on a sibling parachain let (para_id, agent_id) = ensure_sibling::(&origin_location)?; @@ -375,12 +375,12 @@ pub mod pallet { /// /// The message is sent over the bridge on BridgeHub's own channel to the Gateway. /// - /// - `origin`: Must be `MultiLocation` + /// - `origin`: Must be `Location` /// - `mode`: Initial operating mode of the channel #[pallet::call_index(4)] #[pallet::weight(T::WeightInfo::create_channel())] pub fn create_channel(origin: OriginFor, mode: OperatingMode) -> DispatchResult { - let origin_location: MultiLocation = T::SiblingOrigin::ensure_origin(origin)?; + let origin_location: Location = T::SiblingOrigin::ensure_origin(origin)?; // Ensure that origin location is a sibling parachain let (para_id, agent_id) = ensure_sibling::(&origin_location)?; @@ -407,12 +407,12 @@ pub mod pallet { /// /// A partial fee will be charged for local processing only. /// - /// - `origin`: Must be `MultiLocation` + /// - `origin`: Must be `Location` /// - `mode`: Initial operating mode of the channel #[pallet::call_index(5)] #[pallet::weight(T::WeightInfo::update_channel())] pub fn update_channel(origin: OriginFor, mode: OperatingMode) -> DispatchResult { - let origin_location: MultiLocation = T::SiblingOrigin::ensure_origin(origin)?; + let origin_location: Location = T::SiblingOrigin::ensure_origin(origin)?; // Ensure that origin location is a sibling parachain let (para_id, _) = ensure_sibling::(&origin_location)?; @@ -461,7 +461,7 @@ pub mod pallet { /// /// A partial fee will be charged for local processing only. /// - /// - `origin`: Must be `MultiLocation` + /// - `origin`: Must be `Location` #[pallet::call_index(7)] #[pallet::weight(T::WeightInfo::transfer_native_from_agent())] pub fn transfer_native_from_agent( @@ -469,7 +469,7 @@ pub mod pallet { recipient: H160, amount: u128, ) -> DispatchResult { - let origin_location: MultiLocation = T::SiblingOrigin::ensure_origin(origin)?; + let origin_location: Location = T::SiblingOrigin::ensure_origin(origin)?; // Ensure that origin location is some consensus system on a sibling parachain let (para_id, agent_id) = ensure_sibling::(&origin_location)?; @@ -501,14 +501,14 @@ pub mod pallet { #[pallet::weight(T::WeightInfo::force_transfer_native_from_agent())] pub fn force_transfer_native_from_agent( origin: OriginFor, - location: Box, + location: Box, recipient: H160, amount: u128, ) -> DispatchResult { ensure_root(origin)?; // Ensure that location is some consensus system on a sibling parachain - let location: MultiLocation = + let location: Location = (*location).try_into().map_err(|_| Error::::UnsupportedLocationVersion)?; let (_, agent_id) = ensure_sibling::(&location).map_err(|_| Error::::InvalidLocation)?; @@ -621,8 +621,8 @@ pub mod pallet { /// Initializes agents and channels. pub fn initialize(para_id: ParaId, asset_hub_para_id: ParaId) -> Result<(), DispatchError> { // Asset Hub - let asset_hub_location: MultiLocation = - ParentThen(X1(Parachain(asset_hub_para_id.into()))).into(); + let asset_hub_location: Location = + ParentThen(Parachain(asset_hub_para_id.into()).into()).into(); let asset_hub_agent_id = agent_id_of::(&asset_hub_location)?; let asset_hub_channel_id: ChannelId = asset_hub_para_id.into(); Agents::::insert(asset_hub_agent_id, ()); @@ -632,7 +632,7 @@ pub mod pallet { ); // Governance channels - let bridge_hub_agent_id = agent_id_of::(&MultiLocation::here())?; + let bridge_hub_agent_id = agent_id_of::(&Location::here())?; // Agent for BridgeHub Agents::::insert(bridge_hub_agent_id, ()); diff --git a/snowbridge/parachain/pallets/system/src/mock.rs b/snowbridge/parachain/pallets/system/src/mock.rs index bb9bae6b56d..bc229578132 100644 --- a/snowbridge/parachain/pallets/system/src/mock.rs +++ b/snowbridge/parachain/pallets/system/src/mock.rs @@ -49,22 +49,22 @@ mod pallet_xcm_origin { // Insert this custom Origin into the aggregate RuntimeOrigin #[pallet::origin] #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] - pub struct Origin(pub MultiLocation); + pub struct Origin(pub Location); - impl From for Origin { - fn from(location: MultiLocation) -> Origin { + impl From for Origin { + fn from(location: Location) -> Origin { Origin(location) } } - /// `EnsureOrigin` implementation succeeding with a `MultiLocation` value to recognize and + /// `EnsureOrigin` implementation succeeding with a `Location` value to recognize and /// filter the contained location pub struct EnsureXcm(PhantomData); - impl, F: Contains> EnsureOrigin for EnsureXcm + impl, F: Contains> EnsureOrigin for EnsureXcm where O::PalletsOrigin: From + TryInto, { - type Success = MultiLocation; + type Success = Location; fn try_origin(outer: O) -> Result { outer.try_with_caller(|caller| { @@ -77,7 +77,7 @@ mod pallet_xcm_origin { #[cfg(feature = "runtime-benchmarks")] fn try_successful_origin() -> Result { - Ok(O::from(Origin(MultiLocation { parents: 1, interior: X1(Parachain(2000)) }))) + Ok(O::from(Origin(Location::new(1, [Parachain(2000)])))) } } } @@ -186,9 +186,9 @@ parameter_types! { pub const SS58Prefix: u8 = 42; pub const AnyNetwork: Option = None; pub const RelayNetwork: Option = Some(NetworkId::Kusama); - pub const RelayLocation: MultiLocation = MultiLocation::parent(); - pub UniversalLocation: InteriorMultiLocation = - X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(1013)); + pub const RelayLocation: Location = Location::parent(); + pub UniversalLocation: InteriorLocation = + [GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(1013)].into(); } pub const DOT: u128 = 10_000_000_000; @@ -211,7 +211,7 @@ parameter_types! { #[cfg(feature = "runtime-benchmarks")] impl BenchmarkHelper for () { - fn make_xcm_origin(location: MultiLocation) -> RuntimeOrigin { + fn make_xcm_origin(location: Location) -> RuntimeOrigin { RuntimeOrigin::from(pallet_xcm_origin::Origin(location)) } } @@ -260,11 +260,11 @@ pub fn new_test_ext(genesis_build: bool) -> sp_io::TestExternalities { // Test helpers -pub fn make_xcm_origin(location: MultiLocation) -> RuntimeOrigin { +pub fn make_xcm_origin(location: Location) -> RuntimeOrigin { pallet_xcm_origin::Origin(location).into() } -pub fn make_agent_id(location: MultiLocation) -> AgentId { +pub fn make_agent_id(location: Location) -> AgentId { ::AgentIdOf::convert_location(&location) .expect("convert location") } diff --git a/snowbridge/parachain/pallets/system/src/tests.rs b/snowbridge/parachain/pallets/system/src/tests.rs index e07481c1e33..8b417c258ea 100644 --- a/snowbridge/parachain/pallets/system/src/tests.rs +++ b/snowbridge/parachain/pallets/system/src/tests.rs @@ -11,8 +11,8 @@ use sp_runtime::{AccountId32, DispatchError::BadOrigin, TokenError}; fn create_agent() { new_test_ext(true).execute_with(|| { let origin_para_id = 2000; - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; - let agent_id = make_agent_id(origin_location); + let origin_location = Location::new(1, [Parachain(origin_para_id)]); + let agent_id = make_agent_id(origin_location.clone()); let sovereign_account = sibling_sovereign_account::(origin_para_id.into()); // fund sovereign account of origin @@ -30,7 +30,7 @@ fn create_agent() { #[test] fn test_agent_for_here() { new_test_ext(true).execute_with(|| { - let origin_location = MultiLocation::here(); + let origin_location = Location::here(); let agent_id = make_agent_id(origin_location); assert_eq!( agent_id, @@ -42,7 +42,7 @@ fn test_agent_for_here() { #[test] fn create_agent_fails_on_funds_unavailable() { new_test_ext(true).execute_with(|| { - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(2000)) }; + let origin_location = Location::new(1, [Parachain(2000)]); let origin = make_xcm_origin(origin_location); // Reset balance of sovereign_account to zero so to trigger the FundsUnavailable error let sovereign_account = sibling_sovereign_account::(2000.into()); @@ -56,19 +56,16 @@ fn create_agent_bad_origin() { new_test_ext(true).execute_with(|| { // relay chain location not allowed assert_noop!( - EthereumSystem::create_agent(make_xcm_origin(MultiLocation { - parents: 1, - interior: Here, - })), + EthereumSystem::create_agent(make_xcm_origin(Location::new(1, [],))), BadOrigin, ); // local account location not allowed assert_noop!( - EthereumSystem::create_agent(make_xcm_origin(MultiLocation { - parents: 0, - interior: X1(Junction::AccountId32 { network: None, id: [67u8; 32] }), - })), + EthereumSystem::create_agent(make_xcm_origin(Location::new( + 0, + [Junction::AccountId32 { network: None, id: [67u8; 32] }], + ))), BadOrigin, ); @@ -243,7 +240,7 @@ fn set_token_transfer_fees_invalid() { fn create_channel() { new_test_ext(true).execute_with(|| { let origin_para_id = 2000; - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let origin_location = Location::new(1, [Parachain(origin_para_id)]); let sovereign_account = sibling_sovereign_account::(origin_para_id.into()); let origin = make_xcm_origin(origin_location); @@ -259,7 +256,7 @@ fn create_channel() { fn create_channel_fail_already_exists() { new_test_ext(true).execute_with(|| { let origin_para_id = 2000; - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let origin_location = Location::new(1, [Parachain(origin_para_id)]); let sovereign_account = sibling_sovereign_account::(origin_para_id.into()); let origin = make_xcm_origin(origin_location); @@ -282,7 +279,7 @@ fn create_channel_bad_origin() { // relay chain location not allowed assert_noop!( EthereumSystem::create_channel( - make_xcm_origin(MultiLocation { parents: 1, interior: Here }), + make_xcm_origin(Location::new(1, [])), OperatingMode::Normal, ), BadOrigin, @@ -291,13 +288,10 @@ fn create_channel_bad_origin() { // child of sibling location not allowed assert_noop!( EthereumSystem::create_channel( - make_xcm_origin(MultiLocation { - parents: 1, - interior: X2( - Parachain(2000), - Junction::AccountId32 { network: None, id: [67u8; 32] } - ), - }), + make_xcm_origin(Location::new( + 1, + [Parachain(2000), Junction::AccountId32 { network: None, id: [67u8; 32] }], + )), OperatingMode::Normal, ), BadOrigin, @@ -306,10 +300,10 @@ fn create_channel_bad_origin() { // local account location not allowed assert_noop!( EthereumSystem::create_channel( - make_xcm_origin(MultiLocation { - parents: 0, - interior: X1(Junction::AccountId32 { network: None, id: [67u8; 32] }), - }), + make_xcm_origin(Location::new( + 0, + [Junction::AccountId32 { network: None, id: [67u8; 32] }], + )), OperatingMode::Normal, ), BadOrigin, @@ -333,7 +327,7 @@ fn create_channel_bad_origin() { fn update_channel() { new_test_ext(true).execute_with(|| { let origin_para_id = 2000; - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let origin_location = Location::new(1, [Parachain(origin_para_id)]); let sovereign_account = sibling_sovereign_account::(origin_para_id.into()); let origin = make_xcm_origin(origin_location); @@ -359,23 +353,17 @@ fn update_channel_bad_origin() { // relay chain location not allowed assert_noop!( - EthereumSystem::update_channel( - make_xcm_origin(MultiLocation { parents: 1, interior: Here }), - mode, - ), + EthereumSystem::update_channel(make_xcm_origin(Location::new(1, [])), mode,), BadOrigin, ); // child of sibling location not allowed assert_noop!( EthereumSystem::update_channel( - make_xcm_origin(MultiLocation { - parents: 1, - interior: X2( - Parachain(2000), - Junction::AccountId32 { network: None, id: [67u8; 32] } - ), - }), + make_xcm_origin(Location::new( + 1, + [Parachain(2000), Junction::AccountId32 { network: None, id: [67u8; 32] }], + )), mode, ), BadOrigin, @@ -384,10 +372,10 @@ fn update_channel_bad_origin() { // local account location not allowed assert_noop!( EthereumSystem::update_channel( - make_xcm_origin(MultiLocation { - parents: 0, - interior: X1(Junction::AccountId32 { network: None, id: [67u8; 32] }), - }), + make_xcm_origin(Location::new( + 0, + [Junction::AccountId32 { network: None, id: [67u8; 32] }], + )), mode, ), BadOrigin, @@ -407,7 +395,7 @@ fn update_channel_bad_origin() { #[test] fn update_channel_fails_not_exist() { new_test_ext(true).execute_with(|| { - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(2000)) }; + let origin_location = Location::new(1, [Parachain(2000)]); let origin = make_xcm_origin(origin_location); // Now try to update it @@ -422,7 +410,7 @@ fn update_channel_fails_not_exist() { fn force_update_channel() { new_test_ext(true).execute_with(|| { let origin_para_id = 2000; - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(origin_para_id)) }; + let origin_location = Location::new(1, [Parachain(origin_para_id)]); let sovereign_account = sibling_sovereign_account::(origin_para_id.into()); let origin = make_xcm_origin(origin_location); @@ -468,8 +456,8 @@ fn force_update_channel_bad_origin() { #[test] fn transfer_native_from_agent() { new_test_ext(true).execute_with(|| { - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(2000)) }; - let origin = make_xcm_origin(origin_location); + let origin_location = Location::new(1, [Parachain(2000)]); + let origin = make_xcm_origin(origin_location.clone()); let recipient: H160 = [27u8; 20].into(); let amount = 103435; @@ -477,7 +465,7 @@ fn transfer_native_from_agent() { assert_ok!(EthereumSystem::create_agent(origin.clone())); assert_ok!(EthereumSystem::create_channel(origin, OperatingMode::Normal)); - let origin = make_xcm_origin(origin_location); + let origin = make_xcm_origin(origin_location.clone()); assert_ok!(EthereumSystem::transfer_native_from_agent(origin, recipient, amount),); System::assert_last_event(RuntimeEvent::EthereumSystem( @@ -494,13 +482,13 @@ fn transfer_native_from_agent() { fn force_transfer_native_from_agent() { new_test_ext(true).execute_with(|| { let origin = RuntimeOrigin::root(); - let location = MultiLocation { parents: 1, interior: X1(Parachain(2000)) }; - let versioned_location: Box = Box::new(location.into()); + let location = Location::new(1, [Parachain(2000)]); + let versioned_location: Box = Box::new(location.clone().into()); let recipient: H160 = [27u8; 20].into(); let amount = 103435; // First create the agent - Agents::::insert(make_agent_id(location), ()); + Agents::::insert(make_agent_id(location.clone()), ()); assert_ok!(EthereumSystem::force_transfer_native_from_agent( origin, @@ -530,13 +518,10 @@ fn force_transfer_native_from_agent_bad_origin() { EthereumSystem::force_transfer_native_from_agent( RuntimeOrigin::signed([14; 32].into()), Box::new( - MultiLocation { - parents: 1, - interior: X2( - Parachain(2000), - Junction::AccountId32 { network: None, id: [67u8; 32] } - ), - } + Location::new( + 1, + [Parachain(2000), Junction::AccountId32 { network: None, id: [67u8; 32] }], + ) .into() ), recipient, @@ -571,8 +556,8 @@ fn check_sibling_sovereign_account() { fn charge_fee_for_create_agent() { new_test_ext(true).execute_with(|| { let para_id: u32 = TestParaId::get(); - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(para_id)) }; - let origin = make_xcm_origin(origin_location); + let origin_location = Location::new(1, [Parachain(para_id)]); + let origin = make_xcm_origin(origin_location.clone()); let sovereign_account = sibling_sovereign_account::(para_id.into()); let (_, agent_id) = ensure_sibling::(&origin_location).unwrap(); @@ -605,10 +590,10 @@ fn charge_fee_for_create_agent() { fn charge_fee_for_transfer_native_from_agent() { new_test_ext(true).execute_with(|| { let para_id: u32 = TestParaId::get(); - let origin_location = MultiLocation { parents: 1, interior: X1(Parachain(para_id)) }; + let origin_location = Location::new(1, [Parachain(para_id)]); let recipient: H160 = [27u8; 20].into(); let amount = 103435; - let origin = make_xcm_origin(origin_location); + let origin = make_xcm_origin(origin_location.clone()); let (_, agent_id) = ensure_sibling::(&origin_location).unwrap(); let sovereign_account = sibling_sovereign_account::(para_id.into()); diff --git a/snowbridge/parachain/primitives/core/src/lib.rs b/snowbridge/parachain/primitives/core/src/lib.rs index ecbc3bb365f..a464557a72b 100644 --- a/snowbridge/parachain/primitives/core/src/lib.rs +++ b/snowbridge/parachain/primitives/core/src/lib.rs @@ -28,11 +28,7 @@ use sp_core::H256; use sp_io::hashing::keccak_256; use sp_runtime::{traits::AccountIdConversion, RuntimeDebug}; use sp_std::prelude::*; -use xcm::prelude::{ - Junction::Parachain, - Junctions::{Here, X1}, - MultiLocation, -}; +use xcm::prelude::{Junction::Parachain, Location}; use xcm_builder::{DescribeAllTerminal, DescribeFamily, DescribeLocation, HashedDescription}; /// The ID of an agent contract @@ -53,9 +49,9 @@ pub fn sibling_sovereign_account_raw(para_id: ParaId) -> [u8; 32] { } pub struct AllowSiblingsOnly; -impl Contains for AllowSiblingsOnly { - fn contains(location: &MultiLocation) -> bool { - matches!(location, MultiLocation { parents: 1, interior: X1(Parachain(_)) }) +impl Contains for AllowSiblingsOnly { + fn contains(location: &Location) -> bool { + matches!(location.unpack(), (1, [Parachain(_)])) } } @@ -161,14 +157,14 @@ pub const SECONDARY_GOVERNANCE_CHANNEL: ChannelId = pub struct DescribeHere; impl DescribeLocation for DescribeHere { - fn describe_location(l: &MultiLocation) -> Option> { - match (l.parents, l.interior) { - (0, Here) => Some(Vec::::new().encode()), + fn describe_location(l: &Location) -> Option> { + match l.unpack() { + (0, []) => Some(Vec::::new().encode()), _ => None, } } } -/// Creates an AgentId from a MultiLocation. An AgentId is a unique mapping to a Agent contract on -/// Ethereum which acts as the sovereign account for the MultiLocation. +/// Creates an AgentId from a Location. An AgentId is a unique mapping to a Agent contract on +/// Ethereum which acts as the sovereign account for the Location. pub type AgentIdOf = HashedDescription)>; diff --git a/snowbridge/parachain/primitives/core/tests/mod.rs b/snowbridge/parachain/primitives/core/tests/mod.rs index 2da5d2df182..c91063a8148 100644 --- a/snowbridge/parachain/primitives/core/tests/mod.rs +++ b/snowbridge/parachain/primitives/core/tests/mod.rs @@ -2,12 +2,12 @@ mod tests { use frame_support::traits::Contains; use snowbridge_core::AllowSiblingsOnly; - use xcm::prelude::{Junction::Parachain, Junctions::X1, MultiLocation}; + use xcm::prelude::{Junction::Parachain, Location}; #[test] fn allow_siblings_predicate_only_allows_siblings() { - let sibling = MultiLocation::new(1, X1(Parachain(1000))); - let child = MultiLocation::new(0, X1(Parachain(1000))); + let sibling = Location::new(1, [Parachain(1000)]); + let child = Location::new(0, [Parachain(1000)]); assert!(AllowSiblingsOnly::contains(&sibling), "Sibling returns true."); assert!(!AllowSiblingsOnly::contains(&child), "Child returns false."); } diff --git a/snowbridge/parachain/primitives/router/src/inbound/mod.rs b/snowbridge/parachain/primitives/router/src/inbound/mod.rs index a07e0eae5d7..c20554c6d18 100644 --- a/snowbridge/parachain/primitives/router/src/inbound/mod.rs +++ b/snowbridge/parachain/primitives/router/src/inbound/mod.rs @@ -161,13 +161,13 @@ where { fn convert_register_token(chain_id: u64, token: H160, fee: u128) -> (Xcm<()>, Balance) { let network = Ethereum { chain_id }; - let xcm_fee: MultiAsset = (MultiLocation::parent(), fee).into(); - let deposit: MultiAsset = (MultiLocation::parent(), CreateAssetDeposit::get()).into(); + let xcm_fee: Asset = (Location::parent(), fee).into(); + let deposit: Asset = (Location::parent(), CreateAssetDeposit::get()).into(); let total_amount = fee + CreateAssetDeposit::get(); - let total: MultiAsset = (MultiLocation::parent(), total_amount).into(); + let total: Asset = (Location::parent(), total_amount).into(); - let bridge_location: MultiLocation = (Parent, Parent, GlobalConsensus(network)).into(); + let bridge_location: Location = (Parent, Parent, GlobalConsensus(network)).into(); let owner = GlobalConsensusEthereumConvertsFor::<[u8; 32]>::from_chain_id(&chain_id); let asset_id = Self::convert_token_address(network, token); @@ -182,7 +182,7 @@ where // Fund the snowbridge sovereign with the required deposit for creation. DepositAsset { assets: Definite(deposit.into()), beneficiary: bridge_location }, // Only our inbound-queue pallet is allowed to invoke `UniversalOrigin` - DescendOrigin(X1(PalletInstance(inbound_queue_pallet_index))), + DescendOrigin(PalletInstance(inbound_queue_pallet_index).into()), // Change origin to the bridge. UniversalOrigin(GlobalConsensus(network)), // Call create_asset on foreign assets pallet. @@ -216,40 +216,37 @@ where asset_hub_fee: u128, ) -> (Xcm<()>, Balance) { let network = Ethereum { chain_id }; - let asset_hub_fee_asset: MultiAsset = (MultiLocation::parent(), asset_hub_fee).into(); - let asset: MultiAsset = (Self::convert_token_address(network, token), amount).into(); + let asset_hub_fee_asset: Asset = (Location::parent(), asset_hub_fee).into(); + let asset: Asset = (Self::convert_token_address(network, token), amount).into(); let (dest_para_id, beneficiary, dest_para_fee) = match destination { // Final destination is a 32-byte account on AssetHub - Destination::AccountId32 { id } => ( - None, - MultiLocation { parents: 0, interior: X1(AccountId32 { network: None, id }) }, - 0, - ), + Destination::AccountId32 { id } => + (None, Location::new(0, [AccountId32 { network: None, id }]), 0), // Final destination is a 32-byte account on a sibling of AssetHub Destination::ForeignAccountId32 { para_id, id, fee } => ( Some(para_id), - MultiLocation { parents: 0, interior: X1(AccountId32 { network: None, id }) }, + Location::new(0, [AccountId32 { network: None, id }]), // Total fee needs to cover execution on AssetHub and Sibling fee, ), // Final destination is a 20-byte account on a sibling of AssetHub Destination::ForeignAccountId20 { para_id, id, fee } => ( Some(para_id), - MultiLocation { parents: 0, interior: X1(AccountKey20 { network: None, key: id }) }, + Location::new(0, [AccountKey20 { network: None, key: id }]), // Total fee needs to cover execution on AssetHub and Sibling fee, ), }; let total_fees = asset_hub_fee.saturating_add(dest_para_fee); - let total_fee_asset: MultiAsset = (MultiLocation::parent(), total_fees).into(); + let total_fee_asset: Asset = (Location::parent(), total_fees).into(); let inbound_queue_pallet_index = InboundQueuePalletInstance::get(); let mut instructions = vec![ ReceiveTeleportedAsset(total_fee_asset.into()), BuyExecution { fees: asset_hub_fee_asset, weight_limit: Unlimited }, - DescendOrigin(X1(PalletInstance(inbound_queue_pallet_index))), + DescendOrigin(PalletInstance(inbound_queue_pallet_index).into()), UniversalOrigin(GlobalConsensus(network)), ReserveAssetDeposited(asset.clone().into()), ClearOrigin, @@ -257,14 +254,13 @@ where match dest_para_id { Some(dest_para_id) => { - let dest_para_fee_asset: MultiAsset = - (MultiLocation::parent(), dest_para_fee).into(); + let dest_para_fee_asset: Asset = (Location::parent(), dest_para_fee).into(); instructions.extend(vec![ // Perform a deposit reserve to send to destination chain. DepositReserveAsset { assets: Definite(vec![dest_para_fee_asset.clone(), asset.clone()].into()), - dest: MultiLocation { parents: 1, interior: X1(Parachain(dest_para_id)) }, + dest: Location::new(1, [Parachain(dest_para_id)]), xcm: vec![ // Buy execution on target. BuyExecution { fees: dest_para_fee_asset, weight_limit: Unlimited }, @@ -286,15 +282,12 @@ where (instructions.into(), total_fees.into()) } - // Convert ERC20 token address to a Multilocation that can be understood by Assets Hub. - fn convert_token_address(network: NetworkId, token: H160) -> MultiLocation { - MultiLocation { - parents: 2, - interior: X2( - GlobalConsensus(network), - AccountKey20 { network: None, key: token.into() }, - ), - } + // Convert ERC20 token address to a location that can be understood by Assets Hub. + fn convert_token_address(network: NetworkId, token: H160) -> Location { + Location::new( + 2, + [GlobalConsensus(network), AccountKey20 { network: None, key: token.into() }], + ) } } @@ -303,12 +296,11 @@ impl ConvertLocation for GlobalConsensusEthereumConvertsFo where AccountId: From<[u8; 32]> + Clone, { - fn convert_location(location: &MultiLocation) -> Option { - if let MultiLocation { interior: X1(GlobalConsensus(Ethereum { chain_id })), .. } = location - { - Some(Self::from_chain_id(chain_id).into()) - } else { - None + fn convert_location(location: &Location) -> Option { + match location.unpack() { + (_, [GlobalConsensus(Ethereum { chain_id })]) => + Some(Self::from_chain_id(chain_id).into()), + _ => None, } } } diff --git a/snowbridge/parachain/primitives/router/src/inbound/tests.rs b/snowbridge/parachain/primitives/router/src/inbound/tests.rs index 8c96c13cf22..c46b88a84a4 100644 --- a/snowbridge/parachain/primitives/router/src/inbound/tests.rs +++ b/snowbridge/parachain/primitives/router/src/inbound/tests.rs @@ -2,7 +2,7 @@ use super::GlobalConsensusEthereumConvertsFor; use crate::inbound::CallIndex; use frame_support::parameter_types; use hex_literal::hex; -use xcm::v3::prelude::*; +use xcm::v4::prelude::*; use xcm_executor::traits::ConvertLocation; const NETWORK: NetworkId = Ethereum { chain_id: 11155111 }; @@ -20,7 +20,7 @@ parameter_types! { fn test_contract_location_with_network_converts_successfully() { let expected_account: [u8; 32] = hex!("ce796ae65569a670d0c1cc1ac12515a3ce21b5fbf729d63d7b289baad070139d"); - let contract_location = MultiLocation { parents: 2, interior: X1(GlobalConsensus(NETWORK)) }; + let contract_location = Location::new(2, [GlobalConsensus(NETWORK)]); let account = GlobalConsensusEthereumConvertsFor::<[u8; 32]>::convert_location(&contract_location) @@ -31,8 +31,7 @@ fn test_contract_location_with_network_converts_successfully() { #[test] fn test_contract_location_with_incorrect_location_fails_convert() { - let contract_location = - MultiLocation { parents: 2, interior: X2(GlobalConsensus(Polkadot), Parachain(1000)) }; + let contract_location = Location::new(2, [GlobalConsensus(Polkadot), Parachain(1000)]); assert_eq!( GlobalConsensusEthereumConvertsFor::<[u8; 32]>::convert_location(&contract_location), diff --git a/snowbridge/parachain/primitives/router/src/outbound/mod.rs b/snowbridge/parachain/primitives/router/src/outbound/mod.rs index c7f2f440834..21823992db7 100644 --- a/snowbridge/parachain/primitives/router/src/outbound/mod.rs +++ b/snowbridge/parachain/primitives/router/src/outbound/mod.rs @@ -16,7 +16,7 @@ use snowbridge_core::{ }; use sp_core::{H160, H256}; use sp_std::{iter::Peekable, marker::PhantomData, prelude::*}; -use xcm::v3::prelude::*; +use xcm::v4::prelude::*; use xcm_executor::traits::{ConvertLocation, ExportXcm}; pub struct EthereumBlobExporter< @@ -29,7 +29,7 @@ pub struct EthereumBlobExporter< impl ExportXcm for EthereumBlobExporter where - UniversalLocation: Get, + UniversalLocation: Get, EthereumNetwork: Get, OutboundQueue: SendMessage, AgentHashedDescription: ConvertLocation, @@ -39,8 +39,8 @@ where fn validate( network: NetworkId, _channel: u32, - universal_source: &mut Option, - destination: &mut Option, + universal_source: &mut Option, + destination: &mut Option, message: &mut Option>, ) -> SendResult { let expected_network = EthereumNetwork::get(); @@ -74,8 +74,8 @@ where return Err(SendError::NotApplicable) } - let para_id = match local_sub { - X1(Parachain(para_id)) => para_id, + let para_id = match local_sub.as_slice() { + [Parachain(para_id)] => *para_id, _ => { log::error!(target: "xcm::ethereum_blob_exporter", "could not get parachain id from universal source '{local_sub:?}'."); return Err(SendError::MissingArgument) @@ -93,7 +93,7 @@ where SendError::Unroutable })?; - let source_location: MultiLocation = MultiLocation { parents: 1, interior: local_sub }; + let source_location = Location::new(1, local_sub.clone()); let agent_id = match AgentHashedDescription::convert_location(&source_location) { Some(id) => id, None => { @@ -116,8 +116,8 @@ where SendError::Unroutable })?; - // convert fee to MultiAsset - let fee = MultiAsset::from((MultiLocation::parent(), fee.total())).into(); + // convert fee to Asset + let fee = Asset::from((Location::parent(), fee.total())).into(); Ok(((ticket.encode(), message_id), fee)) } @@ -216,8 +216,8 @@ impl<'a, Call> XcmConverter<'a, Call> { // assert that the beneficiary is AccountKey20. let recipient = match_expression!( - beneficiary, - MultiLocation { parents: 0, interior: X1(AccountKey20 { network, key }) } + beneficiary.unpack(), + (0, [AccountKey20 { network, key }]) if self.network_matches(network), H160(*key) ) @@ -245,14 +245,15 @@ impl<'a, Call> XcmConverter<'a, Call> { } } - let (token, amount) = match_expression!( - reserve_asset, - MultiAsset { - id: Concrete(MultiLocation { parents: 0, interior: X1(AccountKey20 { network , key })}), - fun: Fungible(amount) - } if self.network_matches(network), - (H160(*key), *amount) - ) + let (token, amount) = match reserve_asset { + Asset { id: AssetId(inner_location), fun: Fungible(amount) } => + match inner_location.unpack() { + (0, [AccountKey20 { network, key }]) if self.network_matches(network) => + Some((H160(*key), *amount)), + _ => None, + }, + _ => None, + } .ok_or(AssetResolutionFailed)?; // transfer amount must be greater than 0. diff --git a/snowbridge/parachain/primitives/router/src/outbound/tests.rs b/snowbridge/parachain/primitives/router/src/outbound/tests.rs index 153d934c390..111243bb45a 100644 --- a/snowbridge/parachain/primitives/router/src/outbound/tests.rs +++ b/snowbridge/parachain/primitives/router/src/outbound/tests.rs @@ -11,7 +11,7 @@ use super::*; parameter_types! { const MaxMessageSize: u32 = u32::MAX; const RelayNetwork: NetworkId = Polkadot; - const UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(RelayNetwork::get()), Parachain(1013)); + UniversalLocation: InteriorLocation = [GlobalConsensus(RelayNetwork::get()), Parachain(1013)].into(); const BridgedNetwork: NetworkId = Ethereum{ chain_id: 1 }; const NonBridgedNetwork: NetworkId = Ethereum{ chain_id: 2 }; } @@ -61,8 +61,8 @@ impl SendMessageFeeProvider for MockErrOutboundQueue { fn exporter_validate_with_unknown_network_yields_not_applicable() { let network = Ethereum { chain_id: 1337 }; let channel: u32 = 0; - let mut universal_source: Option = None; - let mut destination: Option = None; + let mut universal_source: Option = None; + let mut destination: Option = None; let mut message: Option> = None; let result = EthereumBlobExporter::< @@ -80,8 +80,8 @@ fn exporter_validate_with_unknown_network_yields_not_applicable() { fn exporter_validate_with_invalid_destination_yields_missing_argument() { let network = BridgedNetwork::get(); let channel: u32 = 0; - let mut universal_source: Option = None; - let mut destination: Option = None; + let mut universal_source: Option = None; + let mut destination: Option = None; let mut message: Option> = None; let result = EthereumBlobExporter::< @@ -99,10 +99,11 @@ fn exporter_validate_with_invalid_destination_yields_missing_argument() { fn exporter_validate_with_x8_destination_yields_not_applicable() { let network = BridgedNetwork::get(); let channel: u32 = 0; - let mut universal_source: Option = None; - let mut destination: Option = Some(X8( - OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild, - )); + let mut universal_source: Option = None; + let mut destination: Option = Some( + [OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild] + .into(), + ); let mut message: Option> = None; let result = EthereumBlobExporter::< @@ -120,8 +121,8 @@ fn exporter_validate_with_x8_destination_yields_not_applicable() { fn exporter_validate_without_universal_source_yields_missing_argument() { let network = BridgedNetwork::get(); let channel: u32 = 0; - let mut universal_source: Option = None; - let mut destination: Option = Here.into(); + let mut universal_source: Option = None; + let mut destination: Option = Here.into(); let mut message: Option> = None; let result = EthereumBlobExporter::< @@ -139,8 +140,8 @@ fn exporter_validate_without_universal_source_yields_missing_argument() { fn exporter_validate_without_global_universal_location_yields_unroutable() { let network = BridgedNetwork::get(); let channel: u32 = 0; - let mut universal_source: Option = Here.into(); - let mut destination: Option = Here.into(); + let mut universal_source: Option = Here.into(); + let mut destination: Option = Here.into(); let mut message: Option> = None; let result = EthereumBlobExporter::< @@ -158,8 +159,8 @@ fn exporter_validate_without_global_universal_location_yields_unroutable() { fn exporter_validate_without_global_bridge_location_yields_not_applicable() { let network = NonBridgedNetwork::get(); let channel: u32 = 0; - let mut universal_source: Option = Here.into(); - let mut destination: Option = Here.into(); + let mut universal_source: Option = Here.into(); + let mut destination: Option = Here.into(); let mut message: Option> = None; let result = EthereumBlobExporter::< @@ -177,9 +178,9 @@ fn exporter_validate_without_global_bridge_location_yields_not_applicable() { fn exporter_validate_with_remote_universal_source_yields_not_applicable() { let network = BridgedNetwork::get(); let channel: u32 = 0; - let mut universal_source: Option = - Some(X2(GlobalConsensus(Kusama), Parachain(1000))); - let mut destination: Option = Here.into(); + let mut universal_source: Option = + Some([GlobalConsensus(Kusama), Parachain(1000)].into()); + let mut destination: Option = Here.into(); let mut message: Option> = None; let result = EthereumBlobExporter::< @@ -197,8 +198,8 @@ fn exporter_validate_with_remote_universal_source_yields_not_applicable() { fn exporter_validate_without_para_id_in_source_yields_missing_argument() { let network = BridgedNetwork::get(); let channel: u32 = 0; - let mut universal_source: Option = Some(X1(GlobalConsensus(Polkadot))); - let mut destination: Option = Here.into(); + let mut universal_source: Option = Some(GlobalConsensus(Polkadot).into()); + let mut destination: Option = Here.into(); let mut message: Option> = None; let result = EthereumBlobExporter::< @@ -216,9 +217,9 @@ fn exporter_validate_without_para_id_in_source_yields_missing_argument() { fn exporter_validate_complex_para_id_in_source_yields_missing_argument() { let network = BridgedNetwork::get(); let channel: u32 = 0; - let mut universal_source: Option = - Some(X3(GlobalConsensus(Polkadot), Parachain(1000), PalletInstance(12))); - let mut destination: Option = Here.into(); + let mut universal_source: Option = + Some([GlobalConsensus(Polkadot), Parachain(1000), PalletInstance(12)].into()); + let mut destination: Option = Here.into(); let mut message: Option> = None; let result = EthereumBlobExporter::< @@ -236,9 +237,9 @@ fn exporter_validate_complex_para_id_in_source_yields_missing_argument() { fn exporter_validate_without_xcm_message_yields_missing_argument() { let network = BridgedNetwork::get(); let channel: u32 = 0; - let mut universal_source: Option = - Some(X2(GlobalConsensus(Polkadot), Parachain(1000))); - let mut destination: Option = Here.into(); + let mut universal_source: Option = + Some([GlobalConsensus(Polkadot), Parachain(1000)].into()); + let mut destination: Option = Here.into(); let mut message: Option> = None; let result = EthereumBlobExporter::< @@ -255,23 +256,23 @@ fn exporter_validate_without_xcm_message_yields_missing_argument() { #[test] fn exporter_validate_with_max_target_fee_yields_unroutable() { let network = BridgedNetwork::get(); - let mut destination: Option = Here.into(); + let mut destination: Option = Here.into(); - let mut universal_source: Option = - Some(X2(GlobalConsensus(Polkadot), Parachain(1000))); + let mut universal_source: Option = + Some([GlobalConsensus(Polkadot), Parachain(1000)].into()); let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); let channel: u32 = 0; - let fee = MultiAsset { id: Concrete(Here.into()), fun: Fungible(1000) }; - let fees: MultiAssets = vec![fee.clone()].into(); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + let fee = Asset { id: AssetId(Here.into()), fun: Fungible(1000) }; + let fees: Assets = vec![fee.clone()].into(); + let assets: Assets = vec![Asset { + id: AssetId(AccountKey20 { network: None, key: token_address }.into()), fun: Fungible(1000), }] .into(); - let filter: MultiAssetFilter = assets.clone().into(); + let filter: AssetFilter = assets.clone().into(); let mut message: Option> = Some( vec![ @@ -280,7 +281,7 @@ fn exporter_validate_with_max_target_fee_yields_unroutable() { WithdrawAsset(assets), DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: Some(network), key: beneficiary_address }) + beneficiary: AccountKey20 { network: Some(network), key: beneficiary_address } .into(), }, SetTopic([0; 32]), @@ -303,14 +304,14 @@ fn exporter_validate_with_max_target_fee_yields_unroutable() { #[test] fn exporter_validate_with_unparsable_xcm_yields_unroutable() { let network = BridgedNetwork::get(); - let mut destination: Option = Here.into(); + let mut destination: Option = Here.into(); - let mut universal_source: Option = - Some(X2(GlobalConsensus(Polkadot), Parachain(1000))); + let mut universal_source: Option = + Some([GlobalConsensus(Polkadot), Parachain(1000)].into()); let channel: u32 = 0; - let fee = MultiAsset { id: Concrete(Here.into()), fun: Fungible(1000) }; - let fees: MultiAssets = vec![fee.clone()].into(); + let fee = Asset { id: AssetId(Here.into()), fun: Fungible(1000) }; + let fees: Assets = vec![fee.clone()].into(); let mut message: Option> = Some(vec![WithdrawAsset(fees), BuyExecution { fees: fee, weight_limit: Unlimited }].into()); @@ -330,22 +331,22 @@ fn exporter_validate_with_unparsable_xcm_yields_unroutable() { #[test] fn exporter_validate_xcm_success_case_1() { let network = BridgedNetwork::get(); - let mut destination: Option = Here.into(); + let mut destination: Option = Here.into(); - let mut universal_source: Option = - Some(X2(GlobalConsensus(Polkadot), Parachain(1000))); + let mut universal_source: Option = + Some([GlobalConsensus(Polkadot), Parachain(1000)].into()); let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); let channel: u32 = 0; - let assets: MultiAssets = vec![MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + let assets: Assets = vec![Asset { + id: AssetId([AccountKey20 { network: None, key: token_address }].into()), fun: Fungible(1000), }] .into(); let fee = assets.clone().get(0).unwrap().clone(); - let filter: MultiAssetFilter = assets.clone().into(); + let filter: AssetFilter = assets.clone().into(); let mut message: Option> = Some( vec![ @@ -354,7 +355,7 @@ fn exporter_validate_xcm_success_case_1() { BuyExecution { fees: fee, weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ] @@ -391,12 +392,12 @@ fn xcm_converter_convert_success() { let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + let assets: Assets = vec![Asset { + id: AssetId([AccountKey20 { network: None, key: token_address }].into()), fun: Fungible(1000), }] .into(); - let filter: MultiAssetFilter = assets.clone().into(); + let filter: AssetFilter = assets.clone().into(); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), @@ -404,7 +405,7 @@ fn xcm_converter_convert_success() { BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ] @@ -426,18 +427,18 @@ fn xcm_converter_convert_without_buy_execution_yields_success() { let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + let assets: Assets = vec![Asset { + id: AssetId([AccountKey20 { network: None, key: token_address }].into()), fun: Fungible(1000), }] .into(); - let filter: MultiAssetFilter = assets.clone().into(); + let filter: AssetFilter = assets.clone().into(); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ] @@ -459,12 +460,12 @@ fn xcm_converter_convert_with_wildcard_all_asset_filter_succeeds() { let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + let assets: Assets = vec![Asset { + id: AssetId([AccountKey20 { network: None, key: token_address }].into()), fun: Fungible(1000), }] .into(); - let filter: MultiAssetFilter = Wild(All); + let filter: AssetFilter = Wild(All); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), @@ -472,7 +473,7 @@ fn xcm_converter_convert_with_wildcard_all_asset_filter_succeeds() { BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ] @@ -494,13 +495,12 @@ fn xcm_converter_convert_with_fees_less_than_reserve_yields_success() { let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let asset_location = X1(AccountKey20 { network: None, key: token_address }).into(); - let fee_asset = MultiAsset { id: Concrete(asset_location), fun: Fungible(500) }; + let asset_location: Location = [AccountKey20 { network: None, key: token_address }].into(); + let fee_asset = Asset { id: AssetId(asset_location.clone()), fun: Fungible(500) }; - let assets: MultiAssets = - vec![MultiAsset { id: Concrete(asset_location), fun: Fungible(1000) }].into(); + let assets: Assets = vec![Asset { id: AssetId(asset_location), fun: Fungible(1000) }].into(); - let filter: MultiAssetFilter = assets.clone().into(); + let filter: AssetFilter = assets.clone().into(); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), @@ -508,7 +508,7 @@ fn xcm_converter_convert_with_fees_less_than_reserve_yields_success() { BuyExecution { fees: fee_asset, weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ] @@ -530,19 +530,19 @@ fn xcm_converter_convert_without_set_topic_yields_set_topic_expected() { let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + let assets: Assets = vec![Asset { + id: AssetId([AccountKey20 { network: None, key: token_address }].into()), fun: Fungible(1000), }] .into(); - let filter: MultiAssetFilter = assets.clone().into(); + let filter: AssetFilter = assets.clone().into(); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, ClearTopic, ] @@ -557,8 +557,8 @@ fn xcm_converter_convert_with_partial_message_yields_unexpected_end_of_xcm() { let network = BridgedNetwork::get(); let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + let assets: Assets = vec![Asset { + id: AssetId([AccountKey20 { network: None, key: token_address }].into()), fun: Fungible(1000), }] .into(); @@ -576,16 +576,13 @@ fn xcm_converter_with_different_fee_asset_fails() { let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let asset_location = X1(AccountKey20 { network: None, key: token_address }).into(); - let fee_asset = MultiAsset { - id: Concrete(MultiLocation { parents: 0, interior: Here }), - fun: Fungible(1000), - }; + let asset_location = [AccountKey20 { network: None, key: token_address }].into(); + let fee_asset = + Asset { id: AssetId(Location { parents: 0, interior: Here }), fun: Fungible(1000) }; - let assets: MultiAssets = - vec![MultiAsset { id: Concrete(asset_location), fun: Fungible(1000) }].into(); + let assets: Assets = vec![Asset { id: AssetId(asset_location), fun: Fungible(1000) }].into(); - let filter: MultiAssetFilter = assets.clone().into(); + let filter: AssetFilter = assets.clone().into(); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), @@ -593,7 +590,7 @@ fn xcm_converter_with_different_fee_asset_fails() { BuyExecution { fees: fee_asset, weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ] @@ -610,13 +607,12 @@ fn xcm_converter_with_fees_greater_than_reserve_fails() { let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let asset_location = X1(AccountKey20 { network: None, key: token_address }).into(); - let fee_asset = MultiAsset { id: Concrete(asset_location), fun: Fungible(1001) }; + let asset_location: Location = [AccountKey20 { network: None, key: token_address }].into(); + let fee_asset = Asset { id: AssetId(asset_location.clone()), fun: Fungible(1001) }; - let assets: MultiAssets = - vec![MultiAsset { id: Concrete(asset_location), fun: Fungible(1000) }].into(); + let assets: Assets = vec![Asset { id: AssetId(asset_location), fun: Fungible(1000) }].into(); - let filter: MultiAssetFilter = assets.clone().into(); + let filter: AssetFilter = assets.clone().into(); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), @@ -624,7 +620,7 @@ fn xcm_converter_with_fees_greater_than_reserve_fails() { BuyExecution { fees: fee_asset, weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ] @@ -653,12 +649,12 @@ fn xcm_converter_convert_with_extra_instructions_yields_end_of_xcm_message_expec let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + let assets: Assets = vec![Asset { + id: AssetId([AccountKey20 { network: None, key: token_address }].into()), fun: Fungible(1000), }] .into(); - let filter: MultiAssetFilter = assets.clone().into(); + let filter: AssetFilter = assets.clone().into(); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), @@ -666,7 +662,7 @@ fn xcm_converter_convert_with_extra_instructions_yields_end_of_xcm_message_expec BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ClearError, @@ -685,19 +681,19 @@ fn xcm_converter_convert_without_withdraw_asset_yields_withdraw_expected() { let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + let assets: Assets = vec![Asset { + id: AssetId([AccountKey20 { network: None, key: token_address }].into()), fun: Fungible(1000), }] .into(); - let filter: MultiAssetFilter = assets.clone().into(); + let filter: AssetFilter = assets.clone().into(); let message: Xcm<()> = vec![ ClearOrigin, BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ] @@ -714,8 +710,8 @@ fn xcm_converter_convert_without_withdraw_asset_yields_deposit_expected() { let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + let assets: Assets = vec![Asset { + id: AssetId(AccountKey20 { network: None, key: token_address }.into()), fun: Fungible(1000), }] .into(); @@ -741,11 +737,11 @@ fn xcm_converter_convert_without_assets_yields_no_reserve_assets() { let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![].into(); - let filter: MultiAssetFilter = assets.clone().into(); + let assets: Assets = vec![].into(); + let filter: AssetFilter = assets.clone().into(); - let fee = MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + let fee = Asset { + id: AssetId(AccountKey20 { network: None, key: token_address }.into()), fun: Fungible(1000), }; @@ -755,7 +751,7 @@ fn xcm_converter_convert_without_assets_yields_no_reserve_assets() { BuyExecution { fees: fee, weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ] @@ -774,18 +770,18 @@ fn xcm_converter_convert_with_two_assets_yields_too_many_assets() { let token_address_2: [u8; 20] = hex!("1100000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![ - MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address_1 }).into()), + let assets: Assets = vec![ + Asset { + id: AssetId(AccountKey20 { network: None, key: token_address_1 }.into()), fun: Fungible(1000), }, - MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address_2 }).into()), + Asset { + id: AssetId(AccountKey20 { network: None, key: token_address_2 }.into()), fun: Fungible(500), }, ] .into(); - let filter: MultiAssetFilter = assets.clone().into(); + let filter: AssetFilter = assets.clone().into(); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), @@ -793,7 +789,7 @@ fn xcm_converter_convert_with_two_assets_yields_too_many_assets() { BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ] @@ -811,12 +807,12 @@ fn xcm_converter_convert_without_consuming_filter_yields_filter_does_not_consume let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + let assets: Assets = vec![Asset { + id: AssetId(AccountKey20 { network: None, key: token_address }.into()), fun: Fungible(1000), }] .into(); - let filter: MultiAssetFilter = Wild(WildMultiAsset::AllCounted(0)); + let filter: AssetFilter = Wild(WildAsset::AllCounted(0)); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), @@ -824,7 +820,7 @@ fn xcm_converter_convert_without_consuming_filter_yields_filter_does_not_consume BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ] @@ -842,12 +838,12 @@ fn xcm_converter_convert_with_zero_amount_asset_yields_zero_asset_transfer() { let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + let assets: Assets = vec![Asset { + id: AssetId(AccountKey20 { network: None, key: token_address }.into()), fun: Fungible(0), }] .into(); - let filter: MultiAssetFilter = Wild(WildMultiAsset::AllCounted(1)); + let filter: AssetFilter = Wild(WildAsset::AllCounted(1)); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), @@ -855,7 +851,7 @@ fn xcm_converter_convert_with_zero_amount_asset_yields_zero_asset_transfer() { BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ] @@ -872,12 +868,12 @@ fn xcm_converter_convert_non_ethereum_asset_yields_asset_resolution_failed() { let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete(X3(GlobalConsensus(Polkadot), Parachain(1000), GeneralIndex(0)).into()), + let assets: Assets = vec![Asset { + id: AssetId([GlobalConsensus(Polkadot), Parachain(1000), GeneralIndex(0)].into()), fun: Fungible(1000), }] .into(); - let filter: MultiAssetFilter = Wild(WildMultiAsset::AllCounted(1)); + let filter: AssetFilter = Wild(WildAsset::AllCounted(1)); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), @@ -885,7 +881,7 @@ fn xcm_converter_convert_non_ethereum_asset_yields_asset_resolution_failed() { BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ] @@ -903,14 +899,14 @@ fn xcm_converter_convert_non_ethereum_chain_asset_yields_asset_resolution_failed let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete( - X1(AccountKey20 { network: Some(Ethereum { chain_id: 2 }), key: token_address }).into(), + let assets: Assets = vec![Asset { + id: AssetId( + AccountKey20 { network: Some(Ethereum { chain_id: 2 }), key: token_address }.into(), ), fun: Fungible(1000), }] .into(); - let filter: MultiAssetFilter = Wild(WildMultiAsset::AllCounted(1)); + let filter: AssetFilter = Wild(WildAsset::AllCounted(1)); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), @@ -918,7 +914,7 @@ fn xcm_converter_convert_non_ethereum_chain_asset_yields_asset_resolution_failed BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ] @@ -936,14 +932,14 @@ fn xcm_converter_convert_non_ethereum_chain_yields_asset_resolution_failed() { let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete( - X1(AccountKey20 { network: Some(NonBridgedNetwork::get()), key: token_address }).into(), + let assets: Assets = vec![Asset { + id: AssetId( + [AccountKey20 { network: Some(NonBridgedNetwork::get()), key: token_address }].into(), ), fun: Fungible(1000), }] .into(); - let filter: MultiAssetFilter = Wild(WildMultiAsset::AllCounted(1)); + let filter: AssetFilter = Wild(WildAsset::AllCounted(1)); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), @@ -951,7 +947,7 @@ fn xcm_converter_convert_non_ethereum_chain_yields_asset_resolution_failed() { BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { network: None, key: beneficiary_address }).into(), + beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), }, SetTopic([0; 32]), ] @@ -971,23 +967,23 @@ fn xcm_converter_convert_with_non_ethereum_beneficiary_yields_beneficiary_resolu let beneficiary_address: [u8; 32] = hex!("2000000000000000000000000000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + let assets: Assets = vec![Asset { + id: AssetId(AccountKey20 { network: None, key: token_address }.into()), fun: Fungible(1000), }] .into(); - let filter: MultiAssetFilter = Wild(WildMultiAsset::AllCounted(1)); + let filter: AssetFilter = Wild(WildAsset::AllCounted(1)); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), ClearOrigin, BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X3( + beneficiary: [ GlobalConsensus(Polkadot), Parachain(1000), AccountId32 { network: Some(Polkadot), id: beneficiary_address }, - ) + ] .into(), }, SetTopic([0; 32]), @@ -1007,12 +1003,12 @@ fn xcm_converter_convert_with_non_ethereum_chain_beneficiary_yields_beneficiary_ let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - let assets: MultiAssets = vec![MultiAsset { - id: Concrete(X1(AccountKey20 { network: None, key: token_address }).into()), + let assets: Assets = vec![Asset { + id: AssetId(AccountKey20 { network: None, key: token_address }.into()), fun: Fungible(1000), }] .into(); - let filter: MultiAssetFilter = Wild(WildMultiAsset::AllCounted(1)); + let filter: AssetFilter = Wild(WildAsset::AllCounted(1)); let message: Xcm<()> = vec![ WithdrawAsset(assets.clone()), @@ -1020,10 +1016,10 @@ fn xcm_converter_convert_with_non_ethereum_chain_beneficiary_yields_beneficiary_ BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, DepositAsset { assets: filter, - beneficiary: X1(AccountKey20 { + beneficiary: AccountKey20 { network: Some(Ethereum { chain_id: 2 }), key: beneficiary_address, - }) + } .into(), }, SetTopic([0; 32]), @@ -1037,14 +1033,13 @@ fn xcm_converter_convert_with_non_ethereum_chain_beneficiary_yields_beneficiary_ #[test] fn test_describe_asset_hub() { - let legacy_location: MultiLocation = - MultiLocation { parents: 0, interior: X1(Parachain(1000)) }; + let legacy_location: Location = Location::new(0, [Parachain(1000)]); let legacy_agent_id = AgentIdOf::convert_location(&legacy_location).unwrap(); assert_eq!( legacy_agent_id, hex!("72456f48efed08af20e5b317abf8648ac66e86bb90a411d9b0b713f7364b75b4").into() ); - let location: MultiLocation = MultiLocation { parents: 1, interior: X1(Parachain(1000)) }; + let location: Location = Location::new(1, [Parachain(1000)]); let agent_id = AgentIdOf::convert_location(&location).unwrap(); assert_eq!( agent_id, @@ -1054,7 +1049,7 @@ fn test_describe_asset_hub() { #[test] fn test_describe_here() { - let location: MultiLocation = MultiLocation { parents: 0, interior: Here }; + let location: Location = Location::new(0, []); let agent_id = AgentIdOf::convert_location(&location).unwrap(); assert_eq!( agent_id, diff --git a/snowbridge/parachain/runtime/runtime-common/src/lib.rs b/snowbridge/parachain/runtime/runtime-common/src/lib.rs index b7f54d262bb..1a9b704f356 100644 --- a/snowbridge/parachain/runtime/runtime-common/src/lib.rs +++ b/snowbridge/parachain/runtime/runtime-common/src/lib.rs @@ -46,43 +46,38 @@ impl where Balance: BaseArithmetic + Unsigned + Copy + From + Into, AccountId: Clone + Into<[u8; 32]> + From<[u8; 32]>, - FeeAssetLocation: Get, + FeeAssetLocation: Get, EthereumNetwork: Get, AssetTransactor: TransactAsset, FeeProvider: SendMessageFeeProvider, { - fn handle_fee( - fees: MultiAssets, - context: Option<&XcmContext>, - reason: FeeReason, - ) -> MultiAssets { + fn handle_fee(fees: Assets, context: Option<&XcmContext>, reason: FeeReason) -> Assets { let token_location = FeeAssetLocation::get(); // Check the reason to see if this export is for snowbridge. if !matches!( reason, - FeeReason::Export { network: bridged_network, destination } - if bridged_network == EthereumNetwork::get() && destination == Here + FeeReason::Export { network: bridged_network, ref destination } + if bridged_network == EthereumNetwork::get() && destination == &Here ) { return fees } // Get the parachain sovereign from the `context`. - let para_sovereign = if let Some(XcmContext { - origin: Some(MultiLocation { parents: 1, interior }), - .. - }) = context - { - if let Some(Parachain(sibling_para_id)) = interior.first() { - let account: AccountId = - sibling_sovereign_account_raw((*sibling_para_id).into()).into(); - account + let para_sovereign = + if let Some(XcmContext { origin: Some(Location { parents: 1, interior }), .. }) = + context + { + if let Some(Parachain(sibling_para_id)) = interior.first() { + let account: AccountId = + sibling_sovereign_account_raw((*sibling_para_id).into()).into(); + account + } else { + return fees + } } else { return fees - } - } else { - return fees - }; + }; // Get the total fee offered by export message. let maybe_total_supplied_fee: Option<(usize, Balance)> = fees @@ -90,8 +85,8 @@ impl (0u128).into() { // Refund remote component of fee to physical origin deposit_or_burn_fee::( - MultiAsset { id: Concrete(token_location), fun: Fungible(remote_fee.into()) } + Asset { id: AssetId(token_location.clone()), fun: Fungible(remote_fee.into()) } .into(), context, para_sovereign, @@ -112,8 +107,8 @@ impl::execute_xcm( + let mut hash = xcm.using_encoded(sp_io::hashing::blake2_256); + XcmExecutor::::prepare_and_execute( assethub_parachain_location, xcm, - hash, + &mut hash, RuntimeHelper::::xcm_max_weight(XcmReceivedFrom::Sibling), + Weight::zero(), ) } @@ -176,7 +175,7 @@ pub fn send_unpaid_transfer_token_message( XcmConfig: xcm_executor::Config, ValidatorIdOf: From>, { - let assethub_parachain_location = MultiLocation::new(1, Parachain(assethub_parachain_id)); + let assethub_parachain_location = Location::new(1, Parachain(assethub_parachain_id)); ExtBuilder::::default() .with_collators(collator_session_key.collators()) @@ -194,28 +193,25 @@ pub fn send_unpaid_transfer_token_message( ) .unwrap(); - let asset = MultiAsset { - id: Concrete(MultiLocation { - parents: 0, - interior: X1(AccountKey20 { network: None, key: weth_contract_address.into() }), - }), + let asset = Asset { + id: AssetId(Location::new( + 0, + [AccountKey20 { network: None, key: weth_contract_address.into() }], + )), fun: Fungible(1000000000), }; let assets = vec![asset.clone()]; let inner_xcm = Xcm(vec![ - WithdrawAsset(MultiAssets::from(assets.clone())), + WithdrawAsset(Assets::from(assets.clone())), ClearOrigin, BuyExecution { fees: asset, weight_limit: Unlimited }, DepositAsset { assets: Wild(AllCounted(1)), - beneficiary: MultiLocation { - parents: 0, - interior: X1(AccountKey20 { - network: None, - key: destination_contract.into(), - }), - }, + beneficiary: Location::new( + 0, + [AccountKey20 { network: None, key: destination_contract.into() }], + ), }, SetTopic([0; 32]), ]); @@ -231,12 +227,13 @@ pub fn send_unpaid_transfer_token_message( ]); // execute XCM - let hash = xcm.using_encoded(sp_io::hashing::blake2_256); - let outcome = XcmExecutor::::execute_xcm( + let mut hash = xcm.using_encoded(sp_io::hashing::blake2_256); + let outcome = XcmExecutor::::prepare_and_execute( assethub_parachain_location, xcm, - hash, + &mut hash, RuntimeHelper::::xcm_max_weight(XcmReceivedFrom::Sibling), + Weight::zero(), ); // check error is barrier assert_err!(outcome.ensure_complete(), Barrier); From a8d456305860e0a961e01d5160324a13d3714e76 Mon Sep 17 00:00:00 2001 From: cristiantroy <154241727+cristiantroy@users.noreply.github.com> Date: Thu, 18 Jan 2024 20:30:29 +0800 Subject: [PATCH 11/15] Fix typos (#2983) --- modules/parachains/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/parachains/src/lib.rs b/modules/parachains/src/lib.rs index 9adeacb0eb8..87c57e84622 100644 --- a/modules/parachains/src/lib.rs +++ b/modules/parachains/src/lib.rs @@ -1494,7 +1494,7 @@ pub(crate) mod tests { ); // then if someone is pretending to provide updated head#10 of parachain#1 at relay - // block#30, and actualy provides it + // block#30, and actually provides it // // => we'll update value proceed(30, state_root_10_at_30); From 86898bb342f9e38bf5698444033fbfb569aaa238 Mon Sep 17 00:00:00 2001 From: Serban Iorga Date: Thu, 18 Jan 2024 16:29:42 +0100 Subject: [PATCH 12/15] Update polkadot-sdk refs --- Cargo.lock | 1193 +++++++++------------------------------------------- 1 file changed, 196 insertions(+), 997 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cbf9eb6519f..ece5469979b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,15 +36,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" -dependencies = [ - "generic-array 0.14.7", -] - [[package]] name = "aead" version = "0.4.3" @@ -52,7 +43,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ "generic-array 0.14.7", - "rand_core 0.6.4", ] [[package]] @@ -65,17 +55,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "aes" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" -dependencies = [ - "aes-soft", - "aesni", - "cipher 0.2.5", -] - [[package]] name = "aes" version = "0.7.5" @@ -127,26 +106,6 @@ dependencies = [ "subtle 2.4.1", ] -[[package]] -name = "aes-soft" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.0", -] - -[[package]] -name = "aesni" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.0", -] - [[package]] name = "ahash" version = "0.7.6" @@ -226,24 +185,18 @@ dependencies = [ [[package]] name = "aquamarine" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df752953c49ce90719c7bf1fc587bc8227aed04732ea0c0f85e5397d7fdbd1a1" +checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" dependencies = [ "include_dir", "itertools", "proc-macro-error", "proc-macro2 1.0.76", "quote 1.0.35", - "syn 1.0.109", + "syn 2.0.48", ] -[[package]] -name = "arc-swap" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" - [[package]] name = "ark-bls12-377" version = "0.4.0" @@ -570,48 +523,20 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "asn1-rs" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" -dependencies = [ - "asn1-rs-derive 0.1.0", - "asn1-rs-impl", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror", - "time 0.3.31", -] - [[package]] name = "asn1-rs" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" dependencies = [ - "asn1-rs-derive 0.4.0", + "asn1-rs-derive", "asn1-rs-impl", "displaydoc", "nom", "num-traits", "rusticata-macros", "thiserror", - "time 0.3.31", -] - -[[package]] -name = "asn1-rs-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" -dependencies = [ - "proc-macro2 1.0.76", - "quote 1.0.35", - "syn 1.0.109", - "synstructure", + "time", ] [[package]] @@ -899,12 +824,6 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - [[package]] name = "base16ct" version = "0.2.0" @@ -947,7 +866,7 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "hash-db", "log", @@ -1054,7 +973,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "block-padding 0.1.5", + "block-padding", "byte-tools", "byteorder", "generic-array 0.12.4", @@ -1078,16 +997,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "block-modes" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" -dependencies = [ - "block-padding 0.2.1", - "cipher 0.2.5", -] - [[package]] name = "block-padding" version = "0.1.5" @@ -1097,12 +1006,6 @@ dependencies = [ "byte-tools", ] -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - [[package]] name = "blocking" version = "1.3.1" @@ -1564,17 +1467,6 @@ dependencies = [ "jobserver", ] -[[package]] -name = "ccm" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca1a8fbc20b50ac9673ff014abfb2b5f4085ee1a850d408f14a159c5853ac7" -dependencies = [ - "aead 0.3.2", - "cipher 0.2.5", - "subtle 2.4.1", -] - [[package]] name = "cfg-expr" version = "0.15.5" @@ -1633,15 +1525,14 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.28" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ed24df0632f708f5f6d8082675bef2596f7084dee3dd55f632290bf35bfe0f" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", - "time 0.1.45", "wasm-bindgen", "windows-targets 0.48.1", ] @@ -1931,21 +1822,6 @@ dependencies = [ "wasmtime-types", ] -[[package]] -name = "crc" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" - [[package]] name = "crc32fast" version = "1.3.2" @@ -2004,18 +1880,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-bigint" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" -dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", - "subtle 2.4.1", - "zeroize", -] - [[package]] name = "crypto-bigint" version = "0.5.2" @@ -2146,9 +2010,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -2281,17 +2145,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - [[package]] name = "der" version = "0.7.7" @@ -2302,27 +2155,13 @@ dependencies = [ "zeroize", ] -[[package]] -name = "der-parser" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" -dependencies = [ - "asn1-rs 0.3.1", - "displaydoc", - "nom", - "num-bigint", - "num-traits", - "rusticata-macros", -] - [[package]] name = "der-parser" version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "displaydoc", "nom", "num-bigint", @@ -2361,37 +2200,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive_builder" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" -dependencies = [ - "darling 0.14.4", - "proc-macro2 1.0.76", - "quote 1.0.35", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_macro" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" -dependencies = [ - "derive_builder_core", - "syn 1.0.109", -] - [[package]] name = "derive_more" version = "0.99.17" @@ -2561,30 +2369,18 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" -[[package]] -name = "ecdsa" -version = "0.14.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" -dependencies = [ - "der 0.6.1", - "elliptic-curve 0.12.3", - "rfc6979 0.3.1", - "signature 1.6.4", -] - [[package]] name = "ecdsa" version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" dependencies = [ - "der 0.7.7", + "der", "digest 0.10.7", - "elliptic-curve 0.13.5", - "rfc6979 0.4.0", - "signature 2.1.0", - "spki 0.7.2", + "elliptic-curve", + "rfc6979", + "signature", + "spki", ] [[package]] @@ -2593,8 +2389,8 @@ version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ - "pkcs8 0.10.2", - "signature 2.1.0", + "pkcs8", + "signature", ] [[package]] @@ -2603,7 +2399,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" dependencies = [ - "curve25519-dalek 4.0.0", + "curve25519-dalek 4.1.1", "ed25519", "rand_core 0.6.4", "serde", @@ -2632,43 +2428,21 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" -[[package]] -name = "elliptic-curve" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" -dependencies = [ - "base16ct 0.1.1", - "crypto-bigint 0.4.9", - "der 0.6.1", - "digest 0.10.7", - "ff 0.12.1", - "generic-array 0.14.7", - "group 0.12.1", - "hkdf", - "pem-rfc7468", - "pkcs8 0.9.0", - "rand_core 0.6.4", - "sec1 0.3.0", - "subtle 2.4.1", - "zeroize", -] - [[package]] name = "elliptic-curve" version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ - "base16ct 0.2.0", - "crypto-bigint 0.5.2", + "base16ct", + "crypto-bigint", "digest 0.10.7", - "ff 0.13.0", + "ff", "generic-array 0.14.7", - "group 0.13.0", - "pkcs8 0.10.2", + "group", + "pkcs8", "rand_core 0.6.4", - "sec1 0.7.3", + "sec1", "subtle 2.4.1", "zeroize", ] @@ -2817,16 +2591,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" -[[package]] -name = "ff" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" -dependencies = [ - "rand_core 0.6.4", - "subtle 2.4.1", -] - [[package]] name = "ff" version = "0.13.0" @@ -2852,9 +2616,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.1.20" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" [[package]] name = "file-per-thread-logger" @@ -2959,7 +2723,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "frame-support", "frame-support-procedural", @@ -3007,7 +2771,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "aquamarine", "array-bytes 6.1.0", @@ -3048,7 +2812,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "Inflector", "cfg-expr", @@ -3067,10 +2831,10 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 2.0.1", + "proc-macro-crate 3.1.0", "proc-macro2 1.0.76", "quote 1.0.35", "syn 2.0.48", @@ -3079,7 +2843,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "proc-macro2 1.0.76", "quote 1.0.35", @@ -3089,7 +2853,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "cfg-if 1.0.0", "docify", @@ -3201,7 +2965,7 @@ checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", "rustls 0.20.8", - "webpki 0.22.2", + "webpki", ] [[package]] @@ -3357,24 +3121,13 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "group" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" -dependencies = [ - "ff 0.12.1", - "rand_core 0.6.4", - "subtle 2.4.1", -] - [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff 0.13.0", + "ff", "rand_core 0.6.4", "subtle 2.4.1", ] @@ -3823,25 +3576,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "interceptor" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8a11ae2da61704edada656798b61c94b35ecac2c58eb955156987d5e6be90b" -dependencies = [ - "async-trait", - "bytes", - "log", - "rand 0.8.5", - "rtcp", - "rtp", - "thiserror", - "tokio", - "waitgroup", - "webrtc-srtp", - "webrtc-util", -] - [[package]] name = "intx" version = "0.1.0" @@ -4241,8 +3975,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if 1.0.0", - "ecdsa 0.16.7", - "elliptic-curve 0.13.5", + "ecdsa", + "elliptic-curve", "once_cell", "sha2 0.10.7", ] @@ -4310,9 +4044,9 @@ dependencies = [ [[package]] name = "libp2p" -version = "0.51.3" +version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f210d259724eae82005b5c48078619b7745edb7b76de370b03f8ba59ea103097" +checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" dependencies = [ "bytes", "futures", @@ -4335,7 +4069,6 @@ dependencies = [ "libp2p-swarm", "libp2p-tcp", "libp2p-wasm-ext", - "libp2p-webrtc", "libp2p-websocket", "libp2p-yamux", "multiaddr", @@ -4647,12 +4380,12 @@ dependencies = [ "futures-rustls", "libp2p-core", "libp2p-identity", - "rcgen 0.10.0", + "rcgen", "ring 0.16.20", "rustls 0.20.8", "thiserror", - "webpki 0.22.2", - "x509-parser 0.14.0", + "webpki", + "x509-parser", "yasna", ] @@ -4670,37 +4403,6 @@ dependencies = [ "wasm-bindgen-futures", ] -[[package]] -name = "libp2p-webrtc" -version = "0.4.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba48592edbc2f60b4bc7c10d65445b0c3964c07df26fdf493b6880d33be36f8" -dependencies = [ - "async-trait", - "asynchronous-codec", - "bytes", - "futures", - "futures-timer", - "hex", - "if-watch", - "libp2p-core", - "libp2p-identity", - "libp2p-noise", - "log", - "multihash", - "quick-protobuf", - "quick-protobuf-codec", - "rand 0.8.5", - "rcgen 0.9.3", - "serde", - "stun", - "thiserror", - "tinytemplate", - "tokio", - "tokio-util", - "webrtc", -] - [[package]] name = "libp2p-websocket" version = "0.41.0" @@ -4981,15 +4683,6 @@ dependencies = [ "rawpointer", ] -[[package]] -name = "md-5" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" -dependencies = [ - "digest 0.10.7", -] - [[package]] name = "memchr" version = "2.5.0" @@ -5014,15 +4707,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.8.0" @@ -5135,7 +4819,7 @@ dependencies = [ "bitflags 1.3.2", "blake2 0.10.6", "c2-chacha", - "curve25519-dalek 4.0.0", + "curve25519-dalek 4.1.1", "either", "hashlink", "lioness", @@ -5213,9 +4897,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" dependencies = [ "core2", - "digest 0.10.7", "multihash-derive", - "sha2 0.10.7", "unsigned-varint", ] @@ -5355,7 +5037,6 @@ dependencies = [ "bitflags 1.3.2", "cfg-if 1.0.0", "libc", - "memoffset 0.6.5", ] [[package]] @@ -5503,22 +5184,13 @@ dependencies = [ "memchr", ] -[[package]] -name = "oid-registry" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e20717fa0541f39bd146692035c37bedfa532b3e5071b35761082407546b2a" -dependencies = [ - "asn1-rs 0.3.1", -] - [[package]] name = "oid-registry" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", ] [[package]] @@ -5557,32 +5229,10 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "p256" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.7", -] - -[[package]] -name = "p384" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.7", -] - [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "frame-support", "frame-system", @@ -5596,7 +5246,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "frame-benchmarking", "frame-support", @@ -5611,7 +5261,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "frame-support", "frame-system", @@ -5631,7 +5281,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "array-bytes 6.1.0", "binary-merkle-tree", @@ -5766,7 +5416,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "frame-benchmarking", "frame-support", @@ -5789,7 +5439,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "frame-benchmarking", "frame-support", @@ -5807,7 +5457,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "frame-support", "frame-system", @@ -5829,7 +5479,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "docify", "frame-benchmarking", @@ -5849,7 +5499,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "frame-support", "frame-system", @@ -5865,7 +5515,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5877,7 +5527,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "frame-benchmarking", "frame-support", @@ -6110,15 +5760,6 @@ dependencies = [ "base64 0.13.1", ] -[[package]] -name = "pem-rfc7468" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" -dependencies = [ - "base64ct", -] - [[package]] name = "percent-encoding" version = "2.3.0" @@ -6173,24 +5814,14 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkcs8" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" -dependencies = [ - "der 0.6.1", - "spki 0.6.0", -] - [[package]] name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.7", - "spki 0.7.2", + "der", + "spki", ] [[package]] @@ -6208,7 +5839,7 @@ checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" [[package]] name = "polkadot-core-primitives" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "parity-scale-codec", "scale-info", @@ -6220,7 +5851,7 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "bounded-collections", "derive_more", @@ -6237,7 +5868,7 @@ dependencies = [ [[package]] name = "polkadot-primitives" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "bitvec", "hex-literal", @@ -6389,12 +6020,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_datetime", - "toml_edit 0.20.2", + "toml_edit 0.21.0", ] [[package]] @@ -6610,7 +6240,7 @@ dependencies = [ "thiserror", "tinyvec", "tracing", - "webpki 0.22.2", + "webpki", ] [[package]] @@ -6764,19 +6394,6 @@ dependencies = [ "syn 0.15.44", ] -[[package]] -name = "rcgen" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" -dependencies = [ - "pem", - "ring 0.16.20", - "time 0.3.31", - "x509-parser 0.13.2", - "yasna", -] - [[package]] name = "rcgen" version = "0.10.0" @@ -6785,7 +6402,7 @@ checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ "pem", "ring 0.16.20", - "time 0.3.31", + "time", "yasna", ] @@ -7123,7 +6740,7 @@ dependencies = [ "substrate-prometheus-endpoint", "sysinfo", "thiserror", - "time 0.3.31", + "time", "tokio", ] @@ -7156,17 +6773,6 @@ dependencies = [ "quick-error", ] -[[package]] -name = "rfc6979" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" -dependencies = [ - "crypto-bigint 0.4.9", - "hmac 0.12.1", - "zeroize", -] - [[package]] name = "rfc6979" version = "0.4.0" @@ -7218,17 +6824,6 @@ dependencies = [ "rustc-hex", ] -[[package]] -name = "rtcp" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1919efd6d4a6a85d13388f9487549bb8e359f17198cc03ffd72f79b553873691" -dependencies = [ - "bytes", - "thiserror", - "webrtc-util", -] - [[package]] name = "rtnetlink" version = "0.10.1" @@ -7244,20 +6839,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "rtp" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a095411ff00eed7b12e4c6a118ba984d113e1079582570d56a5ee723f11f80" -dependencies = [ - "async-trait", - "bytes", - "rand 0.8.5", - "serde", - "thiserror", - "webrtc-util", -] - [[package]] name = "rustc-demangle" version = "0.1.23" @@ -7335,19 +6916,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustls" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" -dependencies = [ - "base64 0.13.1", - "log", - "ring 0.16.20", - "sct 0.6.1", - "webpki 0.21.4", -] - [[package]] name = "rustls" version = "0.20.8" @@ -7356,8 +6924,8 @@ checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring 0.16.20", - "sct 0.7.0", - "webpki 0.22.2", + "sct", + "webpki", ] [[package]] @@ -7369,7 +6937,7 @@ dependencies = [ "log", "ring 0.16.20", "rustls-webpki", - "sct 0.7.0", + "sct", ] [[package]] @@ -7458,7 +7026,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "log", "sp-core", @@ -7469,7 +7037,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "array-bytes 6.1.0", "docify", @@ -7494,9 +7062,9 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ - "proc-macro-crate 2.0.1", + "proc-macro-crate 3.1.0", "proc-macro2 1.0.76", "quote 1.0.35", "syn 2.0.48", @@ -7505,7 +7073,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "fnv", "futures", @@ -7532,7 +7100,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "async-trait", "futures", @@ -7557,7 +7125,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", @@ -7579,7 +7147,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -7591,7 +7159,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "anyhow", "cfg-if 1.0.0", @@ -7609,7 +7177,7 @@ dependencies = [ [[package]] name = "sc-mixnet" version = "0.1.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "array-bytes 4.2.0", "arrayvec 0.7.4", @@ -7638,7 +7206,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "array-bytes 6.1.0", "async-channel", @@ -7681,7 +7249,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -7698,7 +7266,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "jsonrpsee 0.16.2", "parity-scale-codec", @@ -7718,7 +7286,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "chrono", "futures", @@ -7737,7 +7305,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "async-trait", "futures", @@ -7753,7 +7321,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "async-channel", "futures", @@ -7933,20 +7501,29 @@ dependencies = [ ] [[package]] -name = "scopeguard" -version = "1.2.0" +name = "schnorrkel" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" +dependencies = [ + "aead 0.5.2", + "arrayref", + "arrayvec 0.7.4", + "curve25519-dalek 4.1.1", + "getrandom_or_panic", + "merlin 3.0.0", + "rand_core 0.6.4", + "serde_bytes", + "sha2 0.10.7", + "subtle 2.4.1", + "zeroize", +] [[package]] -name = "sct" -version = "0.6.1" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" -dependencies = [ - "ring 0.16.20", - "untrusted", -] +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" @@ -7958,42 +7535,16 @@ dependencies = [ "untrusted", ] -[[package]] -name = "sdp" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d22a5ef407871893fd72b4562ee15e4742269b173959db4b8df6f538c414e13" -dependencies = [ - "rand 0.8.5", - "substring", - "thiserror", - "url", -] - -[[package]] -name = "sec1" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" -dependencies = [ - "base16ct 0.1.1", - "der 0.6.1", - "generic-array 0.14.7", - "pkcs8 0.9.0", - "subtle 2.4.1", - "zeroize", -] - [[package]] name = "sec1" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct 0.2.0", - "der 0.7.7", + "base16ct", + "der", "generic-array 0.14.7", - "pkcs8 0.10.2", + "pkcs8", "subtle 2.4.1", "zeroize", ] @@ -8063,6 +7614,15 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde_bytes" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" version = "1.0.195" @@ -8108,17 +7668,6 @@ dependencies = [ "opaque-debug 0.3.0", ] -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.7", -] - [[package]] name = "sha2" version = "0.8.2" @@ -8205,16 +7754,6 @@ dependencies = [ "libc", ] -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" -dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] - [[package]] name = "signature" version = "2.1.0" @@ -8241,7 +7780,7 @@ dependencies = [ [[package]] name = "simple-mermaid" version = "0.1.0" -source = "git+https://github.com/kianenigma/simple-mermaid.git?branch=main#e48b187bcfd5cc75111acd9d241f1bd36604344b" +source = "git+https://github.com/kianenigma/simple-mermaid.git?rev=e48b187bcfd5cc75111acd9d241f1bd36604344b#e48b187bcfd5cc75111acd9d241f1bd36604344b" [[package]] name = "siphasher" @@ -8388,7 +7927,7 @@ dependencies = [ "aes-gcm 0.9.4", "blake2 0.10.6", "chacha20poly1305", - "curve25519-dalek 4.0.0", + "curve25519-dalek 4.1.1", "rand_core 0.6.4", "ring 0.16.20", "rustc_version", @@ -8436,7 +7975,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "hash-db", "log", @@ -8457,12 +7996,12 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "Inflector", "blake2 0.10.6", "expander", - "proc-macro-crate 2.0.1", + "proc-macro-crate 3.1.0", "proc-macro2 1.0.76", "quote 1.0.35", "syn 2.0.48", @@ -8471,7 +8010,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "parity-scale-codec", "scale-info", @@ -8484,7 +8023,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "integer-sqrt", "num-traits", @@ -8516,7 +8055,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "parity-scale-codec", "scale-info", @@ -8529,7 +8068,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "futures", "log", @@ -8547,7 +8086,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "async-trait", "futures", @@ -8562,7 +8101,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "lazy_static", "parity-scale-codec", @@ -8581,7 +8120,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "finality-grandpa", "log", @@ -8599,7 +8138,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "parity-scale-codec", "scale-info", @@ -8611,7 +8150,7 @@ dependencies = [ [[package]] name = "sp-core" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "array-bytes 6.1.0", "bandersnatch_vrfs", @@ -8629,14 +8168,14 @@ dependencies = [ "itertools", "libsecp256k1", "log", - "merlin 2.0.1", + "merlin 3.0.0", "parity-scale-codec", "parking_lot 0.12.1", "paste", "primitive-types", "rand 0.8.5", "scale-info", - "schnorrkel 0.9.1", + "schnorrkel 0.11.4", "secp256k1", "secrecy", "serde", @@ -8672,7 +8211,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "9.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "blake2b_simd", "byteorder", @@ -8685,7 +8224,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "9.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "quote 1.0.35", "sp-core-hashing 9.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=master)", @@ -8695,7 +8234,7 @@ dependencies = [ [[package]] name = "sp-crypto-ec-utils" version = "0.4.1" -source = "git+https://github.com/paritytech/polkadot-sdk#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "ark-bls12-377", "ark-bls12-377-ext", @@ -8716,7 +8255,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -8725,7 +8264,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "8.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "proc-macro2 1.0.76", "quote 1.0.35", @@ -8735,7 +8274,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "8.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "proc-macro2 1.0.76", "quote 1.0.35", @@ -8745,7 +8284,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "environmental", "parity-scale-codec", @@ -8756,7 +8295,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "environmental", "parity-scale-codec", @@ -8767,7 +8306,7 @@ dependencies = [ [[package]] name = "sp-genesis-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "serde_json", "sp-api", @@ -8778,7 +8317,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -8792,7 +8331,7 @@ dependencies = [ [[package]] name = "sp-io" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "bytes", "ed25519-dalek", @@ -8816,7 +8355,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "sp-core", "sp-runtime", @@ -8826,7 +8365,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.27.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", @@ -8838,7 +8377,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "thiserror", "zstd 0.12.4", @@ -8847,7 +8386,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "frame-metadata 16.0.0", "parity-scale-codec", @@ -8858,7 +8397,7 @@ dependencies = [ [[package]] name = "sp-mixnet" version = "0.1.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "parity-scale-codec", "scale-info", @@ -8870,7 +8409,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "ckb-merkle-mountain-range 0.5.2", "log", @@ -8888,7 +8427,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "8.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "backtrace", "lazy_static", @@ -8898,7 +8437,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "rustc-hash", "serde", @@ -8908,7 +8447,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "docify", "either", @@ -8932,7 +8471,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -8950,7 +8489,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -8968,11 +8507,11 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "Inflector", "expander", - "proc-macro-crate 2.0.1", + "proc-macro-crate 3.1.0", "proc-macro2 1.0.76", "quote 1.0.35", "syn 2.0.48", @@ -8981,11 +8520,11 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "Inflector", "expander", - "proc-macro-crate 2.0.1", + "proc-macro-crate 3.1.0", "proc-macro2 1.0.76", "quote 1.0.35", "syn 2.0.48", @@ -8994,7 +8533,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "parity-scale-codec", "scale-info", @@ -9009,7 +8548,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9023,7 +8562,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.28.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "hash-db", "log", @@ -9044,10 +8583,10 @@ dependencies = [ [[package]] name = "sp-statement-store" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "aes-gcm 0.10.2", - "curve25519-dalek 4.0.0", + "curve25519-dalek 4.1.1", "ed25519-dalek", "hkdf", "parity-scale-codec", @@ -9074,17 +8613,17 @@ checksum = "53458e3c57df53698b3401ec0934bea8e8cfce034816873c0b0abbd83d7bac0d" [[package]] name = "sp-std" version = "8.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" [[package]] name = "sp-std" version = "8.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk#dcc76525d98a097be152293eee3389f6af5c4404" [[package]] name = "sp-storage" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9097,7 +8636,7 @@ dependencies = [ [[package]] name = "sp-storage" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9110,7 +8649,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "async-trait", "parity-scale-codec", @@ -9123,7 +8662,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "parity-scale-codec", "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=master)", @@ -9135,7 +8674,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "parity-scale-codec", "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk)", @@ -9147,7 +8686,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "ahash 0.8.3", "hash-db", @@ -9171,7 +8710,7 @@ dependencies = [ [[package]] name = "sp-version" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9188,7 +8727,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "8.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "parity-scale-codec", "proc-macro2 1.0.76", @@ -9199,7 +8738,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -9212,7 +8751,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -9225,7 +8764,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -9249,16 +8788,6 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "base64ct", - "der 0.6.1", -] - [[package]] name = "spki" version = "0.7.2" @@ -9266,7 +8795,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", - "der 0.7.7", + "der", ] [[package]] @@ -9293,8 +8822,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-xcm" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ + "array-bytes 6.1.0", "bounded-collections", "derivative", "environmental", @@ -9310,7 +8840,7 @@ dependencies = [ [[package]] name = "staging-xcm-builder" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "frame-support", "frame-system", @@ -9332,7 +8862,7 @@ dependencies = [ [[package]] name = "staging-xcm-executor" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "environmental", "frame-benchmarking", @@ -9436,25 +8966,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "stun" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" -dependencies = [ - "base64 0.13.1", - "crc", - "lazy_static", - "md-5", - "rand 0.8.5", - "ring 0.16.20", - "subtle 2.4.1", - "thiserror", - "tokio", - "url", - "webrtc-util", -] - [[package]] name = "substrate-bip39" version = "0.4.4" @@ -9471,7 +8982,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "hyper", "log", @@ -9578,15 +9089,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "substring" -version = "1.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86" -dependencies = [ - "autocfg", -] - [[package]] name = "subtle" version = "1.0.0" @@ -9880,17 +9382,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - [[package]] name = "time" version = "0.3.31" @@ -9931,16 +9422,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -9969,7 +9450,6 @@ dependencies = [ "num_cpus", "parking_lot 0.12.1", "pin-project-lite 0.2.12", - "signal-hook-registry", "socket2 0.5.5", "tokio-macros", "windows-sys 0.48.0", @@ -10045,9 +9525,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] @@ -10067,9 +9547,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.2" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ "indexmap 2.0.0", "toml_datetime", @@ -10270,25 +9750,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" -[[package]] -name = "turn" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4712ee30d123ec7ae26d1e1b218395a16c87cdbaf4b3925d170d684af62ea5e8" -dependencies = [ - "async-trait", - "base64 0.13.1", - "futures", - "log", - "md-5", - "rand 0.8.5", - "ring 0.16.20", - "stun", - "thiserror", - "tokio", - "webrtc-util", -] - [[package]] name = "twox-hash" version = "1.6.3" @@ -10413,15 +9874,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "uuid" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" -dependencies = [ - "getrandom 0.2.10", -] - [[package]] name = "valuable" version = "0.1.0" @@ -10482,15 +9934,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "waitgroup" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292" -dependencies = [ - "atomic-waker", -] - [[package]] name = "waker-fn" version = "1.1.0" @@ -10522,12 +9965,6 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -10880,16 +10317,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring 0.16.20", - "untrusted", -] - [[package]] name = "webpki" version = "0.22.2" @@ -10906,216 +10333,7 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki 0.22.2", -] - -[[package]] -name = "webrtc" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3bc9049bdb2cea52f5fd4f6f728184225bdb867ed0dc2410eab6df5bdd67bb" -dependencies = [ - "arc-swap", - "async-trait", - "bytes", - "hex", - "interceptor", - "lazy_static", - "log", - "rand 0.8.5", - "rcgen 0.9.3", - "regex", - "ring 0.16.20", - "rtcp", - "rtp", - "rustls 0.19.1", - "sdp", - "serde", - "serde_json", - "sha2 0.10.7", - "stun", - "thiserror", - "time 0.3.31", - "tokio", - "turn", - "url", - "waitgroup", - "webrtc-data", - "webrtc-dtls", - "webrtc-ice", - "webrtc-mdns", - "webrtc-media", - "webrtc-sctp", - "webrtc-srtp", - "webrtc-util", -] - -[[package]] -name = "webrtc-data" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef36a4d12baa6e842582fe9ec16a57184ba35e1a09308307b67d43ec8883100" -dependencies = [ - "bytes", - "derive_builder", - "log", - "thiserror", - "tokio", - "webrtc-sctp", - "webrtc-util", -] - -[[package]] -name = "webrtc-dtls" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942be5bd85f072c3128396f6e5a9bfb93ca8c1939ded735d177b7bcba9a13d05" -dependencies = [ - "aes 0.6.0", - "aes-gcm 0.10.2", - "async-trait", - "bincode", - "block-modes", - "byteorder", - "ccm", - "curve25519-dalek 3.2.0", - "der-parser 8.2.0", - "elliptic-curve 0.12.3", - "hkdf", - "hmac 0.12.1", - "log", - "oid-registry 0.6.1", - "p256", - "p384", - "rand 0.8.5", - "rand_core 0.6.4", - "rcgen 0.9.3", - "ring 0.16.20", - "rustls 0.19.1", - "sec1 0.3.0", - "serde", - "sha1", - "sha2 0.10.7", - "signature 1.6.4", - "subtle 2.4.1", - "thiserror", - "tokio", - "webpki 0.21.4", - "webrtc-util", - "x25519-dalek 2.0.0", - "x509-parser 0.13.2", -] - -[[package]] -name = "webrtc-ice" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465a03cc11e9a7d7b4f9f99870558fe37a102b65b93f8045392fef7c67b39e80" -dependencies = [ - "arc-swap", - "async-trait", - "crc", - "log", - "rand 0.8.5", - "serde", - "serde_json", - "stun", - "thiserror", - "tokio", - "turn", - "url", - "uuid", - "waitgroup", - "webrtc-mdns", - "webrtc-util", -] - -[[package]] -name = "webrtc-mdns" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" -dependencies = [ - "log", - "socket2 0.4.9", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-media" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f72e1650a8ae006017d1a5280efb49e2610c19ccc3c0905b03b648aee9554991" -dependencies = [ - "byteorder", - "bytes", - "rand 0.8.5", - "rtp", - "thiserror", -] - -[[package]] -name = "webrtc-sctp" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d47adcd9427eb3ede33d5a7f3424038f63c965491beafcc20bc650a2f6679c0" -dependencies = [ - "arc-swap", - "async-trait", - "bytes", - "crc", - "log", - "rand 0.8.5", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-srtp" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6183edc4c1c6c0175f8812eefdce84dfa0aea9c3ece71c2bf6ddd3c964de3da5" -dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "aes-gcm 0.9.4", - "async-trait", - "byteorder", - "bytes", - "ctr 0.8.0", - "hmac 0.11.0", - "log", - "rtcp", - "rtp", - "sha-1", - "subtle 2.4.1", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-util" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" -dependencies = [ - "async-trait", - "bitflags 1.3.2", - "bytes", - "cc", - "ipnet", - "lazy_static", - "libc", - "log", - "nix", - "rand 0.8.5", - "thiserror", - "tokio", - "winapi", + "webpki", ] [[package]] @@ -11490,53 +10708,34 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" dependencies = [ - "curve25519-dalek 4.0.0", + "curve25519-dalek 4.1.1", "rand_core 0.6.4", "serde", "zeroize", ] -[[package]] -name = "x509-parser" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" -dependencies = [ - "asn1-rs 0.3.1", - "base64 0.13.1", - "data-encoding", - "der-parser 7.0.0", - "lazy_static", - "nom", - "oid-registry 0.4.0", - "ring 0.16.20", - "rusticata-macros", - "thiserror", - "time 0.3.31", -] - [[package]] name = "x509-parser" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "base64 0.13.1", "data-encoding", - "der-parser 8.2.0", + "der-parser", "lazy_static", "nom", - "oid-registry 0.6.1", + "oid-registry", "rusticata-macros", "thiserror", - "time 0.3.31", + "time", ] [[package]] name = "xcm-procedural" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#ebe2aad6f0ae576a0e176f38a084fe7579f936dd" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#dcc76525d98a097be152293eee3389f6af5c4404" dependencies = [ "Inflector", "proc-macro2 1.0.76", @@ -11570,7 +10769,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ - "time 0.3.31", + "time", ] [[package]] From 4f690ec42c6fdb61ccf2473fb0f6781eb1d30d99 Mon Sep 17 00:00:00 2001 From: Serban Iorga Date: Thu, 18 Jan 2024 16:35:46 +0100 Subject: [PATCH 13/15] Update deprecated struct --- relays/client-substrate/src/calls.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/relays/client-substrate/src/calls.rs b/relays/client-substrate/src/calls.rs index 4e0ae9d99d2..71b9ec84aca 100644 --- a/relays/client-substrate/src/calls.rs +++ b/relays/client-substrate/src/calls.rs @@ -20,7 +20,7 @@ use codec::{Decode, Encode}; use scale_info::TypeInfo; use sp_std::{boxed::Box, vec::Vec}; -use xcm::{VersionedMultiLocation, VersionedXcm}; +use xcm::{VersionedLocation, VersionedXcm}; /// A minimized version of `frame-system::Call` that can be used without a runtime. #[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)] @@ -55,5 +55,5 @@ pub enum SudoCall { pub enum XcmCall { /// `pallet-xcm::Call::send` #[codec(index = 0)] - send(Box, Box>), + send(Box, Box>), } From 8ac0c717271208a35d0c3d8212a9fb2072863881 Mon Sep 17 00:00:00 2001 From: Serban Iorga Date: Thu, 18 Jan 2024 16:39:03 +0100 Subject: [PATCH 14/15] Remove snowbridge folder --- snowbridge/LICENSE | 201 --- snowbridge/README.md | 127 -- snowbridge/parachain/LICENSE | 201 --- snowbridge/parachain/README.md | 127 -- .../pallets/ethereum-client/Cargo.toml | 99 -- .../pallets/ethereum-client/README.md | 3 - .../pallets/ethereum-client/benchmark.md | 88 -- .../src/benchmarking/fixtures_mainnet.rs | 1215 ----------------- .../src/benchmarking/fixtures_minimal.rs | 248 ---- .../ethereum-client/src/benchmarking/mod.rs | 166 --- .../ethereum-client/src/benchmarking/util.rs | 44 - .../ethereum-client/src/config/mainnet.rs | 10 - .../ethereum-client/src/config/minimal.rs | 10 - .../pallets/ethereum-client/src/config/mod.rs | 56 - .../pallets/ethereum-client/src/functions.rs | 31 - .../pallets/ethereum-client/src/impls.rs | 93 -- .../pallets/ethereum-client/src/lib.rs | 841 ------------ .../pallets/ethereum-client/src/mock.rs | 284 ---- .../pallets/ethereum-client/src/tests.rs | 1045 -------------- .../pallets/ethereum-client/src/types.rs | 38 - .../pallets/ethereum-client/src/weights.rs | 68 - .../execution-header-update.mainnet.json | 50 - .../execution-header-update.minimal.json | 43 - .../finalized-header-update.mainnet.json | 38 - .../finalized-header-update.minimal.json | 38 - .../fixtures/initial-checkpoint.mainnet.json | 542 -------- .../fixtures/initial-checkpoint.minimal.json | 62 - .../next-finalized-header-update.mainnet.json | 38 - .../next-finalized-header-update.minimal.json | 38 - .../next-sync-committee-update.mainnet.json | 563 -------- .../next-sync-committee-update.minimal.json | 83 -- .../sync-committee-update.mainnet.json | 563 -------- .../sync-committee-update.minimal.json | 83 -- .../pallets/inbound-queue/Cargo.toml | 100 -- .../parachain/pallets/inbound-queue/README.md | 3 - .../src/benchmarking/fixtures.rs | 40 - .../inbound-queue/src/benchmarking/mod.rs | 55 - .../pallets/inbound-queue/src/envelope.rs | 50 - .../pallets/inbound-queue/src/lib.rs | 372 ----- .../pallets/inbound-queue/src/mock.rs | 344 ----- .../pallets/inbound-queue/src/test.rs | 212 --- .../pallets/inbound-queue/src/weights.rs | 31 - .../pallets/outbound-queue/Cargo.toml | 82 -- .../pallets/outbound-queue/README.md | 3 - .../outbound-queue/merkle-tree/Cargo.toml | 37 - .../outbound-queue/merkle-tree/README.md | 4 - .../outbound-queue/merkle-tree/src/lib.rs | 464 ------- .../outbound-queue/runtime-api/Cargo.toml | 38 - .../outbound-queue/runtime-api/README.md | 6 - .../outbound-queue/runtime-api/src/lib.rs | 20 - .../pallets/outbound-queue/src/api.rs | 30 - .../outbound-queue/src/benchmarking.rs | 85 -- .../pallets/outbound-queue/src/lib.rs | 406 ------ .../pallets/outbound-queue/src/mock.rs | 189 --- .../src/process_message_impl.rs | 23 - .../outbound-queue/src/send_message_impl.rs | 98 -- .../pallets/outbound-queue/src/test.rs | 268 ---- .../pallets/outbound-queue/src/types.rs | 57 - .../pallets/outbound-queue/src/weights.rs | 81 -- .../parachain/pallets/system/Cargo.toml | 87 -- snowbridge/parachain/pallets/system/README.md | 3 - .../pallets/system/runtime-api/Cargo.toml | 36 - .../pallets/system/runtime-api/README.md | 3 - .../pallets/system/runtime-api/src/lib.rs | 13 - .../parachain/pallets/system/src/api.rs | 16 - .../pallets/system/src/benchmarking.rs | 167 --- .../parachain/pallets/system/src/lib.rs | 681 --------- .../parachain/pallets/system/src/migration.rs | 74 - .../parachain/pallets/system/src/mock.rs | 270 ---- .../parachain/pallets/system/src/tests.rs | 649 --------- .../parachain/pallets/system/src/weights.rs | 249 ---- .../parachain/primitives/beacon/Cargo.toml | 57 - .../parachain/primitives/beacon/README.md | 10 - .../parachain/primitives/beacon/src/bits.rs | 19 - .../parachain/primitives/beacon/src/bls.rs | 87 -- .../parachain/primitives/beacon/src/config.rs | 10 - .../parachain/primitives/beacon/src/lib.rs | 31 - .../primitives/beacon/src/merkle_proof.rs | 58 - .../primitives/beacon/src/receipt.rs | 96 -- .../primitives/beacon/src/serde_utils.rs | 130 -- .../parachain/primitives/beacon/src/ssz.rs | 194 --- .../parachain/primitives/beacon/src/types.rs | 512 ------- .../primitives/beacon/src/updates.rs | 110 -- .../parachain/primitives/core/Cargo.toml | 65 - .../parachain/primitives/core/README.md | 4 - .../parachain/primitives/core/src/inbound.rs | 74 - .../parachain/primitives/core/src/lib.rs | 170 --- .../primitives/core/src/operating_mode.rs | 25 - .../parachain/primitives/core/src/outbound.rs | 413 ------ .../parachain/primitives/core/src/pricing.rs | 67 - .../primitives/core/src/ringbuffer.rs | 76 -- .../parachain/primitives/core/src/tests.rs | 13 - .../core/tests/fixtures/packet.scale | Bin 386 -> 0 bytes .../parachain/primitives/core/tests/mod.rs | 14 - .../primitives/ethereum/.cargo/config.toml | 2 - .../parachain/primitives/ethereum/Cargo.toml | 56 - .../parachain/primitives/ethereum/README.md | 4 - .../primitives/ethereum/src/header.rs | 414 ------ .../parachain/primitives/ethereum/src/lib.rs | 36 - .../parachain/primitives/ethereum/src/log.rs | 75 - .../parachain/primitives/ethereum/src/mpt.rs | 142 -- .../primitives/ethereum/src/receipt.rs | 139 -- .../parachain/primitives/router/Cargo.toml | 66 - .../parachain/primitives/router/README.md | 4 - .../primitives/router/src/inbound/mod.rs | 312 ----- .../primitives/router/src/inbound/tests.rs | 40 - .../parachain/primitives/router/src/lib.rs | 6 - .../primitives/router/src/outbound/mod.rs | 283 ---- .../primitives/router/src/outbound/tests.rs | 1058 -------------- .../runtime/runtime-common/Cargo.toml | 46 - .../runtime/runtime-common/README.md | 3 - .../runtime/runtime-common/src/lib.rs | 124 -- .../parachain/runtime/test-common/Cargo.toml | 199 --- .../parachain/runtime/test-common/README.md | 3 - .../parachain/runtime/test-common/src/lib.rs | 291 ---- snowbridge/parachain/scripts/benchmark.sh | 15 - snowbridge/parachain/scripts/hexliteral.sh | 5 - snowbridge/parachain/scripts/init.sh | 12 - .../parachain/scripts/make-build-config.sh | 5 - .../parachain/scripts/verify-pallets-build.sh | 116 -- 120 files changed, 18173 deletions(-) delete mode 100644 snowbridge/LICENSE delete mode 100644 snowbridge/README.md delete mode 100644 snowbridge/parachain/LICENSE delete mode 100644 snowbridge/parachain/README.md delete mode 100644 snowbridge/parachain/pallets/ethereum-client/Cargo.toml delete mode 100644 snowbridge/parachain/pallets/ethereum-client/README.md delete mode 100644 snowbridge/parachain/pallets/ethereum-client/benchmark.md delete mode 100644 snowbridge/parachain/pallets/ethereum-client/src/benchmarking/fixtures_mainnet.rs delete mode 100755 snowbridge/parachain/pallets/ethereum-client/src/benchmarking/fixtures_minimal.rs delete mode 100644 snowbridge/parachain/pallets/ethereum-client/src/benchmarking/mod.rs delete mode 100644 snowbridge/parachain/pallets/ethereum-client/src/benchmarking/util.rs delete mode 100644 snowbridge/parachain/pallets/ethereum-client/src/config/mainnet.rs delete mode 100644 snowbridge/parachain/pallets/ethereum-client/src/config/minimal.rs delete mode 100644 snowbridge/parachain/pallets/ethereum-client/src/config/mod.rs delete mode 100644 snowbridge/parachain/pallets/ethereum-client/src/functions.rs delete mode 100644 snowbridge/parachain/pallets/ethereum-client/src/impls.rs delete mode 100644 snowbridge/parachain/pallets/ethereum-client/src/lib.rs delete mode 100644 snowbridge/parachain/pallets/ethereum-client/src/mock.rs delete mode 100644 snowbridge/parachain/pallets/ethereum-client/src/tests.rs delete mode 100644 snowbridge/parachain/pallets/ethereum-client/src/types.rs delete mode 100644 snowbridge/parachain/pallets/ethereum-client/src/weights.rs delete mode 100755 snowbridge/parachain/pallets/ethereum-client/tests/fixtures/execution-header-update.mainnet.json delete mode 100644 snowbridge/parachain/pallets/ethereum-client/tests/fixtures/execution-header-update.minimal.json delete mode 100755 snowbridge/parachain/pallets/ethereum-client/tests/fixtures/finalized-header-update.mainnet.json delete mode 100644 snowbridge/parachain/pallets/ethereum-client/tests/fixtures/finalized-header-update.minimal.json delete mode 100755 snowbridge/parachain/pallets/ethereum-client/tests/fixtures/initial-checkpoint.mainnet.json delete mode 100644 snowbridge/parachain/pallets/ethereum-client/tests/fixtures/initial-checkpoint.minimal.json delete mode 100755 snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-finalized-header-update.mainnet.json delete mode 100755 snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-finalized-header-update.minimal.json delete mode 100755 snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-sync-committee-update.mainnet.json delete mode 100755 snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-sync-committee-update.minimal.json delete mode 100755 snowbridge/parachain/pallets/ethereum-client/tests/fixtures/sync-committee-update.mainnet.json delete mode 100644 snowbridge/parachain/pallets/ethereum-client/tests/fixtures/sync-committee-update.minimal.json delete mode 100644 snowbridge/parachain/pallets/inbound-queue/Cargo.toml delete mode 100644 snowbridge/parachain/pallets/inbound-queue/README.md delete mode 100644 snowbridge/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs delete mode 100644 snowbridge/parachain/pallets/inbound-queue/src/benchmarking/mod.rs delete mode 100644 snowbridge/parachain/pallets/inbound-queue/src/envelope.rs delete mode 100644 snowbridge/parachain/pallets/inbound-queue/src/lib.rs delete mode 100644 snowbridge/parachain/pallets/inbound-queue/src/mock.rs delete mode 100644 snowbridge/parachain/pallets/inbound-queue/src/test.rs delete mode 100644 snowbridge/parachain/pallets/inbound-queue/src/weights.rs delete mode 100644 snowbridge/parachain/pallets/outbound-queue/Cargo.toml delete mode 100644 snowbridge/parachain/pallets/outbound-queue/README.md delete mode 100644 snowbridge/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml delete mode 100644 snowbridge/parachain/pallets/outbound-queue/merkle-tree/README.md delete mode 100644 snowbridge/parachain/pallets/outbound-queue/merkle-tree/src/lib.rs delete mode 100644 snowbridge/parachain/pallets/outbound-queue/runtime-api/Cargo.toml delete mode 100644 snowbridge/parachain/pallets/outbound-queue/runtime-api/README.md delete mode 100644 snowbridge/parachain/pallets/outbound-queue/runtime-api/src/lib.rs delete mode 100644 snowbridge/parachain/pallets/outbound-queue/src/api.rs delete mode 100644 snowbridge/parachain/pallets/outbound-queue/src/benchmarking.rs delete mode 100644 snowbridge/parachain/pallets/outbound-queue/src/lib.rs delete mode 100644 snowbridge/parachain/pallets/outbound-queue/src/mock.rs delete mode 100644 snowbridge/parachain/pallets/outbound-queue/src/process_message_impl.rs delete mode 100644 snowbridge/parachain/pallets/outbound-queue/src/send_message_impl.rs delete mode 100644 snowbridge/parachain/pallets/outbound-queue/src/test.rs delete mode 100644 snowbridge/parachain/pallets/outbound-queue/src/types.rs delete mode 100644 snowbridge/parachain/pallets/outbound-queue/src/weights.rs delete mode 100644 snowbridge/parachain/pallets/system/Cargo.toml delete mode 100644 snowbridge/parachain/pallets/system/README.md delete mode 100644 snowbridge/parachain/pallets/system/runtime-api/Cargo.toml delete mode 100644 snowbridge/parachain/pallets/system/runtime-api/README.md delete mode 100644 snowbridge/parachain/pallets/system/runtime-api/src/lib.rs delete mode 100644 snowbridge/parachain/pallets/system/src/api.rs delete mode 100644 snowbridge/parachain/pallets/system/src/benchmarking.rs delete mode 100644 snowbridge/parachain/pallets/system/src/lib.rs delete mode 100644 snowbridge/parachain/pallets/system/src/migration.rs delete mode 100644 snowbridge/parachain/pallets/system/src/mock.rs delete mode 100644 snowbridge/parachain/pallets/system/src/tests.rs delete mode 100644 snowbridge/parachain/pallets/system/src/weights.rs delete mode 100644 snowbridge/parachain/primitives/beacon/Cargo.toml delete mode 100644 snowbridge/parachain/primitives/beacon/README.md delete mode 100644 snowbridge/parachain/primitives/beacon/src/bits.rs delete mode 100644 snowbridge/parachain/primitives/beacon/src/bls.rs delete mode 100644 snowbridge/parachain/primitives/beacon/src/config.rs delete mode 100644 snowbridge/parachain/primitives/beacon/src/lib.rs delete mode 100644 snowbridge/parachain/primitives/beacon/src/merkle_proof.rs delete mode 100644 snowbridge/parachain/primitives/beacon/src/receipt.rs delete mode 100644 snowbridge/parachain/primitives/beacon/src/serde_utils.rs delete mode 100644 snowbridge/parachain/primitives/beacon/src/ssz.rs delete mode 100644 snowbridge/parachain/primitives/beacon/src/types.rs delete mode 100644 snowbridge/parachain/primitives/beacon/src/updates.rs delete mode 100644 snowbridge/parachain/primitives/core/Cargo.toml delete mode 100644 snowbridge/parachain/primitives/core/README.md delete mode 100644 snowbridge/parachain/primitives/core/src/inbound.rs delete mode 100644 snowbridge/parachain/primitives/core/src/lib.rs delete mode 100644 snowbridge/parachain/primitives/core/src/operating_mode.rs delete mode 100644 snowbridge/parachain/primitives/core/src/outbound.rs delete mode 100644 snowbridge/parachain/primitives/core/src/pricing.rs delete mode 100644 snowbridge/parachain/primitives/core/src/ringbuffer.rs delete mode 100644 snowbridge/parachain/primitives/core/src/tests.rs delete mode 100644 snowbridge/parachain/primitives/core/tests/fixtures/packet.scale delete mode 100644 snowbridge/parachain/primitives/core/tests/mod.rs delete mode 100644 snowbridge/parachain/primitives/ethereum/.cargo/config.toml delete mode 100644 snowbridge/parachain/primitives/ethereum/Cargo.toml delete mode 100644 snowbridge/parachain/primitives/ethereum/README.md delete mode 100644 snowbridge/parachain/primitives/ethereum/src/header.rs delete mode 100644 snowbridge/parachain/primitives/ethereum/src/lib.rs delete mode 100644 snowbridge/parachain/primitives/ethereum/src/log.rs delete mode 100644 snowbridge/parachain/primitives/ethereum/src/mpt.rs delete mode 100644 snowbridge/parachain/primitives/ethereum/src/receipt.rs delete mode 100644 snowbridge/parachain/primitives/router/Cargo.toml delete mode 100644 snowbridge/parachain/primitives/router/README.md delete mode 100644 snowbridge/parachain/primitives/router/src/inbound/mod.rs delete mode 100644 snowbridge/parachain/primitives/router/src/inbound/tests.rs delete mode 100644 snowbridge/parachain/primitives/router/src/lib.rs delete mode 100644 snowbridge/parachain/primitives/router/src/outbound/mod.rs delete mode 100644 snowbridge/parachain/primitives/router/src/outbound/tests.rs delete mode 100644 snowbridge/parachain/runtime/runtime-common/Cargo.toml delete mode 100644 snowbridge/parachain/runtime/runtime-common/README.md delete mode 100644 snowbridge/parachain/runtime/runtime-common/src/lib.rs delete mode 100644 snowbridge/parachain/runtime/test-common/Cargo.toml delete mode 100644 snowbridge/parachain/runtime/test-common/README.md delete mode 100644 snowbridge/parachain/runtime/test-common/src/lib.rs delete mode 100755 snowbridge/parachain/scripts/benchmark.sh delete mode 100755 snowbridge/parachain/scripts/hexliteral.sh delete mode 100755 snowbridge/parachain/scripts/init.sh delete mode 100755 snowbridge/parachain/scripts/make-build-config.sh delete mode 100755 snowbridge/parachain/scripts/verify-pallets-build.sh diff --git a/snowbridge/LICENSE b/snowbridge/LICENSE deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/snowbridge/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/snowbridge/README.md b/snowbridge/README.md deleted file mode 100644 index a38910da316..00000000000 --- a/snowbridge/README.md +++ /dev/null @@ -1,127 +0,0 @@ -# Snowbridge · -[![codecov](https://codecov.io/gh/Snowfork/snowbridge/branch/main/graph/badge.svg?token=9hvgSws4rN)] -(https://codecov.io/gh/Snowfork/snowbridge) -![GitHub](https://img.shields.io/github/license/Snowfork/snowbridge) - -Snowbridge is a trustless bridge between Polkadot and Ethereum. For documentation, visit https://docs.snowbridge.network. - -## Components - -### Parachain - -Polkadot parachain and our pallets. See [parachain/README.md](https://github.com/Snowfork/snowbridge/blob/main/parachain/README.md). - -### Contracts - -Ethereum contracts and unit tests. See [contracts/README.md](https://github.com/Snowfork/snowbridge/blob/main/contracts/README.md) - -### Relayer - -Off-chain relayer services for relaying messages between Polkadot and Ethereum. See -[relayer/README.md](https://github.com/Snowfork/snowbridge/blob/main/relayer/README.md) - -### Local Testnet - -Scripts to provision a local testnet, running the above services to bridge between local deployments of Polkadot and -Ethereum. See [web/packages/test/README.md](https://github.com/Snowfork/snowbridge/blob/main/web/packages/test/README.md). - -### Smoke Tests - -Integration tests for our local testnet. See [smoketest/README.md](https://github.com/Snowfork/snowbridge/blob/main/smoketest/README.md). - -## Development - -We use the Nix package manager to provide a reproducible and maintainable developer environment. - -After [installing nix](https://nixos.org/download.html) Nix, enable [flakes](https://nixos.wiki/wiki/Flakes): - -```sh -mkdir -p ~/.config/nix -echo 'experimental-features = nix-command flakes' >> ~/.config/nix/nix.conf -``` - -Then activate a developer shell in the root of our repo, where -[`flake.nix`](https://github.com/Snowfork/snowbridge/blob/main/flake.nix) is located: - -```sh -nix develop -``` - -Also make sure to run this initialization script once: -```sh -scripts/init.sh -``` - -### Support for code editors - -To ensure your code editor (such as VS Code) can execute tools in the nix shell, startup your editor within the -interactive shell. - -Example for VS Code: - -```sh -nix develop -code . -``` - -### Custom shells - -The developer shell is bash by default. To preserve your existing shell: - -```sh -nix develop --command $SHELL -``` - -### Automatic developer shells - -To automatically enter the developer shell whenever you open the project, install -[`direnv`](https://direnv.net/docs/installation.html) and use the template `.envrc`: - -```sh -cp .envrc.example .envrc -direnv allow -``` - -### Upgrading the Rust toolchain - -Sometimes we would like to upgrade rust toolchain. First update `parachain/rust-toolchain.toml` as required and then -update `flake.lock` running -```sh -nix flake lock --update-input rust-overlay -``` - -## Troubleshooting - -Check the contents of all `.envrc` files. - -Remove untracked files: -```sh -git clean -idx -``` - -Ensure that the current Rust toolchain is the one selected in `scripts/init.sh`. - -Ensure submodules are up-to-date: -```sh -git submodule update -``` - -Check untracked files & directories: -```sh -git clean -ndx | awk '{print $3}' -``` -After removing `node_modules` directories (eg. with `git clean above`), clear the pnpm cache: -```sh -pnpm store prune -``` - -Check Nix config in `~/.config/nix/nix.conf`. - -Run a pure developer shell (note that this removes access to your local tools): -```sh -nix develop -i --pure-eval -``` - -## Security - -The security policy and procedures can be found in SECURITY.md. diff --git a/snowbridge/parachain/LICENSE b/snowbridge/parachain/LICENSE deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/snowbridge/parachain/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/snowbridge/parachain/README.md b/snowbridge/parachain/README.md deleted file mode 100644 index a38910da316..00000000000 --- a/snowbridge/parachain/README.md +++ /dev/null @@ -1,127 +0,0 @@ -# Snowbridge · -[![codecov](https://codecov.io/gh/Snowfork/snowbridge/branch/main/graph/badge.svg?token=9hvgSws4rN)] -(https://codecov.io/gh/Snowfork/snowbridge) -![GitHub](https://img.shields.io/github/license/Snowfork/snowbridge) - -Snowbridge is a trustless bridge between Polkadot and Ethereum. For documentation, visit https://docs.snowbridge.network. - -## Components - -### Parachain - -Polkadot parachain and our pallets. See [parachain/README.md](https://github.com/Snowfork/snowbridge/blob/main/parachain/README.md). - -### Contracts - -Ethereum contracts and unit tests. See [contracts/README.md](https://github.com/Snowfork/snowbridge/blob/main/contracts/README.md) - -### Relayer - -Off-chain relayer services for relaying messages between Polkadot and Ethereum. See -[relayer/README.md](https://github.com/Snowfork/snowbridge/blob/main/relayer/README.md) - -### Local Testnet - -Scripts to provision a local testnet, running the above services to bridge between local deployments of Polkadot and -Ethereum. See [web/packages/test/README.md](https://github.com/Snowfork/snowbridge/blob/main/web/packages/test/README.md). - -### Smoke Tests - -Integration tests for our local testnet. See [smoketest/README.md](https://github.com/Snowfork/snowbridge/blob/main/smoketest/README.md). - -## Development - -We use the Nix package manager to provide a reproducible and maintainable developer environment. - -After [installing nix](https://nixos.org/download.html) Nix, enable [flakes](https://nixos.wiki/wiki/Flakes): - -```sh -mkdir -p ~/.config/nix -echo 'experimental-features = nix-command flakes' >> ~/.config/nix/nix.conf -``` - -Then activate a developer shell in the root of our repo, where -[`flake.nix`](https://github.com/Snowfork/snowbridge/blob/main/flake.nix) is located: - -```sh -nix develop -``` - -Also make sure to run this initialization script once: -```sh -scripts/init.sh -``` - -### Support for code editors - -To ensure your code editor (such as VS Code) can execute tools in the nix shell, startup your editor within the -interactive shell. - -Example for VS Code: - -```sh -nix develop -code . -``` - -### Custom shells - -The developer shell is bash by default. To preserve your existing shell: - -```sh -nix develop --command $SHELL -``` - -### Automatic developer shells - -To automatically enter the developer shell whenever you open the project, install -[`direnv`](https://direnv.net/docs/installation.html) and use the template `.envrc`: - -```sh -cp .envrc.example .envrc -direnv allow -``` - -### Upgrading the Rust toolchain - -Sometimes we would like to upgrade rust toolchain. First update `parachain/rust-toolchain.toml` as required and then -update `flake.lock` running -```sh -nix flake lock --update-input rust-overlay -``` - -## Troubleshooting - -Check the contents of all `.envrc` files. - -Remove untracked files: -```sh -git clean -idx -``` - -Ensure that the current Rust toolchain is the one selected in `scripts/init.sh`. - -Ensure submodules are up-to-date: -```sh -git submodule update -``` - -Check untracked files & directories: -```sh -git clean -ndx | awk '{print $3}' -``` -After removing `node_modules` directories (eg. with `git clean above`), clear the pnpm cache: -```sh -pnpm store prune -``` - -Check Nix config in `~/.config/nix/nix.conf`. - -Run a pure developer shell (note that this removes access to your local tools): -```sh -nix develop -i --pure-eval -``` - -## Security - -The security policy and procedures can be found in SECURITY.md. diff --git a/snowbridge/parachain/pallets/ethereum-client/Cargo.toml b/snowbridge/parachain/pallets/ethereum-client/Cargo.toml deleted file mode 100644 index 59efcf91fd0..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/Cargo.toml +++ /dev/null @@ -1,99 +0,0 @@ -[package] -name = "snowbridge-pallet-ethereum-client" -description = "Snowbridge Ethereum Client Pallet" -version = "0.9.0" -authors = ["Snowfork "] -edition.workspace = true -repository.workspace = true -license = "Apache-2.0" -categories = ["cryptography::cryptocurrencies"] - -[lints] -workspace = true - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0.195", optional = true } -serde_json = { version = "1.0.111", 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"] } -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.2", default-features = false } -hex-literal = { version = "0.4.1", optional = true } -log = { version = "0.4.20", default-features = false } - -frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking", default-features = false, optional = true } -frame-support = { path = "../../../../../substrate/frame/support", default-features = false } -frame-system = { path = "../../../../../substrate/frame/system", default-features = false } -sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } -sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } -sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } -sp-io = { path = "../../../../../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", default-features = false } -bp-runtime = { path = "../../../../../bridges/primitives/runtime", default-features = false } -pallet-timestamp = { path = "../../../../../substrate/frame/timestamp", default-features = false, optional = true } - -[dev-dependencies] -rand = "0.8.5" -sp-keyring = { path = "../../../../../substrate/primitives/keyring" } -serde_json = "1.0.111" -hex-literal = "0.4.1" -pallet-timestamp = { path = "../../../../../substrate/frame/timestamp" } -sp-io = { path = "../../../../../substrate/primitives/io" } -serde = "1.0.195" - -[features] -default = ["std"] -fuzzing = [ - "hex-literal", - "pallet-timestamp", - "serde", - "serde_json", - "sp-io", -] -std = [ - "bp-runtime/std", - "byte-slice-cast/std", - "codec/std", - "frame-support/std", - "frame-system/std", - "log/std", - "pallet-timestamp/std", - "primitives/std", - "rlp/std", - "scale-info/std", - "serde", - "snowbridge-core/std", - "snowbridge-ethereum/std", - "sp-core/std", - "sp-io/std", - "sp-runtime/std", - "sp-std/std", - "ssz_rs/std", - 'frame-benchmarking/std', -] -runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "hex-literal", - "pallet-timestamp?/runtime-benchmarks", - "snowbridge-core/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", -] -try-runtime = [ - "frame-support/try-runtime", - "frame-system/try-runtime", - "pallet-timestamp?/try-runtime", - "sp-runtime/try-runtime", -] -beacon-spec-minimal = [] -fast-runtime = ["beacon-spec-minimal"] diff --git a/snowbridge/parachain/pallets/ethereum-client/README.md b/snowbridge/parachain/pallets/ethereum-client/README.md deleted file mode 100644 index 0cd3b9f8558..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Ethereum Beacon Client - -The Ethereum Beacon Client is an on-chain light client that tracks Ethereum consensus using the beacon chain. diff --git a/snowbridge/parachain/pallets/ethereum-client/benchmark.md b/snowbridge/parachain/pallets/ethereum-client/benchmark.md deleted file mode 100644 index 2e19fece7cb..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/benchmark.md +++ /dev/null @@ -1,88 +0,0 @@ -# Motivation -Demonstrate that -[FastAggregateVerify](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04#section-3.3.4) is the most -expensive call in ethereum beacon light client, though in [#13031](https://github.com/paritytech/substrate/pull/13031) -Parity team has wrapped some low level host functions for `bls-12381` but adding a high level host function specific -for it is super helpful. - -# Benchmark -We add several benchmarks -[here](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-client/src/benchmarking/mod.rs#L98-L124) -as following to demonstrate -[bls_fast_aggregate_verify](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-client/src/lib.rs#L764) -is the main bottleneck. Test data -[here](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-client/src/benchmarking/data_mainnet.rs#L553-L1120) -is real from goerli network which contains 512 public keys from sync committee. - -## sync_committee_period_update -Base line benchmark for extrinsic [sync_committee_period_update](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-client/src/lib.rs#L233) - -## bls_fast_aggregate_verify -Subfunction of extrinsic `sync_committee_period_update` which does what -[FastAggregateVerify](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04#section-3.3.4) requires. - -## bls_aggregate_pubkey -Subfunction of `bls_fast_aggregate_verify` which decompress and instantiate G1 pubkeys only. - -## bls_verify_message -Subfunction of `bls_fast_aggregate_verify` which verify the prepared signature only. - - -# Result - -## hardware spec -Run benchmark in a EC2 instance -``` -cargo run --release --bin polkadot-parachain --features runtime-benchmarks -- benchmark machine --base-path /mnt/scratch/benchmark - -+----------+----------------+-------------+-------------+-------------------+ -| Category | Function | Score | Minimum | Result | -+===========================================================================+ -| CPU | BLAKE2-256 | 1.08 GiBs | 1.00 GiBs | ✅ Pass (107.5 %) | -|----------+----------------+-------------+-------------+-------------------| -| CPU | SR25519-Verify | 568.87 KiBs | 666.00 KiBs | ❌ Fail ( 85.4 %) | -|----------+----------------+-------------+-------------+-------------------| -| Memory | Copy | 13.67 GiBs | 14.32 GiBs | ✅ Pass ( 95.4 %) | -|----------+----------------+-------------+-------------+-------------------| -| Disk | Seq Write | 334.35 MiBs | 450.00 MiBs | ❌ Fail ( 74.3 %) | -|----------+----------------+-------------+-------------+-------------------| -| Disk | Rnd Write | 143.59 MiBs | 200.00 MiBs | ❌ Fail ( 71.8 %) | -+----------+----------------+-------------+-------------+-------------------+ -``` - -## benchmark - -``` -cargo run --release --bin polkadot-parachain \ ---features runtime-benchmarks \ --- \ -benchmark pallet \ ---base-path /mnt/scratch/benchmark \ ---chain=bridge-hub-rococo-dev \ ---pallet=snowbridge_pallet_ethereum_client \ ---extrinsic="*" \ ---execution=wasm --wasm-execution=compiled \ ---steps 50 --repeat 20 \ ---output ./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs -``` - -### [Weights](https://github.com/Snowfork/cumulus/blob/ron/benchmark-beacon-bridge/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs) - -|extrinsic | minimum execution time benchmarked(us) | -| --------------------------------------- |----------------------------------------| -|sync_committee_period_update | 123_126 | -|bls_fast_aggregate_verify| 121_083 | -|bls_aggregate_pubkey | 90_306 | -|bls_verify_message | 28_000 | - -- [bls_fast_aggregate_verify](#bls_fast_aggregate_verify) consumes 98% execution time of [sync_committee_period_update](#sync_committee_period_update) - -- [bls_aggregate_pubkey](#bls_aggregate_pubkey) consumes 75% execution time of [bls_fast_aggregate_verify](#bls_fast_aggregate_verify) - -- [bls_verify_message](#bls_verify_message) consumes 23% execution time of [bls_fast_aggregate_verify](#bls_fast_aggregate_verify) - -# Conclusion - -A high level host function specific for -[bls_fast_aggregate_verify](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-client/src/lib.rs#L764) -is super helpful. diff --git a/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/fixtures_mainnet.rs b/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/fixtures_mainnet.rs deleted file mode 100644 index 4b88d887091..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/fixtures_mainnet.rs +++ /dev/null @@ -1,1215 +0,0 @@ -// Generated, do not edit! -// See README.md for instructions to generate -use crate::{CheckpointUpdate, ExecutionHeaderUpdate, Update}; -use hex_literal::hex; -use primitives::{ - updates::AncestryProof, BeaconHeader, ExecutionPayloadHeader, NextSyncCommitteeUpdate, - SyncAggregate, SyncCommittee, -}; -use sp_core::U256; -use sp_std::{boxed::Box, vec}; - -pub fn make_checkpoint() -> Box { - Box::new(CheckpointUpdate { - header: BeaconHeader { - slot: 4058624, - proposer_index: 631, - parent_root: hex!("4abadda13b61df8d40fcb061d1ec15d0fb7bc5144252bb54c57b41893b642bf3").into(), - state_root: hex!("6fe9fa01a04dcdeaa64eba04a72fa6dbadc8596dc5ec1fff2ef343520fe722e1").into(), - body_root: hex!("6cd83df0ee7669e06e64496a1d2be083bc3bb9f2da17e9b1e62979d200328106").into(), - }, - current_sync_committee: SyncCommittee { - pubkeys: [ - hex!("a13bf1fc1826b61cceefcc941c5a4865cefdfa6c91e5223308fa6a0aa6e7b13a0499a63edf5d9fff48fdeae83e38dcbf").into(), - hex!("b3285148b91dab139b053442bdd14d627ba1e1250fe469f0f2df854b6e6ff4a18671ae3879ec9f7d8091f99f092162e9").into(), - hex!("b00d95908e72c6051478a422eb2231b5f797c2fa5c696ed1e6b9c9996ba1d8236f512443f18c01ce63312c38fa383fd4").into(), - hex!("a866633b4293e726accf6e97ac90c1898cac83e8531a25b50ae99f0ecb477a692e6a5f2488447ccd83ed869ab5abc406").into(), - hex!("a308ed8737b3a9346ff20dc9f112efccc193472e6fde6aa218ceae11e288bbd2c35fa45c1d8bb238696a96767cd68b46").into(), - hex!("81534e2a182da0c6831479c7e722953d267ba9c63a204ac96a178b1dc90d0a6ba8737002688ba5f102eda5669249f114").into(), - hex!("87c5670e16a84e27529677881dbedc5c1d6ebb4e4ff58c13ece43d21d5b42dc89470f41059bfa6ebcf18167f97ddacaa").into(), - hex!("b37334c41a3456b73b61d0eb0777260af9c2e400bbec0e0c0fdb45c39ce0dd19f021d9760f35da801f20486c6be30e9e").into(), - hex!("ab73a043ccdfe63437a339e6ee96ef1241264e04dd4d917f6d6bc99396006de54e1e156d38596ba3d15cb1aaa329f8f5").into(), - hex!("8983fdebbeba6e3cc3ee1c9feb24faaeee712356975e359b0ddca3f7c9c7448132d665f54a4629002252d3fcf375f7b0").into(), - hex!("a03c1e287ccc4d457f5e71e9dc769294835945561e6f236ac7de210d2e614eee8a85e21dfb46e2143c68de22ccee8660").into(), - hex!("8e6b888197010ebadd216da35b9716daa8675d93b3c33a96a19fd9ca42624f6b430b2ff115cd0f5b717341605dda24bf").into(), - hex!("8fb51e3ef3c1047ae7c527dc24dc8824b2655faff2c4c78da1fcedde48b531d19abaf517363bf30605a87336b8642073").into(), - hex!("893272a63650b08e5b8f9b3f17f8547b456192ad649c168bafd7166b4c08c5adf795c508b88fd2425f7be8334592afb2").into(), - hex!("a90c42266ca0a65976fb4dc18465b0a44a63ed3b2747cae74e46e3ccf158f98384e2e86c852e7c5556b083b3ded9d243").into(), - hex!("b67c621d9b6313a9f6744dfcdd77d4e9cb4bd413fb5e3199cdcd7f675fc39f1ba492860749bfddf98f4088756e844a98").into(), - hex!("a9760afaa51002be0948acf7aebd90ec4e60e0dba8456e445aea93408a0468b62bb6da4984b92f8f6061561c9d56f4c4").into(), - hex!("981b2d7c56ff38f1d02c5d7a7f8bfe71daaf94d48c3bc93e8083a0a23c1ae1ff05f90312deb09b35d4513c1ffa573d86").into(), - hex!("9515dedf061e654d58a43e4e525a63ad2a6274ea6f20b1d624a6ba7d3062ed68a0226eee6951ab8464906c52ba5556b0").into(), - hex!("901f724ee1891ca876e5551bd8f4ad4da422576c618465f63d65700c2dd7953496d83abe148c6a4875a46a5a36c218cf").into(), - hex!("a8d152e5d94b75cb9e249230db21af31de4d4f3d4ef60ccbf2212babf69aed2a38435a993ee2f13cca410ad55a4875ab").into(), - hex!("875ebfe737cea438e967d70ceaffb4360cce28ecc76c8c4ee612c47fb6b3e89af03c66981571066107323f49a6242772").into(), - hex!("a798a0371e8cc4dc42ccd79934b0db5a3a59f18a0ae09f2eb172596428fcb3f00312e783d6fd21cbc1610317f44e08cb").into(), - hex!("99c629c9cd603a9344b04d22d2bcc06cf45ebf62d97f968df19c73c7a50f4f6a2a2cc7fb633f509f961edfb94fbab94e").into(), - hex!("854410e6fb856da8b997ebf28ae2415ce6e1f9f6a4579fad15b5df61709c924a925397b33fe67c89ffad6143a39d756a").into(), - hex!("a3969926aa2e52f1a48ac53074b764648b4c71bd43430944679628463cd68398f700d874c14503b53756be451c8ba284").into(), - hex!("8ee8873de7cd28a54ba2c63a80b63399effed76b154e96ed26e7c0668b9f2476e298688b6a00c4b2ab9d020a897695d7").into(), - hex!("ad54241ba3de6a4426c788690d3f78d2eb678814edc49d3fb988d7fc752e43512972567bb384bcc1b18d083d15e376da").into(), - hex!("942bee9ee880ac5e2f8ba35518b60890a211974d273b2ae415d34ce842803de7d29a4d26f6ee79c09e910559bdcac6d3").into(), - hex!("96b478b1e5e49d4ea3fd97c4846ae0f781dcc9f9ff61ee022ca92c3d8dfba89c513c46e8bb38b73e6b678a79b9b12177").into(), - hex!("aad9577501d7f3a5dbac329f2c1fe711710869cc825740f365488fc55a278d687bb72423560f7cb2cbd60546a82ea1e6").into(), - hex!("8aa3d9dad1c122b9aed75e3cc94b3a9dab160fa4cad92ebab68a58c0151a5d93f0f6b40b86fba00e63d45bd29a93b982").into(), - hex!("a12fc78b8d3334a3eb7b535cd5e648bb030df645cda4e90272a1fc3b368ee43975051bbecc3275d6b1e4600cc07239b0").into(), - hex!("ab01a7b13c967620d98de736b8ff23d856daa26d5cd8576993ee02a5d694332c0464ed018ebffcd5c71bab5cada850ce").into(), - hex!("96cf5760c79cfc830d1d5bd6df6cfd67596bef24e22eed52cee04c290ad418add74e77965ea5748b7f0fb34ee4f43232").into(), - hex!("9443e6ba4400fb3370c573cd7e33f05e1475f9cf1d6adb905bee3aff8f1452d8d384c8a72c9110070f35c6aad940bba6").into(), - hex!("95c60b5561e53cfc26d620be90f84199ffd6dd9687c1be3a547048e7cba10a0be9bb6da000e7521cbd488d0901d48ee9").into(), - hex!("ab69cf79750436d310dc3c5e96c2b97003f4394f31dfa8a9ac420595dc7b4d96dad5787d93347ba2bc6f196c241a3dbf").into(), - hex!("9145ee1fb6e84114c903819db94fa5a72bcbc15fcb8a7fd8eefba23b156cc46309281dcf78b48a2847b3754f7d7d7a79").into(), - hex!("b118f77f99ac947df97e7682f0fb446175185b842380af4ee7394531e4f93002c72b41a57a7c1b923a4f24b10924c84f").into(), - hex!("a4aabd1890ebf35423565dbff3477a09eea4e35f5a26ed449eab38e0a21fb89e9ddfe3a2003cddc457db648a1b5891a3").into(), - hex!("8ff5d2e6c98b1fea70cb36ea8ed497fd1233b9418948ac58c6c379ed35fb10f8253ef188c909d5e77e81b5b8e2a4ad17").into(), - hex!("a23f076306c120dccf69d7d2ac7f83a377a72d35bf448f88feff8b6dba9307fdabf34452e30b87407b2258b9edfd1174").into(), - hex!("87d2217eb05d657aba7b048cf3c661b463e78e51135a5b937e71975ff5102e596434720f02349c73415decb88418cb0d").into(), - hex!("8bb51b380a8a52d61a94e7b382ff6ce601260fa9b8c5d616764a3df719b382ec43aec9266444a16951e102d8b1fb2f38").into(), - hex!("b0053550040ab3a3996cba5caf9ad5718867b5f5df273ed8c6520761571f03a94e50b5f8a6a8c42d725383cce97d3cae").into(), - hex!("ae50f93230983a82e732903d6ed50a506d678f35b6b4a4b3686a92b12aeb9d34cb095e8562b0900125bbced0359b37de").into(), - hex!("8bfa106ada4914419bf1d8900c5981dd5b90c3023196d7e918d62879fc3a575bd0a25f939366f7fd2240df6108b069ec").into(), - hex!("b3a5497365bd40a81202b8a94a5e28a8a039cc2e639d73de289294cbda2c0e987c1f9468daba09ea4390f8e4e806f3c8").into(), - hex!("b4f583e10aa9af79b4ebd647e0fffe1c720112727e5ffac4313f236737491fceeee194537786c561cd5777b453e5b03c").into(), - hex!("826be957cf66db958028fa95655b54b2337f78fb6ef26bd29e2e3a64b130b90521333f31d132c04779e4b23a6b6cd951").into(), - hex!("aace45334070c51cc8b3579598d4cd8cda2153bba51f56e3b1fe5e135c83ef70503c322756b9cad9d3cd28f1ecfc8227").into(), - hex!("94bb68c8180496472262455fd6ab338697810825fa4e82fc673f3ac2dacfd29ee539ac0bfe97eb39d4ef118db875bab6").into(), - hex!("b560c33950a355119845f63defb355807e56773f636fb836f7746155fad070e384fc1091b8e5c057e4cbc7da9275ecf7").into(), - hex!("820cc2ac3eed5bce7dc72df2aa3214e71690b91445d8bb1634c0488a671e3669028efbe1eae52f7132bde29b16a020b7").into(), - hex!("9244703338879e3ea00663dcde8f11095de3e38df9277d8c2acc26e72021c222ae40bcc91228789fdf0b69acc3144783").into(), - hex!("8d474636a638e7b398566a39b3f939a314f1cf88e64d81db0f556ca60951ec1dca1b93e3906a6654ed9ba06f2c31d4ea").into(), - hex!("889a5cf9315383bf64dfe88e562d772213c256b0eed15ce27c41c3767c048afe06410d7675e5d59a2302993e7dc45d83").into(), - hex!("b544c692b046aad8b6f5c2e3493bc8f638659795f06327fff1e9f4ffc8e9f7abdbf4b7f6fcdfb8fe19654d8fa7d68170").into(), - hex!("aefc682f8784b18d36202a069269be7dba8ab67ae3543838e6d473fbc5713d103abcc8da1729a288503b786baac182d3").into(), - hex!("a0f2092ac34d2363614fb2f57fc7b72db247eb1fa53f395881ce6b4aacd6fb920d6dc59507701d487288102e4c4fa389").into(), - hex!("b33de3de106be61481ccb7f07a7a63cf4d1674010e462388fb8ab5ea08f444ed7a277905207e0b3aa2f00bb9efca984f").into(), - hex!("84173aeaf3d96368dc7ca1ad5e5575da279113567e5815a364a0356a720c5e08cb58ca1fdd891924f4871d3eaae5de40").into(), - hex!("b6d6482ad7b9b412ffbefbbdcc28eb3d091b1291f54f77bdd53c4ac85f705c454940f466dc272dde7b03c26f0cd6ecb3").into(), - hex!("a2053719da2b7501dab42011ae144b3c8d72bd17493181bf3ae79a678068dc3ee2f19d29a60b5a323692c3f684f96392").into(), - hex!("8296f8caf58316af535def398a43357e48cb3b1e674b857eba1bd1b970da3dd045e22fe6d17dee4e9117f62ece3ec31c").into(), - hex!("84faf4d90edaa6cc837e5e04dc67761084ae24e410345f21923327c9cb5494ffa51b504c89bee168c11250edbdcbe194").into(), - hex!("879aea8f09dec92f354e31aa479d00cb77457d363de2d9a51ddf7d734061b6f83d6345cf33dbef22004cd23dd6c4b760").into(), - hex!("b8fca0f7bc276f03c526d42df9f88c19b8dc630ad1299689e2d52cd4717bbe5425479b13bdf6e6337c48832e4cd34bb5").into(), - hex!("b2a01dc47dd98f089f28eee67ba2f789153516b7d3b47127f430f542869ec42dd8fd4dc83cfbe625c5c40a2d2d0633ea").into(), - hex!("a19f2ce14e09ece5972fe5af1c1778b86d2ab6e825eccdb0ac368bb246cfe53433327abfe0c6fa00e0553863d0a8128e").into(), - hex!("95d1f944b0c53eb3e9fcd5632713602bbb9195b87a172a370ae2df98504612a55f3968615a39b569ce6a0fe9fb559be7").into(), - hex!("ae36ab11be96f8c8fcfd75382bb7f4727511596bc08c25814d22f2b894952489d08396b458f7884d6b3c0adb69856a6d").into(), - hex!("824d0dc002e158adef06fc38d79b01553be5a3903566029cf0beddb2248b11da40e66feb168e8e3e2a63ea033a75f382").into(), - hex!("8f9f85ae6377414fcf8297ed45a736210cd3803f54f33116b0f290b853dc61e99ea08f3c422ed9bc6bdc2f42ab4f56ba").into(), - hex!("86c53fc078846c3d9bc47682506f8285ba4551475921fd388b96291741970c34b8de4210202e40d2de4acb6e2892072b").into(), - hex!("853184f246d098139230962e511585368b44d46a115c5f06ccaeef746773951bead595fb6246c69975496bac61b42a4f").into(), - hex!("b91b4260e2884bae9778fe29a2c1e4525e4663ec004159def5d47320de304c96d2a33ad7a670e05acf90cbba3efdd4d9").into(), - hex!("83492e27e07e35c0836aee6bee95d040b8d3e82db6f94a3917d07797800f7200f5dbc6c9596c6c3c70f8f470b65a9b6e").into(), - hex!("b1bb33607d10ea8c954064ecb00c1f02b446355ef73763a122f43b9ea42cd5650b54c5c9d1cfa81d4a421d17a0a451aa").into(), - hex!("99cb1728157a1b7cdd9607cf15911bbcb56b64d52fb0d0117b457853a81ec55913f977850f26e188fa2652579efe9ddf").into(), - hex!("8b7cb5b8de09a6dfceddcbaa498bc65f86297bcf95d107880c08854ed2289441a67721340285cfe1749c62e8ef0f3c58").into(), - hex!("b97447233c8b97a8654749a840f12dab6764209c3a033154e045c76e0c8ed93b89788aac5cd1e24ed4a18c36de3fbf60").into(), - hex!("b4790910e2cbef848448f24f63e9dd4a1b122cf65feecf152d5fde282ad6fcc6ea3f9cc23178baf85612020795e4b13a").into(), - hex!("81fc724846b5781f3736795c32b217458bb29972af36cc4483dd98ab91680d3d9bc18842db2661487d3a85430dc9e326").into(), - hex!("a154892ff23b284040e623bba940a6a1ef1207b8b089fc699cb152b00bcce220464502cfa1dfb5a2f62e6f3960cdf349").into(), - hex!("af3f765fd293c253072b33a780ed68933f78d7e079d9a2079b6232755bedf6ebcbce9ba65c01f695602fa8ee17899867").into(), - hex!("97578474be98726192cb0eac3cb9195a54c7315e9c619d5c44c56b3f98671636c383416f73605d4ea7ca9fbeff8dd699").into(), - hex!("917c4fd52538d34c26ccdd816e54ebea09517712aa74cec68a2e3d759c6a69b5ccb4089ad1e0b988e916b2ce9f5c8918").into(), - hex!("8cf3c29531a17489a5f8232d56c5251ffddc95be3ff7ff61472e19fb38c5eaec841ef3b1ee36756b3dd8ff71ae199982").into(), - hex!("96d4b9b411319e531bab6af55c13f0adb1dd6b4286784ff807f283e7990dc368c16d536fc5db3d992deb4b0278914e6f").into(), - hex!("8903f7e0c9764ce844b15d84feea04406dc66b195a5f82ff4027f27361e11cf368538137d139368f5a6f42876b04f056").into(), - hex!("a4047173b5906c9b4292aaee1e91d9080ae74b1d3eb990449ed1f96bf22c3ee80f4915361e5bf7dccce24ae1618dae77").into(), - hex!("a4c4b96071e7bc92e41defba3507ddf423d93f3a94271b1f9812dfc4660e4c9fd24e0dd7aef324c46deb8d7a7c97eaa4").into(), - hex!("8289b65d6245fde8a768ce48d7c4cc7d861880ff5ff1b110db6b7e1ffbfdc5eadff0b172ba79fd426458811f2b7095eb").into(), - hex!("ab4119eef94133198adb684b81f5e90070d3ca8f578c4c6c3d07de592a9af4e9fa18314db825f4c31cea1e2c7c62ed87").into(), - hex!("a3ffc3dad920d41ec3f4c39743ef571bcabb4430465d9aa811d0f0a7daa12bee4ed256527d16a6e937bf709ebb560ebd").into(), - hex!("8553748da4e0b695967e843277d0f6efeb8ba24b44aa9fa3230f4b731caec6ed5e87d3a2fcd31d8ee206e2e4414d6cf4").into(), - hex!("b15e1b4ac64bafbc4fdfead9aeff126bf102fdd125c1c914f7979680ec1715fbeccf3dc35c77d284421ec1371ed8bc32").into(), - hex!("9377aab082c8ae33b26519d6a8c3f586c7c7fccc96ec29a6f698b67d72d9266ad07378ba90d18e8c86a2ec77ecc7f137").into(), - hex!("b71c11828ecad7731136cb1f5b80392a4add8d62f8866a781fdde797a201ebf6d483b2348aacbea2061a5108933b757d").into(), - hex!("86793899ef71740ab2ec221d0085701f7909251b1cf59a276c8d629492f9ef15fc0b471beedc446a25b777391ab00718").into(), - hex!("8100b48ac2785477a123a7967bfcea8bacef59391680a411692880098a08771ff9786bd3b8dfb034cae00d5a7665621c").into(), - hex!("8b027c14affe47f83ee59b504d83b2fd2d9303de2c03ee59d169bb199d9f4bd6533d7f8c812dd7a6f1e8155e3e185689").into(), - hex!("9615800f8c95f95bf25055ae079b964e0a64fa0176cc98da272662014f57e7cd2745929daf838df0094b9f54be18b415").into(), - hex!("951aa38464912a29df2101c60771d6de7fadb63f2db3f13527f8bdacb66e9e8a97aaac7b81b19e3d1025b54e2c8facff").into(), - hex!("a0e68d24f784fcb2b71acc2d5871285623c829d0e939146b145e04908b904468a67c07a2f156e6b17bf531adc5777c4b").into(), - hex!("86a533b02ae929f67c301649a2d58651b98cdffe731b63fa32aa1013c271634bbb088c0d02865913c11bbb1bf57c0e12").into(), - hex!("81f145ebb9a5674a5b052d0e9059acc8f8ab612dd9f54d43ff620202606e19a86a9b284dc6480d555a030e5fefee8c50").into(), - hex!("a698b04227e8593a6fed6a1f6f6d1eafe186b9e73f87e42e7997f264d97225165c3f76e929a3c562ec93ee2babe953ed").into(), - hex!("b3180ded54610b1b3a2db7db539197ced6a75e9bb381d1f4b802ca7cd450f5418522ad2bee3df1956ed63ff1ffe95dc1").into(), - hex!("86fa3d4b60e8282827115c50b1b49b29a371b52aa9c9b8f83cd5268b535859f86e1a60aade6bf4f52e234777bea30bda").into(), - hex!("97d076617cf0a64ab3d1f030cfd72a303b6b252c0a7b96157ff7fc8af5970f00d14492c46e8f6f37caafe837d0dc95c7").into(), - hex!("ac2c98a0ab3f9d041fc115d9be4a6c77bd2219bb4b851cbee0d9257a4de5791251735b5b8fad09c55d16eb0d97080eff").into(), - hex!("ace7fda25c2fb7c18710603c16a0ff0f963352d1582a42a20c9f5603c66f485df8383465c35c31e8379b4cb2ec15b4c4").into(), - hex!("a07b35ec8d6849e95cbd89645283050882209617a3bb53eae0149d78a60dbf8c1626d7af498e363025896febdba86ee7").into(), - hex!("b2fc4478830f2ae4234569346d80b59899247c609b75bd2190a896498539e1f30dca5edbad69f0224918d09f0d7eb332").into(), - hex!("84926cf2265981e5531d90d8f2da1041cb73bdb1a7e11eb8ab21dbe94fefad5bbd674f6cafbcaa597480567edf0b2029").into(), - hex!("b5f32034d0f66bcbccefe2a177a60f31132d98c0899aa1ffff5ebf807546ff3104103077b1435fa6587bfe3e67ac0266").into(), - hex!("938206740a33d82ffda3e01598216324731335d367965aa0b740486d60ba2e86a4ecd546851046a61a4b0fc88295b5cb").into(), - hex!("ad2b1ab32161e37ee553e3787f05f9281073d7ef7d0ae035daa353bc83da8ef8c76c99ad2928463c7c708f7404020476").into(), - hex!("94f4720c194e7ea4232048b0af18b8a920fde7b82869e2abcc7e14a9906530be1ef61132884bb159df019e66d83a0315").into(), - hex!("a26dd9b28564c3d95679aca03e3432ac26e287f80e870714c5946b05538b3cb43bba7b85c16bceb5430e81b7a04c1b1d").into(), - hex!("8ef0930db046c45ca5c69d565d54681d2b6d249e27092736aee582b29de3aac3fd96e1066a57cadd851b4e5334261594").into(), - hex!("92096ebf98ebac5c82345d3ef0db0f5a14af23ceea73279087426b281d6701997fe131fe65a7df7d624b4ff91d997ae8").into(), - hex!("81c850f419cf426223fc976032883d87daed6d8a505f652e363a10c7387c8946abee55cf9f71a9181b066f1cde353993").into(), - hex!("97070a33393a7c9ce99c51a7811b41d477d57086e7255f7647fd369de9d40baed63ce1ea23ad82b6412e79f364c2d9a3").into(), - hex!("a99cde5c7c85ae291c74c893e598cc0e6eb2dda2a81dbb504a638eb21dd2c41d6e5caf7baa29e3c1c32e94dca0d791f1").into(), - hex!("937ccbf8cd19b82af2755b4856cfcca3d791e33ae37e4881982ea89d3b21d205a9402d754fac63037243e699484d21f6").into(), - hex!("ad7dca7640444f1268f03b67544815d4366c6a4a2f0d25ee78f3361c63095416216fd31aa0bcce7448cdd7ba73a6344e").into(), - hex!("84991ca8ef255610ebc6aff6d66ea413a768e4d3a7764750fd02b5cd4735d41df399b36e87647fc83cf73421a39d09e9").into(), - hex!("91215fc3f7243638733fe293dab7029e0c4275550102acf5f1638773cf8f8ef2c53ffa5bdfc1b602c269a2b5ab164b7a").into(), - hex!("aa6cfb3a25f4d06c3ce1e8fd87496a74a5b951ab72557472a181a2e278c5e982d290dd4facf40bd2f4f8be62263dadb0").into(), - hex!("ac9f29ad08aaf27581fe1f12e210ad4ac6011507fe3100763a4120f9e439f3c6d191f3fb55aadf58bd865cfd4406c68e").into(), - hex!("87c6cb9ca628d4081000bc6c71425b95570291eb32ef2cf62416bd1ce3666eb2ce54accd69f79d506cefbfe6feb5a1da").into(), - hex!("93042dd42e56671155bb40d85d9d56f42caf27bd965c6a7a7948b39089dba8487d4d5fd30522dba6ba392964e3ffd590").into(), - hex!("a76adeddf2454d131c91d5e2e3a464ef5d3c40ee6a2ab95e70ef2e49e0920d24f9b09276250ed7b29851affbdbc7885a").into(), - hex!("92a488068e1b70bf01e6e417f81e1dc3bcec71d51e7eabbc53b6736e8afdb8b67d191940fe09c55783be9210e1cbd73c").into(), - hex!("8180ffffb5abe78c38f2a42a3b7f1a408a6d70d3f698d047d5f1eef3018068256110fcb9fb028c8bdccbc22c0a4c3a20").into(), - hex!("a50ab79cf3f6777a45f28d1b5cdad2c7ea718c60efeeb4c828d6307b29ef319445e6a9f98aa90f351c78b496575150c1").into(), - hex!("a4632399c1a813e41fb2055ef293466098ea7752a9d3722d019aa01620f8c5ecdc5954f176c6c0901a770cbe6990eb11").into(), - hex!("83bf5055d6332009c060fd50b8dc698d42b764b079c90a1fad8a83101f8dd1cc27acb27dc9d1c25ac8d3db4107471b4a").into(), - hex!("8c432e044af778fb5e5e5677dbd29cd52d6574a66b09b0cd6e2a5812e71c91559c3f257587bfc557b4b072a822973a60").into(), - hex!("8368a0f17c8427beb71dbf11a09a2fe8495a33f08c29c74a9a996a88aa01c0a09f9555abeb1ef1592cab99a9e05875cf").into(), - hex!("a8795e7f4c4c5d025ead0077c3aa374daaf9858f1025c0d3024d72f5d6c03355ae6ac7418bf0757fe49c220acff89f7f").into(), - hex!("a6d9f67ca319ea9de50c3fed513269b83fa067977adfd1e9d9ee07ad61b2ac1de64a39d7b6897ab55870cf982fe481dd").into(), - hex!("86b3a4ea9b1fde00cce79d5ae480353d60cb6ddce363c535bbbc3e41a4b8e39fcf2978eb430091ae1b10420d43193971").into(), - hex!("90fb5cac22a22fb8a6b619f1eacd95873be974d4d5d1f7080e523bb9b4b2644eda7340d780bd1ea8ce36407ca0410fea").into(), - hex!("b5036d4c241685bcd67156e4ab0eba42b97f639947d54b17af2c88fbcc5fc57359c7df4bc7f8df955a524fb1501a6fda").into(), - hex!("b1c56f028f31f0ff86bdf55788703b4d809becaf3e4d9d349f1b660a07d2f15e127eb72a0e2a5a2742313785a3de43a5").into(), - hex!("a3e909196f447e492200cc67000c5d7f0f585fb98e966cf9bf08257597fea8d92a90ceb054d4b5553d561330b5d0c89a").into(), - hex!("87cac423d0847ee3547f45ac5babf53bddb154814e291f368cbb62ddd4f2c6f18d77a1c39fddb482befe1a0e77d5b7fd").into(), - hex!("8605b88ce23190b1fa9d389b15e6907417239a72b97673d1479c4ccb8f4515c7921d14537775c74e738a9c3f122b1443").into(), - hex!("87587504e819bc7f0349705a05c15e8504fd6b2c25c3fd264096cdb7aaa22d8078da776215925d9d775a7f9355b6f0c0").into(), - hex!("afba279768f0f928b864645aa4e491e9c949bf3dab57efa24eeaa1a9a7d4d5a53c840019354068e64c65a2f5889b8f3c").into(), - hex!("86b1cdd26ea9a3ae04d31a0b34aa3edc9e8d038437152214d195381173e79e4ccf7f8f0ce9801086724a1c927c20e4c8").into(), - hex!("812d3ded3a3c9e58eecf13a29bb4cc13b01b2a0af322423a29bb0e4f6d9021d1d87ac4af7a2a6b88d34f44a8bc1b3c55").into(), - hex!("a988cfed9f481bc98beb5fc188ed3f6893a3ebba27c3ebace669792f6abf0997727023c3b6930a6421224f5b257b8b49").into(), - hex!("a38c974b57da968f0c4611f5d85d8014fd48594c8cd763ef2f721cfd2c738e828d41ff029e3591d7447e3125641db8ef").into(), - hex!("880b4ef2b278e1b2cccf36a3b5b7fbce94f106ed9fa2820cb9099a7a540a57e9fdeef5c0fb0a743049828fc2b8c46163").into(), - hex!("96e7d1bbd42195360267c2a324b4d9bccad3231ed8a7f070278472a90371867e2ef2c29c9979a1ec6e194893afd992df").into(), - hex!("a92beb343caf6a945990adcf84302c55d1fccdef96c34a21f2c00d3e206a9b2c6c6b412f66e5d4fafe26ef6446cde705").into(), - hex!("aa48afa77d5a81cd967b285c0035e941ca6d783493e1840d7cbc0f2829a114ace9146a8fbe31ecbd8e63e9b3c216a8c5").into(), - hex!("893a2d97ae067202c8401f626ab3938b135110105b719b94b8d54b56e9158665e96d8096effe9b15c5a40c6701b83c41").into(), - hex!("b614910b247c6ade31001b0435686c3026b425b9bff80b6c23df81c55968633349e1408a9a5a9398a7d5d6ed5d9d3835").into(), - hex!("991c660e4d476ad92aa32ef2c5b27669ab84026eeb5ca70af69bbbcd8ebc0a8fec17843423306edc78b4436629d55c25").into(), - hex!("b926a21f555c296603dc9e24e176243199a533914f48994b20abca16f19c30cfd0baf319268139fe3f83ce69afdc324d").into(), - hex!("8e70e4867d2731901d603928d72bbeb34b2e0339a4f5cf06e7a771640717421b4ea039c61dde951582a28c2ff152ff70").into(), - hex!("95aafa379cc6a2b4bdd0cad30b7f0a47839952af41f584219ec201c6c4d54610eb2c04b67b29080acb8cecc5e7543fbc").into(), - hex!("8465bd8be9bd9c2c6116d4ae44ec6618c109cb9aaee2d241e7a6ed906d398ef15a6fc18bc8b1d3398184241405954bba").into(), - hex!("b455f751232de0a48440d09983f4f4718b6169907979c9f282acf7177ab5b1f338fe1f2acd8d0bee4b4aad61d0340839").into(), - hex!("970df2314849c27daa16c6845f95b7be178c034d795b00a5b6757cc2f43c4c8d8c2e4d082bec28d58dd4de0cb5718d61").into(), - hex!("8d52413f981bc611427ad0534d25e914113d0ebcd6960aab6421608bec6648b89ae4b2ca2153c57d3cf4f1f37212aa5c").into(), - hex!("b7ac87da14b783914ab2e914fb7b536893b7a650cdc5baa1f3b4aca9da77b93a3336671335250e6467a8cd4aa8dc61e9").into(), - hex!("b37a2ec9dec3d7d9cbc911fa1e5310a47d23a841d02c8b99a923991c73fc0185d130a494748c64f2b5a4c07bcd06920e").into(), - hex!("86108b661fb2c363adcca84c114c83346413df748b959015c018452cfac14890bf585dc0a646d68727cc3cdfd2b61897").into(), - hex!("8421044f794a1bcb497de6d8705f57faaba7f70632f99982e1c66b7e7403a4fb10d9ef5fb2877b66da72fd556fd6ffb0").into(), - hex!("84d2eb008578aebd6f01254b7e46584c1524e6fd7a5a2ae5fa0ea560865ca50d52290cf2d12dd20b042f402e62181b4d").into(), - hex!("8d6bed5f6b3f47b1428f00c306df550784cd24212ebac7e6384a0b1226ab50129c0341d0a10d990bd59b229869e7665a").into(), - hex!("80e30cabe1b6b4c3454bc8632b9ba068a0bcfd20ce5b6d44c8b1e2e39cbe84792fd96c51cf45cf9855c847dc92ce9437").into(), - hex!("b7e74ab2b379ceb9e660087ee2160dafe1e36926dfab1d321a001a9c5adde6c60cd48c6da146d8adfa2bd33162eeaf1a").into(), - hex!("a2b1ea43f51460b3cb83657b4e296944658945d3ad6ae7b392e60f40829ba1da6a812d89f0380474578cbd0ab09801ac").into(), - hex!("91ead7dacf43905eb5d4b179af29f945479ed074126bad3b5a2bbc1663af5f664fe53a36684e9389ab5819e53f1344fc").into(), - hex!("927c030d5a69f0908c08f95715f7a8d1e33bed5e95fc4cfb17f7743cb0262755b1e6b56d409adcfb7351b2706c964d3b").into(), - hex!("883f38af3b2c1d50f6e7c515a5e02468d76890f6e669f7acd2df89365862fa65877095deb001b4e2868bc5b59439dbb1").into(), - hex!("a0ebae60a998907a19baa396ae5a82bfe6aa22cf71bfca4e1b4df7d297bd9367bbeb2463bda37aa852ad8fd51803e482").into(), - hex!("8ae80eeaed3fc456f8a25c2176bd09f52a2546d45d77a70f48a9e30aa29e35ff561c510ae1f64e476e4a0f330b9fdbdd").into(), - hex!("a7be457b8bc1bfde4865a35b7b1826118edba213b0f0d3cf5d877267cc1559cabe61cefb1e300142a978c29676036179").into(), - hex!("af51da717d2a45ab96fad5d9317ea867ec4c6a411af6fabd72e568230099a04c036a0f114158815b1a75da6474dc892a").into(), - hex!("b549cef11bf7c8bcf4bb11e5cdf5a289fc4bf145826e96a446fb4c729a2c839a4d8d38629cc599eda7efa05f3cf3425b").into(), - hex!("8d264fbfeeebb6c4df37ff02224e75e245e508f53fb3446192cd786ecf10d0f704c4fc2e53e7f7318ae1407e46fc0fb8").into(), - hex!("ac3195143035cdb4ddcd5f93c150035d327addee5503ea2087b1a10b2f73b02453ddd1a94d8e7d883e365f9f0e3c38c9").into(), - hex!("acbb398ea9d782388c834cf7b3d95b9ff80ee2a8d072acae8f9979595910849e657889b994531c949d2601b3ce7b235d").into(), - hex!("811e6a5478f708495addbb1445a2ef23e39ee90287f3a23ecd3d57d4b844e4f85b828bae8fa0f1893dfcc456f86f7889").into(), - hex!("8cde690247d4831dfe312145ae879f4e53cb26641b3a3bb9eb4d590c56c11ece3cfe77180bd809468df5cddaea4f5ab1").into(), - hex!("b42578df29a9eb23bed91db6a1698df49654d2bc1b0d7973b2a7e300e9cf32e0e6ac464d463d4d26e394e7598239c4bf").into(), - hex!("97ffcbf88b668cde86b2839c7f14d19cb7f634a4cf05d977e65f3cd0e8051b2670e521ae74edc572d88201cff225e38a").into(), - hex!("a322b5d2a6e3cb98b8aaa4c068e097188affef5dec2f08c3e9ce29e73687340d4e5a743a8be5f10e138f9cabbe0c7211").into(), - hex!("a076ea1084b7a1a33115ef62d6524f36e7820579868763a6ed1f8bce468f150cbfbf0ed04be2487aaa34100d828b0db6").into(), - hex!("944259a56e3b4f745996289912740281bde47e22705f142c2a483ffd701e780f51a01b177d2494dc8db9e69157f45d44").into(), - hex!("91cb79d52951d1b901e4a686bf4ad587e31db57ea5af6ffeb93eeafae3929879c386ddec860f803c2dc61055437e6bee").into(), - hex!("91efdbcaad9931312d7c41d24de977f94d7f3f7b88090a1f72d9a097a1e30cc805c5ea16180f463022d9b26b8863f958").into(), - hex!("b26f5ed09f7d5bb640ec94ddd1df0b76466f69a943b4699f53d45296d5d6b8010bb61477539bc377d1a673d89074d22f").into(), - hex!("80822499f96a1a8c0048f01f389dfcaaa5d8269c332dbb507fe46f270bcfd5f67c53f827fd867221592dbde77b6b37ab").into(), - hex!("8860ba25d5530cb8585975d8013a1c2d5b0f0f96066044fdc43ed13488ae44e379c624ff6993a18cb6e037809d7985e7").into(), - hex!("999d1c44e14184349064415ae28a149b3b11aba5baab6792744378d14df554a3625fac82038eaca920064822294dd513").into(), - hex!("a62c2e7c692403e874a16e08e46a067e19dd561993ca07ff79cecb53c753763b3e49d372638c96c0a8c921bfa0798a0c").into(), - hex!("a1c84730a5c41dcab9a5ef9e1508a48213dbc69b00c8f814baf3f5e676355fc0b432d58a23ad542b55b527a3909b3af6").into(), - hex!("a1c0c317e6e352e16e25c140820b927161ce5d2c4c2e10bca3057ba4d46b4f42ad7aba20de86dad9fc6368ea92695268").into(), - hex!("85c216e314eb7bd8ba02e092c90e132bc4bafb21c6a0fbe058b0dd4272cb76f183b83c6783fc321786065ff78c95f952").into(), - hex!("8e8f63ec8f4f1f7fcc61f893b671710c3c17f9d2d26c5c6ca40e671bd4b252bc0cc1655e6780d2ddcf2915d8f623b9a4").into(), - hex!("aaeb0005d77e120ef764f1764967833cba61f2b30b0e9fed1d3f0c90b5ad6588646b8153bdf1d66707ac2e59fd4a2671").into(), - hex!("92ff79402d5005d463006e0a6991eaacc3136c4823487d912cc7eec1fe9f61caf24cd10022afdab5f6b4f85bfb3eee4f").into(), - hex!("a32a5bd9b7bec31dd138c44d8365186b9323afbba359550414a01e1cdb529426bfa0b6f7daaf3536e9402821faa80003").into(), - hex!("845982c2672fdd44b33d2e56ad676e704c02f756b09e8765bea42b924c14724484567b55f0db42ac20cb70a7f5201c14").into(), - hex!("89cd9f6ae7d9a9ff2b4db916ba3af9fe700fcfbd16577bf73a965af938e8cf633020466b0298d3c31300360aa6851af2").into(), - hex!("8fa2d7b22af8e6b82679ebdfa13efdcb34289a554653ea6c1b16efb9f957f7fe64df787e7b03d8cdc8a732b91c916bd1").into(), - hex!("94f327bc57ed1ce88ce4504b4810cc8af5bd21a7e07b280a7866ce08e39b6cf7a6560bf73a5f10671271624cd7893970").into(), - hex!("90f4476224b64c2a5333198a4300ece8b3a59ae315469b23fd98dadcdceaaf38642d2076e9cd0bfacc515306f807819f").into(), - hex!("ae0db78548261216ad7d6a7ed4e6089ee17b3fa311494b2f2c559e215cd3de7e5f3a781a49dcff428a8a61c2a4f49a19").into(), - hex!("a83371f44e007c708dc4bcafa7bd3581f9080a4583c9be88624265014fd92f060127e628de5af3c442a25f049c7e7766").into(), - hex!("b471c72bd2971353f4b44248b8e6cf5316812861a88ccfc20fd0d89a5e010428c387228b2f6f14c12f79e31afc9d0753").into(), - hex!("8962afddcb1a26cc8ccd3c993109e79a4dd747ca473b8b5ef93d9c2e71d29623b834ac945074acf118248e3ae7878a6c").into(), - hex!("aa0940e4e5586e79a3d97397c8aff3d112c6f759d2efac29366acc5b5c6a7cfef8d50516bf309da8b787de265dc8deda").into(), - hex!("a211120e1bb3b10138df1fa58efb009a298b8771f884b82bb3de15822b1252124a68f3980f96122a775fb96f05ddc3d5").into(), - hex!("a1047401598b1e6e2613d746bb4689e0406eccdbadf319a6609a3261cd09deec215d90eba6d0ddc50dd3787d60104e7f").into(), - hex!("96791b2b8066b155de0b57a2e4b814bc9b6b7c5a1db3d2475a2183b09f9dcd9c6f273e2b0c922a23d1cf049a6ce602a3").into(), - hex!("91013e0d537fb085a49bf1aa3b727239b3e2c1d74c0f52050ff066982d23d5ee6104e70b533047b685e8b1529a0f14dc").into(), - hex!("aa65c11071be23c9bddaa5203f3166e5cf043efe5fb8f4b26f8a9cabe71db701a450e79eb001c401da5752755d9cf1af").into(), - hex!("8645cc44d180c18a6d8f57ba57bae05879451997533cfe558cad4d3d586caec877e348915e32a09ee73483283c4df744").into(), - hex!("8eafbb7002f5bc4cea23e7b1ba1ec10558de447c7b3e209b77f4df7b042804a07bb27c85d76aea591fa5693542c070de").into(), - hex!("919c81bd1f3d9918e121e4793690f9ddd96c925ae928536322d4b98132f21979c1f34731d393f0ae6e0871af4355a8ad").into(), - hex!("98181e9291622f3f3f72937c3828cee9a1661ca522250dfbbe1c39cda23b23be5b6e970faf400c6c7f15c9ca1d563868").into(), - hex!("8f44c43b80a3c5f488118859fab054745cfe5b0824821944b82fcf870fda6d93489ea9ca4220c24db2f4ad09c6080cb7").into(), - hex!("a683d4865ddcc099f7b698153007b92f853b80f49b3be75163ea8cd1f8ff584b43a68e68de3ae61cda8ad4b41f355c87").into(), - hex!("942772b7c7c47d4e5957ccf1d6f1450070930af3e2b7eaab0dd7699372445df0cc910e6c0efcf501887dd1adabdaee23").into(), - hex!("805c06e565ee67cab0cbccb92b6656fdb240b430766eade3c6b0a0b1b93c840e2b4f028601451dca135c783239463880").into(), - hex!("84d3e2a06e16ced26094b356a16a4fb6aad50ad9ab23ef804a5852a33ef0bff76f3c5fbf7beb062376c2e669cb598679").into(), - hex!("803df08aa745cc3c0a799f3a91bb6ed423cd520c9d255d36c21bed1a0c3b12e8cad32f54da09dadca97683e9548fba91").into(), - hex!("aa2c3ef95b8d4265f01666129646004b6950d3e8ce74b4ca12aa3b90fbb445079a569178df772c272463a44d48922b8f").into(), - hex!("b0a4c136fb93594913ffcebba98ee1cdf7bc60ad175af0bc2fb1afe7314524bbb85f620dd101e9af765588b7b4bf51d0").into(), - hex!("93e4c18896f3ebbbf3cdb5ca6b346e1a76bee6897f927f081d477993eefbc54bbdfaddc871a90d5e96bc445e1cfce24e").into(), - hex!("89019e9550648962420984e9fd03597a854ae824567d9aa6cd5db01a4616b4e1477230f2d1362a2d307e2425a3eeb898").into(), - hex!("861b710d5ec8ce873e921655a2ca877429e34d432643f65d50e8b2669929be40a9ce11c6353b0ada1fe115e45396b2b7").into(), - hex!("88554c83648ea97dac83d806cd81d92531980346b208d281fba489da15a0084fd4d9a00591d1ca67aad3c5793685d55f").into(), - hex!("851fcadebee06930186f35293feefd40d7daedec9b94e6fe5967536c2c0e4cc68f58d3f5fbc76f1e77b90c9580074f98").into(), - hex!("b96a11048c7c327709d52e72e6f6ed0b7653329a374ea341ad909311b5b303e5629d6dcf11dcdb195e8c7592ceefac21").into(), - hex!("836075979eaf386ff6cb459cfd48fed171ae812b0ac3b38dc24dd8ca905cac1c600be717d4a0defa0a854f40cfaf8c33").into(), - hex!("90fc170529bcc0b80c46a53fffd8323fd2cc5cfa9b75ea4d36db21bd1f198335ad2bfa87f8990cf9cd9fd7989ecca718").into(), - hex!("b7eb6a49bf8f942dd8c37c41c1b35df43e4536e07ca9f4c1cfbbf8a8c03f84c54c1a0d8e901c49de526900aeac0f922f").into(), - hex!("af6911edd6c7ad30f905a0a3f78634808832fdeb4206b006934822d673bcced8e378779261b3c4b772b34b8871987f57").into(), - hex!("a74d240d0d7ea0afe68813fab55388d77e75eca0519d21771dcb7170cedb11dc14b237b26c5ae1f7f728b52e5ec0f02d").into(), - hex!("a7b86e4f1366da44fd59a3ee68018a99c23ba3588789463bd88b0177a9b94030b58cb879a506e64421af966f261eaa86").into(), - hex!("ad8d94e46cc02a1c0ad27105e8f672ec15b8296051801f1918d0bd470625686e8e8a0abde8f6852b846ee8d9132b26bc").into(), - hex!("980508c4d1e655cc6200f89a884b3a25c0c05708a3e4a101205c4fd901c3e20a943071a6300bb2614be41a139d4ef1df").into(), - hex!("b0173651b4ba0590b1d2f0265183f3729b5bb09893523ca12c4936120cbe5ef0d9b98733734407d99fdc766792ff10ac").into(), - hex!("abf72ec0280d56971e599b3be7915f5f224c0ccde2c440237e67b95489f0c9154ace04b7763db228473715f68053f071").into(), - hex!("b404beebf60026ca6843f2953cfcdee494d495c8e2d18865147102ef29a8f0ee470961d2246fe5a450c622d20ca51d53").into(), - hex!("89461cb2dadf51d6f1208b0965c8eabec895d7b19b7d90d3c6e49dbe75a75c30fd26db3dfb169dd46a4342280225032a").into(), - hex!("a61cb5b148cb7ff34775dead8efa7d54d7141182356bf614070dfaa710ebf07a4dfb684dad151db60c0f8261c30a4f40").into(), - hex!("83a798f47a4f62dcb8b531d463b0fd4a876d47a8ca990710290549255033c909de709471b4e823a60bf94d8baf8b5acf").into(), - hex!("a23431589f3a25070a188deead9adb0ed423d6b00af267f3f125cdd4391c1527909b5cfa88130dc4b67915f5002128fa").into(), - hex!("8d77e65ba6250fe18c54ce70d0ba4571a7d3e68a8b169055cd208e4434b35a4297e154775c73e7dfba511faadb2598c5").into(), - hex!("90e5db75f3787b819df471712f87b6f3281437090f5db7a2c21b07164446292a414c687e41de2d1ca00786b093239c64").into(), - hex!("b382fa28670a5e14dc954b2db8ace250c73df71ab095304bd8ee28f455ab26cc54f82775a831428e110d1a3a2af709bb").into(), - hex!("a58d2fb1c2612d28c54fafa7f2e1e6c336c24435abdb53e1be9dce9aebecbf7468a348b872549535ac18aa003f83ea87").into(), - hex!("9545f94c4e9056e360dd999985f8ad06210556fa6f07cff77136a2460605afb0ff1fb1d1a2abe4a4e319fd6c29fff80f").into(), - hex!("93121aa60f904a48e624e00f5410cf8c8925d2b0719f90c20e00cba584626f833de7c8a18dbfa6a07df24b916156bfc0").into(), - hex!("aa3446aac25f6c23ea16e8f7d19c58d187746ef3c2ac7d8fdf9bdc329409a07589ec8eebafbe2b156e7ba60addc15af8").into(), - hex!("b964f50011f03135e993739e2e63a71933ba4583040b3af96c7e2dce874226518f7b68f622c4a1d78b9c3ec671d33ad7").into(), - hex!("8cb5cb7cba886af58acadc5a4348524b1395a39dc51196316d759a9b72d9fc0fe45b706e264393a13ff911f0d15de45c").into(), - hex!("b50c306f78143b37986e68efa10dbe1fb047d58562e9b5c5439b341dd8f1896c7ae586afac0a3213759784a905c1caaa").into(), - hex!("97825edba8410e8bcb85c5943628c02ea95ee7595f559c030b94395c0d1d0d84c38eca199fce9c1992e572b5029b124c").into(), - hex!("b0922acd6da2a95b36de6d0755316594a7e2e32ea774792dc314e8c3cd76d9f1d69df38231e166e24bd42c664f4fbac7").into(), - hex!("ae5ea228c1b91ef23c245928186fbafa1275ff1817535018d7d2d913abff0fd76bf41fd04a96d816f2f1891bd16e9264").into(), - hex!("b106c6d13ca17a4c8ea599306e84918127cf2de21027ac3fe5a57d35cf6f3b1d7671c70b866f6e02168ae4e7adb56860").into(), - hex!("a044cd5a3b727dc1cb59875e4025718375d12e706fffcdb48874e51a675dc2cabb209670192e408cdced5aeac65192e4").into(), - hex!("ab1cc44983e46a6ea2430aa6616ab28614f43624665e3e6ae31a9357c0c5434f34e56c720906e184327693cc4ebe1fa2").into(), - hex!("890def696fc04bbb9e9ed87a2a4965b896a9ae127bc0e1cc515549b88ddbcbc02647e983561cab691f7d25cf7c7eb254").into(), - hex!("a86be58fef115445b909dffac6f51da3fe9214afd9c31fd564bb8f39b1dc3cb895b1222f2c63226b54b60b278ec45edb").into(), - hex!("8757e9a6a2dac742ab66011c53fa76edb5ebc3c2fbd9a7265529a3e5608b5c24b4482fed095725e9b8fed5a8319c17a4").into(), - hex!("a7e0ddbae16e4491822684c0da3affecbbd17ef96c5c491ac093c6eb4e162fc7854c367535e296fd3d6265c2ed1210bb").into(), - hex!("941fe0dabcdb3225a625af70a132bc1e24ccab1f8331dde87db3e26cbee710b12b85535e46b55de7f5d1c67a52ddd5c8").into(), - hex!("a24d05b51c7c128bb49979cbd9019e6618545d95275a44b5c3d1d03e71bf2ebffdf43fff50c30846ec27d279043cef4e").into(), - hex!("b526f40d519e7a8f2c81b69f71b3e2ef079028004c0448ba0608296c2787972491ec6d05ed6a8fbd5ef2da76325a93cb").into(), - hex!("87ca4fa85a257adf7e21af302437e0fa094e09efced2d7ebab6cf848e6a77ae7bfc7cf76079117f6ed6eded9d79ce9cb").into(), - hex!("9276e8051bed8f5dbfc6b35765aac577dd9351d9d6ac1bb14496bd98091005b9a4737b213e347336413743f681f5043b").into(), - hex!("a7741c52498e0a24db3ce7699882de8f462a2b3ed5e9f77dc7200cbdf46b6cdd923b1128759909d6dddd64700c4c20c5").into(), - hex!("ab5b363ed9551e32042e43495a456e394cbc6d53b15d37a8859850162608bdf36d3d4564b88fdbaf36ff391bb4090b8c").into(), - hex!("838ff6630dc3908a04c51fb44a29eca5a0d88330f48c1d0dd68b8890411a394fd728f14215482b03477d33f39645dceb").into(), - hex!("997d3b82e4753f1fc3fc2595cfe25b22ac1956d89c0950767c6b9de20623d310b1d84aaa72ab967ef1ea6d397e13524b").into(), - hex!("85416cf3eef63d5530062d6f031aeddad101c7f1aea3bccb826c73f8a25d5d963caefd789a6b9832bd4ed459f268ae64").into(), - hex!("9194bc45e11d7276ed1c9ef3ad5a33d6a27372f5568563ca8ee213e2e7029dee404ab5acbaecaef698129798d35fd895").into(), - hex!("a4828a003513ab887082390262a932a7e8c5e25431824b7b4cc10fccba73265c0e5ee5b315ccef13906d971644913806").into(), - hex!("b907ec84b6ae5729d36e2acd585a350acacdeef148bcc5dc4a91edb57505526462bd4371574865541d8bb0d786a29b2f").into(), - hex!("aa5d1c1f0a7f6b9b3c3734f85864aa60bddad5121450218d76d82edefd2602685a820965c56d7eefe789d5115cb41e01").into(), - hex!("ad28fe70a8606f87bcb5d6f44e1fca499c24bcee791971f599ffef1f403dc7aec2ab6ebed73c1f8750a9b0ff8f69a1e6").into(), - hex!("a641eaa149c366de228a2833907ad60eea423dd3edf47e76042fdf6f5dc47a5b5fc1f1b92c8b96c70e6d8a68d3b8896c").into(), - hex!("abac08f4df786b2d524f758bca43b403b724d12601dc0a8362b7a2779d55b060c6682a5618fffea2e4def169fcbd2bfb").into(), - hex!("8658a15df961c25648fd444bdf48a8f7bb382d9212c0c65d56bf9cdb61aab3bd86604c687fb682260dbc0ad2dc84bf01").into(), - hex!("ac7983d50ec447b65e62ed38054d8e8242c31b40030f630098ce0a4e93536da9179c3f3ae0b34a0b02aad427a97ee60d").into(), - hex!("b8877a00a24b0ffcb2bd3fce8a8ba327d8ee2e98d85531cb61fec21fd49cd1696491cd51024a9c3820cf06a77cacf04b").into(), - hex!("ae075b66e5f211c2149c45b211d1297bbc1d9e6497cb3315363c492a9a51ae5b9d0a28bfecd755d68553736901ac6606").into(), - hex!("afdc091a224486e7bfac169e6a7b4e008d2d04144508a337fd93b6f4d385ee3f0d927b1f5c1cd79a15e0fd6078e45dd4").into(), - hex!("b75c28941ee3f91b3535b4eaa0fb17b59ca65b5256601a1f6d0cf2bb4d66837fd16e51d6942856679012a5730a66e519").into(), - hex!("84a6edac5ac68a7ca837c46d5ada8fab136748b6c3a3b9165dbbc231ec386b15328e4ef7d69a15d4cf354135348a4ee4").into(), - hex!("b01ee30d120b97e7b60ea89b9b6c537cdf20b6e36337e70d289ed5949355dd32679dc0a747525d6f2076f5be051d3a89").into(), - hex!("a80deb10bba4bc7e729145e4caf009a39f5c69388a2a86eaba3de275b441d5217d615554a610466a33cfe0bbe09ef355").into(), - hex!("8d6e3df29419bd0da1deba52c1feebe37744108685b49ca703e1b76fb4d612e3959d3b60b822506e5c0aac50b2f5eee2").into(), - hex!("a373408beb5e4e0d3ebd5ca3843fe39bb56b77a5d3d2121d4a7a87f9add3ec7376388e9d4b8da0ba69164850cb4b077d").into(), - hex!("ae0beb452af7479134a7fbc31a5f59d248e8a67d4c7f73a0e30a51db9cd33a1da3f0ae947fa7e5983aea1343e7daf06a").into(), - hex!("aa103a329b699d4102f948101ce5fae27226419f75d866d235da8956f11367e71db5c0a179dd63007ed53f7eec333aaa").into(), - hex!("a094cca9d120d92c0e92ce740bc774a89667c6f796b438b0d98df0b7aef0935d8c915d5b0dad4b53e383dc9f095c29fa").into(), - hex!("a4d88467136b99d6e55603b3665b6da0f7fb27c7759687f7e6977b6230272773d7b95049d999538c008f310c05ed948a").into(), - hex!("a23710308d8e25a0bb1db53c8598e526235c5e91e4605e402f6a25c126687d9de146b75c39a31c69ab76bab514320e05").into(), - hex!("a36d6952c2d7f88bf28032a76ed46c4dabbf1901a46efc50deb798d1b44adf7e0210fbdf2473a1ba408b5c98d76943e5").into(), - hex!("ab45f5b756ec6e0b98d0d4301c87675a0a1f0b1178b8a9780c1ab23e482cd821834835afa1de890962212159e464b10a").into(), - hex!("b800be1788175a01a9228b0d3e7eb4302484a2654eb2a86c0f0900b593da0a436ef031ac230e2b05e968b33e90a342ce").into(), - hex!("8cc8d279ec08d0a5a2a09ad07fabb0122eb65f48da2571d83f86efa2c1c5bc51b04ae94b145f0a8ef19a3988638b9380").into(), - hex!("b4cd409256819e8e4627edbba90ec40b7da17a57f95749104d90db0364f5007b1accc816f4d51a0dbe5ffbcb737cb37e").into(), - hex!("99365fe5ab8ea8bd768ae7181a6ba49b79d240f512ce309b02f09d465fea276298ff55b5b9cb5b4162a901b390606024").into(), - hex!("ad77fcac9753efba7a9d9ef8ff4ec9889aa4b9e43ba185e5df6bf6574a5cf9b9ad3f0f3ef2bcbea660c7eef869ce76c8").into(), - hex!("ad2456725ac3aeb0e4ca5c0502a8abb4dbd8a8897d9d91e673fea6a0cffd64d907b714b662d73c0877b98d4ab3ce6a89").into(), - hex!("ac8436e33619e2907659741d66082acbda32612d245fcc8ae31e55f99703fac1a15657342fa66751d3be44fc35d71c36").into(), - hex!("b0eecd04c8d09fd364f9ca724036995c16ba6830d6c13a480b30eb2118c66c019cfdc9dacce6bfd8215abe025733e43d").into(), - hex!("9439b663e4104d64433be7d49d0beaae263f20cfac0b5af402a59412056094bd71f0450bc52a294fc759ca8a3fddfee9").into(), - hex!("b72de0187809aaea904652d81dcabd38295e7988e3b98d5279c1b6d097b05e35ca381d4e32083d2cf24ca73cc8289d2b").into(), - hex!("93706f8d7daca7c3b339538fb7087ddbf09c733662b55c35f2a71073f4a17c91741955d4d549c2ee6c22eaa84193c1ad").into(), - hex!("926dc729e135f1f0bff4662ee3d6823a64597fe189b763ada34f246e77705fd4e062d85506a338e9fa98c4d225a3b27a").into(), - hex!("93f03495d53c781be8b76e37e68b64aa260523004eff6455ddc8a8552af39854e5181f8c5365812b1f65926534fba5dd").into(), - hex!("9834f66e5c946c3a8241ca2bbde046a7e88072124911d5d15c037a95b61e82b88b5c2058fa4a3721537dee39dee5da18").into(), - hex!("92ec1aeb2aa24c51cd5f724972c8b6095e77b237d83f93ed34ca0bc91a1dbf1ad95adccc59e0f0abbfef33f331f3298c").into(), - hex!("94402d05dbe02a7505da715c5b26438880d086e3130dce7d6c59a9cca1943fe88c44771619303ec71736774b3cc5b1f6").into(), - hex!("8368bb9b9bb2e17730c42ed1100eb870c88a8431601312aa8cb1e738cdb9ca2704dfd432cf1703c0db043259819631dc").into(), - hex!("a35189a105401f0cfba4b43be21723486c04659e5a01e67c43e8f9911030810b878beee696f04f63d314ccfe97ebb790").into(), - hex!("93ccd8c5f82374e0bef6562e16576f742d79b6f400e3485ef36e148088b61fbd882c3d2bb38ab0b43fa1dac77f31d543").into(), - hex!("b85d9a426a23ca9ee582bc16c203a9352dcc5f85440e46979de80eb572384479b697dc964cafd9457d9f34eeb77bb72a").into(), - hex!("aefb70e89dbf4456e077690509afcdcabf975416ff2fa16777fdf90b3abd3f5dcd865c43f1ebe6f8a669edc7f3bd6ad8").into(), - hex!("8eb03001ac9e22c6956a682ed458e650785c36d23ddbcd51ac4d9cc991325c02519ff1958987a08eb29ff56ff6e2c293").into(), - hex!("ab4a1ffef7e001723c71f5d28f3dd030a06c42d91773733d117247bbf9c01cd66fca2cff8c6ce04c4bfb68dfcdd851f2").into(), - hex!("a9ef845ab489f61dbfdcd71abcc29fc38f3494a00243b9c20b9cd0dd9e8a0f23304df84939b9652cdf5542d9b3ee085e").into(), - hex!("b5726aee939d8aee0d50bf15565f99e6d0c4df7388073b4534f581f572ad55893c5566eab1a7e22db8feeb8a90175b7d").into(), - hex!("9953a7cbc152f101a60e3e381f2af17ebe7401e16ef6462d132b8f0f6c6a18837914a1299d1605f9f289b9561112f4bb").into(), - hex!("a0c9b944a338325f5efb675c9c12619fb43c8e25e80d38d6140e31d5070573b1a0ed9bb52576e4f22f37d0292d36a648").into(), - hex!("8bfd6a173a56b73480cc950ef266a18933ecafc86915a7453ded09efd8a0cf4466101f1373f05d48eae3e7fc5c0f7f54").into(), - hex!("983fc1ddf17f9756c9cecc00b39bb2ad432587a5c6d1c3296a383b9f539c9afe84c6c818447a709c0b686ba26ce5ea3e").into(), - hex!("94bbc6b2742d21eff4fae77c720313015dd4bbcc5add8146bf1c4b89e32f6f5df46ca770e1f385fdd29dc5c7b9653361").into(), - hex!("b26b4d483bca73d3f3a976bb595a0e40f9a42094e0febbad3a1874934be1939a1b362ee4ea14a4f5cbfa9b1392796a12").into(), - hex!("8dbe8fcbcc414eb352245c52549973f73d987012de9d5f2b2f55dfdc43cf8cc9ea6b147abf149817f80f9e15aea566c6").into(), - hex!("9604da21e23c994a0a875ad5e0d279c79210f7a7de5c9699fac4aebbd76d39b703eeec5dd5efc9ad6b9dc58936089ddc").into(), - hex!("8934e9a3feababa12ed142daa30e91bd6d28b432d182ac625501fe1dc82f973c67f0fe82d39c9b1da3613bb8bfe2f77b").into(), - hex!("85f2ed3ffb03e50c8f22553b8e6349be6244d893aa37a7c6dbd221e9e121579e5a04466e60d6b4d3567bc747b1fc1e9f").into(), - hex!("ab0ad421f6fd056687b4fa5e99dff97bd08840b7c4e00435eb9da80e0d7d071a447a22f8e5c1c5e93a9c729e5b875a1e").into(), - hex!("841d77b358c4567396925040dffe17b3b82c6f199285ac621b2a95aa401ddb2bc6f07ebd5fa500af01f64d3bb44de2df").into(), - hex!("83f21dfe0272a5a8682c3c7814c5e0e4db6a9098f1fa80fda725f77ea81fdfd2fa36b0c8db013503a89bd035f86306fa").into(), - hex!("95c98e3b6b62f84edf7f297cae93ee5f82593478877f92fb5bf43fd4422c3c78e37d48c1ee7ca474f807ab3e848d4496").into(), - hex!("81c3a8c00cfe4e82f3d8cb48de7d4926d5ec2f7689f9cb85c1886a23758bc107a4bc6e978601c3519156a169d0bf6779").into(), - hex!("8e956ca6050684b113a6c09d575996a9c99cc0bf61c6fb5c9eaae57b453838821cc604cf8adb70111de2c5076ae9d456").into(), - hex!("83474776ef2341051b781a8feaf971915b4a1034fa30a9232c4bf4b1bd0b57bc069c72c79510acef92e75da6f6b8843d").into(), - hex!("b41780d9d67e9e8b81b1f62d25c0c72ecfda659d2bfe6825edb70ecd0e0724250ac364e7be521cdc112ba638f16360d4").into(), - hex!("842ba3c847c99532bf3a9339380e84839326d39d404f9c2994821eaf265185c1ac87d3dc04a7f851df4961e540330323").into(), - hex!("af17532b35bcb373ce1deebce1c84abe34f88a412082b97795b0c73570cb6b88ea4ba52e7f5eb5ca181277cdba7a2d6d").into(), - hex!("b9574edb9567f07f85c7c2e6ca6c02d90ad7c7b87d49796f1e2fb7240ad071fb755cf13ca8678668a56217c62df168eb").into(), - hex!("82212706111fb1cf5def02b5b0eb7ae9e6ea42b4c7a2b9fcacb7aec928326edb9ac940850dd933f2822f6cf519de0d50").into(), - hex!("9579973ee2559da09b327c62b1cc0177f2859872885dca709e24dcfbb9bdf9224a6d26869aafce498f44c0e6bd8a996c").into(), - hex!("a102c2ade15ea2f2b0cbc7dbd8c1171de0c8092fc4ecef84b5fd2bae7424aea8be1629f851c75e4d1d0e96104e54bfbc").into(), - hex!("a5d7e847ce7793386e17fe525f82aabb790d5417c3c6e3f6312f8e5ff52efa8b345c1ff60c4c9bf7636f5ff17b7a0061").into(), - hex!("b4b80d7fbdb1dbf1567dfb30d8e814e63de670839a8f6ff434fe171416599fef831b8e978d6498851b8a81e0bc8dfb85").into(), - hex!("b6e6277b86cd5284299ced867d37ab98090ac44a94deef6898aeadd177e64605440c15b9609c07e71fe54c95b61873b0").into(), - hex!("8135a0633082e4465090d6930b770340e82366bc5c37be6ef6dd105f85acf63361e17de8b5fcab4c82e9f9b4029954b7").into(), - hex!("864d5d9858cd881eecb0dde5e3e0c6c5de623cd9ef619e87b82fd25c5edf45a1a025b1dc763c27c5f4d520fd564b464a").into(), - hex!("8784a8fa62e0ce23283386175007bb781a8ec91b06fd94f22a20cd869929de37259847a94a0f22078ab14bb74709fac6").into(), - hex!("8adb748d5fa5c22ce4c76a1debf394b00d58add9f4e08524cf9c503f95981b36b8d0cb2dfaef0d59d07768e555733ecc").into(), - hex!("b76cb8cb446eb3cb4f682a5cd884f6c93086a8bf626c5b5c557a06499de9c13315618d48a0c5693512a3dc143a799c07").into(), - hex!("b2af1f7ece1fd640c205a09614122d69d5d2e81a7618bedefd6dbb91c7f432679be4ced1e6dddd3de323bd44991931c5").into(), - hex!("b950b457c34bfdfdd9d6da9628d41749ccae03659518a04b56487bf1b4c0681b719ec5230c0b0fd5dd710894df6aa2f8").into(), - hex!("b21785008910a949804d1291e7533752641d31beae3cb518806488f81d58c38a5efe5ed9534ac692e68c3121e2f9d97d").into(), - hex!("a9b120a77d70c1cbc0178a12d97a78b2dd0b98d0584e8e780b937800ceb18c90eaa1f0a83c5b50e34cae1c20468f004f").into(), - hex!("998c9ee20d33f96a2388b1df642aa602bc8900ba335e8810baab17060c1eace4bc5203672c257b9ae750008b707b0aa1").into(), - hex!("a7d1676816e81a752267d309014de1772b571b109c2901dc7c9810f45417faa18c81965c114be489ed178e54ac3687a1").into(), - hex!("b409f87f0632aae9bc081345b17a50a767ba4198f9ac9d352246fb3bebd29ed53c9d6f148c2f318c2eb12846b0aac4cb").into(), - hex!("b40a3bae2b08c13db00f993db49e2042be99cde3d6f4f03d9991e42297933d6049394c659e31f316fcb081b60461dabf").into(), - hex!("8c1de4264e04ff7e8282faf81c0bfb5943656451be52170211cb7adf4ff21bccbb789400735579c622f69982fcb8e9c6").into(), - hex!("8085c60b6b12ac8a5be8a7e24977663125c34827842aa3b2730854ab199dd0d2eaa93084c9599f0939be8db6758b198b").into(), - hex!("972cfaefda96f5edfe0614c01533b76153118712c1c02c505008204a5be2aa438675d97f43384199517b1c08c7c9fdb2").into(), - hex!("a1e47798a782a024da340d6d6a1b1e5e15a0f2d8668adf349ca375086964414a563cc1eea3226ae637f87e78c0a630b3").into(), - hex!("8171f20c020faae112bb92ca213c1df5b1050151496c70db5c5319212bada83b120d515bd7d8b24736090c574e1b7203").into(), - hex!("afe779a9ca4edc032fed08ee0dd069be277d7663e898dceaba6001399b0b77bbce653c9dc90f27137b4278d754c1551a").into(), - hex!("a5a07bf219432e9c80c38596c93560b49c7de287f31e30b7a06fcb4d15982add4a24085adbc5b753c462be989c64c96d").into(), - hex!("9210be290176d7e8a5005d27e7ed825067b1c678b174bc8180f92b5c03b6c3d1822356edba84f460caf6bf5275cd7efb").into(), - hex!("a95bec86a7c8417a8df3a0158199327ba0924d3b7dd94cd7c1ef8489b10270ae64b8537ed39cd3699a48942bfc80c35d").into(), - hex!("ad9725114b01152fff134c1a8ccb8d171b8cd11685ef6815b76f442d757d130bab9ef4c9845e66f4aa0237ee2b525c20").into(), - hex!("8018499ef720e28759133033833edfe17ed23e42f99058bb79fe844ddee823cfdc43916be2dc9724d18f9726e6f1b409").into(), - hex!("809c7a08fbef7caf4c137cd639f2e47a8ca60d13bca3990eac51ac2a9e4442cd1a1473bebb63c61d595b586525d7b027").into(), - hex!("9793a74fa578ace75b083578277a1ae8766d41a5c508b0f1135fb97dff1d0826002393a7276b18cbc4b3c5671360ce0b").into(), - hex!("a6d7e65bf9f889532090ae4f9067bb63f15b21f05f22c2540ff1bb5b0b5d98f205e150b1b1690e9aa13d0dee37222143").into(), - hex!("99c935fe18699bca9852200c292690a2b834bac508890c4ee9af1aa6999a8d590bf6a3a274bb55d5a73f1b7095d10f37").into(), - hex!("860f5649c5299211728a36722a142bf1aa7cbbfbd225b671d427c67546375de96832c06709c73b7a51439b091249d34f").into(), - hex!("9104ac7ad13b441c6b2234a319e1c54e7f172c9a3efcb8c5fab0ac1d388b01895a9a208f59910bc00fb998b0adab1bc3").into(), - hex!("a3b109249ac2900806f0f39338da72d4f2cc6d1ac403b59834b46da5705cf436af8499fa83717f954edb32312397c8d9").into(), - hex!("b9893f7a47af457a9efd90ddc0c0ef383ab34e9c1284e617c126965cd9f0de5c54ee8b7b5208ff190366fe445e9c1325").into(), - hex!("b77416ea9a6b819e63ae427057d5741788bd6301b02d180083c7aa662200f5ebed14a486efae63c3de81572fe0d92a9c").into(), - hex!("8b20a852fc8f0b7cdbbd808c04a0cfd2fbccbdc0cb2361434f0d96341c8bde6155695977768d563b95746dcb4339fe2c").into(), - hex!("96b15806d9009962fa07f8c32e92e3bc30be4ded0645ab9f486962a1b317e313830992179826d746ea26d4d906bdb7b6").into(), - hex!("b0d69b3861ca6791632ec8a87114b463e0da571bc076c22a8f0d9e88a1a5eaef24683f3efa8f34900d0112412e3dc4fa").into(), - hex!("b01a30d439def99e676c097e5f4b2aa249aa4d184eaace81819a698cb37d33f5a24089339916ee0acb539f0e62936d83").into(), - hex!("b19ca6e55f349bbb2dc3e429520ff5b2e817972470794f35c1aac8c118b37a694cfcc875b6d72225343799825d2f5c39").into(), - hex!("b7ea5e0d3cfcf0570204b0371d69df1ab8f1fdc4e58688ecd2b884399644f7d318d660c23bd4d6d60d44a43aa9cf656d").into(), - hex!("a778da56ddfe4a383816b43b027464d7a28689fc4a6b35b36883d3f36d9c41f0177bdbfc8f258afe8da90f02d3b64fea").into(), - hex!("910fd030feb5538f538e5ba74b9bd017d889ed6d2a797be9c26d2be8caeba7a473006102de27e87755742ba34e445bca").into(), - hex!("b49593ea6040ce82cfb5aa2881a4b0c42b78aa9fc8467d79c8e4a8ae4ee7355842841c8e1cc0558362047ed80de44fd3").into(), - hex!("b07447c7e87459315fcbda3fb86fef27f98373b1246e2ce367e26afd87f6d698a438501fdc13cc5de9eef8d545aab768").into(), - hex!("8a9f7e8d45f11c4bfb0921c6008f3c79ff923452bcfa7769beb3222f1f37dcb861be979e6eae187f06cf26af05e8ee5b").into(), - hex!("8ebfbcaccddd2489c4a29a374a2babc26987c3312607eadb2c4b0a53a17de97107c54eab34def09144b3098c082c286b").into(), - hex!("93be3d4363659fb6fbf3e4c91ac25524f486450a3937bc210c2043773131f81018dbc042f40be623192fbdd174369be2").into(), - hex!("8cf8412bd48b21b008f0207b1f430ed96bc6512c3712dffbbecb66e493e33698c051b27a2998c5bddd89d6c373d02d06").into(), - hex!("a5562fbaa952d4dcfe234023f969fa691307a8dfa46de1b2dcff73d3791d56b1c52d3b949365911fdff6dde44c08e855").into(), - hex!("a8c167b93023b60e2050e704fcaca8951df180b2ae17bfb6af464533395ece7ed9d9ec200fd08b27b6f04dafa3a7a0bd").into(), - hex!("93e4d7740847caeeaca68e0b8f9a81b9475435108861506e3d3ccd3d716e05ced294ac30743eb9f45496acd6438b255d").into(), - hex!("8016d3229030424cfeff6c5b813970ea193f8d012cfa767270ca9057d58eddc556e96c14544bf4c038dbed5f24aa8da0").into(), - hex!("ab7eff4ef8696db334bce564bc273af0412bb4de547056326dff2037e1eca7abde039a51953948dd61d3d15925cd92f6").into(), - hex!("a3f9dcc48290883d233100b69404b0b05cf34df5f6e6f6833a17cc7b23a2612b85c39df03c1e6e3cd380f259402c6120").into(), - hex!("8b476b3b065a3b95a3d11ec60a749c2258ddcc5885bfb50b8a086d3fd1e49ff73e1dde733b8981c3d2d206aa0c87b09b").into(), - hex!("af3e694ad71684f7214f86bed85149db039971e1c362119b979a135255aa226128802e58e2caaeaf8d89304371dd0440").into(), - hex!("aa19a75f21a14ad5f170e336a0bd07e0c98b9f5d71f91e784d1dc28a5f5eb6870a4eb35bb41edcf9e6efe982ae5c2c5b").into(), - hex!("b9528983419ab5766596683faebb3592982a76b68593f810186b4e5f94f6de60830739ad8dcc164c601d575b84bd2700").into(), - hex!("88e7a12a90428bb45bcf4b01442c11607433211fc2f9bee9545304eb66e0b4b5339360160bc782e185391385da7c5ad7").into(), - hex!("a4c4df0e29db19ab4c82dd6ca8570b337d15b59c7d84577a7a444a8f762ff16ff5ab3e4203a1d6b60a23ff949a93ea81").into(), - hex!("8f11ee58ef82b1bbd2240d3f548d8681e22bed5ce118d605bed4523b4bb39899ac78e15337daab92666750dfcaf32aff").into(), - hex!("8d3cba4d10f94bd3406a341c903ad144cfcfe6b61678d5c03084a56b4413bc30bd20d7a9fd5d839dbb565cc9b2aa99fe").into(), - hex!("ab8a8769c754008a7976b6799e81d7bfe97413d0a79b90715703c1f8f567675463ec93aabee59277121fc4df88b5c7a9").into(), - hex!("b201b0546f19c5db88df9c684cf55ed623bdb43927d06051bd595497df741feb1485961f64e8d3d1811d9e2e9e1e54ad").into(), - hex!("a04016e9e13ad845763cfe44af4e29fecf920b4aa42f581715fc34fb9ca27776feee45c82093c7274839eef1838b10c4").into(), - hex!("8f84cba7ceb7652023fc8ebde4b00ecde1f550935bab12feb630d6f49517b4148f3cde184bf55d4f6ec99a849fc6f862").into(), - hex!("a2248409026f35c3da8bc4d5c02315066df8fca44ff5a358cc42b5c88bdf6866dc133617c697bff004b1ef20ec4b5748").into(), - hex!("a52c5a63b55a8001b6b67c5db4fd5e95923052f03618369312896ed9892d99354aebc0dee8c3b365bafa29e211a5c3f9").into(), - hex!("8c9fefe233d0d657349b7efcdc368f5aaead27071d224af780874751e7d241f6b88f7650fbb4133043b24bbebc12aa48").into(), - hex!("86ceb649a337a5a79c17b496993ca07fa93b38a582367ca04f3dfec5cef8f268d4e8080e5a76b150f5be1b177ef6984e").into(), - hex!("87dcb537e38cefa32e629ae669da42e809b5afcabdeeef244b72ce057fc18584a1e8c3f073d5d33775232707f0cc59ca").into(), - hex!("a020404547407be6d42856780a1b9cf46b5bc48122902880909bdcf45b204c083f3b03447c6e90d97fd241975566e9bf").into(), - hex!("a1beb9f673409ec678020ea4dcbe65177aa18e2932ceb9cfb33fccb94b9a8ccb664f71647d58b3c8b2bdbbffbc02d5f7").into(), - hex!("ae47b31c5b62b38ee886ee04945649054369018dd6543c91f0138464af489a32c1fea339e0e0cbe82e3e8b9f2ef3918c").into(), - hex!("b18c41c0f827f6d8656d3fb93c90b663eb2eac034923972f8842cb30e96c32842b3fbc1127930e1ba4322d5b6641f04d").into(), - hex!("a6d6ef51a361df2e8f1d993980e4df93dbbb32248a8608e3e2b724093936f013edabb2e3374842b7cce9630e57c7e4dd").into(), - hex!("a49da42c27d019a21cc6489ada7b712b98c4ede28ba25dbcfa916acef48446a2baf73e03a48be763378a09774d4a03fc").into(), - hex!("8b62902fb2855300580e94830a4bc825d997ede33bf356fe3b7c08d6a8bd85a37879433fc6bee58f9b44ca280f4e8dfd").into(), - hex!("af9d13103868c854821ba518907b067cfba025d739125f1e9cce0a04fffc3a2a1f25506c1209a0cfe1d6c1572c229ff0").into(), - hex!("8910f41db6952c25dfbf6b6b5ba252a2d999c51537d35a0d86b7688bb54dcb6f11eb755a5dce366113dfb2f6b56802b7").into(), - hex!("b551d1ce88cbf4ffbdcb0113a6e319513bd676d0078dd4e6a6f23ad336c1d0fb47a4e427bdedbe0fc8f152353971f81d").into(), - hex!("b8876bda1e709ab16e1347a1107852a7898a334a84af978de39920790b4d82eb0739cbfc34da1c7154dd6e9f7674759c").into(), - hex!("a7d9ae9621dd1f3da3cd2d435e891cc3579c4c0d60d6a4565cac86c315cea21a9ad883559fe7b897ae6e05f1aa989ad9").into(), - hex!("aac995a41c14d379853ef18ffc854ad62ad77061ca9bdf5029cab3d6c2630de114e777a7fc3322455939d5205ed59c55").into(), - hex!("999cec6a31d9b2f280017ddd59138014829fa34cab58e6c35a5014ec364b84712441e7a2f717cf2f0de8d5451e250924").into(), - hex!("b1f43b498cba1797f9793dc794a437500c3c44a8a4b59f9125a4d358afa304fc05b88ac31ed40b6eb68f0396b60cb7cd").into(), - hex!("93ba2e000bdb7269818d390bc4232992d280e69abebe2db2ecb6fcb1390d323238c9793574509bc1fa34051ac1928f07").into(), - hex!("a64808a2d15c30460651c200a09b50fc83e9d84d87abc156d06cee73b76fbd74e6d64424cb5bb83d3f16b21bdb7ae9d2").into(), - hex!("a75bcd04fcb44ce5cbab7eef6649155ec0bef46202e4eb86c88b4ced65e111f764ee7fb37e9f68e38067040fedf715ee").into(), - hex!("b95fc0ec39596deee2c4363f57bb4786f5bb8dfb345c1e5b14e2927be482615971d0d81f9a88b3389fac7079b3cb2f46").into(), - hex!("aef456af90354ff88039d2dde02b0f5a6790aa762b23e0a9da8c6ec92c3b8b3320687bb21666608b4a22615843afd1ef").into(), - hex!("b38be9ada17ced704a34a7498c4fd6ba2503f6bd886b693d4712267847efa887a26e7da5d60f8bc5014b92bca8b3a12d").into(), - hex!("991a7c93f06d50ec6a4340c6751b73eb5825bad02a954e44e1e2d424af928819ebbb590c6129ce35b3f1e908e2152f33").into(), - hex!("84888f2efd897a2aca04e34505774f6f4d62a02a5ae93f71405f2d3b326366b4038854458fd6553d12da6d4891788e59").into(), - hex!("941e2e3ba414a371a11c3fe92cabf688ff363da6230ec7c83ac7303f652a19ebc89cc494427c456d0c2ae84c72053f73").into(), - hex!("925f3bb79c89a759cbf1fabdaa4d332dfe1b2d146c9b782fe4a9f85fee522834e05c4c0df8915f8f7b5389604ba66c19").into(), - hex!("941c8962debd2756f92a6a0451a2bf7fbc01f32ed03d0823dffd4a61186628a4c3c7c482b18589ff65e4c449fa35c2a4").into(), - hex!("88ce41025aa153a94f91f22e7b96f9342b5e0e1d76274fc70c4df7d08f66d9f7ac86e55a1c6e77693b8b01b2b38bf900").into(), - hex!("8f142bde50abe4dac8e059003db41610436d5ca60d2dfe2660ecaa5f9628aeb8b5d443e1b57662076f77363c89a1479d").into(), - hex!("b2affe048c187d311a185503d8958cacbe03796edf79bc32e8533941004d9178bd2e376e627e1ba61ed43850c0c455cf").into(), - hex!("8f7bbaaac458bada6d852fe665c87c646133bab16c0d5136c3dc922095b9d647d93a9de7671cb7bfd4cbd138ae0709d1").into(), - hex!("b76f598fd5c28d742bc1a81af84f35f1284d62239989f1025e9eba9bece2d746a52f246f9bb6bcfde888b9f7b67fc4f6").into(), - hex!("a4c665a3e4e25a7af51e433c978573841bfa2c75c075e17dd1f43b2f0369249f3d3a46ff51051e8ce7da528b0fa98d16").into(), - hex!("81e0992e7c1c54c21cac32e36b90b25e1e5b72aac99c953c3c4d019eced64d7e316cbc0840204a4a51a4ad17d8b1d508").into(), - hex!("96d7a69eaf2761bf0e5ebcd607b134d5dedba8e262ca1d6d3e8fbf23e6419a8ce1bbe4cd23b9e4b5f80db54a802a9795").into(), - hex!("b2235bdf60dde5d0d78c72cb69e6e09153b0154efdbab97e1bc91f18d3cec4f660a80311fe6a1acd419a448ab65b18f1").into(), - hex!("838d5eee51f5d65c9ed1632d042bb7f88161f3789e6bb461318c5400eaf6728e7ba0f92c18e1a994aa4743145c96164b").into(), - hex!("acfbac397ae2ff23b31bb27b90788fd0fd51a50f8e8c9f4b31be8499194252014f0b1972b204aeb9c2836a20beb3c868").into(), - hex!("ad85789bb62b60e9768bd330a31a16f711b6018445af6a47646f318f12df8d4d256ad00d1ed7c3afa4e98fef73c6c610").into(), - hex!("b2349265be33d90aaf51362d015ce47c5ffe33e9e6e018c8c6e39336d9327ccdd13d25e792eb33b43ed89a162f6ac2fd").into(), - hex!("aa458aaca6ecb43b6e45ea72d02682e5a7dc8dc22782669a0628e1638e73999319f011803f4ec8cf072467bf2c49c629").into(), - hex!("b9e6c9f2562e90bd3008669a42151538b70faf028cc5bbc09fd6ab3febc626df911fcc65744a2ad793ecaf3f91a1f701").into(), - hex!("a37185bd96faa526dfd3ddaff89b1eb29ceb4597bfc7e346bff9d6b3225b9ca87cbce0db94f05243c7232ead5f6607e8").into(), - hex!("824fde65f1ff4f1f83207d0045137070e0facc8e70070422369a3b72bbf486a9387375c5ef33f4cb6c658a04c3f2bd7e").into(), - hex!("b0ed68167a67490bd7d7d49e83341606d6e6fdd99b82e46747c2190d270719f81c5f5f8733646c246260f438a695aa3a").into(), - hex!("a87c2f13f2a824b7e2c39cfb63ca7b94ae6a11ade0c6b8e83f5092b933fa8b6157a5d2f09c23081f49d35cc85f5db36c").into(), - hex!("88f5e795cb36ab22bdcff01caca0e9d04db463c3d88cf656c3a0e0f5ac864b7092c738758b4c8f3b65e31995c6aaf267").into(), - hex!("ac66f3a7041586ac1576e33598f01921e16d99afbf4249c3350f0ee1654de98bd37a61c243eb6a18a942db529e36af0d").into(), - hex!("aca69a4095567331a665e2841210655636a3273d7b7590e021925fe50757617898e1883532f9cfd46428c2e3d854f9f7").into(), - hex!("946d585d7aa452d37a8c89d404757c3cce2adf2410e18613483c19199abd88f7a12e206f87a43f6009e42f4e31ed20c0").into(), - hex!("9722c1079db7e2e1c49756288a02302b43b8fd92d5671585ac1ea7491123742a2744a526c12c9a0b4c4a80f26342a3a6").into(), - hex!("b80e8516598c59dddcf13fdb7a42d8f5a52c84e01bd6a39880f4acaefe8e4b8f09cc1b1a2423cd5121f4952201f20078").into(), - hex!("85bca2f86423a09014b562f7dc613246bedffdcb3aa41fee02270c13e6b00c8d6704dcbfbafc5997df6a90c7fc08c29f").into(), - hex!("a36dad4f7cba9f4cc843fe40f6240e1973a4c412cae29b4a68712598523cfaecb05272fc47d30772bf06906b5a26e282").into(), - hex!("a3d8610c2522d330df02511710e52b1d9bdc9f2b156deca12b1bf754266caeac4f449ed965d9863558df43ce9ae65a44").into(), - hex!("b3e313e79d905a3cc9cc8a86bd4dba7286fb641c2f93706adb3b932443e32eff2cbed695beeb26d93101c53d5f49d7db").into(), - hex!("88d8a32231ff2bfc39f1f9d39ccf638727b4ead866660b1b8bfbdf59c5ab4d76efddd76930eff49ea0af048b2e396b6c").into(), - hex!("a90d9502a9785e55c199630456fcb1e794bbeb0f5f8c022e66f238a0789998b126cf9911fd0b7d463b7706dc6f9ec128").into(), - hex!("8c627caf25eae6764501b9eff35aa90bd4f24952cad712aae20344579e83ecd104ad1f7915edc4f9023b17fddbdb4cd7").into(), - hex!("87d4b20bbe2dcd4f65f4e1087f58532d5140b39a5288e1a63fc0b7e97a6a56946eafdd90ba09300c3d1fef6356ac6b7c").into(), - hex!("a18f4464cf5cebade8ee280fa00e0917cbf1743aeb0dacc748ab68773b909e30dc60f40fdef3041b5f082e650985f7a6").into(), - hex!("a6ae4fd03fbb4e2150795f75a241ab3a95c622b4615f553bab342a1803b86b1c1a2fc93bd92ee12786bf2de22d455786").into(), - hex!("a89bc7548ea245ce9556eeee3fba98a3256f87499f54a7c5eec0c43b9fb4ef2fe8f6810867ed0df814a88ee100c245af").into(), - hex!("97f1a7370b4f5acf83b466f519da361c366915f560385dd7eff9d53700ad81b25c9862bc71d35428e82372a5ae555ea0").into(), - hex!("825359cfe68ad6a75578a94be6419179e0aa088170b6c20fc5c249dc3be7a260d687c93d8d8a343c7c72c2ed6a716de3").into(), - hex!("aa9b9cc039d147677aedd1e47ad9013fcc0da0164070ff7305b18e5786c7fac0471368637a3adbb78f3af174a5c1592a").into(), - hex!("a61687511b627bde7b3977e9a34cb7fddc2aaa509a7b99b6b6c7b97133845c721e1e69f99758698d82cca265d8703610").into(), - hex!("8853c582e86cf916750d670a621246a63c7fd78f68c556642053bcdfa7937de58885d728209736b7d5521b591387e9a7").into(), - hex!("82b8c013f24fe64b8e0337ae8b6a682cae336b8404eafc1404744f80f765efdb8b2873d1d3f31141e8dfe4d93346ac56").into(), - hex!("866ec39b9eda580d96bc2bff76af5cd4887b6788675149ab33bfefe38db82ad01b8d64c6b60704210918f3564cde1110").into(), - hex!("81337ebe90d6942d8b61922ea880c4d28ebc745ddc10a1acc85b745a15c6c8754af1a73b1b3483b6a5024b783510b35c").into(), - hex!("807c510df25c0ba10d4aa06a462e02f050c69a977c64c071401ab74f9ac1e60788aa504743b4cc1982da835ff9ac2541").into(), - hex!("96b1c82b85cdb8a7026fd3431bea9cd008f0261ee7f4179f4e69a399872837ab836a14e2dd45f5448d54800a4ae7c7f2").into(), - hex!("a48b1031ca2f5a5acb4dbdd0e9a2b4e9add5ccfc0b17d94818273c8df11e825193fade364e0aec10f1ff91d57d03a52f").into(), - ], - aggregate_pubkey: hex!("a825959280c88c6716f6df807204feb84d745dfbee3cb3474ce81a1ef0c4cd142e5ca962a0335e68b7b4266769d631b8").into(), - }, - current_sync_committee_branch: vec![ - hex!("bcfe80e1d24fbdad7bc058b011403a4c26cb56967654494cde51517f888023f4").into(), - hex!("4710ae46156553fee6231622052f7fb2f6945cdb59a5501cef824b1925c87445").into(), - hex!("6df62e05ef3e1ac92c659c3a519b8fa651d1b649c2b46fda58c48cdeffe8337c").into(), - hex!("d26ff22ef5958a707a8d98eb1ffaaf1f9f412e816c04b79f5434cb1792ccf608").into(), - hex!("90d5e61f0af673ab4d8b3ab0b978d05142a8295a163b198e6dea9d8c8f1c6d89").into(), - ], - validators_root: hex!("d8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078").into(), - block_roots_root: hex!("5078f286fa90b88a09dcccd4ac72f6c3615b77c0ab3132508cb8c0c07b20282d").into(), - block_roots_branch: vec![ - hex!("558b658b1230e225ac3adce3daf0b066ed0484b4a768d55b74ba81579ca0e5d0").into(), - hex!("2cbb27d38065ff3f230247af918e67d1998b67bc7e2ce6c244bab7146e16b8ad").into(), - hex!("c63bfc96585f424385e3b4b39ce46e957017b716c54d105eb7e07c841d1d4309").into(), - hex!("e662b38f57427b58c46b09980db3856f17e56b60b36bd5471823b0f2cc1b6467").into(), - hex!("8b3bd99618b1e50cf284b4c3b03d0cc272312bce377d585eded77154aa5580a5").into(), - ], - }) -} - -pub fn make_sync_committee_update() -> Box { - Box::new(Update { - attested_header: BeaconHeader { - slot: 4055104, - proposer_index: 1862, - parent_root: hex!("5f44df1f70338aca4b3046f9e5b144bda8b27276320ca000077389d0aba35317").into(), - state_root: hex!("9daecfedc819b45231bf93819a73efd4304ca79528032fae2e852ebbe514cfdf").into(), - body_root: hex!("a33f5cdc6732684e6f248e5a7636c7e7bf705f0bf709098a46ba15c660b4fc65").into(), - }, - sync_aggregate: SyncAggregate{ - sync_committee_bits: hex!("ffffffffff7bfdfffff7fffff1effffef7f9ffbdfdffffffdffbfffbbf7ffffffffffefdf7ffbeffdffef7bfffffffffffbffffffffffbffffffffffffffdfda"), - sync_committee_signature: hex!("880f147850ac0a94130b81f94203e2f69d512c929df8b954b6adc20cb1e8598aafadf366c074b590c0905d584dd980af18e0c8a837bbcadf6b4438507aa46ef95879c0acd9c2d273ccb13d93e4938e9c601f0dd466f53369ae94e1287955cae6").into(), - }, - signature_slot: 4055105, - next_sync_committee_update: Some(NextSyncCommitteeUpdate { - next_sync_committee: SyncCommittee { - pubkeys: [ - hex!("aedc2d47fa2662be6ab58ddd3682bd5e53f508162968fce8326c75f92fb3c1a25c4d4d0e6904f9b6cb1ccbaaa9dc28d8").into(), - hex!("8097b13908662d245820f3b045d8c2c665fe9a054e9c661323924ec86dfa713b36b0c787ad4dfdeb979318810e687a48").into(), - hex!("98aebd4bf15916512508a5fe89d814d5d76423c562cd3f0a0af504c8cde53be30f4df00e3ba0229cbf8528e198a0df11").into(), - hex!("86bba46d0031989d0f1baccea4174fc3fa0d595e60d35a464e86c33c233e2d6def84fced7a00f59afe397cf4fb5b67c5").into(), - hex!("845982c2672fdd44b33d2e56ad676e704c02f756b09e8765bea42b924c14724484567b55f0db42ac20cb70a7f5201c14").into(), - hex!("926dc729e135f1f0bff4662ee3d6823a64597fe189b763ada34f246e77705fd4e062d85506a338e9fa98c4d225a3b27a").into(), - hex!("b930ecc2a26183240f8da107e80979b59da4e05f090316d982815ed6151d7750490b85273187ec4e07eb221813a4f279").into(), - hex!("81564bee5a3bd09476f658cf7719326c353485e2f4fea58d110071c5dddd3cabc349a8d1ecea45d589ed4479952a2ba2").into(), - hex!("a66d5b1cf24a38a598a45d16818d04e1c1331f8535591e7b9d3d13e390bfb466a0180098b4656131e087b72bf10be172").into(), - hex!("b9b9b6113301bd2b409b71afa1ab9e31d22f84f8cb03badaa408e1d37032350094124e533de766622d7975a047fade6c").into(), - hex!("8eb3b3e3135720036c1120c4e8b8d405b00d002f2bdbe601a06f2c2fffb940a9966d18636ee34fc003dfef547d8f3b76").into(), - hex!("898deb30ede570d391266c81132a78239083aa9e27a9068e26a3bc14ff6468c3f2423484efb2f808b4996c16bfee0932").into(), - hex!("a90d9502a9785e55c199630456fcb1e794bbeb0f5f8c022e66f238a0789998b126cf9911fd0b7d463b7706dc6f9ec128").into(), - hex!("ae8af784224b434b4dfa9ae94481da4c425602097936623e8abb875f25deb907aa7530bce357786a26ed64ef53d5e6b3").into(), - hex!("b544c692b046aad8b6f5c2e3493bc8f638659795f06327fff1e9f4ffc8e9f7abdbf4b7f6fcdfb8fe19654d8fa7d68170").into(), - hex!("ac5c01c51dac6ee1cb365c9b03f09906d9b7b9b4d1b73c44d9e8e06823025d7070f242898a975420bc87d6372382cab8").into(), - hex!("a4632399c1a813e41fb2055ef293466098ea7752a9d3722d019aa01620f8c5ecdc5954f176c6c0901a770cbe6990eb11").into(), - hex!("85f7ae1a7a7c793c408750ddec2d7f58b985fc3cdf9fcf6b2192bc57092b8a271b2fb6ced0639baaffe0bec3203e568b").into(), - hex!("aaeb466f4316874c2107a0de38dafafa65ce50039c20723e8797815238011426f4e77e29fc573e7c6d2df85c1bbfefdd").into(), - hex!("a8fd63da16dd6a4aa1532568058d7f12831698134049c156a2d20264df6539318f65ec1e1a733e0f03a9845076bb8df8").into(), - hex!("93600f65c090814cee5cbd5f22f98e79c69e63510501a0be6a74b111e4c52441133fc1c198c7bf235f9005aeacf1d441").into(), - hex!("a69f0a66173645ebda4f0be19235c620c1a1024c66f90e76715068804b0d86a23dc68b60bca5a3e685cce2501d76de97").into(), - hex!("ac6e7e9960207138d5b4b6a7f061756c01cc4a830e5988423d344f23544ed0eaa790aed63a22df375768f670cc9b9bd4").into(), - hex!("93042dd42e56671155bb40d85d9d56f42caf27bd965c6a7a7948b39089dba8487d4d5fd30522dba6ba392964e3ffd590").into(), - hex!("85bca2f86423a09014b562f7dc613246bedffdcb3aa41fee02270c13e6b00c8d6704dcbfbafc5997df6a90c7fc08c29f").into(), - hex!("9550072f64a48cb86bfa224d492be9a91e5a6c9def04b6a290b7a19d96981937d5a2c35de6515d1881bcb167f6e3d661").into(), - hex!("8d797819318cdf7b26405d1a327d80d4c289e56f830b28d4e303bcb019aeb0b3d69bfed58adcde8a2445dd5281b86af1").into(), - hex!("90c04eb3f3679cd630434418cb3a225a73254887692429960bd45b1613f85b2c14723cd8c7f1e875588ed82b7f5576b7").into(), - hex!("9953a7cbc152f101a60e3e381f2af17ebe7401e16ef6462d132b8f0f6c6a18837914a1299d1605f9f289b9561112f4bb").into(), - hex!("a9300a33927335f482dd0e44d0d57704ebeb278f732ae8301073cb7d5e457f02a0cb03268de71d284b8c23fb96947469").into(), - hex!("88554c83648ea97dac83d806cd81d92531980346b208d281fba489da15a0084fd4d9a00591d1ca67aad3c5793685d55f").into(), - hex!("9131874b09aa95ba186bcaa9e040fabc811b9c7b905b7dc79e902cf2bb5816d7ee39b0b55be609f22bc8c538760b2037").into(), - hex!("8368bb9b9bb2e17730c42ed1100eb870c88a8431601312aa8cb1e738cdb9ca2704dfd432cf1703c0db043259819631dc").into(), - hex!("b49379bbb9f954d2ef5574199607bc6b3aa2cc3b48dcc3745cc77406bba2a394929844fec1b87c4ce65cd0ca0f83062d").into(), - hex!("876afcd045c8a18967923733a3a43757652289b0974cd348238a693f30bb57f38664ecb97877a5e5f7d0185039a2bf54").into(), - hex!("8db19f6dd3789df179ab606508ca7e3da7967ad4340f630bda83df54c197d6bd3a14980c87fe10cbced7678c0c300ef1").into(), - hex!("997a91da55801acb6134d067ad65a9a44ead0b53d3871bb97b46ec36149d25e712d7230d38605479796190abd3d134b7").into(), - hex!("ab1abf9cf630d6cbcac0c503df44603142ac81acd647784ae0e8fc97800ef04378bc9d7f2087f959ad4bbbeec65b8dfe").into(), - hex!("95718b06017ba9d45894867fd67148645d25d9db2229aa89971f444641ba9db4c5c6f0785f3b25cf2cd7fadaa6adc5eb").into(), - hex!("8ec38c68afdfb6ba019204039c2fb49a35467058f561f626fa87314d705fd615a7b9966576052be1b3690028d3c5c7bc").into(), - hex!("a5d72ac4cdcd847d67cb5a68c6141cde99a91303ca84165bbdc6fd7f643422faec783de60739e1b2753088280c90a68b").into(), - hex!("a778da56ddfe4a383816b43b027464d7a28689fc4a6b35b36883d3f36d9c41f0177bdbfc8f258afe8da90f02d3b64fea").into(), - hex!("a2ab566033062b6481eb7e4bbc64ed022407f56aa8dddc1aade76aa54a30ce3256052ce99218b66e6265f70837137a10").into(), - hex!("b9c347c1c350fb7ef6ee9ca6780cf0604f30e3a74e9d0234bca6b3e7faed26148f2b736d9fbff6b04f5b947fda458e8c").into(), - hex!("815f53751f6d3e7d76c489f3c98d2b49214938cac8c2b417e2d17bb13446c285fa76fd32a97e9c4564a68f4faa069ad2").into(), - hex!("b3f1319ae34ad1d59207288f01d3d7b7e1bad7733fb4a819a09b011d72a4d736bd3c7afeb74cf56da0e00cf712042ad2").into(), - hex!("abbfb501071148e98b6aa56308197356fd993c93e27fd58987eca82036c1ae0ea89f9fb1a06c82851234643904c58453").into(), - hex!("a0899189bba608887c6cb729580e570ecce9ca7107865ebd30def867afaaa250bac407c30dbee11b7ef6cd423269a8fd").into(), - hex!("88e7a12a90428bb45bcf4b01442c11607433211fc2f9bee9545304eb66e0b4b5339360160bc782e185391385da7c5ad7").into(), - hex!("82714b00a822c30b317ffc1d4ba163990cc1ffe5769f91906a7f71ad1f62b39865a5314433a4ab2ba762b1d62b01003e").into(), - hex!("a3a930dd70aeeaff0f2e3790927d5425db40467ee106261615de5fcb937bb1621be213ccd8b3a14d96c5908bedc2e421").into(), - hex!("b2902161b565dd5b8e8c54187b26f01741a39ea8bc1120598661bd367cf8fc73e21eda2f0f6f9ba2270c80a59ff5985e").into(), - hex!("b77cdf45f39bf85ab3e8c8afa602f159de8352188aba5378957d468315a2d2326daef83d8ac6b227f1e7a514488afbc6").into(), - hex!("a9e573274f5a131d6c7641bc0576a2621b6466a5bf2cecb21058160a854b1b9e0be176da2b6b9b3ed562fc36c5f09119").into(), - hex!("876561bba29e656b7122f1cb51a02dff1ac7d470217d8a4799c01e61816c4660eea91843a5a42502ddf842d2daeb0586").into(), - hex!("a0ebae60a998907a19baa396ae5a82bfe6aa22cf71bfca4e1b4df7d297bd9367bbeb2463bda37aa852ad8fd51803e482").into(), - hex!("84a6edac5ac68a7ca837c46d5ada8fab136748b6c3a3b9165dbbc231ec386b15328e4ef7d69a15d4cf354135348a4ee4").into(), - hex!("8b476b3b065a3b95a3d11ec60a749c2258ddcc5885bfb50b8a086d3fd1e49ff73e1dde733b8981c3d2d206aa0c87b09b").into(), - hex!("b48490c5a3bc9e66cdc78994f7c73e0f2724fec8a304b4147799e5142396df155ef7c42065ed6d2c0393d138fb4d2a0b").into(), - hex!("849ddbdc3ac55ff22a3b2f4bc51892fed694490ab4dd342165ac38c725c8b38921eaefe3c443962925fc3726aa41e236").into(), - hex!("b49c45d9da4aaa64967c28f1fd77b7f709f5a331b58823eb1613856fd8f92635135981830a287e8dbda3a0e0fc481c5b").into(), - hex!("93ccd8c5f82374e0bef6562e16576f742d79b6f400e3485ef36e148088b61fbd882c3d2bb38ab0b43fa1dac77f31d543").into(), - hex!("81522576ae4ec9358f1a16934cd1c1116de609634e68f552924a972101eb7215f037ab8e0582d7b13541537d55554d31").into(), - hex!("aad60e58a19598c5013b37e2e4adc6721eaa7e6e184960d1dc4e6f012246abbb58a047c0679064d5eaaaaff02de881e5").into(), - hex!("b4f034f2b53ff9989e8a0f12c1484c58ed7942432a429af58a6659feaf23f7d2bf20ff7b9a7e0a28a2e09c9a730681d8").into(), - hex!("88b2c68b425269850c1a4f4608aca194da5c641adeb99e2f7fb92e34b8245dff066e73bde072be60f7f2c3d3d13de3b6").into(), - hex!("a749ab53fc2662a0796489be84fcfa59bb723ff748bd8980df0cb4b3d1e2943845b0d7c67576fa0a33c8b0ff8a86932d").into(), - hex!("abd7248ae069d3a3a45b0ef4dd5d7d54b62994e578ea20bdd3b7876596673953b94c5b109a6e4b953b517544b915368f").into(), - hex!("a49da42c27d019a21cc6489ada7b712b98c4ede28ba25dbcfa916acef48446a2baf73e03a48be763378a09774d4a03fc").into(), - hex!("b3c36fa39f668bbc3fec028875a820057dbf96f727bb423280da96d5d50e885d23bc23fb73457bf79089691ce7663a7b").into(), - hex!("8dca376df4847cb8fc2e54a31894c820860c30b5e123b76670a37435e950f53312f089a8e9bd713f68f59fd1bf09202f").into(), - hex!("95d1f944b0c53eb3e9fcd5632713602bbb9195b87a172a370ae2df98504612a55f3968615a39b569ce6a0fe9fb559be7").into(), - hex!("8c9fefe233d0d657349b7efcdc368f5aaead27071d224af780874751e7d241f6b88f7650fbb4133043b24bbebc12aa48").into(), - hex!("a2ee6c29efa982e9b9abd3c5e4f14b99d5d0369d7bfc3c8edae1ab927398dc8a147a89e127b3324d7f4e3a7494c5d811").into(), - hex!("b7ea5e0d3cfcf0570204b0371d69df1ab8f1fdc4e58688ecd2b884399644f7d318d660c23bd4d6d60d44a43aa9cf656d").into(), - hex!("a07826925f401a7b4222d869bb8794b5714ef2fc66fba2b1170fcac98bed4ba85d976cf9ee268be8a349ae99e17ac075").into(), - hex!("b0a47515752c15e4dbeaf9ee27fab3b5c0db82f5c685e8f716fd7d8764164944340430fe3db1a5679e6ffea5a16dd919").into(), - hex!("b7de6d7a4afb05984dce153e5570b104338265e45c8f0156f4d45c458f47add234a479e01c02d3c1817c170b5b65b100").into(), - hex!("acd4d1e11f81f4833353b09d4473ec8b15b8ff31dbf39e97654f5338a26c4020306d51018f1f4b9c4efdb92992408a6e").into(), - hex!("80e09f3bf3ea87d48e04b53d8f3b43b7e53d61f445f8c8a5a35472b84f6bb4f58f17d9832f5881bb44fc06156151e5c5").into(), - hex!("98d6d46f603afebcbc561c130e416d5a588a7e6c1f17f89ed6e30538b7f8dbf4b3c75b8a3331425c4ca21e03fe8b57f3").into(), - hex!("ab671eb947490c43fd05e42a787344b21af89babb705393c82748eaa0cfcf80bee498d275a1eaf1d647ca3b2923d76ea").into(), - hex!("80e1dbf3296bdfa98aeec1a7560682165d13bc628061bd3257f345aa1ba13f8bd1bea14f117af562be22118f5a8265af").into(), - hex!("aef456af90354ff88039d2dde02b0f5a6790aa762b23e0a9da8c6ec92c3b8b3320687bb21666608b4a22615843afd1ef").into(), - hex!("a5a07bf219432e9c80c38596c93560b49c7de287f31e30b7a06fcb4d15982add4a24085adbc5b753c462be989c64c96d").into(), - hex!("84d2eb008578aebd6f01254b7e46584c1524e6fd7a5a2ae5fa0ea560865ca50d52290cf2d12dd20b042f402e62181b4d").into(), - hex!("b8e5226ad3515627ae6840235f5f7b7ecd54e8f01079c324d126ec852f6665ebb77168b3f2b3b51580e04a6ff602d5b3").into(), - hex!("8c1de4264e04ff7e8282faf81c0bfb5943656451be52170211cb7adf4ff21bccbb789400735579c622f69982fcb8e9c6").into(), - hex!("90bfbe37ac3992432e68c95c0d4342a9712126d1f50089239c9f4f6c0c202b54334e08604d245b97dc8e8f6706f6992c").into(), - hex!("b0a771b9a0dd7e352d46c8efcc1834e610dd097711bf7117678a99d386890c93b9b901872d4dcacb6dcbcf3aea0883ea").into(), - hex!("a4eb903990bee2374b14fa66fc262d6821669537e9ba241c87b4b5c9e2b89b32fff4bfc28ab8471ef52e8eebc3e743d1").into(), - hex!("a6b74c706b33d3cae9b7adc5c7502ac98f7bf94a14d579d2bf77b613ae555634ad6fe631ba36dc14bf44526436355e24").into(), - hex!("8296f8caf58316af535def398a43357e48cb3b1e674b857eba1bd1b970da3dd045e22fe6d17dee4e9117f62ece3ec31c").into(), - hex!("a129c9cf33df42b5a98ad98be9d940207ae154c715d3bde701b7160dfe45304679fb0481a4f9dde242c22a9849fc2d9c").into(), - hex!("858b6f1bd3e68fc536bdf1f4bd96db032994eb76e71571e2d85af73b898478b82f9ab432732b0beebc0864ad8025ae33").into(), - hex!("8658a15df961c25648fd444bdf48a8f7bb382d9212c0c65d56bf9cdb61aab3bd86604c687fb682260dbc0ad2dc84bf01").into(), - hex!("a8d152e5d94b75cb9e249230db21af31de4d4f3d4ef60ccbf2212babf69aed2a38435a993ee2f13cca410ad55a4875ab").into(), - hex!("95757096c132e7f6c096d7b93a5a0d2594d5e609b9f13c4a9f878e95a389fa1a111b185dc1fd8f7d98b737dcf8d2af60").into(), - hex!("a22542a4a2ebde18cc6aa29d5dace8b4f6720703f519610dcf01e671018392aff15728e3764730840272c9cfb074b612").into(), - hex!("8f90e72a54e6894d511061957162e753010812346afd4d90cfedb678b99ba1aacf2b6bd0e49b4b0e684da8082a048619").into(), - hex!("b2affe048c187d311a185503d8958cacbe03796edf79bc32e8533941004d9178bd2e376e627e1ba61ed43850c0c455cf").into(), - hex!("b549d272a7f3180826a978d747507e4dc80d82784abb655cfcd3a69cc72e7d58c70febea1ce002a89852a8f934ea70fb").into(), - hex!("a9ef845ab489f61dbfdcd71abcc29fc38f3494a00243b9c20b9cd0dd9e8a0f23304df84939b9652cdf5542d9b3ee085e").into(), - hex!("aa744c552b5fc41e1ac6ca53184df87a1b7e54d73500751a6903674041f5f36af25711e7bc8a6fbba975dc247ddad52d").into(), - hex!("a802b9ffbd4f01b877791aba27da972be4bacacc64a1f45687be4af01b84bd4b83fe2ba1ea78e29d7683f6c777ab2543").into(), - hex!("b44d2d9510516c0abb4fc101241cf0e0223b179fb70686519628c27f0ef56381232961bc79a30f592ef093ffecbc4486").into(), - hex!("a684a09add047c0fe648d9c5618500d1816047168e055e8ac8c952c3544a462cc095b32fab07d939947a58fcb4ec7ba7").into(), - hex!("b5eb31e5cba0193e74968099ace5808dfc457c6f404f270fdc4949b60daa7607ba1811abab1bb19fccdad61d489b6657").into(), - hex!("a10f19657a9bc5a5c16ebab9f9fddc3f1d812749cd5d80cb331f51de651873ff899e0670f1b079b29a194572de387a17").into(), - hex!("af61f03e3ceef5bef36afa29ba2edc7a3b01ca26cec2589edbc9d124dd46e41410e0e3afbae959c83a6f839bbcf8049a").into(), - hex!("8e6bbfe492ecbbb8dc8889d3dcd7037a58db605bc6bb79131a72a9b9c1bad630e75f5e5e0c1bc407e73f3d13b116739f").into(), - hex!("983fc1ddf17f9756c9cecc00b39bb2ad432587a5c6d1c3296a383b9f539c9afe84c6c818447a709c0b686ba26ce5ea3e").into(), - hex!("8d52413f981bc611427ad0534d25e914113d0ebcd6960aab6421608bec6648b89ae4b2ca2153c57d3cf4f1f37212aa5c").into(), - hex!("ae075b66e5f211c2149c45b211d1297bbc1d9e6497cb3315363c492a9a51ae5b9d0a28bfecd755d68553736901ac6606").into(), - hex!("a02f7fec0661394399a82b2e3151009160b3f5392017ba579b301ed42c85100c295acbfed46b6c58a9d71796ed0930e6").into(), - hex!("a3a7196fecd25e9cc7cac79c35365676e48c7be1493df255676adff2209c0719f2190ceff3ce008d08efa07c244c11a6").into(), - hex!("a5fe3dfb5031517bb8db0d5ade1e9f438e84bcf23221de003b03d2a2f4ea97629e81c79abc3769bdb8c69a512c189b91").into(), - hex!("8cd9d7e953c7ae07ee785d68a999e702565960d376692d9ea468556ad141229b1f3bc97926818c078901f73ecc578e93").into(), - hex!("81d6fc2f01633e8eab3ba4d72588e14f45b00e68ab887bdd4ec5e8558965db21189310df973837106216777b07fc0805").into(), - hex!("b75ac3d5b3dad1edf40a9f6b5d8923a81872832eb3a38e515539cec871a353b07cb477f6d55cf15ba2815a70458aac32").into(), - hex!("94d3c9406dc6dd7241a726355643d706e46b35f1ffe4509ac43e97c64c07592821156ba02ec9a78978e66709995a0ac8").into(), - hex!("a3b109249ac2900806f0f39338da72d4f2cc6d1ac403b59834b46da5705cf436af8499fa83717f954edb32312397c8d9").into(), - hex!("8336744d8ef3a3bb3e9ed3d6b83e08cafffc76b7438adedd3a7358b32acec0e73a4635aa3166362ab4e158e68576255d").into(), - hex!("99b74edbac662fff69ba412de466a427a928ce2363c9e59dddd664f6fa50f2e1dd3d464701b01784aa224b3d96dedea3").into(), - hex!("b397ed7134f447d9bf1c511bf92f2d27d7b6d425b8b411365fbef696cff95c2175461cf5dd83d93bb700e50ebb99b949").into(), - hex!("a3e1fe11f38d3954a7f48c8b68ff956ea0b6f8a3e603fd258c9406ec2b685ff48241db5257179ea020a83c31dc963854").into(), - hex!("949cf015ce50e27cf5c2ff1b8e2e066679905ac91164e3423d3fb7e05c64429e77e432db0f549acb99f91fb134b6edad").into(), - hex!("a1c0c317e6e352e16e25c140820b927161ce5d2c4c2e10bca3057ba4d46b4f42ad7aba20de86dad9fc6368ea92695268").into(), - hex!("8d6e3df29419bd0da1deba52c1feebe37744108685b49ca703e1b76fb4d612e3959d3b60b822506e5c0aac50b2f5eee2").into(), - hex!("a15e0cb96a463ab81e661ca44c619b71a159680bbc04707ea5a5867ff38b15416e3abe55d2fabdab9aede1f157dd37e1").into(), - hex!("b6d6482ad7b9b412ffbefbbdcc28eb3d091b1291f54f77bdd53c4ac85f705c454940f466dc272dde7b03c26f0cd6ecb3").into(), - hex!("8391e3ad6ec2686bdc686671d579edac2d5efa8cf0923577df28fe0735e4d5103173d44452816e3c2b2a7fcc1fcc20d9").into(), - hex!("818202d7cb60e4148c71633ccbe1ce311de7b7ff93a1988e86ba29cc58037189f0f275b3323a6719dc9bdcfbc49c35c3").into(), - hex!("a7c0fcc422c6da878926cc6763ae6ec685a5d8fd1afe61269957be6bfb3f1705a8e4c6e6d85bd15636521f5a2ceb3a00").into(), - hex!("8f7bbaaac458bada6d852fe665c87c646133bab16c0d5136c3dc922095b9d647d93a9de7671cb7bfd4cbd138ae0709d1").into(), - hex!("b6e9fe9fa3d4c833c3beae7f798f30f07e3cdf6f6c8eb8e2b70cad51b37af2549dc9f2e7f97f194e5897d4dedb904a45").into(), - hex!("b455f751232de0a48440d09983f4f4718b6169907979c9f282acf7177ab5b1f338fe1f2acd8d0bee4b4aad61d0340839").into(), - hex!("8aadfcf3562f1c357068323352cb1745349a27a7362358d869e617c2410db747149b993ee9e881e252ecdd42fd75f351").into(), - hex!("91bf4c32fa8888d3829d3c33e12550d2ecb70762d5eeecd044d4902e4a7f8b7a2592cf6cb7736eb6bd9d312f85c2777c").into(), - hex!("859426bf6211e68924eefdb26cdc168ac0deab291aaff7036163997bff34d45809932f91e12d113784c05553ca773b15").into(), - hex!("81730b4bc5f755e5b99c321a6996c65e57ea2ebe6c0e4e404ed30920194fd76db65304635ad054a8b25bfd982cead47a").into(), - hex!("b26f5ed09f7d5bb640ec94ddd1df0b76466f69a943b4699f53d45296d5d6b8010bb61477539bc377d1a673d89074d22f").into(), - hex!("aa65c11071be23c9bddaa5203f3166e5cf043efe5fb8f4b26f8a9cabe71db701a450e79eb001c401da5752755d9cf1af").into(), - hex!("a019370ca799c2c98a605850910cf43531bfb616393039fdfc370848feedd3339b2427b750ccc91952b03a09f690e9ed").into(), - hex!("8f84cba7ceb7652023fc8ebde4b00ecde1f550935bab12feb630d6f49517b4148f3cde184bf55d4f6ec99a849fc6f862").into(), - hex!("838733220d1559c800cf1714db8a43a67a0c0d1d3a9fc1e2cdcf615d20406501e5146fe8b59bf64f4c5daa1a6d74f15c").into(), - hex!("9708cfcc9ff95cf23f544119e17518a338575018f153b1ef50118da0681304919a226b2089a417c2ab7b4320dffafc2a").into(), - hex!("a988cfed9f481bc98beb5fc188ed3f6893a3ebba27c3ebace669792f6abf0997727023c3b6930a6421224f5b257b8b49").into(), - hex!("812d3ded3a3c9e58eecf13a29bb4cc13b01b2a0af322423a29bb0e4f6d9021d1d87ac4af7a2a6b88d34f44a8bc1b3c55").into(), - hex!("b2baa7eba496ac4ef60ad8ef27a9677f9507820d95a1c572d322621c4d0226b36146bfc3a9ca1645d123acbd945de3f4").into(), - hex!("89ab1e5c2565f154f92c9b3554160832d176613f1a2f872b6ed62ed925a33fb0b40b71b7443eaaa15099ab24693c8d13").into(), - hex!("8982534f2c343dda20cccf5a9c8bf98240bba5f4e8eb2206e63a1847097deadb6bf0d24b358014d564c5ef1d0448c43e").into(), - hex!("a1e47798a782a024da340d6d6a1b1e5e15a0f2d8668adf349ca375086964414a563cc1eea3226ae637f87e78c0a630b3").into(), - hex!("847b58626f306ef2d785e3fe1b6515f98d9f72037eea0604d92e891a0219142fec485323bec4e93a4ee132af61026b80").into(), - hex!("8368a0f17c8427beb71dbf11a09a2fe8495a33f08c29c74a9a996a88aa01c0a09f9555abeb1ef1592cab99a9e05875cf").into(), - hex!("b38e558a5e62ad196be361651264f5c28ced6ab7c2229d7e33fb04b7f4e441e9dcb82b463b118e73e05055dcc9ce64b6").into(), - hex!("8018499ef720e28759133033833edfe17ed23e42f99058bb79fe844ddee823cfdc43916be2dc9724d18f9726e6f1b409").into(), - hex!("aa9b9cc039d147677aedd1e47ad9013fcc0da0164070ff7305b18e5786c7fac0471368637a3adbb78f3af174a5c1592a").into(), - hex!("a5c0e42851b769d2d822e39222e708068455aae3bdf782975b59d3201e67a58fd66e16d380558bf2086bcab890a92dd5").into(), - hex!("af3f765fd293c253072b33a780ed68933f78d7e079d9a2079b6232755bedf6ebcbce9ba65c01f695602fa8ee17899867").into(), - hex!("8a0192ef0903d7a5ed2e5614a715901f2554b324ee72390974dc90727ff08dafa580041a21a8e6c48a3e08e1b042afab").into(), - hex!("907c827a4fb5f698bf0e6f10ca07741c5b8e3ecb26aa53f938ba34ceb50c01be80c4afc5ac4358a5fda88eadea0cbe73").into(), - hex!("a35ee5c2d7800489723c78008b495e1742f0542dbb487172ef438f60424c81aa41c2397095821248066140662133f6f4").into(), - hex!("b1925ee53c9228cf80e2f5ac0117008a91e98d878f69bf03d00d873ef45f4351cb6988772d89d4ccddb40778d11e0dd6").into(), - hex!("95aafa379cc6a2b4bdd0cad30b7f0a47839952af41f584219ec201c6c4d54610eb2c04b67b29080acb8cecc5e7543fbc").into(), - hex!("8f44c43b80a3c5f488118859fab054745cfe5b0824821944b82fcf870fda6d93489ea9ca4220c24db2f4ad09c6080cb7").into(), - hex!("af861bb21f84c3e7cab55370839d18ac24c475a9e833607fcd7e65c773ee9d64bea203ee9e8fd9d337f1cd28d5ca0d90").into(), - hex!("8f6fde2ebbd7682c69026069cfe93aa5410071f05de9ccd7070c8c3299a6539b39b3798f01a0b4e9b1330510bdb51de7").into(), - hex!("a35d9d6d5dd5428cce7616842203b5fa3721cb4b20f50c0113f138604954fe0cf214ca3d065b578f921054b9efe823df").into(), - hex!("8d562d6c0e0d8325032e1fbf836022c82a8f600a6fbb56c553ee5d1fac0f052c7ce2504c0fd48c9fa6494a6bff63c9fc").into(), - hex!("b02ce594310f1eb8acc92bb80de524a43e663e12fb64fc28291ff207f9d8ae761631416410c3c8f4d6890b8b7e6ed24d").into(), - hex!("a258f8c0eff666c2bb70e505544c3d10d6b258310e4fb2206fd0999f69bfb739a1e232d1e810e7206f490f6c44f6934a").into(), - hex!("a8a77936ca91df3b2ee7394ea821f2bfe91c6ad8193f44651466c170b6ecca97ab356fa7d947ebb4b767e8967092f143").into(), - hex!("88ad79a0320a896415e15b827a89969b4590d4dfa269b662bdc8f4633618f67b249f7e35a35884b131772d08025bfc32").into(), - hex!("a3c66439724d737d20a640bceed8671b20cf6795671b6d442ed1ea5eda6723ae559396c24f44e982ba7751dcc6adef5c").into(), - hex!("8d0e6475acfa2b904e7d53bc7acd070a2ee4894ff5720a20e560e9ecb7872ea442a51cf2f2eee4bef66604a5c08ad9eb").into(), - hex!("804c021152c3304853941847e80480fdaceba3b9676fbe018268cf77d1a1856966c2f9686bb4d4aa0c4118a7e85f83cc").into(), - hex!("a6565a060dc98e2bfab26b59aff2e494777654015c3292653ecdcefbeeebd2ce9091a4f3d1da10f0a4061f81d721f6ec").into(), - hex!("8d5de60e934ea0471d9e0a46489f21e03abb9722f5b3633631a9a099b9524beac5d67716969c83d824498796d9c106b7").into(), - hex!("8c5a9f6eb0a3ea95e75362b06e5cd23968447a212cf22e1419c984d74432c51d290b717f80e8ed3e76b1232216f99758").into(), - hex!("918ebb73eef984d0ce28083306626d04817038056aab4a82ff9ac8176ffdfbf3173c0b05e936daf553248b323fe54f56").into(), - hex!("8f9aededb605db4e499d3c383b0984b1322007c748dea18dc2f1c73da104a5c0bece6bb41d83abdfac594954801b6b62").into(), - hex!("adb198f70a7f1969ed0958be4a9a60dcc1806bced79c63692b9aad6c5648ffea1fed60b24bf4b1862e817cf229e93e83").into(), - hex!("b118f77f99ac947df97e7682f0fb446175185b842380af4ee7394531e4f93002c72b41a57a7c1b923a4f24b10924c84f").into(), - hex!("944f722d9a4879b5997dc3a3b06299182d8f68d767229220a2c9e369c00539a7a076c95f998bea86595e8ec9f1b957bb").into(), - hex!("b7270f33011db1bad18e076a162d6e53d9123808609773eb46e3a4ac69c84c257407907bd5d05b6eb5e926b8d8c6d884").into(), - hex!("b09c0a505457c6b473fc7b2d634222905b36a6ffcc015dbdffa3bd62218c94e891615e77f28e6e18dd8474be8c156695").into(), - hex!("97d076617cf0a64ab3d1f030cfd72a303b6b252c0a7b96157ff7fc8af5970f00d14492c46e8f6f37caafe837d0dc95c7").into(), - hex!("b405520ef829a2a3b8947f1687ab56a7af4026c1a6f99f59aa192bc4f3b12a2de407862ff74ba1b2c51889b8d6b090c7").into(), - hex!("8bb045e7482b7abe670d72eb2f7afe4207b5a3d488364ff7bb4266f8784ea41893553a4bf7d01e78c99ed9008e2c13bb").into(), - hex!("b2df29442b469c8e9e85a03cb8ea6544598efe3e35109b14c8101a0d2da5837a0427d5559f4e48ae302dec73464fec04").into(), - hex!("99daf03fa434a482d9aa4d090884c99b7208c1f5380b9acbf304e1bc33d3d6902afa5d248d20ccf03795e26901356ede").into(), - hex!("b60df25a7ac1ad14aef7e8809c4bfc190b715f94f14b0534cc2e4015ff6c322883cbdc5309e05d67dca4bc641c69725a").into(), - hex!("b46a818f3e492e231d8fa8de8848c16f0d648a2e0d1c816adf9306a8596fdf45922e59cbf745430570a19e54f45e28f7").into(), - hex!("b3ca2ab7d64b71e40693bd3e2288a1f78741a139403c783d259cb9dc9c29f16c00796b6302cdcea4a4314e132b4f9d1c").into(), - hex!("af3d3dffbe55842dfb4417295a6ed1a82d26a579199494b305445215045785759be4cb57dc870c7ddaffbc101a854a92").into(), - hex!("b21785008910a949804d1291e7533752641d31beae3cb518806488f81d58c38a5efe5ed9534ac692e68c3121e2f9d97d").into(), - hex!("ab7eff4ef8696db334bce564bc273af0412bb4de547056326dff2037e1eca7abde039a51953948dd61d3d15925cd92f6").into(), - hex!("8bb4d08318386c91a0136d980a42da18c05743a5c52a861ce52a436e66a8ebe472dac7f7461db32ea5da59a23e9bd6c9").into(), - hex!("a1c84730a5c41dcab9a5ef9e1508a48213dbc69b00c8f814baf3f5e676355fc0b432d58a23ad542b55b527a3909b3af6").into(), - hex!("948f808c6b8e3e109a999657ef966e1e02c96a7aae6eecaf912344e1c7bf7ea51c911cecd3cea2b41ff55acc31df9454").into(), - hex!("8d264fbfeeebb6c4df37ff02224e75e245e508f53fb3446192cd786ecf10d0f704c4fc2e53e7f7318ae1407e46fc0fb8").into(), - hex!("8d47a7c2c62b459b91e8f67e9841b34a282ceb11e2c4b0549883b627c8526d9e0ebd7333ba70630bc0ec2478114b6ae8").into(), - hex!("a4348ad30c12bb7dd03dd014cca599c3499ddf348e7795b0392a18f998289979478374e374a8297b5b6c427441e2b5af").into(), - hex!("92ec1aeb2aa24c51cd5f724972c8b6095e77b237d83f93ed34ca0bc91a1dbf1ad95adccc59e0f0abbfef33f331f3298c").into(), - hex!("941f73b2138b4347ecafcc7b8c3d03f2a54dc49f580394ed08f22b0878ee7cb63d42978f1d320c09e7dbc67648c06f8c").into(), - hex!("a308ed8737b3a9346ff20dc9f112efccc193472e6fde6aa218ceae11e288bbd2c35fa45c1d8bb238696a96767cd68b46").into(), - hex!("8eb03001ac9e22c6956a682ed458e650785c36d23ddbcd51ac4d9cc991325c02519ff1958987a08eb29ff56ff6e2c293").into(), - hex!("80637db55287f891baa0e865d2423191b9a575620bc4493ea76166d47b99fd89ad8625c21f446b01e3ae17292c78f7ef").into(), - hex!("a5b3da08aad945effdb645c797a0a8bfa828c9d658df2783a214597acebda3ffc07ee48d0ce1147d77540b557d9ada91").into(), - hex!("8d5e0b8cde1f62cc8f15d9f596e31de09c221da91b10335b92ef1155802e742442def161223333573158723f3408bbd3").into(), - hex!("931923f0c1f75a197e6244d67525b524ceb07510a6aae8cb3d56167cc1aacc76d26fadfa1bdfc55d8439c6ee4d4d8174").into(), - hex!("963a298fc8876b702424a697929c7a1938d298075e38b616c8711f1c7116f74868113a7617e0b4783fc00f88c614e72d").into(), - hex!("91ead7dacf43905eb5d4b179af29f945479ed074126bad3b5a2bbc1663af5f664fe53a36684e9389ab5819e53f1344fc").into(), - hex!("b8a6c999068c13fb71a99d75eabadf7edd2d32e28607baf001a0aeec412fdd3575602c68d3feb4d743b90396705e37f3").into(), - hex!("938bbaa0ba14597067ff4c0a7cfc1529c44160d6f61cfad12246526d84fb7a1ba964d3bbb065a348cf7a98356ee15234").into(), - hex!("80e44d3577f12cabaed7074feeb57162ff80b61f86cce8f41d1d1250bc455070b09f6ea9d0c263b7b4824701480f4c14").into(), - hex!("8d74f4c192561ce3acf87ffadc523294197831f2c9ff764734baa61cbad179f8c59ef81c437faaf0480f2b1f0ba1d4c8").into(), - hex!("a0133deca5ae8f1100df8db69920b2d0c31aa21bd3849dbaf4c264eaeaec8937ab8f982770ce1ea17e0e258910a56d02").into(), - hex!("b6a25d493d708b035b853f1f7a6628d8e0b205d2678293f763d7ea4da11d298539533b22b43ed2e5f708648556f3094e").into(), - hex!("a58c3a4ba86d0d6b81c8411bb73a528b4f3bc2debac0e0208f788c080a3a96541d57c927143c165f595070afe14b0517").into(), - hex!("a52c15840b89d92897d1e140b2b8468a88886c5e1092861e598b3a433b340ded5b35b3d632a9879820fd56f20ca3a68b").into(), - hex!("8c122bea78deee98f00a86184ded61c10c97335bd672dadddc8224a1da21a325e221f8a7cfd4e723608ebcd85a2f19fe").into(), - hex!("87a51e0011dd0488009baac9c611fbde01878f9cf1584ea407599742bb32ef10586d9040dae3e9800a125de54f80c047").into(), - hex!("98181e9291622f3f3f72937c3828cee9a1661ca522250dfbbe1c39cda23b23be5b6e970faf400c6c7f15c9ca1d563868").into(), - hex!("b01a30d439def99e676c097e5f4b2aa249aa4d184eaace81819a698cb37d33f5a24089339916ee0acb539f0e62936d83").into(), - hex!("830e70476c6093d8b9c621ddf0468a7890942589cae744300416639a8b3bc59a57a7e1150b8207b6ab83dafcc5b65d3c").into(), - hex!("83ca733849830cb8fc2ef469e7e464fd94def561ce49ff0aa352a6ecd0e52c7aefcd69ab59f3d1ed2d5b8536d0a7895d").into(), - hex!("b76cb8cb446eb3cb4f682a5cd884f6c93086a8bf626c5b5c557a06499de9c13315618d48a0c5693512a3dc143a799c07").into(), - hex!("8b027c14affe47f83ee59b504d83b2fd2d9303de2c03ee59d169bb199d9f4bd6533d7f8c812dd7a6f1e8155e3e185689").into(), - hex!("8e6b888197010ebadd216da35b9716daa8675d93b3c33a96a19fd9ca42624f6b430b2ff115cd0f5b717341605dda24bf").into(), - hex!("b6652440bd01316523feefceb460158cd9ba268dd8dbe860a0271f0176230f057767597e4197885ba907318ca202ba06").into(), - hex!("a0b3dff15982a38a2f56d8c6cfc5c5543c045bf2db24571d23387ccab42abe2756f34d5f0bf6a426bbad3c358b8bdb00").into(), - hex!("a8b593de2c6c90392325b2d7a6cb3f54ec441b33ed584076cc9da4ec6012e3aaf02cec64cc1fd222df32bf1c452cc024").into(), - hex!("96b478b1e5e49d4ea3fd97c4846ae0f781dcc9f9ff61ee022ca92c3d8dfba89c513c46e8bb38b73e6b678a79b9b12177").into(), - hex!("946d585d7aa452d37a8c89d404757c3cce2adf2410e18613483c19199abd88f7a12e206f87a43f6009e42f4e31ed20c0").into(), - hex!("8c432e044af778fb5e5e5677dbd29cd52d6574a66b09b0cd6e2a5812e71c91559c3f257587bfc557b4b072a822973a60").into(), - hex!("ad2cdae4ce412c92c6d0e6d7401639eecb9e31de949b5e6c09941aeafb89753a00ea1eb79fa70b54699acbfa31eda6b7").into(), - hex!("b504cb87a024fd71b7ee7bed2833115567461d1ae8902cccd26809005c4a56078617ec5d3fa5b29a1c5954adc3867a26").into(), - hex!("b8876bda1e709ab16e1347a1107852a7898a334a84af978de39920790b4d82eb0739cbfc34da1c7154dd6e9f7674759c").into(), - hex!("973dcf44ab60f55f5d10a8753ea16db9faedd839466a130729538f3a0724f00f74b3ca1de16987d7c6e24e9467f62bc7").into(), - hex!("94df5fe87661101a89b49091a3d4de89331cdbd88531ebb08a95f2629886ee53b3dcbcc26bb6bc68b443303d8d397141").into(), - hex!("a92beb343caf6a945990adcf84302c55d1fccdef96c34a21f2c00d3e206a9b2c6c6b412f66e5d4fafe26ef6446cde705").into(), - hex!("b298aa927713c86adfe0de1a8d6f4083b718c8be27156da9fd11abd8edb3a54a926ad487801eb39cfc9363a0a3be0d44").into(), - hex!("b34d4d2e15079e7e80fdba30cddf4fc0e6c9a61f7ab06a6ea0a4e55fd5bf632c6d72e021d6264d935439d321de883bb6").into(), - hex!("b4a86fb5b0049718caead1bc036833a2caeb88e1afadbbbcb0cd021d95e1f33fcc916f0b97fc1b9226c37050e3463796").into(), - hex!("b6cec65e5268818c82c0a4a029b02f8d23de98b68730a445119fee670118eb34027c23c987fac950f9b0151631328a4e").into(), - hex!("880b4ef2b278e1b2cccf36a3b5b7fbce94f106ed9fa2820cb9099a7a540a57e9fdeef5c0fb0a743049828fc2b8c46163").into(), - hex!("ab2053c376c6bd113b89fdb2ae3b8401aa891135345885730c61cac7813f69ea7d906c531be752e28657f73af92d1f4e").into(), - hex!("8fa2d7b22af8e6b82679ebdfa13efdcb34289a554653ea6c1b16efb9f957f7fe64df787e7b03d8cdc8a732b91c916bd1").into(), - hex!("8e825c03c8409a3302266dc5f47fbfc381dfbafbadc37bd8d40f079ca8963d4c5ae6ef0d0ba6aef2d4688736f5f6bb45").into(), - hex!("a40ef3d2291d8782540961ce285054678b3d322d3cf7fc154207228c290708b1abfc37a4d7762dab3dfea582a112444a").into(), - hex!("8dbe8fcbcc414eb352245c52549973f73d987012de9d5f2b2f55dfdc43cf8cc9ea6b147abf149817f80f9e15aea566c6").into(), - hex!("a7e8775e04214e3b9898ffb9625dc8bcd1b683e333acdceddb8ca6db241df08a7b80e9d476a711b8b7d66aefca81e9cd").into(), - hex!("8b6ed54668f78a4a7624683b9bf3abf2bb0b6dccffccd8c0967df6297dadaf51732800fb9832b069437a6bf82ed7e6ae").into(), - hex!("9437ce85146202d3815df7f341a182678665dfb74b96006dc9d6acc16110d00b4a02717b702a765566457710ff5a7280").into(), - hex!("86a790072efa2cafa97be4b6b31f8c533f3b20cf3922fc0285fd403da436e4c49c65c5f08d77bfe823526c67bb58fab6").into(), - hex!("8ee8873de7cd28a54ba2c63a80b63399effed76b154e96ed26e7c0668b9f2476e298688b6a00c4b2ab9d020a897695d7").into(), - hex!("975c3261f0f32d59473e588f89593be38f5694cfa09394a861e4330b7800fb2528ea832106a928c54c76a303d49140e2").into(), - hex!("b5222582ed6604b9856a48039bd643340f4bf1bf0fc805e8453a9eb7630d6cea1452d28536706d6fa3ec16617617991c").into(), - hex!("b75c28941ee3f91b3535b4eaa0fb17b59ca65b5256601a1f6d0cf2bb4d66837fd16e51d6942856679012a5730a66e519").into(), - hex!("97b510f9f46bdf77a002b2403d8e42b6d6ad5329ea080940844429763ad3efd592652789c8d3d4fac0903c705f533cf7").into(), - hex!("a3fd9d8bbdc98394883022299fd9793e0c4f374d8e40d6ce89b2869d3173cb6a5476371d6095dad068ff217729f60af4").into(), - hex!("a57d5de556853484b1d88808d2529450238bc467376ded84cfd7b4a1ba258f6d43b5958220f962c57b033abcef1d5158").into(), - hex!("8465bd8be9bd9c2c6116d4ae44ec6618c109cb9aaee2d241e7a6ed906d398ef15a6fc18bc8b1d3398184241405954bba").into(), - hex!("ab1cc44983e46a6ea2430aa6616ab28614f43624665e3e6ae31a9357c0c5434f34e56c720906e184327693cc4ebe1fa2").into(), - hex!("aafe14dd3b680f096010788226d8413ca628feedad79a2bc78cb04d47c6ad910f7f46ca87b8f8281744625d8f42d5eea").into(), - hex!("86a533b02ae929f67c301649a2d58651b98cdffe731b63fa32aa1013c271634bbb088c0d02865913c11bbb1bf57c0e12").into(), - hex!("b28df3e04bde4ec373171401dbd0546f4cb6fa8e9a4a8019aadc653d4e05e0b5b9a64417715dd87f6df9e7b3145f6659").into(), - hex!("ac63fc758c1a3bc5cbff0f5e0b5a07a5aa801363b129d4e0360165c7dc1057ec37b0d808e9fd6b179e2c1e66bbc6090e").into(), - hex!("93f941b4fe6c05621e7a651b87669eefd60b6e8a4a8e630a51fa3fee27417b9eebce39f80a5bade9ca779133ad8388f6").into(), - hex!("96d7a69eaf2761bf0e5ebcd607b134d5dedba8e262ca1d6d3e8fbf23e6419a8ce1bbe4cd23b9e4b5f80db54a802a9795").into(), - hex!("8b62902fb2855300580e94830a4bc825d997ede33bf356fe3b7c08d6a8bd85a37879433fc6bee58f9b44ca280f4e8dfd").into(), - hex!("b043156fcd02b75dbe940c763fa8e8a7c7f6d74c1d5395db5ce544af3b6097eab61686950535a810aa95889ced12f74d").into(), - hex!("8614a7599c8d97aa9ca63b876f677977cf0daa969ff2a9a153f297a4a46e08fa5d91492995de94dc32cf009ce6bb5b5f").into(), - hex!("81351fd284d6d07092875f366bc5e53bfd7944b81eece85eab71a00443d1d2a9fc0337aaf34c980f6778dd211caa9f64").into(), - hex!("8c722aaf5d5dad1845056bf5e56dbff0f8b501f4846610f99da01130a49c96db9962bfd9be20670658cf276cc308be08").into(), - hex!("8effe3fb27c9f76bbd78687b743b52e6f3330eddc81bc9006ca81fd640f149d73630af578694f4530833c2151522dcc1").into(), - hex!("a3d327f48eb34998a3b19a745bca3fade6a71360022c9180efb60d5a6f4126c3f4dfa498f45b9a626ca567fdd66ffbff").into(), - hex!("a59a59db246f981e9c8e54aba52898c714d9787fef8969a6d8677fe6dec82950ff22a1364393b579f3e596cdf5bcd7b1").into(), - hex!("a15ebe9ab6de62a4d1ff30b7fc58acfb14ea54d7fa513cbcb045af3070db22bf9c1e987fa26c0c54356b9e38fa412626").into(), - hex!("b58396bce7d32ba6c70adbd37156d859e153c1932d2b0c7c874a1182ba831439e80d6fc6d7d88a870e193f515aef2264").into(), - hex!("b666dae42ea858c9b7d903ea3ca5279f619c71ac6e3fda7469e2bbba08c7e8e12d6a3c35ff2c6383673b1b7c21db5e0e").into(), - hex!("8eaaa21c8955f15bbcfd5756421a045e7b4825576379cc6229fe9751f7a7738b90be19ba52261db01c1e13af955675b0").into(), - hex!("8027bc62b59f9f15613e38da74ccc71fc3eaee26f096d187c613068195ce6eb64176013f2d86b00c4b0b6a7c11b9a9e5").into(), - hex!("8275eb1a7356f403d4e67a5a70d49e0e1ad13f368ab12527f8a84e71944f71dd0d725352157dbf09732160ec99f7b3b0").into(), - hex!("b8c41c09c228da62a548e49cfa107630166ac5c1469abf6d8aab55938ed1d142d5ddbc4f1043eed9496e9002cac99945").into(), - hex!("912750d2f1b21756662a400236f797b8ba76c73e5af95941a8c6ef9427838c4826715c80942cf8cb7ed01566bc490754").into(), - hex!("862af7dbb38ad7293a4e598cb52a8ac84dacee3d9bf007b5cb6a18a1acead0aa33f6dba796ce630e632c97aeb7100d68").into(), - hex!("890def696fc04bbb9e9ed87a2a4965b896a9ae127bc0e1cc515549b88ddbcbc02647e983561cab691f7d25cf7c7eb254").into(), - hex!("b835ffaf54c8b878d3c4262ca2bf5e6be2c691adced622b35d998ed72e1467ba907f4fde8d64ce43b43a8196f48e55db").into(), - hex!("a6d7e65bf9f889532090ae4f9067bb63f15b21f05f22c2540ff1bb5b0b5d98f205e150b1b1690e9aa13d0dee37222143").into(), - hex!("8ebfbcaccddd2489c4a29a374a2babc26987c3312607eadb2c4b0a53a17de97107c54eab34def09144b3098c082c286b").into(), - hex!("900b9972180a2c8753f5ff49fdd2cfe18c700d9927b3c3e16deb6376ad6ee665c698be72d4837b94911a0b4c183cb140").into(), - hex!("aa9679c01ecf1f1452c54688e01cb25bf157bde6b09b1ed460b8c175d65eba439c7ad4b7c1d72415f5622f3fbc068dc8").into(), - hex!("887a4277ee8754733f3692a90416eeac1ebee52ff23173a827f0ba569bd84efd806eb9139049f66cc577e370d3f0962d").into(), - hex!("951b27456e2af80436608aadec54ebd03bda37fa58452631da63bc5ff3eecb5ffb73d356b19f6c9c4225fcb0da8fda20").into(), - hex!("9104b5af82dbca914370eadb5518b26bee7ed7edeca74b741585ba8b249204e2c998bd47a02cef4335e236f8efafef94").into(), - hex!("8757e9a6a2dac742ab66011c53fa76edb5ebc3c2fbd9a7265529a3e5608b5c24b4482fed095725e9b8fed5a8319c17a4").into(), - hex!("a7acf82999de75f231fd80770bcb0f4c720d6b1e4a2558fa1ce854382fda92beb89fea5b5d229dad85fafee7a9e98329").into(), - hex!("8fb74891a8642f25a55b5eda5818367aac2fdf9663ad1e3dbc0166b484c0cda581b243cc75131167f1afa9caaf6705a0").into(), - hex!("897d7a19b70dcef1af006df3365981d73068c81f18017f32fb9966599481496efd5f6caceef943b31c52750c46d9590d").into(), - hex!("87ac804ccfe7f1fa156b8666664a397236832569f8945e11d4688a9e43ada4d4104efb3fda750f48ef655a29357c5e7d").into(), - hex!("af18cf1e3d094b4d8423da072f98b3023d296f6a1f2a35d500f02bde522bb81dc65e9741c5bc74f7d5613bd78ce6bc03").into(), - hex!("9752561179783f336937757b619b2fdcb9dfce05aa3c4fce6d582dc966182eb85ab4ccb63e7e1736a7c5fad9d33cccd2").into(), - hex!("89e19b665ce7f6617884afaf854e88bb7b501ecdd195a5662c79802d721f5340eca8c48341ad1d6c78f519f82e5a9836").into(), - hex!("94402d05dbe02a7505da715c5b26438880d086e3130dce7d6c59a9cca1943fe88c44771619303ec71736774b3cc5b1f6").into(), - hex!("a76adeddf2454d131c91d5e2e3a464ef5d3c40ee6a2ab95e70ef2e49e0920d24f9b09276250ed7b29851affbdbc7885a").into(), - hex!("8934e9a3feababa12ed142daa30e91bd6d28b432d182ac625501fe1dc82f973c67f0fe82d39c9b1da3613bb8bfe2f77b").into(), - hex!("a5c11337eb91ce0e9b6d61bbdadea0a063beee1bc471cc02dc1d81c5dd2095315c400cbc6c33d23c77e98bba6bdf5439").into(), - hex!("92d00e64ed711951aeb852908aeb6fd379ea516872dd512384b1e773ef078e52e6d618beb202d437d2a46bcb78087f7a").into(), - hex!("97f1a7370b4f5acf83b466f519da361c366915f560385dd7eff9d53700ad81b25c9862bc71d35428e82372a5ae555ea0").into(), - hex!("95614544f65808f096c8297d7cf45b274fc9b2b1bd63f8c3a95d84393f1d0784d18cacb59a7ddd2caf2764b675fba272").into(), - hex!("8d474636a638e7b398566a39b3f939a314f1cf88e64d81db0f556ca60951ec1dca1b93e3906a6654ed9ba06f2c31d4ea").into(), - hex!("b87e5f481b938ac8a481b775cc58be2a06604549e3c810fc4734bab76099e5c617f0243c4c140cb7dd6d36a6dc2286bf").into(), - hex!("806efb61d1c948efc10dbf9bef30197d1c269e5e7fcf20a84367b26223d33fade413a0bbf4e33f0d1f1a00967289015e").into(), - hex!("880b99e77a6efb26c0a69583abb8e1e09a5307ac037962ddf752407cacaf8f46b5a67faf9126bdbcb9b75abf854f1c89").into(), - hex!("82ffe4de0e474109c9d99ad861f90afd33c99eae86ea7930551be40f08f0a6b44cad094cdfc9ed7dd165065b390579d0").into(), - hex!("941cd102228aa81ef99506313a4492a17c506e7169808c6b14dd330164e9e8b71b757cbe6e1bb02184372a8c26f7ad1f").into(), - hex!("ae96dc808c316a677977831bad1e529ef965dadb5d6aea25ab008fe7bb1543e596e33052cfbe4279fa060201199d2c34").into(), - hex!("a2053719da2b7501dab42011ae144b3c8d72bd17493181bf3ae79a678068dc3ee2f19d29a60b5a323692c3f684f96392").into(), - hex!("b17171939519d90e243d41839c3c5ce7ac7e6a978e4a7e56b2c8e6a2b1b587c7eacea47f2e31a55d88555d252c810ebd").into(), - hex!("a958987c2b3c84df8176b600f5b75a8badef9653c71eff967e76648937def38826eaab4027a639f4f300b20019166250").into(), - hex!("854aafa329e2b2563355641eba95f2aba5b33d443ab16f5e342048f97d97c4e2812ff27c6f4180b8110272f3151be690").into(), - hex!("94d4a1e3a3d28a948f14d1507372701ac6fc884a4905405a63663e170831578a2719714ef56f920baa0ca27954823e39").into(), - hex!("826be957cf66db958028fa95655b54b2337f78fb6ef26bd29e2e3a64b130b90521333f31d132c04779e4b23a6b6cd951").into(), - hex!("8261f7e644b929d18197b3a5dcbba5897e03dea3f6270a7218119bd6ec3955591f369b693daff58133b62a07f4031394").into(), - hex!("84926cf2265981e5531d90d8f2da1041cb73bdb1a7e11eb8ab21dbe94fefad5bbd674f6cafbcaa597480567edf0b2029").into(), - hex!("8fb51e3ef3c1047ae7c527dc24dc8824b2655faff2c4c78da1fcedde48b531d19abaf517363bf30605a87336b8642073").into(), - hex!("8ba45888012549a343983c43cea12a0c268d2f7884fcf563d98e8c0e08686064a9231ae83680f225e46d021a4e7959bb").into(), - hex!("973ab82026d360e2cf5676d883906186bc61b43f60767ca58f11d0995e40780b163961e6e096299ccf1c86175203abde").into(), - hex!("b77416ea9a6b819e63ae427057d5741788bd6301b02d180083c7aa662200f5ebed14a486efae63c3de81572fe0d92a9c").into(), - hex!("820cc2ac3eed5bce7dc72df2aa3214e71690b91445d8bb1634c0488a671e3669028efbe1eae52f7132bde29b16a020b7").into(), - hex!("a6b434ac201b511dceeed63b731111d2b985934884f07d65c9d7642075b581604e8a66afc7164fbc0eb556282e8d83d2").into(), - hex!("b81821a79c9148b41d24d85dc997336a1e1719da0e31e42af30812b97a5af31708ca3e7bc2e803c3751cff23af5c509d").into(), - hex!("a013cc5e3fbb47951637426581c1d72764556798f93e413e1317849efd60f3ecb64c762f92544201eb5d6cfb68233050").into(), - hex!("b5f32034d0f66bcbccefe2a177a60f31132d98c0899aa1ffff5ebf807546ff3104103077b1435fa6587bfe3e67ac0266").into(), - hex!("86ca8ed7c475d33455fae4242b05b1b3576e6ec05ac512ca7d3f9c8d44376e909c734c25cd0e33f0f6b4857d40452024").into(), - hex!("b781956110d24e4510a8b5500b71529f8635aa419a009d314898e8c572a4f923ba643ae94bdfdf9224509177aa8e6b73").into(), - hex!("a3f9dcc48290883d233100b69404b0b05cf34df5f6e6f6833a17cc7b23a2612b85c39df03c1e6e3cd380f259402c6120").into(), - hex!("a104d4bad69f1720307ed12363d1ec97952acfe09d9e3650034c33f3f20c763271ebe0d5b50b1d3bd15c469f4573b09d").into(), - hex!("94bbc6b2742d21eff4fae77c720313015dd4bbcc5add8146bf1c4b89e32f6f5df46ca770e1f385fdd29dc5c7b9653361").into(), - hex!("951aa38464912a29df2101c60771d6de7fadb63f2db3f13527f8bdacb66e9e8a97aaac7b81b19e3d1025b54e2c8facff").into(), - hex!("919b5187af7dae210f151dc64a9cbd396d1ae04acadebf542a7123004efc7ce00d6e14c170d876fbc64dc1b5d141a5f4").into(), - hex!("88e1e459ee5aeb8b36ed004f6d03da296101106fbe1b18f9bbf63e92321db51670c34050fd3b7dc56a4bad76403823ee").into(), - hex!("86b3ec14a8ffb811a0ecc3771f600d8b08c098537d100fba66def19e7ee4d1c397a311977bf37e6cd2d47a8a2ee8c223").into(), - hex!("898c4873bd356ba8015f6f686d57088fa8f79f38a187a0ef177a6a5f2bc470f263454ee63d0863b62fca37e5a0292987").into(), - hex!("b471c72bd2971353f4b44248b8e6cf5316812861a88ccfc20fd0d89a5e010428c387228b2f6f14c12f79e31afc9d0753").into(), - hex!("8b7cb5b8de09a6dfceddcbaa498bc65f86297bcf95d107880c08854ed2289441a67721340285cfe1749c62e8ef0f3c58").into(), - hex!("983cb6bbfe83bce8326e699e83fca01ea2958c09808c703cac97a0ea777e5a5f3f5bba9169a47732de7459a3c7af47d2").into(), - hex!("8235a3f09078dd34ce2fc17cc625e061298713b113dda12d354b3d2ba80e11c443b1dd59c9eb5a29513a909645ae97d4").into(), - hex!("8bb51b380a8a52d61a94e7b382ff6ce601260fa9b8c5d616764a3df719b382ec43aec9266444a16951e102d8b1fb2f38").into(), - hex!("9579973ee2559da09b327c62b1cc0177f2859872885dca709e24dcfbb9bdf9224a6d26869aafce498f44c0e6bd8a996c").into(), - hex!("842ba3c847c99532bf3a9339380e84839326d39d404f9c2994821eaf265185c1ac87d3dc04a7f851df4961e540330323").into(), - hex!("99dad12f78e1a554f2163afc50aa26ee2a3067fc30f9c2382975d7da40c738313eaae7adbc2521f34c1c708f3a7475b7").into(), - hex!("b96e3ff8bdae47aa13067c29318b1e96a7fe3941869c17ce6662183b7b064bf261e1cea03e2a4643c993728a2606b5b5").into(), - hex!("955bc897171aa65d0159aa6e5d51855833f83d8bd5e65f93ad26c27781171783f3988a12bf987472edb39994bd071ea5").into(), - hex!("a59249e4dfb674dfdc648ae00b4226f85f8374076ecfccb43dfde2b9b299bb880943181e8b908ddeba2411843e288085").into(), - hex!("ac2955c1d48354e1f95f1b36e085b9ea9829e8de4f2a3e2418a403cb1286e2599ba00a6b82609dd489eda370218dcf4c").into(), - hex!("b2eedff11e346518fa54e161be1d45db77136b724d497e337a55edfc896417de3a180bf90dd5f9d92c19db48e8574760").into(), - hex!("976eb5543e043b88d87fda18634470911dfe0e0cabab874ca38c1009e64d43026d9637d39dcd777bc7f809bbfc3e2110").into(), - hex!("8ea5f88a79f4eb9e7c0b6b29f8ef2d1cc4c15ed0ed798ab11a13d28b17ab99278d16cd59c3fa8217776c6dfae3aedf88").into(), - hex!("b7f146a357e02a63cd79ca47bf93998b193ce1174446953f12fa751f85dc2a54c9ed00c01a9308509152b3bad21d7230").into(), - hex!("87fd7e26a0749350ebdcd7c5d30e4b969a76bda530c831262fc98b36be932a4d025310f695d5b210ead89ee70eb7e53b").into(), - hex!("b9445bafb56298082c43ccbdabac4b0bf5c2f0a60a3f9e65916af4108d773d62ffc898a35b0b8efb72ea846e214faa02").into(), - hex!("b106c6d13ca17a4c8ea599306e84918127cf2de21027ac3fe5a57d35cf6f3b1d7671c70b866f6e02168ae4e7adb56860").into(), - hex!("9276e8051bed8f5dbfc6b35765aac577dd9351d9d6ac1bb14496bd98091005b9a4737b213e347336413743f681f5043b").into(), - hex!("aefc682f8784b18d36202a069269be7dba8ab67ae3543838e6d473fbc5713d103abcc8da1729a288503b786baac182d3").into(), - hex!("97578474be98726192cb0eac3cb9195a54c7315e9c619d5c44c56b3f98671636c383416f73605d4ea7ca9fbeff8dd699").into(), - hex!("99c34f9bd0fcb18b3d931e562988cf91886a417f8678f22651bf3cf138df2bbec3f675de90f62dda769e0eda03d72b7e").into(), - hex!("a0047e03c89a95248543618e6b7ca2c7aad7acda3c9f85771ec5c93fa898c651e8b2ea3b6b799d8cd592290a986cdd7d").into(), - hex!("993726e0b1c2277b97b83c80192e14b67977bf21b6ebcde2bda30261aa1897251cd2e277cfcb6193517f1eb156d2fe86").into(), - hex!("974a5180e55eab23d4c973fbee6ad1010335161ecdb849fe6520b34c1f96530a4faff80bd738fe281019b79d968c472c").into(), - hex!("8f1d90034f998018c3f4b5947b40b139fcead2e40aa80fdec6a4337c60e9d5ff1923dda7f0b5b1731ff16f55027d41bf").into(), - hex!("a7d9ae9621dd1f3da3cd2d435e891cc3579c4c0d60d6a4565cac86c315cea21a9ad883559fe7b897ae6e05f1aa989ad9").into(), - hex!("800f6be579b31ea950a50be65f7de8f678b23b7466579c01ac26ebf9c19599fb2b446da40ad4fc92c6109fcd6793303f").into(), - hex!("86fa3d4b60e8282827115c50b1b49b29a371b52aa9c9b8f83cd5268b535859f86e1a60aade6bf4f52e234777bea30bda").into(), - hex!("a80ac2a197002879ef4db6e2b1e1b9c239e4f6c0f0abf1cc9b9b7bf3da7e078a21893c01eaaab236a7e8618ac146b4a6").into(), - hex!("b4bf70468eff528bf8815a8d07080a7e98d1b03da1b499573e0dbbd9846408654535657062e7a87a54773d5493fc5079").into(), - hex!("ae0e15a09238508b769de83b30582cc224b31cd854d04fdb7b8008d5d8d936dbdd3f4a70fff560a8be634c141772561b").into(), - hex!("936f7e20c96b97548fef667aa9fa9e6cfdc578f392774586abe124e7afc36be3a484735e88cc0d6de6d69cf4548b1227").into(), - hex!("8163eea18eacc062e71bb9f7406c58ebe1ce42a8b93656077dd781c2772e37775fe20e8d5b980dd52fdad98b72f10b71").into(), - hex!("86a6560763e95ba0b4c3aa16efd240b1873813386871681d075266511063b2f5077779a4fe49ffc35e1f320b613b8c94").into(), - hex!("b156d9d22722bb6e3b75b3b885b64642fa510ba7e6057657cd61bac43fb9c284d05bb09e2d4b78a2a4ddada85da9c702").into(), - hex!("9779ca2759dbed8081f0cbbfffcb3b842ba335e3ae48a60c5e5c77c7a2a0623e4c415ec3a023cc4e216885fcbac3ce52").into(), - hex!("b8137fd57ce7d3cfaf8bdbaa28704734d567d0e7a2d87fb84716722c524bb93acb2c1284249027f3c87bccc264c01f4e").into(), - hex!("8cf06b34e7021e9401eb705dde411ecf7e7e7185f8c0b0aeed949097df31812a9fdd4db7d18f9383a8a5a8d2d58fa176").into(), - hex!("8c65aa29a9ee9066b81cf24cf9e0beca3e8e8926e3df22d5ff1236297e158cc8bc7970a2c7016009cc4efa8f14b14347").into(), - hex!("ac7e49f2059e99ff65505742978f8d61a03f73f40141a2bd46fde5a2346f36ce5366e01ed7f0b7e807a5ce0730e9eaa9").into(), - hex!("a1c25eb9b73723982be78180770aa63c5f7b23c2e54a2ed7e75a860c4512d273008066f1124ac8a43c60fe1e2a8bf03c").into(), - hex!("9310722e360a5652737362f6b9cb6e9c3969a0c9bb79b488b3c7d19d9e8c42ebd841df346258ded2e393895c99b413cf").into(), - hex!("893272a63650b08e5b8f9b3f17f8547b456192ad649c168bafd7166b4c08c5adf795c508b88fd2425f7be8334592afb2").into(), - hex!("b576c49c2a7b7c3445bbf9ba8eac10e685cc3760d6819de43b7d1e20769772bcab9f557df96f28fd24409ac8c84d05c4").into(), - hex!("af17532b35bcb373ce1deebce1c84abe34f88a412082b97795b0c73570cb6b88ea4ba52e7f5eb5ca181277cdba7a2d6d").into(), - hex!("8b8813bd2c07001a4d745cd6d9491bc2c4a9177512459a75dc2a0fa989680d173de638f76f887de3303a266b1ede9480").into(), - hex!("ab73a043ccdfe63437a339e6ee96ef1241264e04dd4d917f6d6bc99396006de54e1e156d38596ba3d15cb1aaa329f8f5").into(), - hex!("b67146b202afec0132ac0070c005cf664081e860339f8f4d45ac3e630dda05560936e646673e652d08cecd8d18fc64da").into(), - hex!("a750404e9d4b1a48f767d2b6aa699200c92c3b8102597f8c5c1dbaaf08112a0587c05801dfebb3612fb6dfd76ddc9ccb").into(), - hex!("b0d4231814e40e53ab4eed8333d418a6e2e4bd3910148b610dec5f91961df1ad63f4661d533137a503d809ea1ad576fa").into(), - hex!("81fc724846b5781f3736795c32b217458bb29972af36cc4483dd98ab91680d3d9bc18842db2661487d3a85430dc9e326").into(), - hex!("a5cf6f4fd67aecb845eebc8d7304c98c69806d774d4c468350f7f82ff0f5baeecc56837705e39432a8d246aa2a7075ed").into(), - hex!("a71d2c8374776f773bad4de6edfc5f3ff1ea41f06eb807787d3fba5b1f0f741aae63503dbca533e7d4d7d46ab8e4988a").into(), - hex!("825359cfe68ad6a75578a94be6419179e0aa088170b6c20fc5c249dc3be7a260d687c93d8d8a343c7c72c2ed6a716de3").into(), - hex!("b6aeb7a9b934a54e811921494f271d5d717924c561cd7a23ab3ef3dd3e86184d211c53c418f0746cdb3a12a26a334fc8").into(), - hex!("8c6fc89428c74f0c025e980c5a1e576deadf8685f57136e50600175fa2d19389c853d532bb45a3e22b4a879fab1fcb0d").into(), - hex!("ae95ddcf3db88f6b107dcf5d8aa907b2035e0250f7d664027656146395a794349d08a6a306ce7317b728ca83f70f3eaf").into(), - hex!("8c03fb67dd8c11034bd03c74a53a3d55a75a5752ea390bd2e7f74090bf30c271541b83c984d495871d32c98018088939").into(), - hex!("b8d68610fdee190ec5a1f4be4c4f750b00ad78d3e9c96b576c6913eab9e7a81e1d6d6a675ee3c6efac5d02ed4b3c093a").into(), - hex!("87d4b20bbe2dcd4f65f4e1087f58532d5140b39a5288e1a63fc0b7e97a6a56946eafdd90ba09300c3d1fef6356ac6b7c").into(), - hex!("83e264b1d3d4622826ab98d06f28bbbd03014cc55a41aaf3f2a30eec50430877d62b28c9d6d4be98cb83e1e20f3b13db").into(), - hex!("97ffcbf88b668cde86b2839c7f14d19cb7f634a4cf05d977e65f3cd0e8051b2670e521ae74edc572d88201cff225e38a").into(), - hex!("91efdbcaad9931312d7c41d24de977f94d7f3f7b88090a1f72d9a097a1e30cc805c5ea16180f463022d9b26b8863f958").into(), - hex!("a4b507a4bc2bc424297bf8968bf385fae3acc686cff4b7933b4f5b6ef3149995393d5331dbac4b629e8adce01a91a4cc").into(), - hex!("a76a26c30d8abbbd4bf982bb8bd2066a2ec823a5eb6fbe37c664e67efbe2f72d8ce2d00223b900699149f8441bff5ada").into(), - hex!("b3a5497365bd40a81202b8a94a5e28a8a039cc2e639d73de289294cbda2c0e987c1f9468daba09ea4390f8e4e806f3c8").into(), - hex!("a09b2a07d861e01645accfb088f7f9ad524186bd439712775459a60f8a1fbbd43ee084e4d6e23ffce06daa189cd1e654").into(), - hex!("a41cf5d678a007044005d62f5368b55958b733e3fdde302ba699842b1c4ecc000036eda22174a8e0c6d3e7ef93663659").into(), - hex!("a698b04227e8593a6fed6a1f6f6d1eafe186b9e73f87e42e7997f264d97225165c3f76e929a3c562ec93ee2babe953ed").into(), - hex!("8bc66e370296649989a27117c17fbc705d5ac2bda37c5dad0e4990d44fcc40d3e1872945f8b11195538af97961b5c496").into(), - hex!("8bff10f91b8c0abb6c9542588da17fa0118ffda4c82626a754887e333d7d69661b3ae4e400da15c49565f8d10a77d0d7").into(), - hex!("ac715c7b3d794860a61d9c7bd224a2b14a6023f696afa30345aad2ce0a6ea6dbc142f34af1ffe7f783542851a28e8ece").into(), - hex!("91c5e0b9146fe5403fcc309b8c0eede5933b0ab1de71ab02fac6614753caac5d1097369bdeed3a101f62bbcae258e927").into(), - hex!("8553748da4e0b695967e843277d0f6efeb8ba24b44aa9fa3230f4b731caec6ed5e87d3a2fcd31d8ee206e2e4414d6cf4").into(), - hex!("ac722bd742374f925185ea7d4d62d7510b2d8a6ebf5c750af6ce83e2d8a28c95a3e298870ec8254ab2d1d0aa2a063c60").into(), - hex!("b083c4cefb555576bb37b71f30532822cb4b1e1998e35cb00ffb80ca14e2853193c16a6756417853d4a74d625744dd76").into(), - hex!("85745bd84c92ddfc55df11fe134cf70e3c340aa1c7cdd6188a03308cf3a840f4f19629f9730b2e6426424989ff03000d").into(), - hex!("845b4531dee808b583645f56fa98cbdecce3ea100db60524b64f68e29866173791f01137714f4dc7fb8612f7f7943263").into(), - hex!("93f03495d53c781be8b76e37e68b64aa260523004eff6455ddc8a8552af39854e5181f8c5365812b1f65926534fba5dd").into(), - hex!("801c126abff96fe9b042be8869d2907d0c6963a79901f9db46577a445418b7465a1f4b346933d433e539536a9a2df01c").into(), - hex!("952cf6782b0ad3e85625391cc5f486a16bb5b1f8ea20defcb6857bd7d068dcd2701bc7ed5c3b773a869180d9042f772b").into(), - hex!("b3b6eccb2ec8509b4eea8392877887180841ab5794c512b2447be5df7165466d7e293696deaabf063173e5f2238ce763").into(), - hex!("b63fd45023f850985813a3f54eceaccb523d98d4c2ba77310a21f396e19a47c4f655f906783b4891de32b61a05dc7933").into(), - hex!("a113b889be5dcc859a7f50421614a51516b3aadc60489a8c52f668e035c59d61640da74ba1a608856db4ff1fa1fe2dfd").into(), - hex!("87fec026beda4217b0a2014a2e86f5920e6113b54ac79ab727da2666f57ff8a9bc3a21b327ad7e091a07720a30c507c9").into(), - hex!("a3ee8fd53158dad3b6d9757033abf2f3d1d78a4da4022643920c233711ff5378ac4a94eadcaf0416fdcca525391d0c64").into(), - hex!("8d6bed5f6b3f47b1428f00c306df550784cd24212ebac7e6384a0b1226ab50129c0341d0a10d990bd59b229869e7665a").into(), - hex!("b549cef11bf7c8bcf4bb11e5cdf5a289fc4bf145826e96a446fb4c729a2c839a4d8d38629cc599eda7efa05f3cf3425b").into(), - hex!("982691766a549df56436acd0fe76da78132e027515f27174c10d117bfcc20ed73fc31f5465bd7a22a101094fe913e221").into(), - hex!("985af1d441b93fa2a86c86b6d7b70b16973d3971e4e89e093b65f0ae626d702202336869af8e3af3923e287547d5384b").into(), - hex!("994b7baecc8bb68d270a3a88c58e4054afdbd713b4472f9522b27c1762c637ef8f013d745ce9d1dc8fc4d986d4c9338c").into(), - hex!("827dabda84c7f7b1adc0f5ca0fccf0729e9d7f78e1ffa7c5e9c4f66610ff0ab776c880b00c77137cf7abe14df977febc").into(), - hex!("acd17cba1203748b55bd9d7b940a16bb7c02988c93007a80b87e0bdb049b91f5ecce577e3e4ea68a0abe998a72cd300d").into(), - hex!("989fa046d04b41fc95a04dabb7ab8b64e84afaa85c0aa49e1c6878d7b2814094402d62ae42dfbf3ac72e6770ee0926a8").into(), - hex!("99dc48a054f448792523dcdeec819e1b928b1bd66f60f457261f0554f8532eedd7152792df70ae5316ab2f9c02a57cdc").into(), - hex!("ab33c65587ecb3278325948c706aed26547e47ed2b4bc027e9119bb37bec67ddf5489fbc30304ef6c80699c10662d392").into(), - hex!("ae89e41d8cfbf26057a4078f8a5146978e658801b08814190cbce017d79beaeb71558231a72bde726fa592fb0828c01c").into(), - hex!("a9901df92e2d3abbb25f3bf4b913692c4cd57da327b01c8ee2362c02fbefcf66cdb792c17a81dcbde3c9b9dba313e4a1").into(), - hex!("8ee41011424da5e2ecea941cbf069ea32420749f2519434d3d8f9725ac789753404687a6745cffe4bd5dfc8fec71a719").into(), - hex!("8cfcdfa192b17321be4e447204e1a49ecaadca70a3b5dd96b0c70ab64d1a927d1f8c11a7e596367e5fa34e2307af86fc").into(), - hex!("b8a0003e949cf994b1bb25e270cb61358200c93b1c6f611a041cf8536e2e0de59342453c5a8d13c6d4cc95ed8ce058f3").into(), - hex!("adc806dfa5fbf8ce659aab56fe6cfe0b9162ddd5874b6dcf6d658bd2a626379baeb7df80d765846fa16ad6aad0320540").into(), - hex!("a83b036b01e12cadd7260b00a750093388666aff6d9b639e2ce7dfc771504ef8b2090da28ec4613988f2ec553d1d749e").into(), - hex!("825aca3d3dfa1d0b914e59fc3eeab6afcc5dc7e30fccd4879c592da4ea9a4e8a7a1057fc5b3faab12086e587126aa443").into(), - hex!("845a4a09941f48677e6c03699770f9a56ba72695089e432a6f232294dd8da6d34e394116a9a87f3b0902c78332af9439").into(), - hex!("b2f168afc35ed9b308ab86c8c4aaf1dcd6833ce09153bb5e124dad198b006e86a941832d387b1bd34b63c261c6b88678").into(), - hex!("a094cca9d120d92c0e92ce740bc774a89667c6f796b438b0d98df0b7aef0935d8c915d5b0dad4b53e383dc9f095c29fa").into(), - hex!("956ecb233b3529b2d9cb80ae49e48667f2a3120e4a0d7131d1e9ec36db3a59dc2ef2a579cbb99d6f14880ca83f02b64c").into(), - hex!("906cde18b34f777027d0c64b16c94c9d8f94250449d353e94972d42c94dd4d915aa1b6c73a581da2986e09f336af9673").into(), - hex!("824c8a1399ab199498f84e4baa49ff2c905cf94d6ac176e27ec5e2c7985140dbaa9cc6303d906a07ab5d8e19adf25d8a").into(), - hex!("889a5cf9315383bf64dfe88e562d772213c256b0eed15ce27c41c3767c048afe06410d7675e5d59a2302993e7dc45d83").into(), - hex!("95791fb6b08443445b8757906f3a2b1a8414a9016b5f8059c577752b701d6dc1fe9b784bac1fa57a1446b7adfd11c868").into(), - hex!("99049e9a23c59bb5e8df27976b9e09067d66e4a248926d28171d6c3fdd1ab338944a8b428b2eaae5e491932c68711c7c").into(), - hex!("95c810431c8d4af4aa2b889f9ab3d87892c65a3df793f2bfd35df5cfdb604ca0129010fa9f8acae594700bece707d67f").into(), - hex!("841d77b358c4567396925040dffe17b3b82c6f199285ac621b2a95aa401ddb2bc6f07ebd5fa500af01f64d3bb44de2df").into(), - hex!("90c402a39cd1237c1c91ff04548d6af806663cbc57ff338ed309419c44121108d1fbe23f3166f61e4ab7502e728e31fd").into(), - hex!("968d44188e2d9d1508b0659e96d6dabd0b46aa22df8d182e977c7f59e13aa05d5da09f293f14f6f2ee1b996071cd2f25").into(), - hex!("8ae9585caa3c73e679fe9b00f2c691732f7b7ca096e22d88c475a89d4d55cb9fba3cd0fe0cedd64ce75c591211664955").into(), - hex!("94b81d5ad72efb4dd60867e71afcd8e87e1f24bf958d42fc07db66f6185a1e610987ab9ceef63109a36fe5544a0cf826").into(), - hex!("8499a8c3d67d1f6eccf1c69274393dc498cff862ea8e6c11ffb8107ae190d258ddc1d294f2a8f050488df0212063ece2").into(), - hex!("921109a390e4d7fbc94dff3228db755f71cb00df70a1d48f92d1a6352f5169025bb68bcd04d96ac72f40000cc140f863").into(), - hex!("b464d763e5ef724ab7ee13a60015df5c9a7809a79188ff6a7e0d5e5400febd42ad7330406a59704a44a08f2289d659c8").into(), - hex!("96f1a36134e0d4137a7fe8bbb354f50aaa67f28f194ae2fdbe8be3eb24596678d8c9287765ee90c1f2778d0d607931e0").into(), - hex!("b031d93b8f119211af76cfafee7c157d3759b2167ee1495d79ad5f83647d38248b4345917309ef1a10ecaa579af34760").into(), - hex!("88a7dc337d89324f025f686f37d21240c7da9a1cb802259ea8d8a83e246dcc2adceca7ca3534bc7bf8f3ae1cbeafb5c0").into(), - hex!("b30e022b8a563655074e08e123b5f96956bbf0fe221cc629c5fedd2764a66b475916ceb98867f935b4a47212e53ae9f3").into(), - hex!("ab6e3180dae399d41243f23545e5e6d118844f9b8edba502a3503fd1162ed826f9fc610889a1d685d374b6c21e86067d").into(), - hex!("96cf5760c79cfc830d1d5bd6df6cfd67596bef24e22eed52cee04c290ad418add74e77965ea5748b7f0fb34ee4f43232").into(), - hex!("a5817c74a394b0359a4376ef7e9e8f7dfa6a7829602da225074fb392b715e1fd52c50cae0f128a7006f28b22f233fbf5").into(), - hex!("a50ab79cf3f6777a45f28d1b5cdad2c7ea718c60efeeb4c828d6307b29ef319445e6a9f98aa90f351c78b496575150c1").into(), - hex!("8b300dea07e73dd2f07b05d477e51f8424589f6b2fa6f461240e1322a3a7ab5bf227b74544bb5d66a297702cdbf6c6bf").into(), - hex!("b13b5cb86dc8b8fe87125f1a51fe98db36bdde4f600401408b75059a44e70b1bbfefd874e539691f3f1bf6f54db883c8").into(), - hex!("8d06205cd66703ce6776b38b98c32b27f45c7b3f65ea2d05e2b702c24d553f51c69bf0b17e8db7382475e3d370d2e8d6").into(), - hex!("a11a7496c712734aec80738e30d2bf245758b34245076149854eb209fa6403be8bb0d4e515becc881b7f3610749260c0").into(), - hex!("9615800f8c95f95bf25055ae079b964e0a64fa0176cc98da272662014f57e7cd2745929daf838df0094b9f54be18b415").into(), - hex!("b19ca6e55f349bbb2dc3e429520ff5b2e817972470794f35c1aac8c118b37a694cfcc875b6d72225343799825d2f5c39").into(), - hex!("a650864b7eb6769aaf0625c254891447351e702e40d2be34dfd25f3b5367370de354318d8935ba18db7929270455ae6a").into(), - hex!("a649208372f44f32eb1cd895de458ca1b8be782746356f08ac8ef629429d0780a0799fcff85736e19aead0b79bfff261").into(), - hex!("89461cb2dadf51d6f1208b0965c8eabec895d7b19b7d90d3c6e49dbe75a75c30fd26db3dfb169dd46a4342280225032a").into(), - hex!("b5d6f664ec92e5343792d5d6b629919c5fd8cfb874677df2264daf02bcd9d12facf9b859d5402839c9022396e20d260b").into(), - hex!("a7179d338fe5a0e4669364a364e17f8d00cb6c59a80a069afd5f4f14510df2eee90c07826553e4f7fe46d28f72b2903e").into(), - hex!("8ded37d67b5368619a090266e9b5585fbff60319a90a4244a3c3342641f5bfa5130998dd97d7a42505cd896c29255530").into(), - hex!("a3fd63e87a00b48ba46a646a26187ae6dcb16779721973ada13a545853e2e51b5e4df04630d670884ad4a2304cc60c67").into(), - hex!("92761b7e31f0c758b3b1f5b43a194b25aabec668101946eb6511132863d3afb9d18f833d43a8338d0e7bc78d8689e523").into(), - hex!("ab8a8769c754008a7976b6799e81d7bfe97413d0a79b90715703c1f8f567675463ec93aabee59277121fc4df88b5c7a9").into(), - hex!("b354d0d1bd942f79002a2eaf37eb99dab650170e7040c13c824803ed7c1670dc910ccae13bbe58bde003829b140b45ea").into(), - hex!("b9eed89e003894ad2cc9d9b93a45247e1367ac69a00b0ed5e3280c1188b4cb90eb870d449b83a852a798bd02f9d0c813").into(), - hex!("b900a55013d0427e5da6b21611d6ae3e648f54f794cb099b2d2beebae0a957477a94dc415e8ec5e68e9029ce50d43843").into(), - hex!("afbf44071c2c905f7c8ef396eaed7f13deb7a91719cb5e8b9226aaceb876d81a10076383edc6216bc2f5c38a480b2957").into(), - hex!("80bdb82b7d583bf1e41653966b0ba3b4fec0e7df2ff08e3fa06fd9064bca0364263e075e1582741a5243bde786c9c32e").into(), - hex!("a841fe9ff26db21ade698f6dbfba025d90ae9f81f02af9e008fa0a429b993fb04d06acb93e40a9f81c78f73334555a17").into(), - hex!("8cd49711b42af58a5aae75a38fea9ddc5e4183c467a3159b5b0629f01ba548513c577456d34c861911e85782e52c3b1b").into(), - hex!("a322b5d2a6e3cb98b8aaa4c068e097188affef5dec2f08c3e9ce29e73687340d4e5a743a8be5f10e138f9cabbe0c7211").into(), - hex!("942772b7c7c47d4e5957ccf1d6f1450070930af3e2b7eaab0dd7699372445df0cc910e6c0efcf501887dd1adabdaee23").into(), - hex!("9834f66e5c946c3a8241ca2bbde046a7e88072124911d5d15c037a95b61e82b88b5c2058fa4a3721537dee39dee5da18").into(), - hex!("a90cc5b9c4d84f36962d0d55d5bc123dbe5ec5f4fe7b6bf0d009028b3cf14e36c11bc5365391cb4ae548d5eb04fe371b").into(), - hex!("a7c2174eea2b66b2a71cc8095fae39c423a353c7d5020ec2d0551317a66202fcf082c6119ba768755523fff49791bb4e").into(), - hex!("ab92b2a177dfa55d202a653532f0e04d1339ca301aebe6a0e8419bf45be3e573b6b9ae4d3d822cc8279367a3d2c39b06").into(), - hex!("8a9ad977988eb8d98d9f549e4fd2305348a34e6874674bcd6e467c793bba6d7a2f3c20fa44aabbf7151ca53ecb1612f6").into(), - hex!("a7d1676816e81a752267d309014de1772b571b109c2901dc7c9810f45417faa18c81965c114be489ed178e54ac3687a1").into(), - hex!("a575be185551c40eb8edbdb21a0df381c801b6e99467fcf5882dd7cb34916960ce47ac732c1920ad3218f497b690cef4").into(), - hex!("b50c306f78143b37986e68efa10dbe1fb047d58562e9b5c5439b341dd8f1896c7ae586afac0a3213759784a905c1caaa").into(), - hex!("b31e89b4a034c1b73d43b3d63ea3bddea682a6a5327eff389c70b13e9e72185b0327682a0cb1ff3c4a4f8ba08b13d898").into(), - ], - aggregate_pubkey: hex!("948a4b8d91bd29969cd4470b1bc24d34586d38e73d5be71c98a9894899471a5f708747563276b4b6d2716fdb72860267").into(), - }, - next_sync_committee_branch: vec![ - hex!("cb3fea582872d90706ddc6d029bac0d791ea75d43c3ab04f056f62a11b89d27b").into(), - hex!("f26b4bb68eb7e6906c8ef4a9958398a48e4450bf9c8a462fafa4fde51cd5628f").into(), - hex!("690925f92c1d322d2ff2a5636539094825dfd2c9bf7538fe111b2358e03a71de").into(), - hex!("51d977e358166401c7cd3f6185468c1a8c69a4c3d8577535dd583bc427692e02").into(), - hex!("88d2089aaf2f6fd8f6e4ae499c6fe33cc34289eb9310780861e772204f07b670").into(), - ], - }), - finalized_header: BeaconHeader{ - slot: 4055040, - proposer_index: 854, - parent_root: hex!("8adf3b288deb17566a553fa7a06a2f63f4ac4cea4868af4d89ddca41f73ae9b9").into(), - state_root: hex!("595e9ebaaa23f027672b4d2a33173a22b2839baac709c7f8e66d3219f492ee9f").into(), - body_root: hex!("acf37b466d4f6b5d1db5b6ffe5d77c13972d116c2b0809de924427fd597d391a").into(), - }, - finality_branch: vec![ - hex!("00ef010000000000000000000000000000000000000000000000000000000000").into(), - hex!("3d4be5d019ba15ea3ef304a83b8a067f2e79f46a3fac8069306a6c814a0a35eb").into(), - hex!("a2e2a28c0bb0ad56c25f3c461a4bfe4f3b3b894bc0105a62e85f43a4ae1adc3f").into(), - hex!("690925f92c1d322d2ff2a5636539094825dfd2c9bf7538fe111b2358e03a71de").into(), - hex!("51d977e358166401c7cd3f6185468c1a8c69a4c3d8577535dd583bc427692e02").into(), - hex!("88d2089aaf2f6fd8f6e4ae499c6fe33cc34289eb9310780861e772204f07b670").into(), - ], - block_roots_root: hex!("7054ba439f83e9b2223911e25fad48eb28f5c362d94c0de2455a45436cc93897").into(), - block_roots_branch: vec![ - hex!("c99a842c81d0b956eef988dbcd90499457d61f942375c6cbf67262909b708db5").into(), - hex!("5d32345aeb10aa3ede4be021d2231dac47cc2074f74b72466f0b042e69adf70f").into(), - hex!("b69608a2377956c1a39c3423d3399ccfb12307623c9df6358f5fcfca64a80102").into(), - hex!("cefd9b668e49ece82bd4b0ee2f1efc88ecaf0d9af464fb622735663aaf106c4c").into(), - hex!("c113ad1c971779b15c64772ab69cd775edfb926a60447974913bb6f58fbd12fb").into(), - ], - }) -} - -pub fn make_finalized_header_update() -> Box { - Box::new(Update { - attested_header: BeaconHeader { - slot: 4058720, - proposer_index: 1088, - parent_root: hex!("37c7398a391c71da07258b48f41d4caaaf891fdf558e110b9c25db716fa8ff55").into(), - state_root: hex!("6cf68a66c993f1c27f499e054a5fbd7c0e625c34ea0057fda9691c561e990002").into(), - body_root: hex!("109e4c0c647d42dba0c8c6569997c51b5bcfc1a33475b1433ded6353f48423ff").into(), - }, - sync_aggregate: SyncAggregate{ - sync_committee_bits: hex!("ffffffffff7bfdfffff7fffff1effffef7f9ffbdfdffffffdffbfffbbf7ffffffffffefdf7ffbeffdffef7bfffffffffffbffffffffffbffffffffffffffdfda"), - sync_committee_signature: hex!("b5727bad1db101b6f0fd7ec4cb79b43dae90366fe0cae31a62439388eb03ebd75732cee3bde51f814203a4c0f5b23898120cd0870f0e662bdf0f85a048b534d9a906e6d32a65df019059d34f724221075734ec2849c09679febecf6929934f09").into(), - }, - signature_slot: 4058721, - next_sync_committee_update: None, - finalized_header: BeaconHeader { - slot: 4058656, - proposer_index: 810, - parent_root: hex!("bb6cfda1e02c3117d9fa41c1e1594ce0645352a073ad8b474f83c148e0d9954f").into(), - state_root: hex!("f938f0f0cba85234afbaace20545134c70b35e6ff9f74d944b0fea309109f3cf").into(), - body_root: hex!("cf6a7a6f653cb64b2b910278a478339b34eb08abf00e0766d10c7a8fe9bdb139").into(), - }, - finality_branch: vec![ - hex!("71ef010000000000000000000000000000000000000000000000000000000000").into(), - hex!("3d4be5d019ba15ea3ef304a83b8a067f2e79f46a3fac8069306a6c814a0a35eb").into(), - hex!("a2e2a28c0bb0ad56c25f3c461a4bfe4f3b3b894bc0105a62e85f43a4ae1adc3f").into(), - hex!("aa2bad8cf9b0433d3d79bc5b95c067048b018d1d2ffd0c66db6e7cf86e0a314e").into(), - hex!("027f238235d07ac9757543c19deabe1d553d6fc110e8bea4b037b1fab263b4dc").into(), - hex!("7dfa1cc1907e8927295f78a770bf86b28f5c2bddcac38beb3b4beb265ff5608f").into(), - ], - block_roots_root: hex!("4a5a57fb0769443f6472f59dbb78d7a9a69ff61d09aa89d5da645d634ec46a14").into(), - block_roots_branch: vec![ - hex!("a09ad7f3afd681bb6fd54abba339549f3b601beedea79a5b7d448b1cf1e1613e").into(), - hex!("acdfd4d5eba154f118a84af7a2d17ba6100fcd9c24fc235e927f584a5b56e32f").into(), - hex!("36ca106eac009ed605e680415b105b3a6591830c38034511f300aae44802235f").into(), - hex!("171561a9e1afb413132d0f4d3cbbd810766c151be32ec9f2d609f40aef9e2588").into(), - hex!("7cd963eba3fb57ee5ce37ee4b621d24fc14d642e32f48dc48ade528e11458ab9").into(), - ] - }) -} - -pub fn make_execution_header_update() -> Box { - Box::new(ExecutionHeaderUpdate { - header: BeaconHeader { - slot: 4058654, - proposer_index: 1039, - parent_root: hex!("758fa0a54047c0221b3107423e78b8910514ba7a0c4250401dac77108dce2ff8").into(), - state_root: hex!("53c79320b4b7649e39a9f07903f4fc68a7cfe7a81cb2e30293dd7b00ee13f69a").into(), - body_root: hex!("a76a7f037f12ee070dcb273d9787b13ff0cf17420a39564a101789318a157ec3").into(), - }, - ancestry_proof: Some(AncestryProof { - header_branch: vec![ - hex!("bb6cfda1e02c3117d9fa41c1e1594ce0645352a073ad8b474f83c148e0d9954f").into(), - hex!("b44967bd8ff799126cad993ff7369f7a28d60281304d0c7c058e6721b6ce4c61").into(), - hex!("0009710ef2467f95542c2e8e7a7249282c08f62aedbe7d21ae4a7af04e1a890d").into(), - hex!("7bc5dc20638cfe1cfd5d2547c3efbed4cfb533c76c27d41f723ed876ab9edc3a").into(), - hex!("6dcd59a8a041cf2591921417cb8133f0ff5af9bfe1f1ab491e75a751adc9c9e1").into(), - hex!("3f25a2852042c7bf2c421bf16c0b9373c1d27ccb1eca4088f8191712481261be").into(), - hex!("d1f9cfe1f04031459e5c45f47b2a49c780cabb8ca5b8d76461db2b88c337ed76").into(), - hex!("8c37e3119bf7d3cb8208e832669261b0eda1b3c7b11d321760ba1c0649f61416").into(), - hex!("1783d3b7041ecb78d9e1f913b82bd335229ca1f2cc5d3cc8dd28c94152e887b4").into(), - hex!("e39fc366c951c7cb2100308b0a9417581c46812a7d7e89f516c19863f7686f96").into(), - hex!("3c29b6d9b8715dbe5d6831364229efc91ad56ae69e93cb119d5ef4bdc53fcb37").into(), - hex!("3cf6fe5e8d91dbaa77e6befa81e04fb25a3e089317d83ff35fc8adfbbf2aab5a").into(), - hex!("b41c97cf3b1b4b5bf2999dfb1b3eaeac5c1b12205e9ab0809988e3779d119047").into(), - ], - finalized_block_root: hex!("b4802863fc1d32778211ce6aac8109c73c516a003213f4f5333c80472d08fe4e").into(), - }), - execution_header: ExecutionPayloadHeader { - parent_hash: hex!("9cffcba69c88a619483e13864704dde5db80e05f8d49018f615395ce09cd24ab").into(), - fee_recipient: hex!("ff58d746a67c2e42bcc07d6b3f58406e8837e883").into(), - state_root: hex!("6a4aafc93626778475a416721104229035e91f0db788d0099b57e756cd272f0a").into(), - receipts_root: hex!("e1ce670bdcf9acf4c62fee845cd7e81eabbb6db9ddbff56130020c6cf999a45d").into(), - logs_bloom: hex!("a000980408008000328c1458805c005048b84812c134200090b40428568108a0648090105085100301844800090802484420800d020282019002040d083004031a20420240a4a8900a43296938c040802040220170860210910020036b8c482228c004440300021c82c0400110402a10800582424001c00000828310210020a18130504020790dca716194100880ea5501149104002bc05e189080901c4001010e0a040658a410072021230a5224265030082404000aa11f28162e216636000408842103d41010760972060060000500c20130b000000065401483200081a84934f020020120009618002269c884724616040000840e18080300024490000230").into(), - prev_randao: hex!("5d9ac7ea788ecb534e98bc9079fa0bef199011dadadedaee5dc40e2cd702d664").into(), - block_number: 5025098, - gas_limit: 30000000, - gas_used: 13802943, - timestamp: 1704437448, - extra_data: hex!("476f65726c69205365706f6c69612d4265706f6c696120513966").into(), - base_fee_per_gas: U256::from(19959019915_u64), - block_hash: hex!("795021134c2b7f9c00b498ff7b0971dbbe061561868f702d8ca68a05e5eb5a99").into(), - transactions_root: hex!("3cb7c92fde5d511cc90cd67e375c4388794f4c01e375e8e8a06d003b5593fd12").into(), - withdrawals_root: hex!("5f5155fd8e5cd24b7ecb1e039792b0caff01dfda2990786d9ffc88325b5d1ea8").into(), - }, - execution_branch: vec![ - hex!("85ff3d1c2bc3dcdd5543bcd29a1224c6a8c24875224fbb1e3b69f0515ffaacda").into(), - hex!("336488033fe5f3ef4ccc12af07b9370b92e553e35ecb4a337a1b1c0e4afe1e0e").into(), - hex!("db56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71").into(), - hex!("fe1fa7acd413c54ebd394126ade19fc624ad9e4c60792d54ff3d60b07076b76d").into(), - ], - }) -} diff --git a/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/fixtures_minimal.rs b/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/fixtures_minimal.rs deleted file mode 100755 index b9476a0fb08..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/fixtures_minimal.rs +++ /dev/null @@ -1,248 +0,0 @@ -// Generated, do not edit! -// See README.md for instructions to generate -use crate::{CheckpointUpdate, ExecutionHeaderUpdate, Update}; -use hex_literal::hex; -use primitives::{ - updates::AncestryProof, BeaconHeader, ExecutionPayloadHeader, NextSyncCommitteeUpdate, - SyncAggregate, SyncCommittee, -}; -use sp_core::U256; -use sp_std::{boxed::Box, vec}; - -pub fn make_checkpoint() -> Box { - Box::new(CheckpointUpdate { - header: BeaconHeader { - slot: 152, - proposer_index: 7, - parent_root: hex!("7ecd45ee8bbacb20c6818eb46740b0f8d2fbd5af964e0dd844d3aa49ca75ce26").into(), - state_root: hex!("0859c78c54a2ecf1af0aecc05f3c8ba9274d1df500bfc4e6a7194c0235f55def").into(), - body_root: hex!("561bec3e5b200ee1bf6b60b5858ca2d7766ac9327b46355c070afafae8fca2ba").into(), - }, - current_sync_committee: SyncCommittee { - pubkeys: [ - hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), - hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), - hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), - hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), - hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), - hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), - hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), - hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), - hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), - hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), - hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), - hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), - hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), - hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), - hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), - hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), - hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), - hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), - hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), - hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), - hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), - hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), - hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), - hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), - hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), - hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), - hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), - hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), - hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), - hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), - hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), - hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), - ], - aggregate_pubkey: hex!("8fe11476a05750c52618deb79918e2e674f56dfbf12dbce55ae4386d108e8a1e83c6326f5957e2ef19137582ce270dc6").into(), - }, - current_sync_committee_branch: vec![ - hex!("c6dd41df7b4978b7ee7479dcbfdbfa9fb56d1464afe9806bfd6f527e9d1c69a4").into(), - hex!("b3824f305318071010d4f4d9505f9fc102cdd57f1c03cf4540e471b157f98e3f").into(), - hex!("66677299731d34be9d4dea7c0e89d8eae81b8dffa3c6218152484a063b1064a1").into(), - hex!("ef53c2b02cdb7f44fb37ea75f4c48c5086604a26be9635f88b1138f961f87773").into(), - hex!("1a3f86a88fb2ec99cb1d7b0f35227c0f646490773bac523c30fc7eccf87c0f84").into(), - ], - validators_root: hex!("270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69").into(), - block_roots_root: hex!("8ad7487f0e79a6cf67ce49916f74e5b272be9e38ea5f8a6a588eaa89ea7f858e").into(), - block_roots_branch: vec![ - hex!("90683050cb3f3b04b2a89c206365747bef4c42154feb5d3f4198dfd48b2067ae").into(), - hex!("34f521b45630273930475b8a4350fe2c71c804878ebcd89064eb1dc24a85e468").into(), - hex!("81e166eaeaff5df2d3a5df306c78af075106cbf63c2f1b50ab67eec2dbb0f5ce").into(), - hex!("857526b3bf20de3ec6e57565dd593304f83e47541cc18d7c2d5b4c9f2724ba14").into(), - hex!("1b4bedd5ecc523599da000387f5e33ffe5324b8e234c43ee702de8ccc88d713f").into(), - ], - }) -} - -pub fn make_sync_committee_update() -> Box { - Box::new(Update { - attested_header: BeaconHeader { - slot: 144, - proposer_index: 2, - parent_root: hex!("74e7da3093f79414b5ab593d1c12ba63767db7f4af62672fa1be641331c338e0").into(), - state_root: hex!("92a08dc74f6af7bfcd428aa1677d58f36fefc159c0134b312c186a69fcd00496").into(), - body_root: hex!("51506a8230d40d065a29ad01197c983b9b5d4b9abd26d3c48773941f4e6f482d").into(), - }, - sync_aggregate: SyncAggregate{ - sync_committee_bits: hex!("ffffffff"), - sync_committee_signature: hex!("92cbff711040bcc4a81616edbadbe712ea3ac4939c3d3121a4561b4b3950e2e5b09809606b79fdad2ce20fdef413120a04f02dc65149ca9b6ecab2a94ac4087062df4ab03e161ae56fa6fee4ba40af29c3b4327e21e846f98144cab30684d197").into(), - }, - signature_slot: 145, - next_sync_committee_update: Some(NextSyncCommitteeUpdate { - next_sync_committee: SyncCommittee { - pubkeys: [ - hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), - hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), - hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), - hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), - hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), - hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), - hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), - hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), - hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), - hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), - hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), - hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), - hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), - hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), - hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), - hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), - hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), - hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), - hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), - hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), - hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), - hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), - hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), - hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), - hex!("a8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac").into(), - hex!("81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e").into(), - hex!("b89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b").into(), - hex!("88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e").into(), - hex!("9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373").into(), - hex!("ab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34").into(), - hex!("a3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b").into(), - hex!("a99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c").into(), - ], - aggregate_pubkey: hex!("8fe11476a05750c52618deb79918e2e674f56dfbf12dbce55ae4386d108e8a1e83c6326f5957e2ef19137582ce270dc6").into(), - }, - next_sync_committee_branch: vec![ - hex!("c243f5286cbf6c3c5f58ef6e1734a737bf96cfc0adbf2ee88d4a996f8dfc7097").into(), - hex!("6ae16cb8ea57014c75a9469485bc024bb1e64676656cb069753bf091e58de88f").into(), - hex!("1afa3c77cd75040c1bbbc5d1b7c07e65eeee44fbc659b64ccd55b4ba579038ae").into(), - hex!("89b14216f60859ae366de066eeff4c7b69f8b5738c5b70cdfab4b3a976f9f12f").into(), - hex!("b7d8fa1e64e6d6339a7c68a81e20daab65804777b93a04236fa503b575c2f1a9").into(), - ], - }), - finalized_header: BeaconHeader{ - slot: 128, - proposer_index: 3, - parent_root: hex!("3774d6a479fc6f71ccaff3f8a1881c424b0319e96a7da15f87e3b750ba50dae5").into(), - state_root: hex!("85937007c564046bcc147d53b1d2d78941e2787ec059bee191420369a7f80447").into(), - body_root: hex!("c8f31c33ffaeef2d534363b7ef9ec391f90c17bc5bbe439cf0dcf0de8eeb4d7d").into(), - }, - finality_branch: vec![ - hex!("1000000000000000000000000000000000000000000000000000000000000000").into(), - hex!("10c726fac935bf9657cc7476d3cfa7bedec5983dcfb59e8a7df6d0a619e108d7").into(), - hex!("c2374959a44ad09eb825ada636c430d530e656d7f06dccbcf2ca8b6dc834b188").into(), - hex!("1afa3c77cd75040c1bbbc5d1b7c07e65eeee44fbc659b64ccd55b4ba579038ae").into(), - hex!("89b14216f60859ae366de066eeff4c7b69f8b5738c5b70cdfab4b3a976f9f12f").into(), - hex!("b7d8fa1e64e6d6339a7c68a81e20daab65804777b93a04236fa503b575c2f1a9").into(), - ], - block_roots_root: hex!("b10da1bbb1c0dcb01637b9e3dcb710d1013dc42a002bd837d5b4effa0ac995c9").into(), - block_roots_branch: vec![ - hex!("9c62693fd336e4b3ca61d3cbe9caeb85f1f1b59ef50aeddfce53dc7321d6058b").into(), - hex!("364947a6574f4acc97888e1fddb5ec718859d54cd7e3db98cda8db4dbea82ded").into(), - hex!("10a61d26b0c1b5b89cf5b82b965f772a1b6ae852fbd13a986c5c63bf12b99244").into(), - hex!("506ed8ca9908af4b5acb4cfdec6dd968acf38346c16385abca360c9976411c3e").into(), - hex!("ada571922caf3dde48e19f1482df8d17dd6bb05e525c016c8cf6796a5d7f4a00").into(), - ], - }) -} - -pub fn make_finalized_header_update() -> Box { - Box::new(Update { - attested_header: BeaconHeader { - slot: 184, - proposer_index: 5, - parent_root: hex!("13548d0b72ef2b352ba73a53274ad02e9310d8417d4782bf9cdad877da549595").into(), - state_root: hex!("cbd5e841afef5103a613bb9a89199d39c40751af1af7cabadfa8e1fd49c4be09").into(), - body_root: hex!("c9b5074ac3043ae2ad6da067b0787d61b6f1611b560ef80860ce62564534a53a").into(), - }, - sync_aggregate: SyncAggregate{ - sync_committee_bits: hex!("ffffffff"), - sync_committee_signature: hex!("80628825caef48ef13b4ffda96fcee74743609fe3537b7cd0ca8bc25c8a540b96dfbe23bdd0a60a8db70b2c48f090c1d03a25923207a193724d98e140db90ab692cd00ec2b4d3c0c4cbff13b4ab343e0c896e15cba08f9d82c392b1c982a8115").into(), - }, - signature_slot: 185, - next_sync_committee_update: None, - finalized_header: BeaconHeader { - slot: 168, - proposer_index: 1, - parent_root: hex!("bb8245e89f5d7d9191c559425b8522487d98b8f2c9b814a158656eaf06caaa06").into(), - state_root: hex!("98b4d1141cfc324ce7095417d81b28995587e9a50ebb4872254187155e6b160c").into(), - body_root: hex!("c1a089291dbc744be622356dcbdd65fe053dcb908056511e5148f73a3d5c8a7e").into(), - }, - finality_branch: vec![ - hex!("1500000000000000000000000000000000000000000000000000000000000000").into(), - hex!("10c726fac935bf9657cc7476d3cfa7bedec5983dcfb59e8a7df6d0a619e108d7").into(), - hex!("c2374959a44ad09eb825ada636c430d530e656d7f06dccbcf2ca8b6dc834b188").into(), - hex!("97a3662f859b89f96d7c6ce03496c353df5f6c225455f3f2c5edde329f5a94d1").into(), - hex!("4c4720ad9a38628c6774dbd1180d026aceb0be3cb0085d531b1e09faf014328a").into(), - hex!("c3d59497774f8f1c13fda9f9c6b4f773efabbac8a24d914dc7cf02874d5f5658").into(), - ], - block_roots_root: hex!("dff54b382531f4af2cb6e5b27ea905cc8e19b48f3ae8e02955f859e6bfd37e42").into(), - block_roots_branch: vec![ - hex!("8f957e090dec42d80c118d24c0e841681e82d3b330707729cb939d538c208fb7").into(), - hex!("4d33691095103fbf0df53ae0ea14378d721356b54592019050fc532bfef42d0c").into(), - hex!("bc9b31cd5d18358bff3038fab52101cfd5c56c75539449d988c5a789200fb264").into(), - hex!("7d57e424243eeb39169edccf9dab962ba8d80a9575179799bbd509c95316d8df").into(), - hex!("c07eeb9da14bcedb7dd225a68b92f578ef0b86187724879e5171d5de8a00be3a").into(), - ] - }) -} - -pub fn make_execution_header_update() -> Box { - Box::new(ExecutionHeaderUpdate { - header: BeaconHeader { - slot: 166, - proposer_index: 7, - parent_root: hex!("da28a205118aaf4aa69a3fb4eb7a565541b7172cc77771ec886b54b6f5bc10f3").into(), - state_root: hex!("179a6249c3e86ebcc9c71a0fc604a825a5fb5dd1602177681c54dc7e09af4265").into(), - body_root: hex!("e1290e50d64f043594bcac66824b04eb3047ae4174188e40106235183f47074c").into(), - }, - ancestry_proof: Some(AncestryProof { - header_branch: vec![ - hex!("bb8245e89f5d7d9191c559425b8522487d98b8f2c9b814a158656eaf06caaa06").into(), - hex!("ab498fef414d709fcac589217246527b82c25706fa800f21d543c83a0ccc59a2").into(), - hex!("de054acbf636cf9f1692137f78179381b5b0328b49fbc4d324eb8e897b41f52c").into(), - hex!("c472fde1df644788c92208467ff5aad686ce55bab1570917e8de1922296666fd").into(), - hex!("11a71c67676c72696c452d875318501cd50968106f72fb611bfe5952285516f8").into(), - hex!("6d2bd2b6cd84ddadc89df27f3f7f9141bb88c742a30123c77eefebef9d5f6667").into(), - ], - finalized_block_root: hex!("be7d9cc4483ed0065fc7c32e2a783ca3782d8dbd7bfe899fd7c0bcee82f11629").into(), - }), - execution_header: ExecutionPayloadHeader { - parent_hash: hex!("96b27b6e0919c19a70c4a2f7136fd59d2e63a3ba0453a86775add3f2dd681cea").into(), - fee_recipient: hex!("0000000000000000000000000000000000000000").into(), - state_root: hex!("b847ee60946ebdb5bd92c22385da44b8a9aea4c6779f1a1402cc06e22b76fb4a").into(), - receipts_root: hex!("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").into(), - logs_bloom: hex!("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").into(), - prev_randao: hex!("e6c6665aa502e12dd8f5937da2eb7f7fe7a78bc9a900c9321412b8ddd4d72325").into(), - block_number: 166, - gas_limit: 68022694, - gas_used: 0, - timestamp: 1704700423, - extra_data: hex!("d983010d05846765746888676f312e32312e318664617277696e").into(), - base_fee_per_gas: U256::from(7_u64), - block_hash: hex!("1871ded7b2b8b4b5b358c904104704811b15aeefc24e49daa2a1a68176d6553a").into(), - transactions_root: hex!("7ffe241ea60187fdb0187bfa22de35d1f9bed7ab061d9401fd47e34a54fbede1").into(), - withdrawals_root: hex!("28ba1834a3a7b657460ce79fa3a1d909ab8828fd557659d4d0554a9bdbc0ec30").into(), - }, - execution_branch: vec![ - hex!("276d006ecfe51451787321ef00417b194e90b35d4106bd7d51372f39918a4531").into(), - hex!("336488033fe5f3ef4ccc12af07b9370b92e553e35ecb4a337a1b1c0e4afe1e0e").into(), - hex!("db56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71").into(), - hex!("6b8ff91d1be713c644ef9b3e5b77323897930c342fd12615c0d2142bee5cd1d7").into(), - ], - }) -} diff --git a/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/mod.rs b/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/mod.rs deleted file mode 100644 index 807d4de14ee..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/mod.rs +++ /dev/null @@ -1,166 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use super::*; -mod util; - -use crate::Pallet as EthereumBeaconClient; -use frame_benchmarking::v2::*; -use frame_system::RawOrigin; - -#[cfg(feature = "beacon-spec-minimal")] -mod fixtures_minimal; -#[cfg(feature = "beacon-spec-minimal")] -use fixtures_minimal::*; - -#[cfg(not(feature = "beacon-spec-minimal"))] -mod fixtures_mainnet; -#[cfg(not(feature = "beacon-spec-minimal"))] -use fixtures_mainnet::*; - -use primitives::{ - fast_aggregate_verify, prepare_aggregate_pubkey, prepare_aggregate_signature, - verify_merkle_branch, -}; -use util::*; - -#[benchmarks] -mod benchmarks { - use super::*; - - #[benchmark] - fn force_checkpoint() -> Result<(), BenchmarkError> { - let checkpoint_update = make_checkpoint(); - let block_root: H256 = checkpoint_update.header.hash_tree_root().unwrap(); - - #[extrinsic_call] - _(RawOrigin::Root, Box::new(*checkpoint_update)); - - assert!(>::get() == block_root); - assert!(>::get(block_root).is_some()); - - Ok(()) - } - - #[benchmark] - fn submit() -> Result<(), BenchmarkError> { - let caller: T::AccountId = whitelisted_caller(); - let checkpoint_update = make_checkpoint(); - let finalized_header_update = make_finalized_header_update(); - let block_root: H256 = finalized_header_update.finalized_header.hash_tree_root().unwrap(); - EthereumBeaconClient::::process_checkpoint_update(&checkpoint_update)?; - - #[extrinsic_call] - submit(RawOrigin::Signed(caller.clone()), Box::new(*finalized_header_update)); - - assert!(>::get() == block_root); - assert!(>::get(block_root).is_some()); - - Ok(()) - } - - #[benchmark] - fn submit_with_sync_committee() -> Result<(), BenchmarkError> { - let caller: T::AccountId = whitelisted_caller(); - let checkpoint_update = make_checkpoint(); - let sync_committee_update = make_sync_committee_update(); - EthereumBeaconClient::::process_checkpoint_update(&checkpoint_update)?; - - #[extrinsic_call] - submit(RawOrigin::Signed(caller.clone()), Box::new(*sync_committee_update)); - - assert!(>::exists()); - - Ok(()) - } - - #[benchmark] - fn submit_execution_header() -> Result<(), BenchmarkError> { - let caller: T::AccountId = whitelisted_caller(); - let checkpoint_update = make_checkpoint(); - let finalized_header_update = make_finalized_header_update(); - let execution_header_update = make_execution_header_update(); - let execution_header_hash = execution_header_update.execution_header.block_hash; - EthereumBeaconClient::::process_checkpoint_update(&checkpoint_update)?; - EthereumBeaconClient::::process_update(&finalized_header_update)?; - - #[extrinsic_call] - _(RawOrigin::Signed(caller.clone()), Box::new(*execution_header_update)); - - assert!(>::contains_key(execution_header_hash)); - - Ok(()) - } - - #[benchmark(extra)] - fn bls_fast_aggregate_verify_pre_aggregated() -> Result<(), BenchmarkError> { - EthereumBeaconClient::::process_checkpoint_update(&make_checkpoint())?; - let update = make_sync_committee_update(); - let participant_pubkeys = participant_pubkeys::(&update)?; - let signing_root = signing_root::(&update)?; - let agg_sig = - prepare_aggregate_signature(&update.sync_aggregate.sync_committee_signature).unwrap(); - let agg_pub_key = prepare_aggregate_pubkey(&participant_pubkeys).unwrap(); - - #[block] - { - agg_sig.fast_aggregate_verify_pre_aggregated(signing_root.as_bytes(), &agg_pub_key); - } - - Ok(()) - } - - #[benchmark(extra)] - fn bls_fast_aggregate_verify() -> Result<(), BenchmarkError> { - EthereumBeaconClient::::process_checkpoint_update(&make_checkpoint())?; - let update = make_sync_committee_update(); - let current_sync_committee = >::get(); - let absent_pubkeys = absent_pubkeys::(&update)?; - let signing_root = signing_root::(&update)?; - - #[block] - { - fast_aggregate_verify( - ¤t_sync_committee.aggregate_pubkey, - &absent_pubkeys, - signing_root, - &update.sync_aggregate.sync_committee_signature, - ) - .unwrap(); - } - - Ok(()) - } - - #[benchmark(extra)] - fn verify_merkle_proof() -> Result<(), BenchmarkError> { - EthereumBeaconClient::::process_checkpoint_update(&make_checkpoint())?; - let update = make_sync_committee_update(); - let block_root: H256 = update.finalized_header.hash_tree_root().unwrap(); - - #[block] - { - verify_merkle_branch( - block_root, - &update.finality_branch, - config::FINALIZED_ROOT_SUBTREE_INDEX, - config::FINALIZED_ROOT_DEPTH, - update.attested_header.state_root, - ); - } - - Ok(()) - } - - #[cfg(feature = "beacon-spec-minimal")] - impl_benchmark_test_suite!( - EthereumBeaconClient, - crate::mock::minimal::new_tester(), - crate::mock::minimal::Test - ); - #[cfg(not(feature = "beacon-spec-minimal"))] - impl_benchmark_test_suite!( - EthereumBeaconClient, - crate::mock::mainnet::new_tester(), - crate::mock::mainnet::Test - ); -} diff --git a/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/util.rs b/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/util.rs deleted file mode 100644 index 7e5ded6e1f0..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/src/benchmarking/util.rs +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use crate::{ - decompress_sync_committee_bits, Config, CurrentSyncCommittee, Pallet as EthereumBeaconClient, - Update, ValidatorsRoot, Vec, -}; -use primitives::PublicKeyPrepared; -use sp_core::H256; - -pub fn participant_pubkeys( - update: &Update, -) -> Result, &'static str> { - let sync_committee_bits = - decompress_sync_committee_bits(update.sync_aggregate.sync_committee_bits); - let current_sync_committee = >::get(); - let pubkeys = EthereumBeaconClient::::find_pubkeys( - &sync_committee_bits, - (*current_sync_committee.pubkeys).as_ref(), - true, - ); - Ok(pubkeys) -} - -pub fn absent_pubkeys(update: &Update) -> Result, &'static str> { - let sync_committee_bits = - decompress_sync_committee_bits(update.sync_aggregate.sync_committee_bits); - let current_sync_committee = >::get(); - let pubkeys = EthereumBeaconClient::::find_pubkeys( - &sync_committee_bits, - (*current_sync_committee.pubkeys).as_ref(), - false, - ); - Ok(pubkeys) -} - -pub fn signing_root(update: &Update) -> Result { - let validators_root = >::get(); - let signing_root = EthereumBeaconClient::::signing_root( - &update.attested_header, - validators_root, - update.signature_slot, - )?; - Ok(signing_root) -} diff --git a/snowbridge/parachain/pallets/ethereum-client/src/config/mainnet.rs b/snowbridge/parachain/pallets/ethereum-client/src/config/mainnet.rs deleted file mode 100644 index 3d22ad82cec..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/src/config/mainnet.rs +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -pub const SLOTS_PER_EPOCH: usize = 32; -pub const SECONDS_PER_SLOT: usize = 12; -pub const EPOCHS_PER_SYNC_COMMITTEE_PERIOD: usize = 256; -pub const SYNC_COMMITTEE_SIZE: usize = 512; -pub const SYNC_COMMITTEE_BITS_SIZE: usize = SYNC_COMMITTEE_SIZE / 8; -pub const SLOTS_PER_HISTORICAL_ROOT: usize = 8192; -pub const IS_MINIMAL: bool = false; -pub const BLOCK_ROOT_AT_INDEX_DEPTH: usize = 13; diff --git a/snowbridge/parachain/pallets/ethereum-client/src/config/minimal.rs b/snowbridge/parachain/pallets/ethereum-client/src/config/minimal.rs deleted file mode 100644 index affa86db976..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/src/config/minimal.rs +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -pub const SLOTS_PER_EPOCH: usize = 8; -pub const SECONDS_PER_SLOT: usize = 6; -pub const EPOCHS_PER_SYNC_COMMITTEE_PERIOD: usize = 8; -pub const SYNC_COMMITTEE_SIZE: usize = 32; -pub const SYNC_COMMITTEE_BITS_SIZE: usize = SYNC_COMMITTEE_SIZE / 8; -pub const SLOTS_PER_HISTORICAL_ROOT: usize = 64; -pub const IS_MINIMAL: bool = true; -pub const BLOCK_ROOT_AT_INDEX_DEPTH: usize = 6; diff --git a/snowbridge/parachain/pallets/ethereum-client/src/config/mod.rs b/snowbridge/parachain/pallets/ethereum-client/src/config/mod.rs deleted file mode 100644 index d20743b846e..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/src/config/mod.rs +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use primitives::merkle_proof::{generalized_index_length, subtree_index}; -use static_assertions::const_assert; - -pub mod mainnet; -pub mod minimal; - -#[cfg(feature = "beacon-spec-minimal")] -pub use minimal::*; - -#[cfg(not(feature = "beacon-spec-minimal"))] -pub use mainnet::*; - -// Generalized Indices - -// get_generalized_index(BeaconState, 'block_roots') -pub const BLOCK_ROOTS_INDEX: usize = 37; -pub const BLOCK_ROOTS_SUBTREE_INDEX: usize = subtree_index(BLOCK_ROOTS_INDEX); -pub const BLOCK_ROOTS_DEPTH: usize = generalized_index_length(BLOCK_ROOTS_INDEX); - -// get_generalized_index(BeaconState, 'finalized_checkpoint', 'root') -pub const FINALIZED_ROOT_INDEX: usize = 105; -pub const FINALIZED_ROOT_SUBTREE_INDEX: usize = subtree_index(FINALIZED_ROOT_INDEX); -pub const FINALIZED_ROOT_DEPTH: usize = generalized_index_length(FINALIZED_ROOT_INDEX); - -// get_generalized_index(BeaconState, 'current_sync_committee') -pub const CURRENT_SYNC_COMMITTEE_INDEX: usize = 54; -pub const CURRENT_SYNC_COMMITTEE_SUBTREE_INDEX: usize = subtree_index(CURRENT_SYNC_COMMITTEE_INDEX); -pub const CURRENT_SYNC_COMMITTEE_DEPTH: usize = - generalized_index_length(CURRENT_SYNC_COMMITTEE_INDEX); - -// get_generalized_index(BeaconState, 'next_sync_committee') -pub const NEXT_SYNC_COMMITTEE_INDEX: usize = 55; -pub const NEXT_SYNC_COMMITTEE_SUBTREE_INDEX: usize = subtree_index(NEXT_SYNC_COMMITTEE_INDEX); -pub const NEXT_SYNC_COMMITTEE_DEPTH: usize = generalized_index_length(NEXT_SYNC_COMMITTEE_INDEX); - -// get_generalized_index(BeaconBlockBody, 'execution_payload') -pub const EXECUTION_HEADER_INDEX: usize = 25; -pub const EXECUTION_HEADER_SUBTREE_INDEX: usize = subtree_index(EXECUTION_HEADER_INDEX); -pub const EXECUTION_HEADER_DEPTH: usize = generalized_index_length(EXECUTION_HEADER_INDEX); - -pub const MAX_EXTRA_DATA_BYTES: usize = 32; -pub const MAX_LOGS_BLOOM_SIZE: usize = 256; -pub const MAX_FEE_RECIPIENT_SIZE: usize = 20; - -pub const MAX_BRANCH_PROOF_SIZE: usize = 20; - -/// DomainType('0x07000000') -/// -pub const DOMAIN_SYNC_COMMITTEE: [u8; 4] = [7, 0, 0, 0]; - -pub const PUBKEY_SIZE: usize = 48; -pub const SIGNATURE_SIZE: usize = 96; - -const_assert!(SYNC_COMMITTEE_BITS_SIZE == SYNC_COMMITTEE_SIZE / 8); diff --git a/snowbridge/parachain/pallets/ethereum-client/src/functions.rs b/snowbridge/parachain/pallets/ethereum-client/src/functions.rs deleted file mode 100644 index 751e63c7f86..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/src/functions.rs +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use crate::config::{ - EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH, SYNC_COMMITTEE_BITS_SIZE, - SYNC_COMMITTEE_SIZE, -}; - -/// Decompress packed bitvector into byte vector according to SSZ deserialization rules. Each byte -/// in the decompressed vector is either 0 or 1. -pub fn decompress_sync_committee_bits( - input: [u8; SYNC_COMMITTEE_BITS_SIZE], -) -> [u8; SYNC_COMMITTEE_SIZE] { - primitives::decompress_sync_committee_bits::( - input, - ) -} - -/// Compute the sync committee period in which a slot is contained. -pub fn compute_period(slot: u64) -> u64 { - slot / SLOTS_PER_EPOCH as u64 / EPOCHS_PER_SYNC_COMMITTEE_PERIOD as u64 -} - -/// Compute epoch in which a slot is contained. -pub fn compute_epoch(slot: u64, slots_per_epoch: u64) -> u64 { - slot / slots_per_epoch -} - -/// Sums the bit vector of sync committee participation. -pub fn sync_committee_sum(sync_committee_bits: &[u8]) -> u32 { - sync_committee_bits.iter().fold(0, |acc: u32, x| acc + *x as u32) -} diff --git a/snowbridge/parachain/pallets/ethereum-client/src/impls.rs b/snowbridge/parachain/pallets/ethereum-client/src/impls.rs deleted file mode 100644 index 300431d8770..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/src/impls.rs +++ /dev/null @@ -1,93 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use super::*; - -use snowbridge_core::inbound::{ - VerificationError::{self, *}, - *, -}; -use snowbridge_ethereum::Receipt; - -impl Verifier for Pallet { - /// Verify a message by verifying the existence of the corresponding - /// Ethereum log in a block. Returns the log if successful. The execution header containing - /// the log should be in the beacon client storage, meaning it has been verified and is an - /// ancestor of a finalized beacon block. - fn verify(event_log: &Log, proof: &Proof) -> Result<(), VerificationError> { - log::info!( - target: "ethereum-client", - "💫 Verifying message with block hash {}", - proof.block_hash, - ); - - let header = >::get(proof.block_hash).ok_or(HeaderNotFound)?; - - let receipt = match Self::verify_receipt_inclusion(header.receipts_root, proof) { - Ok(receipt) => receipt, - Err(err) => { - log::error!( - target: "ethereum-client", - "💫 Verification of receipt inclusion failed for block {}: {:?}", - proof.block_hash, - err - ); - return Err(err) - }, - }; - - log::trace!( - target: "ethereum-client", - "💫 Verified receipt inclusion for transaction at index {} in block {}", - proof.tx_index, proof.block_hash, - ); - - event_log.validate().map_err(|_| InvalidLog)?; - - // Convert snowbridge_core::inbound::Log to snowbridge_ethereum::Log. - let event_log = snowbridge_ethereum::Log { - address: event_log.address, - topics: event_log.topics.clone(), - data: event_log.data.clone(), - }; - - if !receipt.contains_log(&event_log) { - log::error!( - target: "ethereum-client", - "💫 Event log not found in receipt for transaction at index {} in block {}", - proof.tx_index, proof.block_hash, - ); - return Err(LogNotFound) - } - - log::info!( - target: "ethereum-client", - "💫 Receipt verification successful for {}", - proof.block_hash, - ); - - Ok(()) - } -} - -impl Pallet { - /// Verifies that the receipt encoded in `proof.data` is included in the block given by - /// `proof.block_hash`. - pub fn verify_receipt_inclusion( - receipts_root: H256, - proof: &Proof, - ) -> Result { - let result = verify_receipt_proof(receipts_root, &proof.data.1).ok_or(InvalidProof)?; - - match result { - Ok(receipt) => Ok(receipt), - Err(err) => { - log::trace!( - target: "ethereum-client", - "💫 Failed to decode transaction receipt: {}", - err - ); - Err(InvalidProof) - }, - } - } -} diff --git a/snowbridge/parachain/pallets/ethereum-client/src/lib.rs b/snowbridge/parachain/pallets/ethereum-client/src/lib.rs deleted file mode 100644 index c99458441a5..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/src/lib.rs +++ /dev/null @@ -1,841 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! Ethereum Beacon Client -//! -//! A light client that verifies consensus updates signed by the sync committee of the beacon chain. -//! -//! # Extrinsics -//! -//! ## Governance -//! -//! * [`Call::force_checkpoint`]: Set the initial trusted consensus checkpoint. -//! * [`Call::set_operating_mode`]: Set the operating mode of the pallet. Can be used to disable -//! processing of conensus updates. -//! -//! ## Consensus Updates -//! -//! * [`Call::submit`]: Submit a finalized beacon header with an optional sync committee update -//! * [`Call::submit_execution_header`]: Submit an execution header together with an ancestry proof -//! that can be verified against an already imported finalized beacon header. -#![cfg_attr(not(feature = "std"), no_std)] - -pub mod config; -pub mod functions; -pub mod impls; -pub mod types; -pub mod weights; - -#[cfg(any(test, feature = "fuzzing"))] -pub mod mock; - -#[cfg(test)] -mod tests; - -#[cfg(feature = "runtime-benchmarks")] -mod benchmarking; - -use frame_support::{ - dispatch::DispatchResult, pallet_prelude::OptionQuery, traits::Get, transactional, -}; -use frame_system::ensure_signed; -use primitives::{ - fast_aggregate_verify, verify_merkle_branch, verify_receipt_proof, BeaconHeader, BlsError, - CompactBeaconState, CompactExecutionHeader, ExecutionHeaderState, ForkData, ForkVersion, - ForkVersions, PublicKeyPrepared, SigningData, -}; -use snowbridge_core::{BasicOperatingMode, RingBufferMap}; -use sp_core::H256; -use sp_std::prelude::*; -pub use weights::WeightInfo; - -use functions::{ - compute_epoch, compute_period, decompress_sync_committee_bits, sync_committee_sum, -}; -pub use types::ExecutionHeaderBuffer; -use types::{ - CheckpointUpdate, ExecutionHeaderUpdate, FinalizedBeaconStateBuffer, SyncCommitteePrepared, - Update, -}; - -pub use pallet::*; - -pub use config::SLOTS_PER_HISTORICAL_ROOT; - -pub const LOG_TARGET: &str = "ethereum-client"; - -#[frame_support::pallet] -pub mod pallet { - use super::*; - - use frame_support::pallet_prelude::*; - use frame_system::pallet_prelude::*; - - #[derive(scale_info::TypeInfo, codec::Encode, codec::Decode, codec::MaxEncodedLen)] - #[codec(mel_bound(T: Config))] - #[scale_info(skip_type_params(T))] - pub struct MaxFinalizedHeadersToKeep(PhantomData); - impl Get for MaxFinalizedHeadersToKeep { - fn get() -> u32 { - // Consider max latency allowed between LatestFinalizedState and LatestExecutionState is - // the total slots in one sync_committee_period so 1 should be fine we keep 2 periods - // here for redundancy. - const MAX_REDUNDANCY: u32 = 2; - config::EPOCHS_PER_SYNC_COMMITTEE_PERIOD as u32 * MAX_REDUNDANCY - } - } - - #[pallet::pallet] - pub struct Pallet(_); - - #[pallet::config] - pub trait Config: frame_system::Config { - type RuntimeEvent: From> + IsType<::RuntimeEvent>; - #[pallet::constant] - type ForkVersions: Get; - /// Maximum number of execution headers to keep - #[pallet::constant] - type MaxExecutionHeadersToKeep: Get; - type WeightInfo: WeightInfo; - } - - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] - pub enum Event { - BeaconHeaderImported { - block_hash: H256, - slot: u64, - }, - ExecutionHeaderImported { - block_hash: H256, - block_number: u64, - }, - SyncCommitteeUpdated { - period: u64, - }, - /// Set OperatingMode - OperatingModeChanged { - mode: BasicOperatingMode, - }, - } - - #[pallet::error] - pub enum Error { - SkippedSyncCommitteePeriod, - /// Attested header is older than latest finalized header. - IrrelevantUpdate, - NotBootstrapped, - SyncCommitteeParticipantsNotSupermajority, - InvalidHeaderMerkleProof, - InvalidSyncCommitteeMerkleProof, - InvalidExecutionHeaderProof, - InvalidAncestryMerkleProof, - InvalidBlockRootsRootMerkleProof, - HeaderNotFinalized, - BlockBodyHashTreeRootFailed, - HeaderHashTreeRootFailed, - SyncCommitteeHashTreeRootFailed, - SigningRootHashTreeRootFailed, - ForkDataHashTreeRootFailed, - ExpectedFinalizedHeaderNotStored, - BLSPreparePublicKeysFailed, - BLSVerificationFailed(BlsError), - InvalidUpdateSlot, - /// The given update is not in the expected period, or the given next sync committee does - /// not match the next sync committee in storage. - InvalidSyncCommitteeUpdate, - ExecutionHeaderTooFarBehind, - ExecutionHeaderSkippedBlock, - Halted, - } - - /// Latest imported checkpoint root - #[pallet::storage] - #[pallet::getter(fn initial_checkpoint_root)] - pub(super) type InitialCheckpointRoot = StorageValue<_, H256, ValueQuery>; - - /// Latest imported finalized block root - #[pallet::storage] - #[pallet::getter(fn latest_finalized_block_root)] - pub(super) type LatestFinalizedBlockRoot = StorageValue<_, H256, ValueQuery>; - - /// Beacon state by finalized block root - #[pallet::storage] - #[pallet::getter(fn finalized_beacon_state)] - pub(super) type FinalizedBeaconState = - StorageMap<_, Identity, H256, CompactBeaconState, OptionQuery>; - - /// Finalized Headers: Current position in ring buffer - #[pallet::storage] - pub(crate) type FinalizedBeaconStateIndex = StorageValue<_, u32, ValueQuery>; - - /// Finalized Headers: Mapping of ring buffer index to a pruning candidate - #[pallet::storage] - pub(crate) type FinalizedBeaconStateMapping = - StorageMap<_, Identity, u32, H256, ValueQuery>; - - #[pallet::storage] - #[pallet::getter(fn validators_root)] - pub(super) type ValidatorsRoot = StorageValue<_, H256, ValueQuery>; - - /// Sync committee for current period - #[pallet::storage] - pub(super) type CurrentSyncCommittee = - StorageValue<_, SyncCommitteePrepared, ValueQuery>; - - /// Sync committee for next period - #[pallet::storage] - pub(super) type NextSyncCommittee = - StorageValue<_, SyncCommitteePrepared, ValueQuery>; - - /// Latest imported execution header - #[pallet::storage] - #[pallet::getter(fn latest_execution_state)] - pub(super) type LatestExecutionState = - StorageValue<_, ExecutionHeaderState, ValueQuery>; - - /// Execution Headers - #[pallet::storage] - pub type ExecutionHeaders = - StorageMap<_, Identity, H256, CompactExecutionHeader, OptionQuery>; - - /// Execution Headers: Current position in ring buffer - #[pallet::storage] - pub type ExecutionHeaderIndex = StorageValue<_, u32, ValueQuery>; - - /// Execution Headers: Mapping of ring buffer index to a pruning candidate - #[pallet::storage] - pub type ExecutionHeaderMapping = StorageMap<_, Identity, u32, H256, ValueQuery>; - - /// The current operating mode of the pallet. - #[pallet::storage] - #[pallet::getter(fn operating_mode)] - pub type OperatingMode = StorageValue<_, BasicOperatingMode, ValueQuery>; - - #[pallet::call] - impl Pallet { - #[pallet::call_index(0)] - #[pallet::weight(T::WeightInfo::force_checkpoint())] - #[transactional] - /// Used for pallet initialization and light client resetting. Needs to be called by - /// the root origin. - pub fn force_checkpoint( - origin: OriginFor, - update: Box, - ) -> DispatchResult { - ensure_root(origin)?; - Self::process_checkpoint_update(&update)?; - Ok(()) - } - - #[pallet::call_index(1)] - #[pallet::weight({ - match update.next_sync_committee_update { - None => T::WeightInfo::submit(), - Some(_) => T::WeightInfo::submit_with_sync_committee(), - } - })] - #[transactional] - /// Submits a new finalized beacon header update. The update may contain the next - /// sync committee. - pub fn submit(origin: OriginFor, update: Box) -> DispatchResult { - ensure_signed(origin)?; - ensure!(!Self::operating_mode().is_halted(), Error::::Halted); - Self::process_update(&update)?; - Ok(()) - } - - #[pallet::call_index(2)] - #[pallet::weight(T::WeightInfo::submit_execution_header())] - #[transactional] - /// Submits a new execution header update. The relevant related beacon header - /// is also included to prove the execution header, as well as ancestry proof data. - pub fn submit_execution_header( - origin: OriginFor, - update: Box, - ) -> DispatchResult { - ensure_signed(origin)?; - ensure!(!Self::operating_mode().is_halted(), Error::::Halted); - Self::process_execution_header_update(&update)?; - Ok(()) - } - - /// Halt or resume all pallet operations. May only be called by root. - #[pallet::call_index(3)] - #[pallet::weight((T::DbWeight::get().reads_writes(1, 1), DispatchClass::Operational))] - pub fn set_operating_mode( - origin: OriginFor, - mode: BasicOperatingMode, - ) -> DispatchResult { - ensure_root(origin)?; - OperatingMode::::set(mode); - Self::deposit_event(Event::OperatingModeChanged { mode }); - Ok(()) - } - } - - impl Pallet { - /// Forces a finalized beacon header checkpoint update. The current sync committee, - /// with a header attesting to the current sync committee, should be provided. - /// An `block_roots` proof should also be provided. This is used for ancestry proofs - /// for execution header updates. - pub(crate) fn process_checkpoint_update(update: &CheckpointUpdate) -> DispatchResult { - let sync_committee_root = update - .current_sync_committee - .hash_tree_root() - .map_err(|_| Error::::SyncCommitteeHashTreeRootFailed)?; - - // Verifies the sync committee in the Beacon state. - ensure!( - verify_merkle_branch( - sync_committee_root, - &update.current_sync_committee_branch, - config::CURRENT_SYNC_COMMITTEE_SUBTREE_INDEX, - config::CURRENT_SYNC_COMMITTEE_DEPTH, - update.header.state_root - ), - Error::::InvalidSyncCommitteeMerkleProof - ); - - let header_root: H256 = update - .header - .hash_tree_root() - .map_err(|_| Error::::HeaderHashTreeRootFailed)?; - - // This is used for ancestry proofs in ExecutionHeader updates. This verifies the - // BeaconState: the beacon state root is the tree root; the `block_roots` hash is the - // tree leaf. - ensure!( - verify_merkle_branch( - update.block_roots_root, - &update.block_roots_branch, - config::BLOCK_ROOTS_SUBTREE_INDEX, - config::BLOCK_ROOTS_DEPTH, - update.header.state_root - ), - Error::::InvalidBlockRootsRootMerkleProof - ); - - let sync_committee_prepared: SyncCommitteePrepared = (&update.current_sync_committee) - .try_into() - .map_err(|_| >::BLSPreparePublicKeysFailed)?; - >::set(sync_committee_prepared); - >::kill(); - InitialCheckpointRoot::::set(header_root); - >::kill(); - - Self::store_validators_root(update.validators_root); - Self::store_finalized_header(header_root, update.header, update.block_roots_root)?; - - Ok(()) - } - - pub(crate) fn process_update(update: &Update) -> DispatchResult { - Self::cross_check_execution_state()?; - Self::verify_update(update)?; - Self::apply_update(update)?; - Ok(()) - } - - /// Cross check to make sure that execution header import does not fall too far behind - /// finalised beacon header import. If that happens just return an error and pause - /// processing until execution header processing has caught up. - pub(crate) fn cross_check_execution_state() -> DispatchResult { - let latest_finalized_state = - FinalizedBeaconState::::get(LatestFinalizedBlockRoot::::get()) - .ok_or(Error::::NotBootstrapped)?; - let latest_execution_state = Self::latest_execution_state(); - // The execution header import should be at least within the slot range of a sync - // committee period. - let max_latency = config::EPOCHS_PER_SYNC_COMMITTEE_PERIOD * config::SLOTS_PER_EPOCH; - ensure!( - latest_execution_state.beacon_slot == 0 || - latest_finalized_state.slot < - latest_execution_state.beacon_slot + max_latency as u64, - Error::::ExecutionHeaderTooFarBehind - ); - Ok(()) - } - - /// References and strictly follows - /// Verifies that provided next sync committee is valid through a series of checks - /// (including checking that a sync committee period isn't skipped and that the header is - /// signed by the current sync committee. - fn verify_update(update: &Update) -> DispatchResult { - // Verify sync committee has sufficient participants. - let participation = - decompress_sync_committee_bits(update.sync_aggregate.sync_committee_bits); - Self::sync_committee_participation_is_supermajority(&participation)?; - - // Verify update does not skip a sync committee period. - ensure!( - update.signature_slot > update.attested_header.slot && - update.attested_header.slot >= update.finalized_header.slot, - Error::::InvalidUpdateSlot - ); - // Retrieve latest finalized state. - let latest_finalized_state = - FinalizedBeaconState::::get(LatestFinalizedBlockRoot::::get()) - .ok_or(Error::::NotBootstrapped)?; - let store_period = compute_period(latest_finalized_state.slot); - let signature_period = compute_period(update.signature_slot); - if >::exists() { - ensure!( - (store_period..=store_period + 1).contains(&signature_period), - Error::::SkippedSyncCommitteePeriod - ) - } else { - ensure!(signature_period == store_period, Error::::SkippedSyncCommitteePeriod) - } - - // Verify update is relevant. - let update_attested_period = compute_period(update.attested_header.slot); - let update_has_next_sync_committee = !>::exists() && - (update.next_sync_committee_update.is_some() && - update_attested_period == store_period); - ensure!( - update.attested_header.slot > latest_finalized_state.slot || - update_has_next_sync_committee, - Error::::IrrelevantUpdate - ); - - // Verify that the `finality_branch`, if present, confirms `finalized_header` to match - // the finalized checkpoint root saved in the state of `attested_header`. - let finalized_block_root: H256 = update - .finalized_header - .hash_tree_root() - .map_err(|_| Error::::HeaderHashTreeRootFailed)?; - ensure!( - verify_merkle_branch( - finalized_block_root, - &update.finality_branch, - config::FINALIZED_ROOT_SUBTREE_INDEX, - config::FINALIZED_ROOT_DEPTH, - update.attested_header.state_root - ), - Error::::InvalidHeaderMerkleProof - ); - - // Though following check does not belong to ALC spec we verify block_roots_root to - // match the finalized checkpoint root saved in the state of `finalized_header` so to - // cache it for later use in `verify_ancestry_proof`. - ensure!( - verify_merkle_branch( - update.block_roots_root, - &update.block_roots_branch, - config::BLOCK_ROOTS_SUBTREE_INDEX, - config::BLOCK_ROOTS_DEPTH, - update.finalized_header.state_root - ), - Error::::InvalidBlockRootsRootMerkleProof - ); - - // Verify that the `next_sync_committee`, if present, actually is the next sync - // committee saved in the state of the `attested_header`. - if let Some(next_sync_committee_update) = &update.next_sync_committee_update { - let sync_committee_root = next_sync_committee_update - .next_sync_committee - .hash_tree_root() - .map_err(|_| Error::::SyncCommitteeHashTreeRootFailed)?; - if update_attested_period == store_period && >::exists() { - let next_committee_root = >::get().root; - ensure!( - sync_committee_root == next_committee_root, - Error::::InvalidSyncCommitteeUpdate - ); - } - ensure!( - verify_merkle_branch( - sync_committee_root, - &next_sync_committee_update.next_sync_committee_branch, - config::NEXT_SYNC_COMMITTEE_SUBTREE_INDEX, - config::NEXT_SYNC_COMMITTEE_DEPTH, - update.attested_header.state_root - ), - Error::::InvalidSyncCommitteeMerkleProof - ); - } - - // Verify sync committee aggregate signature. - let sync_committee = if signature_period == store_period { - >::get() - } else { - >::get() - }; - let absent_pubkeys = - Self::find_pubkeys(&participation, (*sync_committee.pubkeys).as_ref(), false); - let signing_root = Self::signing_root( - &update.attested_header, - Self::validators_root(), - update.signature_slot, - )?; - // Improvement here per - // suggested start from the full set aggregate_pubkey then subtracting the absolute - // minority that did not participate. - fast_aggregate_verify( - &sync_committee.aggregate_pubkey, - &absent_pubkeys, - signing_root, - &update.sync_aggregate.sync_committee_signature, - ) - .map_err(|e| Error::::BLSVerificationFailed(e))?; - - Ok(()) - } - - /// Reference and strictly follows DispatchResult { - let latest_finalized_state = - FinalizedBeaconState::::get(LatestFinalizedBlockRoot::::get()) - .ok_or(Error::::NotBootstrapped)?; - if let Some(next_sync_committee_update) = &update.next_sync_committee_update { - let store_period = compute_period(latest_finalized_state.slot); - let update_finalized_period = compute_period(update.finalized_header.slot); - let sync_committee_prepared: SyncCommitteePrepared = (&next_sync_committee_update - .next_sync_committee) - .try_into() - .map_err(|_| >::BLSPreparePublicKeysFailed)?; - - if !>::exists() { - ensure!( - update_finalized_period == store_period, - >::InvalidSyncCommitteeUpdate - ); - >::set(sync_committee_prepared); - } else if update_finalized_period == store_period + 1 { - >::set(>::get()); - >::set(sync_committee_prepared); - } - log::info!( - target: LOG_TARGET, - "💫 SyncCommitteeUpdated at period {}.", - update_finalized_period - ); - Self::deposit_event(Event::SyncCommitteeUpdated { - period: update_finalized_period, - }); - }; - - if update.finalized_header.slot > latest_finalized_state.slot { - let finalized_block_root: H256 = update - .finalized_header - .hash_tree_root() - .map_err(|_| Error::::HeaderHashTreeRootFailed)?; - Self::store_finalized_header( - finalized_block_root, - update.finalized_header, - update.block_roots_root, - )?; - } - - Ok(()) - } - - /// Validates an execution header for import. The beacon header containing the execution - /// header is sent, plus the execution header, along with a proof that the execution header - /// is rooted in the beacon header body. - pub(crate) fn process_execution_header_update( - update: &ExecutionHeaderUpdate, - ) -> DispatchResult { - let latest_finalized_state = - FinalizedBeaconState::::get(LatestFinalizedBlockRoot::::get()) - .ok_or(Error::::NotBootstrapped)?; - // Checks that the header is an ancestor of a finalized header, using slot number. - ensure!( - update.header.slot <= latest_finalized_state.slot, - Error::::HeaderNotFinalized - ); - - // Checks that we don't skip execution headers, they need to be imported sequentially. - let latest_execution_state: ExecutionHeaderState = Self::latest_execution_state(); - ensure!( - latest_execution_state.block_number == 0 || - update.execution_header.block_number == - latest_execution_state.block_number + 1, - Error::::ExecutionHeaderSkippedBlock - ); - - // Gets the hash tree root of the execution header, in preparation for the execution - // header proof (used to check that the execution header is rooted in the beacon - // header body. - let execution_header_root: H256 = update - .execution_header - .hash_tree_root() - .map_err(|_| Error::::BlockBodyHashTreeRootFailed)?; - - ensure!( - verify_merkle_branch( - execution_header_root, - &update.execution_branch, - config::EXECUTION_HEADER_SUBTREE_INDEX, - config::EXECUTION_HEADER_DEPTH, - update.header.body_root - ), - Error::::InvalidExecutionHeaderProof - ); - - let block_root: H256 = update - .header - .hash_tree_root() - .map_err(|_| Error::::HeaderHashTreeRootFailed)?; - - match &update.ancestry_proof { - Some(proof) => { - Self::verify_ancestry_proof( - block_root, - update.header.slot, - &proof.header_branch, - proof.finalized_block_root, - )?; - }, - None => { - // If the ancestry proof is not provided, we expect this header to be a - // finalized header. We need to check that the header hash matches the finalized - // header root at the expected slot. - let state = >::get(block_root) - .ok_or(Error::::ExpectedFinalizedHeaderNotStored)?; - if update.header.slot != state.slot { - return Err(Error::::ExpectedFinalizedHeaderNotStored.into()) - } - }, - } - - Self::store_execution_header( - update.execution_header.block_hash, - update.execution_header.clone().into(), - update.header.slot, - block_root, - ); - - Ok(()) - } - - /// Verify that `block_root` is an ancestor of `finalized_block_root` Used to prove that - /// an execution header is an ancestor of a finalized header (i.e. the blocks are - /// on the same chain). - fn verify_ancestry_proof( - block_root: H256, - block_slot: u64, - block_root_proof: &[H256], - finalized_block_root: H256, - ) -> DispatchResult { - let state = >::get(finalized_block_root) - .ok_or(Error::::ExpectedFinalizedHeaderNotStored)?; - - ensure!(block_slot < state.slot, Error::::HeaderNotFinalized); - - let index_in_array = block_slot % (SLOTS_PER_HISTORICAL_ROOT as u64); - let leaf_index = (SLOTS_PER_HISTORICAL_ROOT as u64) + index_in_array; - - ensure!( - verify_merkle_branch( - block_root, - block_root_proof, - leaf_index as usize, - config::BLOCK_ROOT_AT_INDEX_DEPTH, - state.block_roots_root - ), - Error::::InvalidAncestryMerkleProof - ); - - Ok(()) - } - - /// Computes the signing root for a given beacon header and domain. The hash tree root - /// of the beacon header is computed, and then the combination of the beacon header hash - /// and the domain makes up the signing root. - pub(super) fn compute_signing_root( - beacon_header: &BeaconHeader, - domain: H256, - ) -> Result { - let beacon_header_root = beacon_header - .hash_tree_root() - .map_err(|_| Error::::HeaderHashTreeRootFailed)?; - - let hash_root = SigningData { object_root: beacon_header_root, domain } - .hash_tree_root() - .map_err(|_| Error::::SigningRootHashTreeRootFailed)?; - - Ok(hash_root) - } - - /// Stores a compacted (slot and block roots root (hash of the `block_roots` beacon state - /// field, used for ancestry proof)) beacon state in a ring buffer map, with the header root - /// as map key. - fn store_finalized_header( - header_root: H256, - header: BeaconHeader, - block_roots_root: H256, - ) -> DispatchResult { - let slot = header.slot; - - >::insert( - header_root, - CompactBeaconState { slot: header.slot, block_roots_root }, - ); - >::set(header_root); - - log::info!( - target: LOG_TARGET, - "💫 Updated latest finalized block root {} at slot {}.", - header_root, - slot - ); - - Self::deposit_event(Event::BeaconHeaderImported { block_hash: header_root, slot }); - - Ok(()) - } - - /// Stores the provided execution header in pallet storage. The header is stored - /// in a ring buffer map, with the block hash as map key. The last imported execution - /// header is also kept in storage, for the relayer to check import progress. - pub fn store_execution_header( - block_hash: H256, - header: CompactExecutionHeader, - beacon_slot: u64, - beacon_block_root: H256, - ) { - let block_number = header.block_number; - - >::insert(block_hash, header); - - log::trace!( - target: LOG_TARGET, - "💫 Updated latest execution block at {} to number {}.", - block_hash, - block_number - ); - - LatestExecutionState::::mutate(|s| { - s.beacon_block_root = beacon_block_root; - s.beacon_slot = beacon_slot; - s.block_hash = block_hash; - s.block_number = block_number; - }); - - Self::deposit_event(Event::ExecutionHeaderImported { block_hash, block_number }); - } - - /// Stores the validators root in storage. Validators root is the hash tree root of all the - /// validators at genesis and is used to used to identify the chain that we are on - /// (used in conjunction with the fork version). - /// - fn store_validators_root(validators_root: H256) { - >::set(validators_root); - } - - /// Returns the domain for the domain_type and fork_version. The domain is used to - /// distinguish between the different players in the chain (see DomainTypes - /// ) and to ensure we are - /// addressing the correct chain. - /// - pub(super) fn compute_domain( - domain_type: Vec, - fork_version: ForkVersion, - genesis_validators_root: H256, - ) -> Result { - let fork_data_root = - Self::compute_fork_data_root(fork_version, genesis_validators_root)?; - - let mut domain = [0u8; 32]; - domain[0..4].copy_from_slice(&(domain_type)); - domain[4..32].copy_from_slice(&(fork_data_root.0[..28])); - - Ok(domain.into()) - } - - /// Computes the fork data root. The fork data root is a merkleization of the current - /// fork version and the genesis validators root. - fn compute_fork_data_root( - current_version: ForkVersion, - genesis_validators_root: H256, - ) -> Result { - let hash_root = ForkData { - current_version, - genesis_validators_root: genesis_validators_root.into(), - } - .hash_tree_root() - .map_err(|_| Error::::ForkDataHashTreeRootFailed)?; - - Ok(hash_root) - } - - /// Checks that the sync committee bits (the votes of the sync committee members, - /// represented by bits 0 and 1) is more than a supermajority (2/3 of the votes are - /// positive). - pub(super) fn sync_committee_participation_is_supermajority( - sync_committee_bits: &[u8], - ) -> DispatchResult { - let sync_committee_sum = sync_committee_sum(sync_committee_bits); - ensure!( - ((sync_committee_sum * 3) as usize) >= sync_committee_bits.len() * 2, - Error::::SyncCommitteeParticipantsNotSupermajority - ); - - Ok(()) - } - - /// Returns the fork version based on the current epoch. The hard fork versions - /// are defined in pallet config. - pub(super) fn compute_fork_version(epoch: u64) -> ForkVersion { - Self::select_fork_version(&T::ForkVersions::get(), epoch) - } - - /// Returns the fork version based on the current epoch. - pub(super) fn select_fork_version(fork_versions: &ForkVersions, epoch: u64) -> ForkVersion { - if epoch >= fork_versions.capella.epoch { - return fork_versions.capella.version - } - if epoch >= fork_versions.bellatrix.epoch { - return fork_versions.bellatrix.version - } - if epoch >= fork_versions.altair.epoch { - return fork_versions.altair.version - } - - fork_versions.genesis.version - } - - /// Returns a vector of public keys that participated in the sync committee block signage. - /// Sync committee bits is an array of 0s and 1s, 0 meaning the corresponding sync committee - /// member did not participate in the vote, 1 meaning they participated. - /// This method can find the absent or participating members, based on the participant - /// parameter. participant = false will return absent participants, participant = true will - /// return participating members. - pub fn find_pubkeys( - sync_committee_bits: &[u8], - sync_committee_pubkeys: &[PublicKeyPrepared], - participant: bool, - ) -> Vec { - let mut pubkeys: Vec = Vec::new(); - for (bit, pubkey) in sync_committee_bits.iter().zip(sync_committee_pubkeys.iter()) { - if *bit == u8::from(participant) { - pubkeys.push(*pubkey); - } - } - pubkeys - } - - /// Calculates signing root for BeaconHeader. The signing root is used for the message - /// value in BLS signature verification. - pub fn signing_root( - header: &BeaconHeader, - validators_root: H256, - signature_slot: u64, - ) -> Result { - let fork_version = Self::compute_fork_version(compute_epoch( - signature_slot, - config::SLOTS_PER_EPOCH as u64, - )); - let domain_type = config::DOMAIN_SYNC_COMMITTEE.to_vec(); - // Domains are used for for seeds, for signatures, and for selecting aggregators. - let domain = Self::compute_domain(domain_type, fork_version, validators_root)?; - // Hash tree root of SigningData - object root + domain - let signing_root = Self::compute_signing_root(header, domain)?; - Ok(signing_root) - } - } -} diff --git a/snowbridge/parachain/pallets/ethereum-client/src/mock.rs b/snowbridge/parachain/pallets/ethereum-client/src/mock.rs deleted file mode 100644 index 217d37db8df..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/src/mock.rs +++ /dev/null @@ -1,284 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use crate as ethereum_beacon_client; -use crate::config; -use frame_support::parameter_types; -use hex_literal::hex; -use pallet_timestamp; -use primitives::{CompactExecutionHeader, Fork, ForkVersions}; -use snowbridge_core::inbound::{Log, Proof}; -use sp_core::H256; -use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; -use std::{fs::File, path::PathBuf}; - -#[cfg(feature = "beacon-spec-minimal")] -const SPEC: &str = "minimal"; -#[cfg(not(feature = "beacon-spec-minimal"))] -const SPEC: &str = "mainnet"; - -fn load_fixture(basename: String) -> Result -where - T: for<'de> serde::Deserialize<'de>, -{ - let filepath: PathBuf = - [env!("CARGO_MANIFEST_DIR"), "tests", "fixtures", &basename].iter().collect(); - serde_json::from_reader(File::open(filepath).unwrap()) -} - -pub fn load_execution_header_update_fixture() -> primitives::ExecutionHeaderUpdate { - let basename = format!("execution-header-update.{}.json", SPEC); - load_fixture(basename).unwrap() -} - -pub fn load_checkpoint_update_fixture( -) -> primitives::CheckpointUpdate<{ config::SYNC_COMMITTEE_SIZE }> { - let basename = format!("initial-checkpoint.{}.json", SPEC); - load_fixture(basename).unwrap() -} - -pub fn load_sync_committee_update_fixture( -) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { - let basename = format!("sync-committee-update.{}.json", SPEC); - load_fixture(basename).unwrap() -} - -pub fn load_finalized_header_update_fixture( -) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { - let basename = format!("finalized-header-update.{}.json", SPEC); - load_fixture(basename).unwrap() -} - -pub fn load_next_sync_committee_update_fixture( -) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { - let basename = format!("next-sync-committee-update.{}.json", SPEC); - load_fixture(basename).unwrap() -} - -pub fn load_next_finalized_header_update_fixture( -) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> { - let basename = format!("next-finalized-header-update.{}.json", SPEC); - load_fixture(basename).unwrap() -} - -pub fn get_message_verification_payload() -> (Log, Proof) { - ( - Log { - address: hex!("ee9170abfbf9421ad6dd07f6bdec9d89f2b581e0").into(), - topics: vec![ - hex!("1b11dcf133cc240f682dab2d3a8e4cd35c5da8c9cf99adac4336f8512584c5ad").into(), - hex!("00000000000000000000000000000000000000000000000000000000000003e8").into(), - hex!("0000000000000000000000000000000000000000000000000000000000000001").into(), - ], - data: hex!("0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004b000f000000000000000100d184c103f7acc340847eee82a0b909e3358bc28d440edffa1352b13227e8ee646f3ea37456dec701345772617070656420457468657210574554481235003511000000000000000000000000000000000000000000").into(), - }, - Proof { - block_hash: hex!("05aaa60b0f27cce9e71909508527264b77ee14da7b5bf915fcc4e32715333213").into(), - tx_index: 0, - data: (vec![ - hex!("cf0d1c1ba57d1e0edfb59786c7e30c2b7e12bd54612b00cd21c4eaeecedf44fb").to_vec(), - hex!("d21fc4f68ab05bc4dcb23c67008e92c4d466437cdd6ed7aad0c008944c185510").to_vec(), - hex!("b9890f91ca0d77aa2a4adfaf9b9e40c94cac9e638b6d9797923865872944b646").to_vec(), - ], vec![ - hex!("f90131a0b601337b3aa10a671caa724eba641e759399979856141d3aea6b6b4ac59b889ba00c7d5dd48be9060221a02fb8fa213860b4c50d47046c8fa65ffaba5737d569e0a094601b62a1086cd9c9cb71a7ebff9e718f3217fd6e837efe4246733c0a196f63a06a4b0dd0aefc37b3c77828c8f07d1b7a2455ceb5dbfd3c77d7d6aeeddc2f7e8ca0d6e8e23142cdd8ec219e1f5d8b56aa18e456702b195deeaa210327284d42ade4a08a313d4c87023005d1ab631bbfe3f5de1e405d0e66d0bef3e033f1e5711b5521a0bf09a5d9a48b10ade82b8d6a5362a15921c8b5228a3487479b467db97411d82fa0f95cccae2a7c572ef3c566503e30bac2b2feb2d2f26eebf6d870dcf7f8cf59cea0d21fc4f68ab05bc4dcb23c67008e92c4d466437cdd6ed7aad0c008944c1855108080808080808080").to_vec(), - hex!("f851a0b9890f91ca0d77aa2a4adfaf9b9e40c94cac9e638b6d9797923865872944b646a060a634b9280e3a23fb63375e7bbdd9ab07fd379ab6a67e2312bbc112195fa358808080808080808080808080808080").to_vec(), - hex!("f9030820b9030402f90300018301d6e2b9010000000000000800000000000020040008000000000000000000000000400000008000000000000000000000000000000000000000000000000000000000042010000000001000000000000000000000000000000000040000000000000000000000000000000000000000000000008000000000000000002000000000000000000000000200000000000000200000000000100000000040000001000200008000000000000200000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000f901f5f87a942ffa5ecdbe006d30397c7636d3e015eee251369ff842a0c965575a00553e094ca7c5d14f02e107c258dda06867cbf9e0e69f80e71bbcc1a000000000000000000000000000000000000000000000000000000000000003e8a000000000000000000000000000000000000000000000000000000000000003e8f9011c94ee9170abfbf9421ad6dd07f6bdec9d89f2b581e0f863a01b11dcf133cc240f682dab2d3a8e4cd35c5da8c9cf99adac4336f8512584c5ada000000000000000000000000000000000000000000000000000000000000003e8a00000000000000000000000000000000000000000000000000000000000000001b8a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004b000f000000000000000100d184c103f7acc340847eee82a0b909e3358bc28d440edffa1352b13227e8ee646f3ea37456dec701345772617070656420457468657210574554481235003511000000000000000000000000000000000000000000f858948cf6147918a5cbb672703f879f385036f8793a24e1a01449abf21e49fd025f33495e77f7b1461caefdd3d4bb646424a3f445c4576a5ba0000000000000000000000000440edffa1352b13227e8ee646f3ea37456dec701").to_vec(), - ]), - } - ) -} - -pub fn get_message_verification_header() -> CompactExecutionHeader { - CompactExecutionHeader { - parent_hash: hex!("04a7f6ab8282203562c62f38b0ab41d32aaebe2c7ea687702b463148a6429e04") - .into(), - block_number: 55, - state_root: hex!("894d968712976d613519f973a317cb0781c7b039c89f27ea2b7ca193f7befdb3").into(), - receipts_root: hex!("cf0d1c1ba57d1e0edfb59786c7e30c2b7e12bd54612b00cd21c4eaeecedf44fb") - .into(), - } -} - -#[cfg(feature = "beacon-spec-minimal")] -pub mod minimal { - use super::*; - - use sp_runtime::BuildStorage; - - type Block = frame_system::mocking::MockBlock; - - frame_support::construct_runtime!( - 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}, - } - ); - - parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; - } - - impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type OnSetCode = (); - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type RuntimeTask = RuntimeTask; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type MaxConsumers = frame_support::traits::ConstU32<16>; - type Nonce = u64; - type Block = Block; - } - - impl pallet_timestamp::Config for Test { - type Moment = u64; - type OnTimestampSet = (); - type MinimumPeriod = (); - type WeightInfo = (); - } - - parameter_types! { - pub const ExecutionHeadersPruneThreshold: u32 = 10; - pub const ChainForkVersions: ForkVersions = ForkVersions{ - genesis: Fork { - version: [0, 0, 0, 1], // 0x00000001 - epoch: 0, - }, - altair: Fork { - version: [1, 0, 0, 1], // 0x01000001 - epoch: 0, - }, - bellatrix: Fork { - version: [2, 0, 0, 1], // 0x02000001 - epoch: 0, - }, - capella: Fork { - version: [3, 0, 0, 1], // 0x03000001 - epoch: 0, - }, - }; - } - - impl ethereum_beacon_client::Config for Test { - type RuntimeEvent = RuntimeEvent; - type ForkVersions = ChainForkVersions; - type MaxExecutionHeadersToKeep = ExecutionHeadersPruneThreshold; - type WeightInfo = (); - } - - // 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 mut ext = sp_io::TestExternalities::new(t); - let _ = ext.execute_with(|| Timestamp::set(RuntimeOrigin::signed(1), 30_000)); - ext - } -} - -#[cfg(not(feature = "beacon-spec-minimal"))] -pub mod mainnet { - use super::*; - - type Block = frame_system::mocking::MockBlock; - use sp_runtime::BuildStorage; - - frame_support::construct_runtime!( - 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}, - } - ); - - parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; - } - - impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type OnSetCode = (); - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type RuntimeTask = RuntimeTask; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type MaxConsumers = frame_support::traits::ConstU32<16>; - type Nonce = u64; - type Block = Block; - } - - impl pallet_timestamp::Config for Test { - type Moment = u64; - type OnTimestampSet = (); - type MinimumPeriod = (); - type WeightInfo = (); - } - - parameter_types! { - pub const ChainForkVersions: ForkVersions = ForkVersions { - genesis: Fork { - version: [144, 0, 0, 111], // 0x90000069 - epoch: 0, - }, - altair: Fork { - version: [144, 0, 0, 112], // 0x90000070 - epoch: 50, - }, - bellatrix: Fork { - version: [144, 0, 0, 113], // 0x90000071 - epoch: 100, - }, - capella: Fork { - version: [144, 0, 0, 114], // 0x90000072 - epoch: 56832, - }, - }; - pub const ExecutionHeadersPruneThreshold: u32 = 8192; - } - - impl ethereum_beacon_client::Config for Test { - type RuntimeEvent = RuntimeEvent; - type ForkVersions = ChainForkVersions; - type MaxExecutionHeadersToKeep = ExecutionHeadersPruneThreshold; - type WeightInfo = (); - } - - // 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 mut ext = sp_io::TestExternalities::new(t); - let _ = ext.execute_with(|| Timestamp::set(RuntimeOrigin::signed(1), 30_000)); - ext - } -} diff --git a/snowbridge/parachain/pallets/ethereum-client/src/tests.rs b/snowbridge/parachain/pallets/ethereum-client/src/tests.rs deleted file mode 100644 index d6346d3aafe..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/src/tests.rs +++ /dev/null @@ -1,1045 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use crate::{ - functions::compute_period, pallet::ExecutionHeaders, sync_committee_sum, verify_merkle_branch, - BeaconHeader, CompactBeaconState, Error, ExecutionHeaderBuffer, FinalizedBeaconState, - LatestExecutionState, LatestFinalizedBlockRoot, NextSyncCommittee, SyncCommitteePrepared, -}; - -use crate::mock::{ - get_message_verification_header, get_message_verification_payload, - load_checkpoint_update_fixture, load_execution_header_update_fixture, - load_finalized_header_update_fixture, load_next_finalized_header_update_fixture, - load_next_sync_committee_update_fixture, load_sync_committee_update_fixture, -}; - -#[cfg(feature = "beacon-spec-minimal")] -pub use crate::config::minimal::*; -#[cfg(feature = "beacon-spec-minimal")] -pub use crate::mock::minimal::*; - -#[cfg(not(feature = "beacon-spec-minimal"))] -pub use crate::config::mainnet::*; -#[cfg(not(feature = "beacon-spec-minimal"))] -pub use crate::mock::mainnet::*; - -use frame_support::{assert_err, assert_noop, assert_ok}; -use hex_literal::hex; -use primitives::{ - CompactExecutionHeader, ExecutionHeaderState, Fork, ForkVersions, NextSyncCommitteeUpdate, -}; -use rand::{thread_rng, Rng}; -use snowbridge_core::{ - inbound::{VerificationError, Verifier}, - RingBufferMap, -}; -use sp_core::H256; -use sp_runtime::DispatchError; - -/// Arbitrary hash used for tests and invalid hashes. -const TEST_HASH: [u8; 32] = - hex!["5f6f02af29218292d21a69b64a794a7c0873b3e0f54611972863706e8cbdf371"]; - -/* UNIT TESTS */ - -#[test] -pub fn sum_sync_committee_participation() { - new_tester().execute_with(|| { - assert_eq!(sync_committee_sum(&[0, 1, 0, 1, 1, 0, 1, 0, 1]), 5); - }); -} - -#[test] -pub fn compute_domain() { - new_tester().execute_with(|| { - let domain = EthereumBeaconClient::compute_domain( - hex!("07000000").into(), - hex!("00000001"), - hex!("5dec7ae03261fde20d5b024dfabce8bac3276c9a4908e23d50ba8c9b50b0adff").into(), - ); - - assert_ok!(&domain); - assert_eq!( - domain.unwrap(), - hex!("0700000046324489ceb6ada6d118eacdbe94f49b1fcb49d5481a685979670c7c").into() - ); - }); -} - -#[test] -pub fn compute_signing_root_bls() { - new_tester().execute_with(|| { - let signing_root = EthereumBeaconClient::compute_signing_root( - &BeaconHeader { - slot: 3529537, - proposer_index: 192549, - parent_root: hex!( - "1f8dc05ea427f78e84e2e2666e13c3befb7106fd1d40ef8a3f67cf615f3f2a4c" - ) - .into(), - state_root: hex!( - "0dfb492a83da711996d2d76b64604f9bca9dc08b6c13cf63b3be91742afe724b" - ) - .into(), - body_root: hex!("66fba38f7c8c2526f7ddfe09c1a54dd12ff93bdd4d0df6a0950e88e802228bfa") - .into(), - }, - hex!("07000000afcaaba0efab1ca832a15152469bb09bb84641c405171dfa2d3fb45f").into(), - ); - - assert_ok!(&signing_root); - assert_eq!( - signing_root.unwrap(), - hex!("3ff6e9807da70b2f65cdd58ea1b25ed441a1d589025d2c4091182026d7af08fb").into() - ); - }); -} - -#[test] -pub fn compute_signing_root() { - new_tester().execute_with(|| { - let signing_root = EthereumBeaconClient::compute_signing_root( - &BeaconHeader { - slot: 222472, - proposer_index: 10726, - parent_root: hex!( - "5d481a9721f0ecce9610eab51d400d223683d599b7fcebca7e4c4d10cdef6ebb" - ) - .into(), - state_root: hex!( - "14eb4575895f996a84528b789ff2e4d5148242e2983f03068353b2c37015507a" - ) - .into(), - body_root: hex!("7bb669c75b12e0781d6fa85d7fc2f32d64eafba89f39678815b084c156e46cac") - .into(), - }, - hex!("07000000e7acb21061790987fa1c1e745cccfb358370b33e8af2b2c18938e6c2").into(), - ); - - assert_ok!(&signing_root); - assert_eq!( - signing_root.unwrap(), - hex!("da12b6a6d3516bc891e8a49f82fc1925cec40b9327e06457f695035303f55cd8").into() - ); - }); -} - -#[test] -pub fn compute_domain_bls() { - new_tester().execute_with(|| { - let domain = EthereumBeaconClient::compute_domain( - hex!("07000000").into(), - hex!("01000000"), - hex!("4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95").into(), - ); - - assert_ok!(&domain); - assert_eq!( - domain.unwrap(), - hex!("07000000afcaaba0efab1ca832a15152469bb09bb84641c405171dfa2d3fb45f").into() - ); - }); -} - -#[test] -pub fn verify_merkle_branch_for_finalized_root() { - new_tester().execute_with(|| { - assert!(verify_merkle_branch( - hex!("0000000000000000000000000000000000000000000000000000000000000000").into(), - &[ - hex!("0000000000000000000000000000000000000000000000000000000000000000").into(), - hex!("5f6f02af29218292d21a69b64a794a7c0873b3e0f54611972863706e8cbdf371").into(), - hex!("e7125ff9ab5a840c44bedb4731f440a405b44e15f2d1a89e27341b432fabe13d").into(), - hex!("002c1fe5bc0bd62db6f299a582f2a80a6d5748ccc82e7ed843eaf0ae0739f74a").into(), - hex!("d2dc4ba9fd4edff6716984136831e70a6b2e74fca27b8097a820cbbaa5a6e3c3").into(), - hex!("91f77a19d8afa4a08e81164bb2e570ecd10477b3b65c305566a6d2be88510584").into(), - ], - crate::config::FINALIZED_ROOT_INDEX, - crate::config::FINALIZED_ROOT_DEPTH, - hex!("e46559327592741956f6beaa0f52e49625eb85dce037a0bd2eff333c743b287f").into() - )); - }); -} - -#[test] -pub fn verify_merkle_branch_fails_if_depth_and_branch_dont_match() { - new_tester().execute_with(|| { - assert!(!verify_merkle_branch( - hex!("0000000000000000000000000000000000000000000000000000000000000000").into(), - &[ - hex!("0000000000000000000000000000000000000000000000000000000000000000").into(), - hex!("5f6f02af29218292d21a69b64a794a7c0873b3e0f54611972863706e8cbdf371").into(), - hex!("e7125ff9ab5a840c44bedb4731f440a405b44e15f2d1a89e27341b432fabe13d").into(), - ], - crate::config::FINALIZED_ROOT_INDEX, - crate::config::FINALIZED_ROOT_DEPTH, - hex!("e46559327592741956f6beaa0f52e49625eb85dce037a0bd2eff333c743b287f").into() - )); - }); -} - -#[test] -pub fn sync_committee_participation_is_supermajority() { - let bits = - hex!("bffffffff7f1ffdfcfeffeffbfdffffbfffffdffffefefffdffff7f7ffff77fffdf7bff77ffdf7fffafffffff77fefffeff7effffffff5f7fedfffdfb6ddff7b" - ); - let participation = primitives::decompress_sync_committee_bits::<512, 64>(bits); - assert_ok!(EthereumBeaconClient::sync_committee_participation_is_supermajority(&participation)); -} - -#[test] -pub fn sync_committee_participation_is_supermajority_errors_when_not_supermajority() { - new_tester().execute_with(|| { - let participation: [u8; 512] = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, - 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, - 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, - 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, - ]; - - assert_err!( - EthereumBeaconClient::sync_committee_participation_is_supermajority(&participation), - Error::::SyncCommitteeParticipantsNotSupermajority - ); - }); -} - -#[test] -pub fn execution_header_pruning() { - new_tester().execute_with(|| { - let execution_header_prune_threshold = ExecutionHeadersPruneThreshold::get(); - let to_be_deleted = execution_header_prune_threshold / 2; - - let mut stored_hashes = vec![]; - - for i in 0..execution_header_prune_threshold { - let mut hash = H256::default(); - thread_rng().try_fill(&mut hash.0[..]).unwrap(); - EthereumBeaconClient::store_execution_header( - hash, - CompactExecutionHeader::default(), - i as u64, - hash, - ); - stored_hashes.push(hash); - } - - // We should have stored everything until now - assert_eq!({ ExecutionHeaders::::iter().count() }, stored_hashes.len()); - - // Let's push extra entries so that some of the previous entries are deleted. - for i in 0..to_be_deleted { - let mut hash = H256::default(); - thread_rng().try_fill(&mut hash.0[..]).unwrap(); - EthereumBeaconClient::store_execution_header( - hash, - CompactExecutionHeader::default(), - (i + execution_header_prune_threshold) as u64, - hash, - ); - - stored_hashes.push(hash); - } - - // We should have only stored upto `execution_header_prune_threshold` - assert_eq!( - ExecutionHeaders::::iter().count() as u32, - execution_header_prune_threshold - ); - - // First `to_be_deleted` items must be deleted - for i in 0..to_be_deleted { - assert!(!ExecutionHeaders::::contains_key(stored_hashes[i as usize])); - } - - // Other entries should be part of data - for i in to_be_deleted..(to_be_deleted + execution_header_prune_threshold) { - assert!(ExecutionHeaders::::contains_key(stored_hashes[i as usize])); - } - }); -} - -#[test] -fn compute_fork_version() { - let mock_fork_versions = ForkVersions { - genesis: Fork { version: [0, 0, 0, 0], epoch: 0 }, - altair: Fork { version: [0, 0, 0, 1], epoch: 10 }, - bellatrix: Fork { version: [0, 0, 0, 2], epoch: 20 }, - capella: Fork { version: [0, 0, 0, 3], epoch: 30 }, - }; - new_tester().execute_with(|| { - assert_eq!(EthereumBeaconClient::select_fork_version(&mock_fork_versions, 0), [0, 0, 0, 0]); - assert_eq!(EthereumBeaconClient::select_fork_version(&mock_fork_versions, 1), [0, 0, 0, 0]); - assert_eq!( - EthereumBeaconClient::select_fork_version(&mock_fork_versions, 10), - [0, 0, 0, 1] - ); - assert_eq!( - EthereumBeaconClient::select_fork_version(&mock_fork_versions, 21), - [0, 0, 0, 2] - ); - assert_eq!( - EthereumBeaconClient::select_fork_version(&mock_fork_versions, 20), - [0, 0, 0, 2] - ); - assert_eq!( - EthereumBeaconClient::select_fork_version(&mock_fork_versions, 32), - [0, 0, 0, 3] - ); - }); -} - -#[test] -fn find_absent_keys() { - let participation: [u8; 32] = [ - 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, - ]; - let update = load_sync_committee_update_fixture(); - let sync_committee_prepared: SyncCommitteePrepared = - (&update.next_sync_committee_update.unwrap().next_sync_committee) - .try_into() - .unwrap(); - - new_tester().execute_with(|| { - let pubkeys = EthereumBeaconClient::find_pubkeys( - &participation, - (*sync_committee_prepared.pubkeys).as_ref(), - false, - ); - assert_eq!(pubkeys.len(), 2); - assert_eq!(pubkeys[0], sync_committee_prepared.pubkeys[0]); - assert_eq!(pubkeys[1], sync_committee_prepared.pubkeys[7]); - }); -} - -#[test] -fn find_present_keys() { - let participation: [u8; 32] = [ - 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 1, 0, - ]; - let update = load_sync_committee_update_fixture(); - let sync_committee_prepared: SyncCommitteePrepared = - (&update.next_sync_committee_update.unwrap().next_sync_committee) - .try_into() - .unwrap(); - - new_tester().execute_with(|| { - let pubkeys = EthereumBeaconClient::find_pubkeys( - &participation, - (*sync_committee_prepared.pubkeys).as_ref(), - true, - ); - assert_eq!(pubkeys.len(), 4); - assert_eq!(pubkeys[0], sync_committee_prepared.pubkeys[1]); - assert_eq!(pubkeys[1], sync_committee_prepared.pubkeys[8]); - assert_eq!(pubkeys[2], sync_committee_prepared.pubkeys[26]); - assert_eq!(pubkeys[3], sync_committee_prepared.pubkeys[30]); - }); -} - -#[test] -fn cross_check_execution_state() { - new_tester().execute_with(|| { - let header_root: H256 = TEST_HASH.into(); - >::insert( - header_root, - CompactBeaconState { - // set slot to period 5 - slot: ((EPOCHS_PER_SYNC_COMMITTEE_PERIOD * SLOTS_PER_EPOCH) * 5) as u64, - block_roots_root: Default::default(), - }, - ); - LatestFinalizedBlockRoot::::set(header_root); - >::set(ExecutionHeaderState { - beacon_block_root: Default::default(), - // set slot to period 2 - beacon_slot: ((EPOCHS_PER_SYNC_COMMITTEE_PERIOD * SLOTS_PER_EPOCH) * 2) as u64, - block_hash: Default::default(), - block_number: 0, - }); - - assert_err!( - EthereumBeaconClient::cross_check_execution_state(), - Error::::ExecutionHeaderTooFarBehind - ); - }); -} - -/* SYNC PROCESS TESTS */ - -#[test] -fn process_initial_checkpoint() { - let checkpoint = load_checkpoint_update_fixture(); - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::force_checkpoint( - RuntimeOrigin::root(), - Box::new(checkpoint.clone()) - )); - let block_root: H256 = checkpoint.header.hash_tree_root().unwrap(); - assert!(>::contains_key(block_root)); - }); -} - -#[test] -fn process_initial_checkpoint_with_invalid_sync_committee_proof() { - let mut checkpoint = load_checkpoint_update_fixture(); - checkpoint.current_sync_committee_branch[0] = TEST_HASH.into(); - - new_tester().execute_with(|| { - assert_err!( - EthereumBeaconClient::force_checkpoint(RuntimeOrigin::root(), Box::new(checkpoint)), - Error::::InvalidSyncCommitteeMerkleProof - ); - }); -} - -#[test] -fn process_initial_checkpoint_with_invalid_blocks_root_proof() { - let mut checkpoint = load_checkpoint_update_fixture(); - checkpoint.block_roots_branch[0] = TEST_HASH.into(); - - new_tester().execute_with(|| { - assert_err!( - EthereumBeaconClient::force_checkpoint(RuntimeOrigin::root(), Box::new(checkpoint)), - Error::::InvalidBlockRootsRootMerkleProof - ); - }); -} - -#[test] -fn submit_update_in_current_period() { - let checkpoint = load_checkpoint_update_fixture(); - let update = load_finalized_header_update_fixture(); - let initial_period = compute_period(checkpoint.header.slot); - let update_period = compute_period(update.finalized_header.slot); - assert_eq!(initial_period, update_period); - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert_ok!(EthereumBeaconClient::submit( - RuntimeOrigin::signed(1), - Box::new(update.clone()) - )); - let block_root: H256 = update.finalized_header.hash_tree_root().unwrap(); - assert!(>::contains_key(block_root)); - }); -} - -#[test] -fn submit_update_with_sync_committee_in_current_period() { - let checkpoint = load_checkpoint_update_fixture(); - let update = load_sync_committee_update_fixture(); - let init_period = compute_period(checkpoint.header.slot); - let update_period = compute_period(update.finalized_header.slot); - assert_eq!(init_period, update_period); - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert!(!>::exists()); - assert_ok!(EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update))); - assert!(>::exists()); - }); -} - -#[test] -fn submit_update_in_next_period() { - let checkpoint = load_checkpoint_update_fixture(); - let sync_committee_update = load_sync_committee_update_fixture(); - let update = load_next_finalized_header_update_fixture(); - let sync_committee_period = compute_period(sync_committee_update.finalized_header.slot); - let next_sync_committee_period = compute_period(update.finalized_header.slot); - assert_eq!(sync_committee_period + 1, next_sync_committee_period); - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert_ok!(EthereumBeaconClient::submit( - RuntimeOrigin::signed(1), - Box::new(sync_committee_update.clone()) - )); - assert_ok!(EthereumBeaconClient::submit( - RuntimeOrigin::signed(1), - Box::new(update.clone()) - )); - let block_root: H256 = update.finalized_header.clone().hash_tree_root().unwrap(); - assert!(>::contains_key(block_root)); - }); -} - -#[test] -fn submit_update_with_invalid_header_proof() { - let checkpoint = load_checkpoint_update_fixture(); - let mut update = load_sync_committee_update_fixture(); - let init_period = compute_period(checkpoint.header.slot); - let update_period = compute_period(update.finalized_header.slot); - assert_eq!(init_period, update_period); - update.finality_branch[0] = TEST_HASH.into(); - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert!(!>::exists()); - assert_err!( - EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), - Error::::InvalidHeaderMerkleProof - ); - }); -} - -#[test] -fn submit_update_with_invalid_block_roots_proof() { - let checkpoint = load_checkpoint_update_fixture(); - let mut update = load_sync_committee_update_fixture(); - let init_period = compute_period(checkpoint.header.slot); - let update_period = compute_period(update.finalized_header.slot); - assert_eq!(init_period, update_period); - update.block_roots_branch[0] = TEST_HASH.into(); - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert!(!>::exists()); - assert_err!( - EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), - Error::::InvalidBlockRootsRootMerkleProof - ); - }); -} - -#[test] -fn submit_update_with_invalid_next_sync_committee_proof() { - let checkpoint = load_checkpoint_update_fixture(); - let mut update = load_sync_committee_update_fixture(); - let init_period = compute_period(checkpoint.header.slot); - let update_period = compute_period(update.finalized_header.slot); - assert_eq!(init_period, update_period); - if let Some(ref mut next_sync_committee_update) = update.next_sync_committee_update { - next_sync_committee_update.next_sync_committee_branch[0] = TEST_HASH.into(); - } - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert!(!>::exists()); - assert_err!( - EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), - Error::::InvalidSyncCommitteeMerkleProof - ); - }); -} - -#[test] -fn submit_update_with_skipped_period() { - let checkpoint = load_checkpoint_update_fixture(); - let sync_committee_update = load_sync_committee_update_fixture(); - let mut update = load_next_finalized_header_update_fixture(); - update.signature_slot += (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * SLOTS_PER_EPOCH) as u64; - update.attested_header.slot = update.signature_slot - 1; - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert_ok!(EthereumBeaconClient::submit( - RuntimeOrigin::signed(1), - Box::new(sync_committee_update.clone()) - )); - assert_err!( - EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), - Error::::SkippedSyncCommitteePeriod - ); - }); -} - -#[test] -fn submit_update_with_sync_committee_in_next_period() { - let checkpoint = load_checkpoint_update_fixture(); - let update = load_sync_committee_update_fixture(); - let next_update = load_next_sync_committee_update_fixture(); - let update_period = compute_period(update.finalized_header.slot); - let next_update_period = compute_period(next_update.finalized_header.slot); - assert_eq!(update_period + 1, next_update_period); - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert!(!>::exists()); - assert_ok!(EthereumBeaconClient::submit( - RuntimeOrigin::signed(1), - Box::new(update.clone()) - )); - assert!(>::exists()); - assert_ok!(EthereumBeaconClient::submit( - RuntimeOrigin::signed(1), - Box::new(next_update.clone()) - )); - let last_finalized_state = - FinalizedBeaconState::::get(LatestFinalizedBlockRoot::::get()).unwrap(); - let last_synced_period = compute_period(last_finalized_state.slot); - assert_eq!(last_synced_period, next_update_period); - }); -} - -#[test] -fn submit_update_with_sync_committee_invalid_signature_slot() { - let checkpoint = load_checkpoint_update_fixture(); - let mut update = load_sync_committee_update_fixture(); - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - - // makes a invalid update with signature_slot should be more than attested_slot - update.signature_slot = update.attested_header.slot; - - assert_err!( - EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), - Error::::InvalidUpdateSlot - ); - }); -} - -#[test] -fn submit_update_with_skipped_sync_committee_period() { - let checkpoint = load_checkpoint_update_fixture(); - let finalized_update = load_next_finalized_header_update_fixture(); - let checkpoint_period = compute_period(checkpoint.header.slot); - let next_sync_committee_period = compute_period(finalized_update.finalized_header.slot); - assert_eq!(checkpoint_period + 1, next_sync_committee_period); - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert_err!( - EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(finalized_update)), - Error::::SkippedSyncCommitteePeriod - ); - }); -} - -#[test] -fn submit_update_execution_headers_too_far_behind() { - let checkpoint = load_checkpoint_update_fixture(); - let finalized_header_update = load_finalized_header_update_fixture(); - let execution_header_update = load_execution_header_update_fixture(); - let next_update = load_next_sync_committee_update_fixture(); - - new_tester().execute_with(|| { - let far_ahead_finalized_header_slot = finalized_header_update.finalized_header.slot + - (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * SLOTS_PER_EPOCH * 2) as u64; - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert_ok!(EthereumBeaconClient::submit( - RuntimeOrigin::signed(1), - Box::new(finalized_header_update) - )); - assert_ok!(EthereumBeaconClient::submit_execution_header( - RuntimeOrigin::signed(1), - Box::new(execution_header_update) - )); - - let header_root: H256 = TEST_HASH.into(); - >::insert( - header_root, - CompactBeaconState { - slot: far_ahead_finalized_header_slot, - block_roots_root: Default::default(), - }, - ); - LatestFinalizedBlockRoot::::set(header_root); - - assert_err!( - EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(next_update)), - Error::::ExecutionHeaderTooFarBehind - ); - }); -} - -#[test] -fn submit_irrelevant_update() { - let checkpoint = load_checkpoint_update_fixture(); - let mut update = load_next_finalized_header_update_fixture(); - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - - // makes an invalid update where the attested_header slot value should be greater than the - // checkpoint slot value - update.finalized_header.slot = checkpoint.header.slot; - update.attested_header.slot = checkpoint.header.slot; - update.signature_slot = checkpoint.header.slot + 1; - - assert_err!( - EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), - Error::::IrrelevantUpdate - ); - }); -} - -#[test] -fn submit_update_with_missing_bootstrap() { - let update = load_next_finalized_header_update_fixture(); - - new_tester().execute_with(|| { - assert_err!( - EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), - Error::::NotBootstrapped - ); - }); -} - -#[test] -fn submit_update_with_invalid_sync_committee_update() { - let checkpoint = load_checkpoint_update_fixture(); - let update = load_sync_committee_update_fixture(); - let mut next_update = load_next_sync_committee_update_fixture(); - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - - assert_ok!(EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update))); - - // makes update with invalid next_sync_committee - >::mutate(>::get(), |x| { - let prev = x.unwrap(); - *x = Some(CompactBeaconState { slot: next_update.attested_header.slot, ..prev }); - }); - next_update.attested_header.slot += 1; - next_update.signature_slot = next_update.attested_header.slot + 1; - let next_sync_committee = NextSyncCommitteeUpdate::default(); - next_update.next_sync_committee_update = Some(next_sync_committee); - - assert_err!( - EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(next_update)), - Error::::InvalidSyncCommitteeUpdate - ); - }); -} - -#[test] -fn submit_execution_header_update() { - let checkpoint = load_checkpoint_update_fixture(); - let finalized_header_update = load_finalized_header_update_fixture(); - let execution_header_update = load_execution_header_update_fixture(); - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert_ok!(EthereumBeaconClient::submit( - RuntimeOrigin::signed(1), - Box::new(finalized_header_update) - )); - assert_ok!(EthereumBeaconClient::submit_execution_header( - RuntimeOrigin::signed(1), - Box::new(execution_header_update.clone()) - )); - assert!(>::contains_key( - execution_header_update.execution_header.block_hash - )); - }); -} - -#[test] -fn submit_execution_header_update_invalid_ancestry_proof() { - let checkpoint = load_checkpoint_update_fixture(); - let finalized_header_update = load_finalized_header_update_fixture(); - let mut execution_header_update = load_execution_header_update_fixture(); - if let Some(ref mut ancestry_proof) = execution_header_update.ancestry_proof { - ancestry_proof.header_branch[0] = TEST_HASH.into() - } - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert_ok!(EthereumBeaconClient::submit( - RuntimeOrigin::signed(1), - Box::new(finalized_header_update) - )); - assert_err!( - EthereumBeaconClient::submit_execution_header( - RuntimeOrigin::signed(1), - Box::new(execution_header_update) - ), - Error::::InvalidAncestryMerkleProof - ); - }); -} - -#[test] -fn submit_execution_header_update_invalid_execution_header_proof() { - let checkpoint = load_checkpoint_update_fixture(); - let finalized_header_update = load_finalized_header_update_fixture(); - let mut execution_header_update = load_execution_header_update_fixture(); - execution_header_update.execution_branch[0] = TEST_HASH.into(); - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert_ok!(EthereumBeaconClient::submit( - RuntimeOrigin::signed(1), - Box::new(finalized_header_update) - )); - assert_err!( - EthereumBeaconClient::submit_execution_header( - RuntimeOrigin::signed(1), - Box::new(execution_header_update) - ), - Error::::InvalidExecutionHeaderProof - ); - }); -} - -#[test] -fn submit_execution_header_update_that_skips_block() { - let checkpoint = load_checkpoint_update_fixture(); - let finalized_header_update = load_finalized_header_update_fixture(); - let execution_header_update = load_execution_header_update_fixture(); - let mut skipped_block_execution_header_update = load_execution_header_update_fixture(); - skipped_block_execution_header_update.execution_header.block_number = - execution_header_update.execution_header.block_number + 2; - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert_ok!(EthereumBeaconClient::submit( - RuntimeOrigin::signed(1), - Box::new(finalized_header_update) - )); - assert_ok!(EthereumBeaconClient::submit_execution_header( - RuntimeOrigin::signed(1), - Box::new(execution_header_update.clone()) - )); - assert!(>::contains_key( - execution_header_update.execution_header.block_hash - )); - assert_err!( - EthereumBeaconClient::submit_execution_header( - RuntimeOrigin::signed(1), - Box::new(skipped_block_execution_header_update) - ), - Error::::ExecutionHeaderSkippedBlock - ); - }); -} - -#[test] -fn submit_execution_header_update_that_is_also_finalized_header_which_is_not_stored() { - let checkpoint = load_checkpoint_update_fixture(); - let finalized_header_update = load_finalized_header_update_fixture(); - let mut execution_header_update = load_execution_header_update_fixture(); - execution_header_update.ancestry_proof = None; - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert_ok!(EthereumBeaconClient::submit( - RuntimeOrigin::signed(1), - Box::new(finalized_header_update) - )); - assert_err!( - EthereumBeaconClient::submit_execution_header( - RuntimeOrigin::signed(1), - Box::new(execution_header_update) - ), - Error::::ExpectedFinalizedHeaderNotStored - ); - }); -} - -#[test] -fn submit_execution_header_update_that_is_also_finalized_header_which_is_stored_but_slots_dont_match( -) { - let checkpoint = load_checkpoint_update_fixture(); - let finalized_header_update = load_finalized_header_update_fixture(); - let mut execution_header_update = load_execution_header_update_fixture(); - execution_header_update.ancestry_proof = None; - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert_ok!(EthereumBeaconClient::submit( - RuntimeOrigin::signed(1), - Box::new(finalized_header_update) - )); - - let block_root: H256 = execution_header_update.header.hash_tree_root().unwrap(); - - >::insert( - block_root, - CompactBeaconState { - slot: execution_header_update.header.slot + 1, - block_roots_root: Default::default(), - }, - ); - LatestFinalizedBlockRoot::::set(block_root); - - assert_err!( - EthereumBeaconClient::submit_execution_header( - RuntimeOrigin::signed(1), - Box::new(execution_header_update) - ), - Error::::ExpectedFinalizedHeaderNotStored - ); - }); -} - -#[test] -fn submit_execution_header_not_finalized() { - let checkpoint = load_checkpoint_update_fixture(); - let finalized_header_update = load_finalized_header_update_fixture(); - let update = load_execution_header_update_fixture(); - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - assert_ok!(EthereumBeaconClient::submit( - RuntimeOrigin::signed(1), - Box::new(finalized_header_update) - )); - - >::mutate(>::get(), |x| { - let prev = x.unwrap(); - *x = Some(CompactBeaconState { slot: update.header.slot - 1, ..prev }); - }); - - assert_err!( - EthereumBeaconClient::submit_execution_header( - RuntimeOrigin::signed(1), - Box::new(update) - ), - Error::::HeaderNotFinalized - ); - }); -} - -/* IMPLS */ - -#[test] -fn verify_message() { - let header = get_message_verification_header(); - let (event_log, proof) = get_message_verification_payload(); - let block_hash = proof.block_hash; - - new_tester().execute_with(|| { - >::insert(block_hash, header); - assert_ok!(EthereumBeaconClient::verify(&event_log, &proof)); - }); -} - -#[test] -fn verify_message_missing_header() { - let (event_log, proof) = get_message_verification_payload(); - - new_tester().execute_with(|| { - assert_err!( - EthereumBeaconClient::verify(&event_log, &proof), - VerificationError::HeaderNotFound - ); - }); -} - -#[test] -fn verify_message_invalid_proof() { - let header = get_message_verification_header(); - let (event_log, mut proof) = get_message_verification_payload(); - proof.data.1[0] = TEST_HASH.into(); - let block_hash = proof.block_hash; - - new_tester().execute_with(|| { - >::insert(block_hash, header); - assert_err!( - EthereumBeaconClient::verify(&event_log, &proof), - VerificationError::InvalidProof - ); - }); -} - -#[test] -fn verify_message_invalid_receipts_root() { - let mut header = get_message_verification_header(); - let (event_log, proof) = get_message_verification_payload(); - let block_hash = proof.block_hash; - header.receipts_root = TEST_HASH.into(); - - new_tester().execute_with(|| { - >::insert(block_hash, header); - assert_err!( - EthereumBeaconClient::verify(&event_log, &proof), - VerificationError::InvalidProof - ); - }); -} - -#[test] -fn verify_message_invalid_log() { - let header = get_message_verification_header(); - let (mut event_log, proof) = get_message_verification_payload(); - let block_hash = proof.block_hash; - event_log.topics = vec![H256::zero(); 10]; - - new_tester().execute_with(|| { - >::insert(block_hash, header); - assert_err!( - EthereumBeaconClient::verify(&event_log, &proof), - VerificationError::InvalidLog - ); - }); -} - -#[test] -fn verify_message_receipt_does_not_contain_log() { - let header = get_message_verification_header(); - let (mut event_log, proof) = get_message_verification_payload(); - let block_hash = proof.block_hash; - event_log.data = hex!("f9013c94ee9170abfbf9421ad6dd07f6bdec9d89f2b581e0f863a01b11dcf133cc240f682dab2d3a8e4cd35c5da8c9cf99adac4336f8512584c5ada000000000000000000000000000000000000000000000000000000000000003e8a00000000000000000000000000000000000000000000000000000000000000002b8c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000068000f000000000000000101d184c103f7acc340847eee82a0b909e3358bc28d440edffa1352b13227e8ee646f3ea37456dec70100000101001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c0000e8890423c78a0000000000000000000000000000000000000000000000000000000000000000").to_vec(); - - new_tester().execute_with(|| { - >::insert(block_hash, header); - assert_err!( - EthereumBeaconClient::verify(&event_log, &proof), - VerificationError::LogNotFound - ); - }); -} - -#[test] -fn set_operating_mode() { - let checkpoint = load_checkpoint_update_fixture(); - let update = load_finalized_header_update_fixture(); - let execution_header_update = load_execution_header_update_fixture(); - - new_tester().execute_with(|| { - assert_ok!(EthereumBeaconClient::process_checkpoint_update(&checkpoint)); - - assert_ok!(EthereumBeaconClient::set_operating_mode( - RuntimeOrigin::root(), - snowbridge_core::BasicOperatingMode::Halted - )); - - assert_noop!( - EthereumBeaconClient::submit(RuntimeOrigin::signed(1), Box::new(update)), - Error::::Halted - ); - - assert_noop!( - EthereumBeaconClient::submit_execution_header( - RuntimeOrigin::signed(1), - Box::new(execution_header_update) - ), - Error::::Halted - ); - }); -} - -#[test] -fn set_operating_mode_root_only() { - new_tester().execute_with(|| { - assert_noop!( - EthereumBeaconClient::set_operating_mode( - RuntimeOrigin::signed(1), - snowbridge_core::BasicOperatingMode::Halted - ), - DispatchError::BadOrigin - ); - }); -} diff --git a/snowbridge/parachain/pallets/ethereum-client/src/types.rs b/snowbridge/parachain/pallets/ethereum-client/src/types.rs deleted file mode 100644 index 5dcefea9f80..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/src/types.rs +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -pub use crate::config::{ - SLOTS_PER_HISTORICAL_ROOT, SYNC_COMMITTEE_BITS_SIZE as SC_BITS_SIZE, - SYNC_COMMITTEE_SIZE as SC_SIZE, -}; -use frame_support::storage::types::OptionQuery; -use snowbridge_core::RingBufferMapImpl; - -// Specialize types based on configured sync committee size -pub type SyncCommittee = primitives::SyncCommittee; -pub type SyncCommitteePrepared = primitives::SyncCommitteePrepared; -pub type SyncAggregate = primitives::SyncAggregate; -pub type CheckpointUpdate = primitives::CheckpointUpdate; -pub type Update = primitives::Update; -pub type NextSyncCommitteeUpdate = primitives::NextSyncCommitteeUpdate; - -pub use primitives::ExecutionHeaderUpdate; - -/// ExecutionHeader ring buffer implementation -pub type ExecutionHeaderBuffer = RingBufferMapImpl< - u32, - ::MaxExecutionHeadersToKeep, - crate::ExecutionHeaderIndex, - crate::ExecutionHeaderMapping, - crate::ExecutionHeaders, - OptionQuery, ->; - -/// FinalizedState ring buffer implementation -pub(crate) type FinalizedBeaconStateBuffer = RingBufferMapImpl< - u32, - crate::MaxFinalizedHeadersToKeep, - crate::FinalizedBeaconStateIndex, - crate::FinalizedBeaconStateMapping, - crate::FinalizedBeaconState, - OptionQuery, ->; diff --git a/snowbridge/parachain/pallets/ethereum-client/src/weights.rs b/snowbridge/parachain/pallets/ethereum-client/src/weights.rs deleted file mode 100644 index e1a5578f466..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/src/weights.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! Autogenerated weights for ethereum_beacon_client -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-27, STEPS: `10`, REPEAT: 10, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("/tmp/snowbridge/spec.json"), DB CACHE: 1024 - -// Executed Command: -// ./target/release/snowbridge -// benchmark -// pallet -// --chain -// /tmp/snowbridge/spec.json -// --execution=wasm -// --pallet -// ethereum_beacon_client -// --extrinsic -// * -// --steps -// 10 -// --repeat -// 10 -// --output -// pallets/ethereum-client/src/weights.rs -// --template -// templates/module-weight-template.hbs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weight functions needed for ethereum_beacon_client. -pub trait WeightInfo { - fn force_checkpoint() -> Weight; - fn submit() -> Weight; - fn submit_with_sync_committee() -> Weight; - fn submit_execution_header() -> Weight; -} - -// For backwards compatibility and tests -impl WeightInfo for () { - fn force_checkpoint() -> Weight { - Weight::from_parts(97_263_571_000_u64, 0) - .saturating_add(Weight::from_parts(0, 3501)) - .saturating_add(RocksDbWeight::get().reads(2)) - .saturating_add(RocksDbWeight::get().writes(9)) - } - fn submit() -> Weight { - Weight::from_parts(26_051_019_000_u64, 0) - .saturating_add(Weight::from_parts(0, 93857)) - .saturating_add(RocksDbWeight::get().reads(8)) - .saturating_add(RocksDbWeight::get().writes(4)) - } - fn submit_with_sync_committee() -> Weight { - Weight::from_parts(122_461_312_000_u64, 0) - .saturating_add(Weight::from_parts(0, 93857)) - .saturating_add(RocksDbWeight::get().reads(6)) - .saturating_add(RocksDbWeight::get().writes(1)) - } - fn submit_execution_header() -> Weight { - Weight::from_parts(113_158_000_u64, 0) - .saturating_add(Weight::from_parts(0, 3537)) - .saturating_add(RocksDbWeight::get().reads(5)) - .saturating_add(RocksDbWeight::get().writes(4)) - } -} diff --git a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/execution-header-update.mainnet.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/execution-header-update.mainnet.json deleted file mode 100755 index 97d498e2d9e..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/execution-header-update.mainnet.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "header": { - "slot": 4058654, - "proposer_index": 1039, - "parent_root": "0x758fa0a54047c0221b3107423e78b8910514ba7a0c4250401dac77108dce2ff8", - "state_root": "0x53c79320b4b7649e39a9f07903f4fc68a7cfe7a81cb2e30293dd7b00ee13f69a", - "body_root": "0xa76a7f037f12ee070dcb273d9787b13ff0cf17420a39564a101789318a157ec3" - }, - "ancestry_proof": { - "header_branch": [ - "0xbb6cfda1e02c3117d9fa41c1e1594ce0645352a073ad8b474f83c148e0d9954f", - "0xb44967bd8ff799126cad993ff7369f7a28d60281304d0c7c058e6721b6ce4c61", - "0x0009710ef2467f95542c2e8e7a7249282c08f62aedbe7d21ae4a7af04e1a890d", - "0x7bc5dc20638cfe1cfd5d2547c3efbed4cfb533c76c27d41f723ed876ab9edc3a", - "0x6dcd59a8a041cf2591921417cb8133f0ff5af9bfe1f1ab491e75a751adc9c9e1", - "0x3f25a2852042c7bf2c421bf16c0b9373c1d27ccb1eca4088f8191712481261be", - "0xd1f9cfe1f04031459e5c45f47b2a49c780cabb8ca5b8d76461db2b88c337ed76", - "0x8c37e3119bf7d3cb8208e832669261b0eda1b3c7b11d321760ba1c0649f61416", - "0x1783d3b7041ecb78d9e1f913b82bd335229ca1f2cc5d3cc8dd28c94152e887b4", - "0xe39fc366c951c7cb2100308b0a9417581c46812a7d7e89f516c19863f7686f96", - "0x3c29b6d9b8715dbe5d6831364229efc91ad56ae69e93cb119d5ef4bdc53fcb37", - "0x3cf6fe5e8d91dbaa77e6befa81e04fb25a3e089317d83ff35fc8adfbbf2aab5a", - "0xb41c97cf3b1b4b5bf2999dfb1b3eaeac5c1b12205e9ab0809988e3779d119047" - ], - "finalized_block_root": "0xb4802863fc1d32778211ce6aac8109c73c516a003213f4f5333c80472d08fe4e" - }, - "execution_header": { - "parent_hash": "0x9cffcba69c88a619483e13864704dde5db80e05f8d49018f615395ce09cd24ab", - "fee_recipient": "0xff58d746a67c2e42bcc07d6b3f58406e8837e883", - "state_root": "0x6a4aafc93626778475a416721104229035e91f0db788d0099b57e756cd272f0a", - "receipts_root": "0xe1ce670bdcf9acf4c62fee845cd7e81eabbb6db9ddbff56130020c6cf999a45d", - "logs_bloom": "0xa000980408008000328c1458805c005048b84812c134200090b40428568108a0648090105085100301844800090802484420800d020282019002040d083004031a20420240a4a8900a43296938c040802040220170860210910020036b8c482228c004440300021c82c0400110402a10800582424001c00000828310210020a18130504020790dca716194100880ea5501149104002bc05e189080901c4001010e0a040658a410072021230a5224265030082404000aa11f28162e216636000408842103d41010760972060060000500c20130b000000065401483200081a84934f020020120009618002269c884724616040000840e18080300024490000230", - "prev_randao": "0x5d9ac7ea788ecb534e98bc9079fa0bef199011dadadedaee5dc40e2cd702d664", - "block_number": 5025098, - "gas_limit": 30000000, - "gas_used": 13802943, - "timestamp": 1704437448, - "extra_data": "0x476f65726c69205365706f6c69612d4265706f6c696120513966", - "base_fee_per_gas": 19959019915, - "block_hash": "0x795021134c2b7f9c00b498ff7b0971dbbe061561868f702d8ca68a05e5eb5a99", - "transactions_root": "0x3cb7c92fde5d511cc90cd67e375c4388794f4c01e375e8e8a06d003b5593fd12", - "withdrawals_root": "0x5f5155fd8e5cd24b7ecb1e039792b0caff01dfda2990786d9ffc88325b5d1ea8" - }, - "execution_branch": [ - "0x85ff3d1c2bc3dcdd5543bcd29a1224c6a8c24875224fbb1e3b69f0515ffaacda", - "0x336488033fe5f3ef4ccc12af07b9370b92e553e35ecb4a337a1b1c0e4afe1e0e", - "0xdb56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71", - "0xfe1fa7acd413c54ebd394126ade19fc624ad9e4c60792d54ff3d60b07076b76d" - ] -} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/execution-header-update.minimal.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/execution-header-update.minimal.json deleted file mode 100644 index 3e17c14f4ad..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/execution-header-update.minimal.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "header": { - "slot": 3622, - "proposer_index": 7, - "parent_root": "0x254c9215f6cce83e21b9776afb482181639602d3cb58cf99452a6a4a4f603930", - "state_root": "0xea98df6d30817d63f3e54ea118e2b1ba8675753c72dec1661c503d4eb43f9bdd", - "body_root": "0x765a0616a31d38e0ca2d10f6e8b234dd3d07e16aa929bcbc4de775c93f1972fd" - }, - "ancestry_proof": { - "header_branch": [ - "0x7690506882ac8c5f01d00f3ade06439259a3a0261ef5d61ec44920678b4104e6", - "0xf01aa0fdd7c9ef7b1affb7854fe8cbcc5c70643ee5b83e032faa702a0675a8cb", - "0x273a7b300b75ffa2c765af50680aa836299264f2107f38010278822313181801", - "0x30fe73a3bae6a31af32656ab759a4b67d27a213e01012b96cc4fedd0f2e77c75", - "0x7246cb3a35f13a1f0bbf907887985bb5382c45f2aa1699dbca48a0a82d5330af", - "0x5e7270e88a22dd4a905b2e76da2c8c358baeddd34de6c64a71bb1c80070ab717" - ], - "finalized_block_root": "0xa6fdc5df11c1759d11c9f0353a666715e5677e9ffd7d414e44cff0970553f1c9" - }, - "execution_header": { - "parent_hash": "0x6c9657f1267ad6040ea017ff6d02b55c4ba25cb092b8326d321dd98d01d1ee64", - "fee_recipient": "0x0000000000000000000000000000000000000000", - "state_root": "0x01f975f7cdff9b0a8844304aa59062fe18af0fef4636539312dfe20d238600ba", - "receipts_root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "logs_bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "prev_randao": "0xcdfcab74bc26b3f4311afdc72d2d21d33a4b045187a01fa208a9d687a6d1d25c", - "block_number": 3622, - "gas_limit": 30000000, - "gas_used": 0, - "timestamp": 1685722543, - "extra_data": "0xd983010b02846765746888676f312e31392e358664617277696e", - "base_fee_per_gas": 7, - "block_hash": "0x38c80e0e26cb80730df627d32f50266bd0fe32fb12b7606300ad81aa2b4033db", - "transactions_root": "0x7ffe241ea60187fdb0187bfa22de35d1f9bed7ab061d9401fd47e34a54fbede1", - "withdrawals_root": "0x28ba1834a3a7b657460ce79fa3a1d909ab8828fd557659d4d0554a9bdbc0ec30" - }, - "execution_branch": [ - "0x005b8d55b34b4323bfd4773c28b09eb53bc87959e65411ccd23728c7e42d5ff2", - "0x336488033fe5f3ef4ccc12af07b9370b92e553e35ecb4a337a1b1c0e4afe1e0e", - "0xdb56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71", - "0x7061330dada1ba1c602ba98f647a441885460ed0db00483fea1282385dfab84b" - ] -} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/finalized-header-update.mainnet.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/finalized-header-update.mainnet.json deleted file mode 100755 index 49434dee72d..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/finalized-header-update.mainnet.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "attested_header": { - "slot": 4058720, - "proposer_index": 1088, - "parent_root": "0x37c7398a391c71da07258b48f41d4caaaf891fdf558e110b9c25db716fa8ff55", - "state_root": "0x6cf68a66c993f1c27f499e054a5fbd7c0e625c34ea0057fda9691c561e990002", - "body_root": "0x109e4c0c647d42dba0c8c6569997c51b5bcfc1a33475b1433ded6353f48423ff" - }, - "sync_aggregate": { - "sync_committee_bits": "0xffffffffff7bfdfffff7fffff1effffef7f9ffbdfdffffffdffbfffbbf7ffffffffffefdf7ffbeffdffef7bfffffffffffbffffffffffbffffffffffffffdfda", - "sync_committee_signature": "0xb5727bad1db101b6f0fd7ec4cb79b43dae90366fe0cae31a62439388eb03ebd75732cee3bde51f814203a4c0f5b23898120cd0870f0e662bdf0f85a048b534d9a906e6d32a65df019059d34f724221075734ec2849c09679febecf6929934f09" - }, - "signature_slot": 4058721, - "next_sync_committee_update": null, - "finalized_header": { - "slot": 4058656, - "proposer_index": 810, - "parent_root": "0xbb6cfda1e02c3117d9fa41c1e1594ce0645352a073ad8b474f83c148e0d9954f", - "state_root": "0xf938f0f0cba85234afbaace20545134c70b35e6ff9f74d944b0fea309109f3cf", - "body_root": "0xcf6a7a6f653cb64b2b910278a478339b34eb08abf00e0766d10c7a8fe9bdb139" - }, - "finality_branch": [ - "0x71ef010000000000000000000000000000000000000000000000000000000000", - "0x3d4be5d019ba15ea3ef304a83b8a067f2e79f46a3fac8069306a6c814a0a35eb", - "0xa2e2a28c0bb0ad56c25f3c461a4bfe4f3b3b894bc0105a62e85f43a4ae1adc3f", - "0xaa2bad8cf9b0433d3d79bc5b95c067048b018d1d2ffd0c66db6e7cf86e0a314e", - "0x027f238235d07ac9757543c19deabe1d553d6fc110e8bea4b037b1fab263b4dc", - "0x7dfa1cc1907e8927295f78a770bf86b28f5c2bddcac38beb3b4beb265ff5608f" - ], - "block_roots_root": "0x4a5a57fb0769443f6472f59dbb78d7a9a69ff61d09aa89d5da645d634ec46a14", - "block_roots_branch": [ - "0xa09ad7f3afd681bb6fd54abba339549f3b601beedea79a5b7d448b1cf1e1613e", - "0xacdfd4d5eba154f118a84af7a2d17ba6100fcd9c24fc235e927f584a5b56e32f", - "0x36ca106eac009ed605e680415b105b3a6591830c38034511f300aae44802235f", - "0x171561a9e1afb413132d0f4d3cbbd810766c151be32ec9f2d609f40aef9e2588", - "0x7cd963eba3fb57ee5ce37ee4b621d24fc14d642e32f48dc48ade528e11458ab9" - ] -} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/finalized-header-update.minimal.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/finalized-header-update.minimal.json deleted file mode 100644 index c6473529b10..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/finalized-header-update.minimal.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "attested_header": { - "slot": 3640, - "proposer_index": 5, - "parent_root": "0xf062fcec9c3379a08e6add37a834b1e39af395fc343973e44957ecebbf2ecddd", - "state_root": "0xb1581cb62fe376e305e02f26463153f5dfb804d8df97ef40fc315c1bc30731ba", - "body_root": "0x98461abcc6d130b7bcb9430292c8a269ea9f01082685347e2968d892f716067c" - }, - "sync_aggregate": { - "sync_committee_bits": "0xffffffff", - "sync_committee_signature": "0x925c6e4b67890a7e28a7ca19853f88247e92014b9d233ac9058efd4f3827f0055db308debe17596e635b93727b5a851e1366ca801f30b03fdec722f45011504702a27646488b5ab5e3428fe7b4d4a50132f374612f66e45d68db27c568f96f08" - }, - "signature_slot": 3641, - "next_sync_committee_update": null, - "finalized_header": { - "slot": 3624, - "proposer_index": 7, - "parent_root": "0x7690506882ac8c5f01d00f3ade06439259a3a0261ef5d61ec44920678b4104e6", - "state_root": "0x3726ebb8d9973977a71a8389caf5fc5830eeb8cd4fdfbbc7b0c4e6ca3e6a4090", - "body_root": "0x0f9a3f0fa5a4ffaf7c10504c86f23e7d554366ffd069fe958a160b253c3fd409" - }, - "finality_branch": [ - "0xc501000000000000000000000000000000000000000000000000000000000000", - "0x10c726fac935bf9657cc7476d3cfa7bedec5983dcfb59e8a7df6d0a619e108d7", - "0x83c3d5360d254f4a44be712c1f433e88e810b6d1e0e789e90bada9e36126b857", - "0x97245fa01a89a6d7b4542cd731fef699f58b2bbaabdd6f641334c9e9eeae3a20", - "0xc3d19c773f66ab94bc2106d5e75a3205398dd6e94b6f8a5716f347741eb9fc5a", - "0x9e5040e56d765c1add56779a716be7497be27cba37f866cd8d34418d55e48715" - ], - "block_roots_root": "0x29a54625749fa25f9e36df14a3baa335c58246bba2f8c7eb8b1ec2e4908e2fd0", - "block_roots_branch": [ - "0x53616f9298818a8423c98adc47c92aaf82f0c5c911dc4ee5f88ba6d3022341c1", - "0x5d2f1c4bce6f63f26cbe3fbf480281c04a6b14bea74350a88ee945354ecbd79d", - "0x8333eefc7eaa4d10091e2014b3aae2bf6bd2d10c22c67100e189f8ab6caab261", - "0x3edfa69130bc193dec47c27a5903f03d5262b75899b69c0e95ac1816a664a3e7", - "0x5e046000f85aede8d4c28140b27778488d4ad21b1e16e345055d07ee53f2711b" - ] -} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/initial-checkpoint.mainnet.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/initial-checkpoint.mainnet.json deleted file mode 100755 index 1f0f837f596..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/initial-checkpoint.mainnet.json +++ /dev/null @@ -1,542 +0,0 @@ -{ - "header": { - "slot": 4058624, - "proposer_index": 631, - "parent_root": "0x4abadda13b61df8d40fcb061d1ec15d0fb7bc5144252bb54c57b41893b642bf3", - "state_root": "0x6fe9fa01a04dcdeaa64eba04a72fa6dbadc8596dc5ec1fff2ef343520fe722e1", - "body_root": "0x6cd83df0ee7669e06e64496a1d2be083bc3bb9f2da17e9b1e62979d200328106" - }, - "current_sync_committee": { - "pubkeys": [ - "0xa13bf1fc1826b61cceefcc941c5a4865cefdfa6c91e5223308fa6a0aa6e7b13a0499a63edf5d9fff48fdeae83e38dcbf", - "0xb3285148b91dab139b053442bdd14d627ba1e1250fe469f0f2df854b6e6ff4a18671ae3879ec9f7d8091f99f092162e9", - "0xb00d95908e72c6051478a422eb2231b5f797c2fa5c696ed1e6b9c9996ba1d8236f512443f18c01ce63312c38fa383fd4", - "0xa866633b4293e726accf6e97ac90c1898cac83e8531a25b50ae99f0ecb477a692e6a5f2488447ccd83ed869ab5abc406", - "0xa308ed8737b3a9346ff20dc9f112efccc193472e6fde6aa218ceae11e288bbd2c35fa45c1d8bb238696a96767cd68b46", - "0x81534e2a182da0c6831479c7e722953d267ba9c63a204ac96a178b1dc90d0a6ba8737002688ba5f102eda5669249f114", - "0x87c5670e16a84e27529677881dbedc5c1d6ebb4e4ff58c13ece43d21d5b42dc89470f41059bfa6ebcf18167f97ddacaa", - "0xb37334c41a3456b73b61d0eb0777260af9c2e400bbec0e0c0fdb45c39ce0dd19f021d9760f35da801f20486c6be30e9e", - "0xab73a043ccdfe63437a339e6ee96ef1241264e04dd4d917f6d6bc99396006de54e1e156d38596ba3d15cb1aaa329f8f5", - "0x8983fdebbeba6e3cc3ee1c9feb24faaeee712356975e359b0ddca3f7c9c7448132d665f54a4629002252d3fcf375f7b0", - "0xa03c1e287ccc4d457f5e71e9dc769294835945561e6f236ac7de210d2e614eee8a85e21dfb46e2143c68de22ccee8660", - "0x8e6b888197010ebadd216da35b9716daa8675d93b3c33a96a19fd9ca42624f6b430b2ff115cd0f5b717341605dda24bf", - "0x8fb51e3ef3c1047ae7c527dc24dc8824b2655faff2c4c78da1fcedde48b531d19abaf517363bf30605a87336b8642073", - "0x893272a63650b08e5b8f9b3f17f8547b456192ad649c168bafd7166b4c08c5adf795c508b88fd2425f7be8334592afb2", - "0xa90c42266ca0a65976fb4dc18465b0a44a63ed3b2747cae74e46e3ccf158f98384e2e86c852e7c5556b083b3ded9d243", - "0xb67c621d9b6313a9f6744dfcdd77d4e9cb4bd413fb5e3199cdcd7f675fc39f1ba492860749bfddf98f4088756e844a98", - "0xa9760afaa51002be0948acf7aebd90ec4e60e0dba8456e445aea93408a0468b62bb6da4984b92f8f6061561c9d56f4c4", - "0x981b2d7c56ff38f1d02c5d7a7f8bfe71daaf94d48c3bc93e8083a0a23c1ae1ff05f90312deb09b35d4513c1ffa573d86", - "0x9515dedf061e654d58a43e4e525a63ad2a6274ea6f20b1d624a6ba7d3062ed68a0226eee6951ab8464906c52ba5556b0", - "0x901f724ee1891ca876e5551bd8f4ad4da422576c618465f63d65700c2dd7953496d83abe148c6a4875a46a5a36c218cf", - "0xa8d152e5d94b75cb9e249230db21af31de4d4f3d4ef60ccbf2212babf69aed2a38435a993ee2f13cca410ad55a4875ab", - "0x875ebfe737cea438e967d70ceaffb4360cce28ecc76c8c4ee612c47fb6b3e89af03c66981571066107323f49a6242772", - "0xa798a0371e8cc4dc42ccd79934b0db5a3a59f18a0ae09f2eb172596428fcb3f00312e783d6fd21cbc1610317f44e08cb", - "0x99c629c9cd603a9344b04d22d2bcc06cf45ebf62d97f968df19c73c7a50f4f6a2a2cc7fb633f509f961edfb94fbab94e", - "0x854410e6fb856da8b997ebf28ae2415ce6e1f9f6a4579fad15b5df61709c924a925397b33fe67c89ffad6143a39d756a", - "0xa3969926aa2e52f1a48ac53074b764648b4c71bd43430944679628463cd68398f700d874c14503b53756be451c8ba284", - "0x8ee8873de7cd28a54ba2c63a80b63399effed76b154e96ed26e7c0668b9f2476e298688b6a00c4b2ab9d020a897695d7", - "0xad54241ba3de6a4426c788690d3f78d2eb678814edc49d3fb988d7fc752e43512972567bb384bcc1b18d083d15e376da", - "0x942bee9ee880ac5e2f8ba35518b60890a211974d273b2ae415d34ce842803de7d29a4d26f6ee79c09e910559bdcac6d3", - "0x96b478b1e5e49d4ea3fd97c4846ae0f781dcc9f9ff61ee022ca92c3d8dfba89c513c46e8bb38b73e6b678a79b9b12177", - "0xaad9577501d7f3a5dbac329f2c1fe711710869cc825740f365488fc55a278d687bb72423560f7cb2cbd60546a82ea1e6", - "0x8aa3d9dad1c122b9aed75e3cc94b3a9dab160fa4cad92ebab68a58c0151a5d93f0f6b40b86fba00e63d45bd29a93b982", - "0xa12fc78b8d3334a3eb7b535cd5e648bb030df645cda4e90272a1fc3b368ee43975051bbecc3275d6b1e4600cc07239b0", - "0xab01a7b13c967620d98de736b8ff23d856daa26d5cd8576993ee02a5d694332c0464ed018ebffcd5c71bab5cada850ce", - "0x96cf5760c79cfc830d1d5bd6df6cfd67596bef24e22eed52cee04c290ad418add74e77965ea5748b7f0fb34ee4f43232", - "0x9443e6ba4400fb3370c573cd7e33f05e1475f9cf1d6adb905bee3aff8f1452d8d384c8a72c9110070f35c6aad940bba6", - "0x95c60b5561e53cfc26d620be90f84199ffd6dd9687c1be3a547048e7cba10a0be9bb6da000e7521cbd488d0901d48ee9", - "0xab69cf79750436d310dc3c5e96c2b97003f4394f31dfa8a9ac420595dc7b4d96dad5787d93347ba2bc6f196c241a3dbf", - "0x9145ee1fb6e84114c903819db94fa5a72bcbc15fcb8a7fd8eefba23b156cc46309281dcf78b48a2847b3754f7d7d7a79", - "0xb118f77f99ac947df97e7682f0fb446175185b842380af4ee7394531e4f93002c72b41a57a7c1b923a4f24b10924c84f", - "0xa4aabd1890ebf35423565dbff3477a09eea4e35f5a26ed449eab38e0a21fb89e9ddfe3a2003cddc457db648a1b5891a3", - "0x8ff5d2e6c98b1fea70cb36ea8ed497fd1233b9418948ac58c6c379ed35fb10f8253ef188c909d5e77e81b5b8e2a4ad17", - "0xa23f076306c120dccf69d7d2ac7f83a377a72d35bf448f88feff8b6dba9307fdabf34452e30b87407b2258b9edfd1174", - "0x87d2217eb05d657aba7b048cf3c661b463e78e51135a5b937e71975ff5102e596434720f02349c73415decb88418cb0d", - "0x8bb51b380a8a52d61a94e7b382ff6ce601260fa9b8c5d616764a3df719b382ec43aec9266444a16951e102d8b1fb2f38", - "0xb0053550040ab3a3996cba5caf9ad5718867b5f5df273ed8c6520761571f03a94e50b5f8a6a8c42d725383cce97d3cae", - "0xae50f93230983a82e732903d6ed50a506d678f35b6b4a4b3686a92b12aeb9d34cb095e8562b0900125bbced0359b37de", - "0x8bfa106ada4914419bf1d8900c5981dd5b90c3023196d7e918d62879fc3a575bd0a25f939366f7fd2240df6108b069ec", - "0xb3a5497365bd40a81202b8a94a5e28a8a039cc2e639d73de289294cbda2c0e987c1f9468daba09ea4390f8e4e806f3c8", - "0xb4f583e10aa9af79b4ebd647e0fffe1c720112727e5ffac4313f236737491fceeee194537786c561cd5777b453e5b03c", - "0x826be957cf66db958028fa95655b54b2337f78fb6ef26bd29e2e3a64b130b90521333f31d132c04779e4b23a6b6cd951", - "0xaace45334070c51cc8b3579598d4cd8cda2153bba51f56e3b1fe5e135c83ef70503c322756b9cad9d3cd28f1ecfc8227", - "0x94bb68c8180496472262455fd6ab338697810825fa4e82fc673f3ac2dacfd29ee539ac0bfe97eb39d4ef118db875bab6", - "0xb560c33950a355119845f63defb355807e56773f636fb836f7746155fad070e384fc1091b8e5c057e4cbc7da9275ecf7", - "0x820cc2ac3eed5bce7dc72df2aa3214e71690b91445d8bb1634c0488a671e3669028efbe1eae52f7132bde29b16a020b7", - "0x9244703338879e3ea00663dcde8f11095de3e38df9277d8c2acc26e72021c222ae40bcc91228789fdf0b69acc3144783", - "0x8d474636a638e7b398566a39b3f939a314f1cf88e64d81db0f556ca60951ec1dca1b93e3906a6654ed9ba06f2c31d4ea", - "0x889a5cf9315383bf64dfe88e562d772213c256b0eed15ce27c41c3767c048afe06410d7675e5d59a2302993e7dc45d83", - "0xb544c692b046aad8b6f5c2e3493bc8f638659795f06327fff1e9f4ffc8e9f7abdbf4b7f6fcdfb8fe19654d8fa7d68170", - "0xaefc682f8784b18d36202a069269be7dba8ab67ae3543838e6d473fbc5713d103abcc8da1729a288503b786baac182d3", - "0xa0f2092ac34d2363614fb2f57fc7b72db247eb1fa53f395881ce6b4aacd6fb920d6dc59507701d487288102e4c4fa389", - "0xb33de3de106be61481ccb7f07a7a63cf4d1674010e462388fb8ab5ea08f444ed7a277905207e0b3aa2f00bb9efca984f", - "0x84173aeaf3d96368dc7ca1ad5e5575da279113567e5815a364a0356a720c5e08cb58ca1fdd891924f4871d3eaae5de40", - "0xb6d6482ad7b9b412ffbefbbdcc28eb3d091b1291f54f77bdd53c4ac85f705c454940f466dc272dde7b03c26f0cd6ecb3", - "0xa2053719da2b7501dab42011ae144b3c8d72bd17493181bf3ae79a678068dc3ee2f19d29a60b5a323692c3f684f96392", - "0x8296f8caf58316af535def398a43357e48cb3b1e674b857eba1bd1b970da3dd045e22fe6d17dee4e9117f62ece3ec31c", - "0x84faf4d90edaa6cc837e5e04dc67761084ae24e410345f21923327c9cb5494ffa51b504c89bee168c11250edbdcbe194", - "0x879aea8f09dec92f354e31aa479d00cb77457d363de2d9a51ddf7d734061b6f83d6345cf33dbef22004cd23dd6c4b760", - "0xb8fca0f7bc276f03c526d42df9f88c19b8dc630ad1299689e2d52cd4717bbe5425479b13bdf6e6337c48832e4cd34bb5", - "0xb2a01dc47dd98f089f28eee67ba2f789153516b7d3b47127f430f542869ec42dd8fd4dc83cfbe625c5c40a2d2d0633ea", - "0xa19f2ce14e09ece5972fe5af1c1778b86d2ab6e825eccdb0ac368bb246cfe53433327abfe0c6fa00e0553863d0a8128e", - "0x95d1f944b0c53eb3e9fcd5632713602bbb9195b87a172a370ae2df98504612a55f3968615a39b569ce6a0fe9fb559be7", - "0xae36ab11be96f8c8fcfd75382bb7f4727511596bc08c25814d22f2b894952489d08396b458f7884d6b3c0adb69856a6d", - "0x824d0dc002e158adef06fc38d79b01553be5a3903566029cf0beddb2248b11da40e66feb168e8e3e2a63ea033a75f382", - "0x8f9f85ae6377414fcf8297ed45a736210cd3803f54f33116b0f290b853dc61e99ea08f3c422ed9bc6bdc2f42ab4f56ba", - "0x86c53fc078846c3d9bc47682506f8285ba4551475921fd388b96291741970c34b8de4210202e40d2de4acb6e2892072b", - "0x853184f246d098139230962e511585368b44d46a115c5f06ccaeef746773951bead595fb6246c69975496bac61b42a4f", - "0xb91b4260e2884bae9778fe29a2c1e4525e4663ec004159def5d47320de304c96d2a33ad7a670e05acf90cbba3efdd4d9", - "0x83492e27e07e35c0836aee6bee95d040b8d3e82db6f94a3917d07797800f7200f5dbc6c9596c6c3c70f8f470b65a9b6e", - "0xb1bb33607d10ea8c954064ecb00c1f02b446355ef73763a122f43b9ea42cd5650b54c5c9d1cfa81d4a421d17a0a451aa", - "0x99cb1728157a1b7cdd9607cf15911bbcb56b64d52fb0d0117b457853a81ec55913f977850f26e188fa2652579efe9ddf", - "0x8b7cb5b8de09a6dfceddcbaa498bc65f86297bcf95d107880c08854ed2289441a67721340285cfe1749c62e8ef0f3c58", - "0xb97447233c8b97a8654749a840f12dab6764209c3a033154e045c76e0c8ed93b89788aac5cd1e24ed4a18c36de3fbf60", - "0xb4790910e2cbef848448f24f63e9dd4a1b122cf65feecf152d5fde282ad6fcc6ea3f9cc23178baf85612020795e4b13a", - "0x81fc724846b5781f3736795c32b217458bb29972af36cc4483dd98ab91680d3d9bc18842db2661487d3a85430dc9e326", - "0xa154892ff23b284040e623bba940a6a1ef1207b8b089fc699cb152b00bcce220464502cfa1dfb5a2f62e6f3960cdf349", - "0xaf3f765fd293c253072b33a780ed68933f78d7e079d9a2079b6232755bedf6ebcbce9ba65c01f695602fa8ee17899867", - "0x97578474be98726192cb0eac3cb9195a54c7315e9c619d5c44c56b3f98671636c383416f73605d4ea7ca9fbeff8dd699", - "0x917c4fd52538d34c26ccdd816e54ebea09517712aa74cec68a2e3d759c6a69b5ccb4089ad1e0b988e916b2ce9f5c8918", - "0x8cf3c29531a17489a5f8232d56c5251ffddc95be3ff7ff61472e19fb38c5eaec841ef3b1ee36756b3dd8ff71ae199982", - "0x96d4b9b411319e531bab6af55c13f0adb1dd6b4286784ff807f283e7990dc368c16d536fc5db3d992deb4b0278914e6f", - "0x8903f7e0c9764ce844b15d84feea04406dc66b195a5f82ff4027f27361e11cf368538137d139368f5a6f42876b04f056", - "0xa4047173b5906c9b4292aaee1e91d9080ae74b1d3eb990449ed1f96bf22c3ee80f4915361e5bf7dccce24ae1618dae77", - "0xa4c4b96071e7bc92e41defba3507ddf423d93f3a94271b1f9812dfc4660e4c9fd24e0dd7aef324c46deb8d7a7c97eaa4", - "0x8289b65d6245fde8a768ce48d7c4cc7d861880ff5ff1b110db6b7e1ffbfdc5eadff0b172ba79fd426458811f2b7095eb", - "0xab4119eef94133198adb684b81f5e90070d3ca8f578c4c6c3d07de592a9af4e9fa18314db825f4c31cea1e2c7c62ed87", - "0xa3ffc3dad920d41ec3f4c39743ef571bcabb4430465d9aa811d0f0a7daa12bee4ed256527d16a6e937bf709ebb560ebd", - "0x8553748da4e0b695967e843277d0f6efeb8ba24b44aa9fa3230f4b731caec6ed5e87d3a2fcd31d8ee206e2e4414d6cf4", - "0xb15e1b4ac64bafbc4fdfead9aeff126bf102fdd125c1c914f7979680ec1715fbeccf3dc35c77d284421ec1371ed8bc32", - "0x9377aab082c8ae33b26519d6a8c3f586c7c7fccc96ec29a6f698b67d72d9266ad07378ba90d18e8c86a2ec77ecc7f137", - "0xb71c11828ecad7731136cb1f5b80392a4add8d62f8866a781fdde797a201ebf6d483b2348aacbea2061a5108933b757d", - "0x86793899ef71740ab2ec221d0085701f7909251b1cf59a276c8d629492f9ef15fc0b471beedc446a25b777391ab00718", - "0x8100b48ac2785477a123a7967bfcea8bacef59391680a411692880098a08771ff9786bd3b8dfb034cae00d5a7665621c", - "0x8b027c14affe47f83ee59b504d83b2fd2d9303de2c03ee59d169bb199d9f4bd6533d7f8c812dd7a6f1e8155e3e185689", - "0x9615800f8c95f95bf25055ae079b964e0a64fa0176cc98da272662014f57e7cd2745929daf838df0094b9f54be18b415", - "0x951aa38464912a29df2101c60771d6de7fadb63f2db3f13527f8bdacb66e9e8a97aaac7b81b19e3d1025b54e2c8facff", - "0xa0e68d24f784fcb2b71acc2d5871285623c829d0e939146b145e04908b904468a67c07a2f156e6b17bf531adc5777c4b", - "0x86a533b02ae929f67c301649a2d58651b98cdffe731b63fa32aa1013c271634bbb088c0d02865913c11bbb1bf57c0e12", - "0x81f145ebb9a5674a5b052d0e9059acc8f8ab612dd9f54d43ff620202606e19a86a9b284dc6480d555a030e5fefee8c50", - "0xa698b04227e8593a6fed6a1f6f6d1eafe186b9e73f87e42e7997f264d97225165c3f76e929a3c562ec93ee2babe953ed", - "0xb3180ded54610b1b3a2db7db539197ced6a75e9bb381d1f4b802ca7cd450f5418522ad2bee3df1956ed63ff1ffe95dc1", - "0x86fa3d4b60e8282827115c50b1b49b29a371b52aa9c9b8f83cd5268b535859f86e1a60aade6bf4f52e234777bea30bda", - "0x97d076617cf0a64ab3d1f030cfd72a303b6b252c0a7b96157ff7fc8af5970f00d14492c46e8f6f37caafe837d0dc95c7", - "0xac2c98a0ab3f9d041fc115d9be4a6c77bd2219bb4b851cbee0d9257a4de5791251735b5b8fad09c55d16eb0d97080eff", - "0xace7fda25c2fb7c18710603c16a0ff0f963352d1582a42a20c9f5603c66f485df8383465c35c31e8379b4cb2ec15b4c4", - "0xa07b35ec8d6849e95cbd89645283050882209617a3bb53eae0149d78a60dbf8c1626d7af498e363025896febdba86ee7", - "0xb2fc4478830f2ae4234569346d80b59899247c609b75bd2190a896498539e1f30dca5edbad69f0224918d09f0d7eb332", - "0x84926cf2265981e5531d90d8f2da1041cb73bdb1a7e11eb8ab21dbe94fefad5bbd674f6cafbcaa597480567edf0b2029", - "0xb5f32034d0f66bcbccefe2a177a60f31132d98c0899aa1ffff5ebf807546ff3104103077b1435fa6587bfe3e67ac0266", - "0x938206740a33d82ffda3e01598216324731335d367965aa0b740486d60ba2e86a4ecd546851046a61a4b0fc88295b5cb", - "0xad2b1ab32161e37ee553e3787f05f9281073d7ef7d0ae035daa353bc83da8ef8c76c99ad2928463c7c708f7404020476", - "0x94f4720c194e7ea4232048b0af18b8a920fde7b82869e2abcc7e14a9906530be1ef61132884bb159df019e66d83a0315", - "0xa26dd9b28564c3d95679aca03e3432ac26e287f80e870714c5946b05538b3cb43bba7b85c16bceb5430e81b7a04c1b1d", - "0x8ef0930db046c45ca5c69d565d54681d2b6d249e27092736aee582b29de3aac3fd96e1066a57cadd851b4e5334261594", - "0x92096ebf98ebac5c82345d3ef0db0f5a14af23ceea73279087426b281d6701997fe131fe65a7df7d624b4ff91d997ae8", - "0x81c850f419cf426223fc976032883d87daed6d8a505f652e363a10c7387c8946abee55cf9f71a9181b066f1cde353993", - "0x97070a33393a7c9ce99c51a7811b41d477d57086e7255f7647fd369de9d40baed63ce1ea23ad82b6412e79f364c2d9a3", - "0xa99cde5c7c85ae291c74c893e598cc0e6eb2dda2a81dbb504a638eb21dd2c41d6e5caf7baa29e3c1c32e94dca0d791f1", - "0x937ccbf8cd19b82af2755b4856cfcca3d791e33ae37e4881982ea89d3b21d205a9402d754fac63037243e699484d21f6", - "0xad7dca7640444f1268f03b67544815d4366c6a4a2f0d25ee78f3361c63095416216fd31aa0bcce7448cdd7ba73a6344e", - "0x84991ca8ef255610ebc6aff6d66ea413a768e4d3a7764750fd02b5cd4735d41df399b36e87647fc83cf73421a39d09e9", - "0x91215fc3f7243638733fe293dab7029e0c4275550102acf5f1638773cf8f8ef2c53ffa5bdfc1b602c269a2b5ab164b7a", - "0xaa6cfb3a25f4d06c3ce1e8fd87496a74a5b951ab72557472a181a2e278c5e982d290dd4facf40bd2f4f8be62263dadb0", - "0xac9f29ad08aaf27581fe1f12e210ad4ac6011507fe3100763a4120f9e439f3c6d191f3fb55aadf58bd865cfd4406c68e", - "0x87c6cb9ca628d4081000bc6c71425b95570291eb32ef2cf62416bd1ce3666eb2ce54accd69f79d506cefbfe6feb5a1da", - "0x93042dd42e56671155bb40d85d9d56f42caf27bd965c6a7a7948b39089dba8487d4d5fd30522dba6ba392964e3ffd590", - "0xa76adeddf2454d131c91d5e2e3a464ef5d3c40ee6a2ab95e70ef2e49e0920d24f9b09276250ed7b29851affbdbc7885a", - "0x92a488068e1b70bf01e6e417f81e1dc3bcec71d51e7eabbc53b6736e8afdb8b67d191940fe09c55783be9210e1cbd73c", - "0x8180ffffb5abe78c38f2a42a3b7f1a408a6d70d3f698d047d5f1eef3018068256110fcb9fb028c8bdccbc22c0a4c3a20", - "0xa50ab79cf3f6777a45f28d1b5cdad2c7ea718c60efeeb4c828d6307b29ef319445e6a9f98aa90f351c78b496575150c1", - "0xa4632399c1a813e41fb2055ef293466098ea7752a9d3722d019aa01620f8c5ecdc5954f176c6c0901a770cbe6990eb11", - "0x83bf5055d6332009c060fd50b8dc698d42b764b079c90a1fad8a83101f8dd1cc27acb27dc9d1c25ac8d3db4107471b4a", - "0x8c432e044af778fb5e5e5677dbd29cd52d6574a66b09b0cd6e2a5812e71c91559c3f257587bfc557b4b072a822973a60", - "0x8368a0f17c8427beb71dbf11a09a2fe8495a33f08c29c74a9a996a88aa01c0a09f9555abeb1ef1592cab99a9e05875cf", - "0xa8795e7f4c4c5d025ead0077c3aa374daaf9858f1025c0d3024d72f5d6c03355ae6ac7418bf0757fe49c220acff89f7f", - "0xa6d9f67ca319ea9de50c3fed513269b83fa067977adfd1e9d9ee07ad61b2ac1de64a39d7b6897ab55870cf982fe481dd", - "0x86b3a4ea9b1fde00cce79d5ae480353d60cb6ddce363c535bbbc3e41a4b8e39fcf2978eb430091ae1b10420d43193971", - "0x90fb5cac22a22fb8a6b619f1eacd95873be974d4d5d1f7080e523bb9b4b2644eda7340d780bd1ea8ce36407ca0410fea", - "0xb5036d4c241685bcd67156e4ab0eba42b97f639947d54b17af2c88fbcc5fc57359c7df4bc7f8df955a524fb1501a6fda", - "0xb1c56f028f31f0ff86bdf55788703b4d809becaf3e4d9d349f1b660a07d2f15e127eb72a0e2a5a2742313785a3de43a5", - "0xa3e909196f447e492200cc67000c5d7f0f585fb98e966cf9bf08257597fea8d92a90ceb054d4b5553d561330b5d0c89a", - "0x87cac423d0847ee3547f45ac5babf53bddb154814e291f368cbb62ddd4f2c6f18d77a1c39fddb482befe1a0e77d5b7fd", - "0x8605b88ce23190b1fa9d389b15e6907417239a72b97673d1479c4ccb8f4515c7921d14537775c74e738a9c3f122b1443", - "0x87587504e819bc7f0349705a05c15e8504fd6b2c25c3fd264096cdb7aaa22d8078da776215925d9d775a7f9355b6f0c0", - "0xafba279768f0f928b864645aa4e491e9c949bf3dab57efa24eeaa1a9a7d4d5a53c840019354068e64c65a2f5889b8f3c", - "0x86b1cdd26ea9a3ae04d31a0b34aa3edc9e8d038437152214d195381173e79e4ccf7f8f0ce9801086724a1c927c20e4c8", - "0x812d3ded3a3c9e58eecf13a29bb4cc13b01b2a0af322423a29bb0e4f6d9021d1d87ac4af7a2a6b88d34f44a8bc1b3c55", - "0xa988cfed9f481bc98beb5fc188ed3f6893a3ebba27c3ebace669792f6abf0997727023c3b6930a6421224f5b257b8b49", - "0xa38c974b57da968f0c4611f5d85d8014fd48594c8cd763ef2f721cfd2c738e828d41ff029e3591d7447e3125641db8ef", - "0x880b4ef2b278e1b2cccf36a3b5b7fbce94f106ed9fa2820cb9099a7a540a57e9fdeef5c0fb0a743049828fc2b8c46163", - "0x96e7d1bbd42195360267c2a324b4d9bccad3231ed8a7f070278472a90371867e2ef2c29c9979a1ec6e194893afd992df", - "0xa92beb343caf6a945990adcf84302c55d1fccdef96c34a21f2c00d3e206a9b2c6c6b412f66e5d4fafe26ef6446cde705", - "0xaa48afa77d5a81cd967b285c0035e941ca6d783493e1840d7cbc0f2829a114ace9146a8fbe31ecbd8e63e9b3c216a8c5", - "0x893a2d97ae067202c8401f626ab3938b135110105b719b94b8d54b56e9158665e96d8096effe9b15c5a40c6701b83c41", - "0xb614910b247c6ade31001b0435686c3026b425b9bff80b6c23df81c55968633349e1408a9a5a9398a7d5d6ed5d9d3835", - "0x991c660e4d476ad92aa32ef2c5b27669ab84026eeb5ca70af69bbbcd8ebc0a8fec17843423306edc78b4436629d55c25", - "0xb926a21f555c296603dc9e24e176243199a533914f48994b20abca16f19c30cfd0baf319268139fe3f83ce69afdc324d", - "0x8e70e4867d2731901d603928d72bbeb34b2e0339a4f5cf06e7a771640717421b4ea039c61dde951582a28c2ff152ff70", - "0x95aafa379cc6a2b4bdd0cad30b7f0a47839952af41f584219ec201c6c4d54610eb2c04b67b29080acb8cecc5e7543fbc", - "0x8465bd8be9bd9c2c6116d4ae44ec6618c109cb9aaee2d241e7a6ed906d398ef15a6fc18bc8b1d3398184241405954bba", - "0xb455f751232de0a48440d09983f4f4718b6169907979c9f282acf7177ab5b1f338fe1f2acd8d0bee4b4aad61d0340839", - "0x970df2314849c27daa16c6845f95b7be178c034d795b00a5b6757cc2f43c4c8d8c2e4d082bec28d58dd4de0cb5718d61", - "0x8d52413f981bc611427ad0534d25e914113d0ebcd6960aab6421608bec6648b89ae4b2ca2153c57d3cf4f1f37212aa5c", - "0xb7ac87da14b783914ab2e914fb7b536893b7a650cdc5baa1f3b4aca9da77b93a3336671335250e6467a8cd4aa8dc61e9", - "0xb37a2ec9dec3d7d9cbc911fa1e5310a47d23a841d02c8b99a923991c73fc0185d130a494748c64f2b5a4c07bcd06920e", - "0x86108b661fb2c363adcca84c114c83346413df748b959015c018452cfac14890bf585dc0a646d68727cc3cdfd2b61897", - "0x8421044f794a1bcb497de6d8705f57faaba7f70632f99982e1c66b7e7403a4fb10d9ef5fb2877b66da72fd556fd6ffb0", - "0x84d2eb008578aebd6f01254b7e46584c1524e6fd7a5a2ae5fa0ea560865ca50d52290cf2d12dd20b042f402e62181b4d", - "0x8d6bed5f6b3f47b1428f00c306df550784cd24212ebac7e6384a0b1226ab50129c0341d0a10d990bd59b229869e7665a", - "0x80e30cabe1b6b4c3454bc8632b9ba068a0bcfd20ce5b6d44c8b1e2e39cbe84792fd96c51cf45cf9855c847dc92ce9437", - "0xb7e74ab2b379ceb9e660087ee2160dafe1e36926dfab1d321a001a9c5adde6c60cd48c6da146d8adfa2bd33162eeaf1a", - "0xa2b1ea43f51460b3cb83657b4e296944658945d3ad6ae7b392e60f40829ba1da6a812d89f0380474578cbd0ab09801ac", - "0x91ead7dacf43905eb5d4b179af29f945479ed074126bad3b5a2bbc1663af5f664fe53a36684e9389ab5819e53f1344fc", - "0x927c030d5a69f0908c08f95715f7a8d1e33bed5e95fc4cfb17f7743cb0262755b1e6b56d409adcfb7351b2706c964d3b", - "0x883f38af3b2c1d50f6e7c515a5e02468d76890f6e669f7acd2df89365862fa65877095deb001b4e2868bc5b59439dbb1", - "0xa0ebae60a998907a19baa396ae5a82bfe6aa22cf71bfca4e1b4df7d297bd9367bbeb2463bda37aa852ad8fd51803e482", - "0x8ae80eeaed3fc456f8a25c2176bd09f52a2546d45d77a70f48a9e30aa29e35ff561c510ae1f64e476e4a0f330b9fdbdd", - "0xa7be457b8bc1bfde4865a35b7b1826118edba213b0f0d3cf5d877267cc1559cabe61cefb1e300142a978c29676036179", - "0xaf51da717d2a45ab96fad5d9317ea867ec4c6a411af6fabd72e568230099a04c036a0f114158815b1a75da6474dc892a", - "0xb549cef11bf7c8bcf4bb11e5cdf5a289fc4bf145826e96a446fb4c729a2c839a4d8d38629cc599eda7efa05f3cf3425b", - "0x8d264fbfeeebb6c4df37ff02224e75e245e508f53fb3446192cd786ecf10d0f704c4fc2e53e7f7318ae1407e46fc0fb8", - "0xac3195143035cdb4ddcd5f93c150035d327addee5503ea2087b1a10b2f73b02453ddd1a94d8e7d883e365f9f0e3c38c9", - "0xacbb398ea9d782388c834cf7b3d95b9ff80ee2a8d072acae8f9979595910849e657889b994531c949d2601b3ce7b235d", - "0x811e6a5478f708495addbb1445a2ef23e39ee90287f3a23ecd3d57d4b844e4f85b828bae8fa0f1893dfcc456f86f7889", - "0x8cde690247d4831dfe312145ae879f4e53cb26641b3a3bb9eb4d590c56c11ece3cfe77180bd809468df5cddaea4f5ab1", - "0xb42578df29a9eb23bed91db6a1698df49654d2bc1b0d7973b2a7e300e9cf32e0e6ac464d463d4d26e394e7598239c4bf", - "0x97ffcbf88b668cde86b2839c7f14d19cb7f634a4cf05d977e65f3cd0e8051b2670e521ae74edc572d88201cff225e38a", - "0xa322b5d2a6e3cb98b8aaa4c068e097188affef5dec2f08c3e9ce29e73687340d4e5a743a8be5f10e138f9cabbe0c7211", - "0xa076ea1084b7a1a33115ef62d6524f36e7820579868763a6ed1f8bce468f150cbfbf0ed04be2487aaa34100d828b0db6", - "0x944259a56e3b4f745996289912740281bde47e22705f142c2a483ffd701e780f51a01b177d2494dc8db9e69157f45d44", - "0x91cb79d52951d1b901e4a686bf4ad587e31db57ea5af6ffeb93eeafae3929879c386ddec860f803c2dc61055437e6bee", - "0x91efdbcaad9931312d7c41d24de977f94d7f3f7b88090a1f72d9a097a1e30cc805c5ea16180f463022d9b26b8863f958", - "0xb26f5ed09f7d5bb640ec94ddd1df0b76466f69a943b4699f53d45296d5d6b8010bb61477539bc377d1a673d89074d22f", - "0x80822499f96a1a8c0048f01f389dfcaaa5d8269c332dbb507fe46f270bcfd5f67c53f827fd867221592dbde77b6b37ab", - "0x8860ba25d5530cb8585975d8013a1c2d5b0f0f96066044fdc43ed13488ae44e379c624ff6993a18cb6e037809d7985e7", - "0x999d1c44e14184349064415ae28a149b3b11aba5baab6792744378d14df554a3625fac82038eaca920064822294dd513", - "0xa62c2e7c692403e874a16e08e46a067e19dd561993ca07ff79cecb53c753763b3e49d372638c96c0a8c921bfa0798a0c", - "0xa1c84730a5c41dcab9a5ef9e1508a48213dbc69b00c8f814baf3f5e676355fc0b432d58a23ad542b55b527a3909b3af6", - "0xa1c0c317e6e352e16e25c140820b927161ce5d2c4c2e10bca3057ba4d46b4f42ad7aba20de86dad9fc6368ea92695268", - "0x85c216e314eb7bd8ba02e092c90e132bc4bafb21c6a0fbe058b0dd4272cb76f183b83c6783fc321786065ff78c95f952", - "0x8e8f63ec8f4f1f7fcc61f893b671710c3c17f9d2d26c5c6ca40e671bd4b252bc0cc1655e6780d2ddcf2915d8f623b9a4", - "0xaaeb0005d77e120ef764f1764967833cba61f2b30b0e9fed1d3f0c90b5ad6588646b8153bdf1d66707ac2e59fd4a2671", - "0x92ff79402d5005d463006e0a6991eaacc3136c4823487d912cc7eec1fe9f61caf24cd10022afdab5f6b4f85bfb3eee4f", - "0xa32a5bd9b7bec31dd138c44d8365186b9323afbba359550414a01e1cdb529426bfa0b6f7daaf3536e9402821faa80003", - "0x845982c2672fdd44b33d2e56ad676e704c02f756b09e8765bea42b924c14724484567b55f0db42ac20cb70a7f5201c14", - "0x89cd9f6ae7d9a9ff2b4db916ba3af9fe700fcfbd16577bf73a965af938e8cf633020466b0298d3c31300360aa6851af2", - "0x8fa2d7b22af8e6b82679ebdfa13efdcb34289a554653ea6c1b16efb9f957f7fe64df787e7b03d8cdc8a732b91c916bd1", - "0x94f327bc57ed1ce88ce4504b4810cc8af5bd21a7e07b280a7866ce08e39b6cf7a6560bf73a5f10671271624cd7893970", - "0x90f4476224b64c2a5333198a4300ece8b3a59ae315469b23fd98dadcdceaaf38642d2076e9cd0bfacc515306f807819f", - "0xae0db78548261216ad7d6a7ed4e6089ee17b3fa311494b2f2c559e215cd3de7e5f3a781a49dcff428a8a61c2a4f49a19", - "0xa83371f44e007c708dc4bcafa7bd3581f9080a4583c9be88624265014fd92f060127e628de5af3c442a25f049c7e7766", - "0xb471c72bd2971353f4b44248b8e6cf5316812861a88ccfc20fd0d89a5e010428c387228b2f6f14c12f79e31afc9d0753", - "0x8962afddcb1a26cc8ccd3c993109e79a4dd747ca473b8b5ef93d9c2e71d29623b834ac945074acf118248e3ae7878a6c", - "0xaa0940e4e5586e79a3d97397c8aff3d112c6f759d2efac29366acc5b5c6a7cfef8d50516bf309da8b787de265dc8deda", - "0xa211120e1bb3b10138df1fa58efb009a298b8771f884b82bb3de15822b1252124a68f3980f96122a775fb96f05ddc3d5", - "0xa1047401598b1e6e2613d746bb4689e0406eccdbadf319a6609a3261cd09deec215d90eba6d0ddc50dd3787d60104e7f", - "0x96791b2b8066b155de0b57a2e4b814bc9b6b7c5a1db3d2475a2183b09f9dcd9c6f273e2b0c922a23d1cf049a6ce602a3", - "0x91013e0d537fb085a49bf1aa3b727239b3e2c1d74c0f52050ff066982d23d5ee6104e70b533047b685e8b1529a0f14dc", - "0xaa65c11071be23c9bddaa5203f3166e5cf043efe5fb8f4b26f8a9cabe71db701a450e79eb001c401da5752755d9cf1af", - "0x8645cc44d180c18a6d8f57ba57bae05879451997533cfe558cad4d3d586caec877e348915e32a09ee73483283c4df744", - "0x8eafbb7002f5bc4cea23e7b1ba1ec10558de447c7b3e209b77f4df7b042804a07bb27c85d76aea591fa5693542c070de", - "0x919c81bd1f3d9918e121e4793690f9ddd96c925ae928536322d4b98132f21979c1f34731d393f0ae6e0871af4355a8ad", - "0x98181e9291622f3f3f72937c3828cee9a1661ca522250dfbbe1c39cda23b23be5b6e970faf400c6c7f15c9ca1d563868", - "0x8f44c43b80a3c5f488118859fab054745cfe5b0824821944b82fcf870fda6d93489ea9ca4220c24db2f4ad09c6080cb7", - "0xa683d4865ddcc099f7b698153007b92f853b80f49b3be75163ea8cd1f8ff584b43a68e68de3ae61cda8ad4b41f355c87", - "0x942772b7c7c47d4e5957ccf1d6f1450070930af3e2b7eaab0dd7699372445df0cc910e6c0efcf501887dd1adabdaee23", - "0x805c06e565ee67cab0cbccb92b6656fdb240b430766eade3c6b0a0b1b93c840e2b4f028601451dca135c783239463880", - "0x84d3e2a06e16ced26094b356a16a4fb6aad50ad9ab23ef804a5852a33ef0bff76f3c5fbf7beb062376c2e669cb598679", - "0x803df08aa745cc3c0a799f3a91bb6ed423cd520c9d255d36c21bed1a0c3b12e8cad32f54da09dadca97683e9548fba91", - "0xaa2c3ef95b8d4265f01666129646004b6950d3e8ce74b4ca12aa3b90fbb445079a569178df772c272463a44d48922b8f", - "0xb0a4c136fb93594913ffcebba98ee1cdf7bc60ad175af0bc2fb1afe7314524bbb85f620dd101e9af765588b7b4bf51d0", - "0x93e4c18896f3ebbbf3cdb5ca6b346e1a76bee6897f927f081d477993eefbc54bbdfaddc871a90d5e96bc445e1cfce24e", - "0x89019e9550648962420984e9fd03597a854ae824567d9aa6cd5db01a4616b4e1477230f2d1362a2d307e2425a3eeb898", - "0x861b710d5ec8ce873e921655a2ca877429e34d432643f65d50e8b2669929be40a9ce11c6353b0ada1fe115e45396b2b7", - "0x88554c83648ea97dac83d806cd81d92531980346b208d281fba489da15a0084fd4d9a00591d1ca67aad3c5793685d55f", - "0x851fcadebee06930186f35293feefd40d7daedec9b94e6fe5967536c2c0e4cc68f58d3f5fbc76f1e77b90c9580074f98", - "0xb96a11048c7c327709d52e72e6f6ed0b7653329a374ea341ad909311b5b303e5629d6dcf11dcdb195e8c7592ceefac21", - "0x836075979eaf386ff6cb459cfd48fed171ae812b0ac3b38dc24dd8ca905cac1c600be717d4a0defa0a854f40cfaf8c33", - "0x90fc170529bcc0b80c46a53fffd8323fd2cc5cfa9b75ea4d36db21bd1f198335ad2bfa87f8990cf9cd9fd7989ecca718", - "0xb7eb6a49bf8f942dd8c37c41c1b35df43e4536e07ca9f4c1cfbbf8a8c03f84c54c1a0d8e901c49de526900aeac0f922f", - "0xaf6911edd6c7ad30f905a0a3f78634808832fdeb4206b006934822d673bcced8e378779261b3c4b772b34b8871987f57", - "0xa74d240d0d7ea0afe68813fab55388d77e75eca0519d21771dcb7170cedb11dc14b237b26c5ae1f7f728b52e5ec0f02d", - "0xa7b86e4f1366da44fd59a3ee68018a99c23ba3588789463bd88b0177a9b94030b58cb879a506e64421af966f261eaa86", - "0xad8d94e46cc02a1c0ad27105e8f672ec15b8296051801f1918d0bd470625686e8e8a0abde8f6852b846ee8d9132b26bc", - "0x980508c4d1e655cc6200f89a884b3a25c0c05708a3e4a101205c4fd901c3e20a943071a6300bb2614be41a139d4ef1df", - "0xb0173651b4ba0590b1d2f0265183f3729b5bb09893523ca12c4936120cbe5ef0d9b98733734407d99fdc766792ff10ac", - "0xabf72ec0280d56971e599b3be7915f5f224c0ccde2c440237e67b95489f0c9154ace04b7763db228473715f68053f071", - "0xb404beebf60026ca6843f2953cfcdee494d495c8e2d18865147102ef29a8f0ee470961d2246fe5a450c622d20ca51d53", - "0x89461cb2dadf51d6f1208b0965c8eabec895d7b19b7d90d3c6e49dbe75a75c30fd26db3dfb169dd46a4342280225032a", - "0xa61cb5b148cb7ff34775dead8efa7d54d7141182356bf614070dfaa710ebf07a4dfb684dad151db60c0f8261c30a4f40", - "0x83a798f47a4f62dcb8b531d463b0fd4a876d47a8ca990710290549255033c909de709471b4e823a60bf94d8baf8b5acf", - "0xa23431589f3a25070a188deead9adb0ed423d6b00af267f3f125cdd4391c1527909b5cfa88130dc4b67915f5002128fa", - "0x8d77e65ba6250fe18c54ce70d0ba4571a7d3e68a8b169055cd208e4434b35a4297e154775c73e7dfba511faadb2598c5", - "0x90e5db75f3787b819df471712f87b6f3281437090f5db7a2c21b07164446292a414c687e41de2d1ca00786b093239c64", - "0xb382fa28670a5e14dc954b2db8ace250c73df71ab095304bd8ee28f455ab26cc54f82775a831428e110d1a3a2af709bb", - "0xa58d2fb1c2612d28c54fafa7f2e1e6c336c24435abdb53e1be9dce9aebecbf7468a348b872549535ac18aa003f83ea87", - "0x9545f94c4e9056e360dd999985f8ad06210556fa6f07cff77136a2460605afb0ff1fb1d1a2abe4a4e319fd6c29fff80f", - "0x93121aa60f904a48e624e00f5410cf8c8925d2b0719f90c20e00cba584626f833de7c8a18dbfa6a07df24b916156bfc0", - "0xaa3446aac25f6c23ea16e8f7d19c58d187746ef3c2ac7d8fdf9bdc329409a07589ec8eebafbe2b156e7ba60addc15af8", - "0xb964f50011f03135e993739e2e63a71933ba4583040b3af96c7e2dce874226518f7b68f622c4a1d78b9c3ec671d33ad7", - "0x8cb5cb7cba886af58acadc5a4348524b1395a39dc51196316d759a9b72d9fc0fe45b706e264393a13ff911f0d15de45c", - "0xb50c306f78143b37986e68efa10dbe1fb047d58562e9b5c5439b341dd8f1896c7ae586afac0a3213759784a905c1caaa", - "0x97825edba8410e8bcb85c5943628c02ea95ee7595f559c030b94395c0d1d0d84c38eca199fce9c1992e572b5029b124c", - "0xb0922acd6da2a95b36de6d0755316594a7e2e32ea774792dc314e8c3cd76d9f1d69df38231e166e24bd42c664f4fbac7", - "0xae5ea228c1b91ef23c245928186fbafa1275ff1817535018d7d2d913abff0fd76bf41fd04a96d816f2f1891bd16e9264", - "0xb106c6d13ca17a4c8ea599306e84918127cf2de21027ac3fe5a57d35cf6f3b1d7671c70b866f6e02168ae4e7adb56860", - "0xa044cd5a3b727dc1cb59875e4025718375d12e706fffcdb48874e51a675dc2cabb209670192e408cdced5aeac65192e4", - "0xab1cc44983e46a6ea2430aa6616ab28614f43624665e3e6ae31a9357c0c5434f34e56c720906e184327693cc4ebe1fa2", - "0x890def696fc04bbb9e9ed87a2a4965b896a9ae127bc0e1cc515549b88ddbcbc02647e983561cab691f7d25cf7c7eb254", - "0xa86be58fef115445b909dffac6f51da3fe9214afd9c31fd564bb8f39b1dc3cb895b1222f2c63226b54b60b278ec45edb", - "0x8757e9a6a2dac742ab66011c53fa76edb5ebc3c2fbd9a7265529a3e5608b5c24b4482fed095725e9b8fed5a8319c17a4", - "0xa7e0ddbae16e4491822684c0da3affecbbd17ef96c5c491ac093c6eb4e162fc7854c367535e296fd3d6265c2ed1210bb", - "0x941fe0dabcdb3225a625af70a132bc1e24ccab1f8331dde87db3e26cbee710b12b85535e46b55de7f5d1c67a52ddd5c8", - "0xa24d05b51c7c128bb49979cbd9019e6618545d95275a44b5c3d1d03e71bf2ebffdf43fff50c30846ec27d279043cef4e", - "0xb526f40d519e7a8f2c81b69f71b3e2ef079028004c0448ba0608296c2787972491ec6d05ed6a8fbd5ef2da76325a93cb", - "0x87ca4fa85a257adf7e21af302437e0fa094e09efced2d7ebab6cf848e6a77ae7bfc7cf76079117f6ed6eded9d79ce9cb", - "0x9276e8051bed8f5dbfc6b35765aac577dd9351d9d6ac1bb14496bd98091005b9a4737b213e347336413743f681f5043b", - "0xa7741c52498e0a24db3ce7699882de8f462a2b3ed5e9f77dc7200cbdf46b6cdd923b1128759909d6dddd64700c4c20c5", - "0xab5b363ed9551e32042e43495a456e394cbc6d53b15d37a8859850162608bdf36d3d4564b88fdbaf36ff391bb4090b8c", - "0x838ff6630dc3908a04c51fb44a29eca5a0d88330f48c1d0dd68b8890411a394fd728f14215482b03477d33f39645dceb", - "0x997d3b82e4753f1fc3fc2595cfe25b22ac1956d89c0950767c6b9de20623d310b1d84aaa72ab967ef1ea6d397e13524b", - "0x85416cf3eef63d5530062d6f031aeddad101c7f1aea3bccb826c73f8a25d5d963caefd789a6b9832bd4ed459f268ae64", - "0x9194bc45e11d7276ed1c9ef3ad5a33d6a27372f5568563ca8ee213e2e7029dee404ab5acbaecaef698129798d35fd895", - "0xa4828a003513ab887082390262a932a7e8c5e25431824b7b4cc10fccba73265c0e5ee5b315ccef13906d971644913806", - "0xb907ec84b6ae5729d36e2acd585a350acacdeef148bcc5dc4a91edb57505526462bd4371574865541d8bb0d786a29b2f", - "0xaa5d1c1f0a7f6b9b3c3734f85864aa60bddad5121450218d76d82edefd2602685a820965c56d7eefe789d5115cb41e01", - "0xad28fe70a8606f87bcb5d6f44e1fca499c24bcee791971f599ffef1f403dc7aec2ab6ebed73c1f8750a9b0ff8f69a1e6", - "0xa641eaa149c366de228a2833907ad60eea423dd3edf47e76042fdf6f5dc47a5b5fc1f1b92c8b96c70e6d8a68d3b8896c", - "0xabac08f4df786b2d524f758bca43b403b724d12601dc0a8362b7a2779d55b060c6682a5618fffea2e4def169fcbd2bfb", - "0x8658a15df961c25648fd444bdf48a8f7bb382d9212c0c65d56bf9cdb61aab3bd86604c687fb682260dbc0ad2dc84bf01", - "0xac7983d50ec447b65e62ed38054d8e8242c31b40030f630098ce0a4e93536da9179c3f3ae0b34a0b02aad427a97ee60d", - "0xb8877a00a24b0ffcb2bd3fce8a8ba327d8ee2e98d85531cb61fec21fd49cd1696491cd51024a9c3820cf06a77cacf04b", - "0xae075b66e5f211c2149c45b211d1297bbc1d9e6497cb3315363c492a9a51ae5b9d0a28bfecd755d68553736901ac6606", - "0xafdc091a224486e7bfac169e6a7b4e008d2d04144508a337fd93b6f4d385ee3f0d927b1f5c1cd79a15e0fd6078e45dd4", - "0xb75c28941ee3f91b3535b4eaa0fb17b59ca65b5256601a1f6d0cf2bb4d66837fd16e51d6942856679012a5730a66e519", - "0x84a6edac5ac68a7ca837c46d5ada8fab136748b6c3a3b9165dbbc231ec386b15328e4ef7d69a15d4cf354135348a4ee4", - "0xb01ee30d120b97e7b60ea89b9b6c537cdf20b6e36337e70d289ed5949355dd32679dc0a747525d6f2076f5be051d3a89", - "0xa80deb10bba4bc7e729145e4caf009a39f5c69388a2a86eaba3de275b441d5217d615554a610466a33cfe0bbe09ef355", - "0x8d6e3df29419bd0da1deba52c1feebe37744108685b49ca703e1b76fb4d612e3959d3b60b822506e5c0aac50b2f5eee2", - "0xa373408beb5e4e0d3ebd5ca3843fe39bb56b77a5d3d2121d4a7a87f9add3ec7376388e9d4b8da0ba69164850cb4b077d", - "0xae0beb452af7479134a7fbc31a5f59d248e8a67d4c7f73a0e30a51db9cd33a1da3f0ae947fa7e5983aea1343e7daf06a", - "0xaa103a329b699d4102f948101ce5fae27226419f75d866d235da8956f11367e71db5c0a179dd63007ed53f7eec333aaa", - "0xa094cca9d120d92c0e92ce740bc774a89667c6f796b438b0d98df0b7aef0935d8c915d5b0dad4b53e383dc9f095c29fa", - "0xa4d88467136b99d6e55603b3665b6da0f7fb27c7759687f7e6977b6230272773d7b95049d999538c008f310c05ed948a", - "0xa23710308d8e25a0bb1db53c8598e526235c5e91e4605e402f6a25c126687d9de146b75c39a31c69ab76bab514320e05", - "0xa36d6952c2d7f88bf28032a76ed46c4dabbf1901a46efc50deb798d1b44adf7e0210fbdf2473a1ba408b5c98d76943e5", - "0xab45f5b756ec6e0b98d0d4301c87675a0a1f0b1178b8a9780c1ab23e482cd821834835afa1de890962212159e464b10a", - "0xb800be1788175a01a9228b0d3e7eb4302484a2654eb2a86c0f0900b593da0a436ef031ac230e2b05e968b33e90a342ce", - "0x8cc8d279ec08d0a5a2a09ad07fabb0122eb65f48da2571d83f86efa2c1c5bc51b04ae94b145f0a8ef19a3988638b9380", - "0xb4cd409256819e8e4627edbba90ec40b7da17a57f95749104d90db0364f5007b1accc816f4d51a0dbe5ffbcb737cb37e", - "0x99365fe5ab8ea8bd768ae7181a6ba49b79d240f512ce309b02f09d465fea276298ff55b5b9cb5b4162a901b390606024", - "0xad77fcac9753efba7a9d9ef8ff4ec9889aa4b9e43ba185e5df6bf6574a5cf9b9ad3f0f3ef2bcbea660c7eef869ce76c8", - "0xad2456725ac3aeb0e4ca5c0502a8abb4dbd8a8897d9d91e673fea6a0cffd64d907b714b662d73c0877b98d4ab3ce6a89", - "0xac8436e33619e2907659741d66082acbda32612d245fcc8ae31e55f99703fac1a15657342fa66751d3be44fc35d71c36", - "0xb0eecd04c8d09fd364f9ca724036995c16ba6830d6c13a480b30eb2118c66c019cfdc9dacce6bfd8215abe025733e43d", - "0x9439b663e4104d64433be7d49d0beaae263f20cfac0b5af402a59412056094bd71f0450bc52a294fc759ca8a3fddfee9", - "0xb72de0187809aaea904652d81dcabd38295e7988e3b98d5279c1b6d097b05e35ca381d4e32083d2cf24ca73cc8289d2b", - "0x93706f8d7daca7c3b339538fb7087ddbf09c733662b55c35f2a71073f4a17c91741955d4d549c2ee6c22eaa84193c1ad", - "0x926dc729e135f1f0bff4662ee3d6823a64597fe189b763ada34f246e77705fd4e062d85506a338e9fa98c4d225a3b27a", - "0x93f03495d53c781be8b76e37e68b64aa260523004eff6455ddc8a8552af39854e5181f8c5365812b1f65926534fba5dd", - "0x9834f66e5c946c3a8241ca2bbde046a7e88072124911d5d15c037a95b61e82b88b5c2058fa4a3721537dee39dee5da18", - "0x92ec1aeb2aa24c51cd5f724972c8b6095e77b237d83f93ed34ca0bc91a1dbf1ad95adccc59e0f0abbfef33f331f3298c", - "0x94402d05dbe02a7505da715c5b26438880d086e3130dce7d6c59a9cca1943fe88c44771619303ec71736774b3cc5b1f6", - "0x8368bb9b9bb2e17730c42ed1100eb870c88a8431601312aa8cb1e738cdb9ca2704dfd432cf1703c0db043259819631dc", - "0xa35189a105401f0cfba4b43be21723486c04659e5a01e67c43e8f9911030810b878beee696f04f63d314ccfe97ebb790", - "0x93ccd8c5f82374e0bef6562e16576f742d79b6f400e3485ef36e148088b61fbd882c3d2bb38ab0b43fa1dac77f31d543", - "0xb85d9a426a23ca9ee582bc16c203a9352dcc5f85440e46979de80eb572384479b697dc964cafd9457d9f34eeb77bb72a", - "0xaefb70e89dbf4456e077690509afcdcabf975416ff2fa16777fdf90b3abd3f5dcd865c43f1ebe6f8a669edc7f3bd6ad8", - "0x8eb03001ac9e22c6956a682ed458e650785c36d23ddbcd51ac4d9cc991325c02519ff1958987a08eb29ff56ff6e2c293", - "0xab4a1ffef7e001723c71f5d28f3dd030a06c42d91773733d117247bbf9c01cd66fca2cff8c6ce04c4bfb68dfcdd851f2", - "0xa9ef845ab489f61dbfdcd71abcc29fc38f3494a00243b9c20b9cd0dd9e8a0f23304df84939b9652cdf5542d9b3ee085e", - "0xb5726aee939d8aee0d50bf15565f99e6d0c4df7388073b4534f581f572ad55893c5566eab1a7e22db8feeb8a90175b7d", - "0x9953a7cbc152f101a60e3e381f2af17ebe7401e16ef6462d132b8f0f6c6a18837914a1299d1605f9f289b9561112f4bb", - "0xa0c9b944a338325f5efb675c9c12619fb43c8e25e80d38d6140e31d5070573b1a0ed9bb52576e4f22f37d0292d36a648", - "0x8bfd6a173a56b73480cc950ef266a18933ecafc86915a7453ded09efd8a0cf4466101f1373f05d48eae3e7fc5c0f7f54", - "0x983fc1ddf17f9756c9cecc00b39bb2ad432587a5c6d1c3296a383b9f539c9afe84c6c818447a709c0b686ba26ce5ea3e", - "0x94bbc6b2742d21eff4fae77c720313015dd4bbcc5add8146bf1c4b89e32f6f5df46ca770e1f385fdd29dc5c7b9653361", - "0xb26b4d483bca73d3f3a976bb595a0e40f9a42094e0febbad3a1874934be1939a1b362ee4ea14a4f5cbfa9b1392796a12", - "0x8dbe8fcbcc414eb352245c52549973f73d987012de9d5f2b2f55dfdc43cf8cc9ea6b147abf149817f80f9e15aea566c6", - "0x9604da21e23c994a0a875ad5e0d279c79210f7a7de5c9699fac4aebbd76d39b703eeec5dd5efc9ad6b9dc58936089ddc", - "0x8934e9a3feababa12ed142daa30e91bd6d28b432d182ac625501fe1dc82f973c67f0fe82d39c9b1da3613bb8bfe2f77b", - "0x85f2ed3ffb03e50c8f22553b8e6349be6244d893aa37a7c6dbd221e9e121579e5a04466e60d6b4d3567bc747b1fc1e9f", - "0xab0ad421f6fd056687b4fa5e99dff97bd08840b7c4e00435eb9da80e0d7d071a447a22f8e5c1c5e93a9c729e5b875a1e", - "0x841d77b358c4567396925040dffe17b3b82c6f199285ac621b2a95aa401ddb2bc6f07ebd5fa500af01f64d3bb44de2df", - "0x83f21dfe0272a5a8682c3c7814c5e0e4db6a9098f1fa80fda725f77ea81fdfd2fa36b0c8db013503a89bd035f86306fa", - "0x95c98e3b6b62f84edf7f297cae93ee5f82593478877f92fb5bf43fd4422c3c78e37d48c1ee7ca474f807ab3e848d4496", - "0x81c3a8c00cfe4e82f3d8cb48de7d4926d5ec2f7689f9cb85c1886a23758bc107a4bc6e978601c3519156a169d0bf6779", - "0x8e956ca6050684b113a6c09d575996a9c99cc0bf61c6fb5c9eaae57b453838821cc604cf8adb70111de2c5076ae9d456", - "0x83474776ef2341051b781a8feaf971915b4a1034fa30a9232c4bf4b1bd0b57bc069c72c79510acef92e75da6f6b8843d", - "0xb41780d9d67e9e8b81b1f62d25c0c72ecfda659d2bfe6825edb70ecd0e0724250ac364e7be521cdc112ba638f16360d4", - "0x842ba3c847c99532bf3a9339380e84839326d39d404f9c2994821eaf265185c1ac87d3dc04a7f851df4961e540330323", - "0xaf17532b35bcb373ce1deebce1c84abe34f88a412082b97795b0c73570cb6b88ea4ba52e7f5eb5ca181277cdba7a2d6d", - "0xb9574edb9567f07f85c7c2e6ca6c02d90ad7c7b87d49796f1e2fb7240ad071fb755cf13ca8678668a56217c62df168eb", - "0x82212706111fb1cf5def02b5b0eb7ae9e6ea42b4c7a2b9fcacb7aec928326edb9ac940850dd933f2822f6cf519de0d50", - "0x9579973ee2559da09b327c62b1cc0177f2859872885dca709e24dcfbb9bdf9224a6d26869aafce498f44c0e6bd8a996c", - "0xa102c2ade15ea2f2b0cbc7dbd8c1171de0c8092fc4ecef84b5fd2bae7424aea8be1629f851c75e4d1d0e96104e54bfbc", - "0xa5d7e847ce7793386e17fe525f82aabb790d5417c3c6e3f6312f8e5ff52efa8b345c1ff60c4c9bf7636f5ff17b7a0061", - "0xb4b80d7fbdb1dbf1567dfb30d8e814e63de670839a8f6ff434fe171416599fef831b8e978d6498851b8a81e0bc8dfb85", - "0xb6e6277b86cd5284299ced867d37ab98090ac44a94deef6898aeadd177e64605440c15b9609c07e71fe54c95b61873b0", - "0x8135a0633082e4465090d6930b770340e82366bc5c37be6ef6dd105f85acf63361e17de8b5fcab4c82e9f9b4029954b7", - "0x864d5d9858cd881eecb0dde5e3e0c6c5de623cd9ef619e87b82fd25c5edf45a1a025b1dc763c27c5f4d520fd564b464a", - "0x8784a8fa62e0ce23283386175007bb781a8ec91b06fd94f22a20cd869929de37259847a94a0f22078ab14bb74709fac6", - "0x8adb748d5fa5c22ce4c76a1debf394b00d58add9f4e08524cf9c503f95981b36b8d0cb2dfaef0d59d07768e555733ecc", - "0xb76cb8cb446eb3cb4f682a5cd884f6c93086a8bf626c5b5c557a06499de9c13315618d48a0c5693512a3dc143a799c07", - "0xb2af1f7ece1fd640c205a09614122d69d5d2e81a7618bedefd6dbb91c7f432679be4ced1e6dddd3de323bd44991931c5", - "0xb950b457c34bfdfdd9d6da9628d41749ccae03659518a04b56487bf1b4c0681b719ec5230c0b0fd5dd710894df6aa2f8", - "0xb21785008910a949804d1291e7533752641d31beae3cb518806488f81d58c38a5efe5ed9534ac692e68c3121e2f9d97d", - "0xa9b120a77d70c1cbc0178a12d97a78b2dd0b98d0584e8e780b937800ceb18c90eaa1f0a83c5b50e34cae1c20468f004f", - "0x998c9ee20d33f96a2388b1df642aa602bc8900ba335e8810baab17060c1eace4bc5203672c257b9ae750008b707b0aa1", - "0xa7d1676816e81a752267d309014de1772b571b109c2901dc7c9810f45417faa18c81965c114be489ed178e54ac3687a1", - "0xb409f87f0632aae9bc081345b17a50a767ba4198f9ac9d352246fb3bebd29ed53c9d6f148c2f318c2eb12846b0aac4cb", - "0xb40a3bae2b08c13db00f993db49e2042be99cde3d6f4f03d9991e42297933d6049394c659e31f316fcb081b60461dabf", - "0x8c1de4264e04ff7e8282faf81c0bfb5943656451be52170211cb7adf4ff21bccbb789400735579c622f69982fcb8e9c6", - "0x8085c60b6b12ac8a5be8a7e24977663125c34827842aa3b2730854ab199dd0d2eaa93084c9599f0939be8db6758b198b", - "0x972cfaefda96f5edfe0614c01533b76153118712c1c02c505008204a5be2aa438675d97f43384199517b1c08c7c9fdb2", - "0xa1e47798a782a024da340d6d6a1b1e5e15a0f2d8668adf349ca375086964414a563cc1eea3226ae637f87e78c0a630b3", - "0x8171f20c020faae112bb92ca213c1df5b1050151496c70db5c5319212bada83b120d515bd7d8b24736090c574e1b7203", - "0xafe779a9ca4edc032fed08ee0dd069be277d7663e898dceaba6001399b0b77bbce653c9dc90f27137b4278d754c1551a", - "0xa5a07bf219432e9c80c38596c93560b49c7de287f31e30b7a06fcb4d15982add4a24085adbc5b753c462be989c64c96d", - "0x9210be290176d7e8a5005d27e7ed825067b1c678b174bc8180f92b5c03b6c3d1822356edba84f460caf6bf5275cd7efb", - "0xa95bec86a7c8417a8df3a0158199327ba0924d3b7dd94cd7c1ef8489b10270ae64b8537ed39cd3699a48942bfc80c35d", - "0xad9725114b01152fff134c1a8ccb8d171b8cd11685ef6815b76f442d757d130bab9ef4c9845e66f4aa0237ee2b525c20", - "0x8018499ef720e28759133033833edfe17ed23e42f99058bb79fe844ddee823cfdc43916be2dc9724d18f9726e6f1b409", - "0x809c7a08fbef7caf4c137cd639f2e47a8ca60d13bca3990eac51ac2a9e4442cd1a1473bebb63c61d595b586525d7b027", - "0x9793a74fa578ace75b083578277a1ae8766d41a5c508b0f1135fb97dff1d0826002393a7276b18cbc4b3c5671360ce0b", - "0xa6d7e65bf9f889532090ae4f9067bb63f15b21f05f22c2540ff1bb5b0b5d98f205e150b1b1690e9aa13d0dee37222143", - "0x99c935fe18699bca9852200c292690a2b834bac508890c4ee9af1aa6999a8d590bf6a3a274bb55d5a73f1b7095d10f37", - "0x860f5649c5299211728a36722a142bf1aa7cbbfbd225b671d427c67546375de96832c06709c73b7a51439b091249d34f", - "0x9104ac7ad13b441c6b2234a319e1c54e7f172c9a3efcb8c5fab0ac1d388b01895a9a208f59910bc00fb998b0adab1bc3", - "0xa3b109249ac2900806f0f39338da72d4f2cc6d1ac403b59834b46da5705cf436af8499fa83717f954edb32312397c8d9", - "0xb9893f7a47af457a9efd90ddc0c0ef383ab34e9c1284e617c126965cd9f0de5c54ee8b7b5208ff190366fe445e9c1325", - "0xb77416ea9a6b819e63ae427057d5741788bd6301b02d180083c7aa662200f5ebed14a486efae63c3de81572fe0d92a9c", - "0x8b20a852fc8f0b7cdbbd808c04a0cfd2fbccbdc0cb2361434f0d96341c8bde6155695977768d563b95746dcb4339fe2c", - "0x96b15806d9009962fa07f8c32e92e3bc30be4ded0645ab9f486962a1b317e313830992179826d746ea26d4d906bdb7b6", - "0xb0d69b3861ca6791632ec8a87114b463e0da571bc076c22a8f0d9e88a1a5eaef24683f3efa8f34900d0112412e3dc4fa", - "0xb01a30d439def99e676c097e5f4b2aa249aa4d184eaace81819a698cb37d33f5a24089339916ee0acb539f0e62936d83", - "0xb19ca6e55f349bbb2dc3e429520ff5b2e817972470794f35c1aac8c118b37a694cfcc875b6d72225343799825d2f5c39", - "0xb7ea5e0d3cfcf0570204b0371d69df1ab8f1fdc4e58688ecd2b884399644f7d318d660c23bd4d6d60d44a43aa9cf656d", - "0xa778da56ddfe4a383816b43b027464d7a28689fc4a6b35b36883d3f36d9c41f0177bdbfc8f258afe8da90f02d3b64fea", - "0x910fd030feb5538f538e5ba74b9bd017d889ed6d2a797be9c26d2be8caeba7a473006102de27e87755742ba34e445bca", - "0xb49593ea6040ce82cfb5aa2881a4b0c42b78aa9fc8467d79c8e4a8ae4ee7355842841c8e1cc0558362047ed80de44fd3", - "0xb07447c7e87459315fcbda3fb86fef27f98373b1246e2ce367e26afd87f6d698a438501fdc13cc5de9eef8d545aab768", - "0x8a9f7e8d45f11c4bfb0921c6008f3c79ff923452bcfa7769beb3222f1f37dcb861be979e6eae187f06cf26af05e8ee5b", - "0x8ebfbcaccddd2489c4a29a374a2babc26987c3312607eadb2c4b0a53a17de97107c54eab34def09144b3098c082c286b", - "0x93be3d4363659fb6fbf3e4c91ac25524f486450a3937bc210c2043773131f81018dbc042f40be623192fbdd174369be2", - "0x8cf8412bd48b21b008f0207b1f430ed96bc6512c3712dffbbecb66e493e33698c051b27a2998c5bddd89d6c373d02d06", - "0xa5562fbaa952d4dcfe234023f969fa691307a8dfa46de1b2dcff73d3791d56b1c52d3b949365911fdff6dde44c08e855", - "0xa8c167b93023b60e2050e704fcaca8951df180b2ae17bfb6af464533395ece7ed9d9ec200fd08b27b6f04dafa3a7a0bd", - "0x93e4d7740847caeeaca68e0b8f9a81b9475435108861506e3d3ccd3d716e05ced294ac30743eb9f45496acd6438b255d", - "0x8016d3229030424cfeff6c5b813970ea193f8d012cfa767270ca9057d58eddc556e96c14544bf4c038dbed5f24aa8da0", - "0xab7eff4ef8696db334bce564bc273af0412bb4de547056326dff2037e1eca7abde039a51953948dd61d3d15925cd92f6", - "0xa3f9dcc48290883d233100b69404b0b05cf34df5f6e6f6833a17cc7b23a2612b85c39df03c1e6e3cd380f259402c6120", - "0x8b476b3b065a3b95a3d11ec60a749c2258ddcc5885bfb50b8a086d3fd1e49ff73e1dde733b8981c3d2d206aa0c87b09b", - "0xaf3e694ad71684f7214f86bed85149db039971e1c362119b979a135255aa226128802e58e2caaeaf8d89304371dd0440", - "0xaa19a75f21a14ad5f170e336a0bd07e0c98b9f5d71f91e784d1dc28a5f5eb6870a4eb35bb41edcf9e6efe982ae5c2c5b", - "0xb9528983419ab5766596683faebb3592982a76b68593f810186b4e5f94f6de60830739ad8dcc164c601d575b84bd2700", - "0x88e7a12a90428bb45bcf4b01442c11607433211fc2f9bee9545304eb66e0b4b5339360160bc782e185391385da7c5ad7", - "0xa4c4df0e29db19ab4c82dd6ca8570b337d15b59c7d84577a7a444a8f762ff16ff5ab3e4203a1d6b60a23ff949a93ea81", - "0x8f11ee58ef82b1bbd2240d3f548d8681e22bed5ce118d605bed4523b4bb39899ac78e15337daab92666750dfcaf32aff", - "0x8d3cba4d10f94bd3406a341c903ad144cfcfe6b61678d5c03084a56b4413bc30bd20d7a9fd5d839dbb565cc9b2aa99fe", - "0xab8a8769c754008a7976b6799e81d7bfe97413d0a79b90715703c1f8f567675463ec93aabee59277121fc4df88b5c7a9", - "0xb201b0546f19c5db88df9c684cf55ed623bdb43927d06051bd595497df741feb1485961f64e8d3d1811d9e2e9e1e54ad", - "0xa04016e9e13ad845763cfe44af4e29fecf920b4aa42f581715fc34fb9ca27776feee45c82093c7274839eef1838b10c4", - "0x8f84cba7ceb7652023fc8ebde4b00ecde1f550935bab12feb630d6f49517b4148f3cde184bf55d4f6ec99a849fc6f862", - "0xa2248409026f35c3da8bc4d5c02315066df8fca44ff5a358cc42b5c88bdf6866dc133617c697bff004b1ef20ec4b5748", - "0xa52c5a63b55a8001b6b67c5db4fd5e95923052f03618369312896ed9892d99354aebc0dee8c3b365bafa29e211a5c3f9", - "0x8c9fefe233d0d657349b7efcdc368f5aaead27071d224af780874751e7d241f6b88f7650fbb4133043b24bbebc12aa48", - "0x86ceb649a337a5a79c17b496993ca07fa93b38a582367ca04f3dfec5cef8f268d4e8080e5a76b150f5be1b177ef6984e", - "0x87dcb537e38cefa32e629ae669da42e809b5afcabdeeef244b72ce057fc18584a1e8c3f073d5d33775232707f0cc59ca", - "0xa020404547407be6d42856780a1b9cf46b5bc48122902880909bdcf45b204c083f3b03447c6e90d97fd241975566e9bf", - "0xa1beb9f673409ec678020ea4dcbe65177aa18e2932ceb9cfb33fccb94b9a8ccb664f71647d58b3c8b2bdbbffbc02d5f7", - "0xae47b31c5b62b38ee886ee04945649054369018dd6543c91f0138464af489a32c1fea339e0e0cbe82e3e8b9f2ef3918c", - "0xb18c41c0f827f6d8656d3fb93c90b663eb2eac034923972f8842cb30e96c32842b3fbc1127930e1ba4322d5b6641f04d", - "0xa6d6ef51a361df2e8f1d993980e4df93dbbb32248a8608e3e2b724093936f013edabb2e3374842b7cce9630e57c7e4dd", - "0xa49da42c27d019a21cc6489ada7b712b98c4ede28ba25dbcfa916acef48446a2baf73e03a48be763378a09774d4a03fc", - "0x8b62902fb2855300580e94830a4bc825d997ede33bf356fe3b7c08d6a8bd85a37879433fc6bee58f9b44ca280f4e8dfd", - "0xaf9d13103868c854821ba518907b067cfba025d739125f1e9cce0a04fffc3a2a1f25506c1209a0cfe1d6c1572c229ff0", - "0x8910f41db6952c25dfbf6b6b5ba252a2d999c51537d35a0d86b7688bb54dcb6f11eb755a5dce366113dfb2f6b56802b7", - "0xb551d1ce88cbf4ffbdcb0113a6e319513bd676d0078dd4e6a6f23ad336c1d0fb47a4e427bdedbe0fc8f152353971f81d", - "0xb8876bda1e709ab16e1347a1107852a7898a334a84af978de39920790b4d82eb0739cbfc34da1c7154dd6e9f7674759c", - "0xa7d9ae9621dd1f3da3cd2d435e891cc3579c4c0d60d6a4565cac86c315cea21a9ad883559fe7b897ae6e05f1aa989ad9", - "0xaac995a41c14d379853ef18ffc854ad62ad77061ca9bdf5029cab3d6c2630de114e777a7fc3322455939d5205ed59c55", - "0x999cec6a31d9b2f280017ddd59138014829fa34cab58e6c35a5014ec364b84712441e7a2f717cf2f0de8d5451e250924", - "0xb1f43b498cba1797f9793dc794a437500c3c44a8a4b59f9125a4d358afa304fc05b88ac31ed40b6eb68f0396b60cb7cd", - "0x93ba2e000bdb7269818d390bc4232992d280e69abebe2db2ecb6fcb1390d323238c9793574509bc1fa34051ac1928f07", - "0xa64808a2d15c30460651c200a09b50fc83e9d84d87abc156d06cee73b76fbd74e6d64424cb5bb83d3f16b21bdb7ae9d2", - "0xa75bcd04fcb44ce5cbab7eef6649155ec0bef46202e4eb86c88b4ced65e111f764ee7fb37e9f68e38067040fedf715ee", - "0xb95fc0ec39596deee2c4363f57bb4786f5bb8dfb345c1e5b14e2927be482615971d0d81f9a88b3389fac7079b3cb2f46", - "0xaef456af90354ff88039d2dde02b0f5a6790aa762b23e0a9da8c6ec92c3b8b3320687bb21666608b4a22615843afd1ef", - "0xb38be9ada17ced704a34a7498c4fd6ba2503f6bd886b693d4712267847efa887a26e7da5d60f8bc5014b92bca8b3a12d", - "0x991a7c93f06d50ec6a4340c6751b73eb5825bad02a954e44e1e2d424af928819ebbb590c6129ce35b3f1e908e2152f33", - "0x84888f2efd897a2aca04e34505774f6f4d62a02a5ae93f71405f2d3b326366b4038854458fd6553d12da6d4891788e59", - "0x941e2e3ba414a371a11c3fe92cabf688ff363da6230ec7c83ac7303f652a19ebc89cc494427c456d0c2ae84c72053f73", - "0x925f3bb79c89a759cbf1fabdaa4d332dfe1b2d146c9b782fe4a9f85fee522834e05c4c0df8915f8f7b5389604ba66c19", - "0x941c8962debd2756f92a6a0451a2bf7fbc01f32ed03d0823dffd4a61186628a4c3c7c482b18589ff65e4c449fa35c2a4", - "0x88ce41025aa153a94f91f22e7b96f9342b5e0e1d76274fc70c4df7d08f66d9f7ac86e55a1c6e77693b8b01b2b38bf900", - "0x8f142bde50abe4dac8e059003db41610436d5ca60d2dfe2660ecaa5f9628aeb8b5d443e1b57662076f77363c89a1479d", - "0xb2affe048c187d311a185503d8958cacbe03796edf79bc32e8533941004d9178bd2e376e627e1ba61ed43850c0c455cf", - "0x8f7bbaaac458bada6d852fe665c87c646133bab16c0d5136c3dc922095b9d647d93a9de7671cb7bfd4cbd138ae0709d1", - "0xb76f598fd5c28d742bc1a81af84f35f1284d62239989f1025e9eba9bece2d746a52f246f9bb6bcfde888b9f7b67fc4f6", - "0xa4c665a3e4e25a7af51e433c978573841bfa2c75c075e17dd1f43b2f0369249f3d3a46ff51051e8ce7da528b0fa98d16", - "0x81e0992e7c1c54c21cac32e36b90b25e1e5b72aac99c953c3c4d019eced64d7e316cbc0840204a4a51a4ad17d8b1d508", - "0x96d7a69eaf2761bf0e5ebcd607b134d5dedba8e262ca1d6d3e8fbf23e6419a8ce1bbe4cd23b9e4b5f80db54a802a9795", - "0xb2235bdf60dde5d0d78c72cb69e6e09153b0154efdbab97e1bc91f18d3cec4f660a80311fe6a1acd419a448ab65b18f1", - "0x838d5eee51f5d65c9ed1632d042bb7f88161f3789e6bb461318c5400eaf6728e7ba0f92c18e1a994aa4743145c96164b", - "0xacfbac397ae2ff23b31bb27b90788fd0fd51a50f8e8c9f4b31be8499194252014f0b1972b204aeb9c2836a20beb3c868", - "0xad85789bb62b60e9768bd330a31a16f711b6018445af6a47646f318f12df8d4d256ad00d1ed7c3afa4e98fef73c6c610", - "0xb2349265be33d90aaf51362d015ce47c5ffe33e9e6e018c8c6e39336d9327ccdd13d25e792eb33b43ed89a162f6ac2fd", - "0xaa458aaca6ecb43b6e45ea72d02682e5a7dc8dc22782669a0628e1638e73999319f011803f4ec8cf072467bf2c49c629", - "0xb9e6c9f2562e90bd3008669a42151538b70faf028cc5bbc09fd6ab3febc626df911fcc65744a2ad793ecaf3f91a1f701", - "0xa37185bd96faa526dfd3ddaff89b1eb29ceb4597bfc7e346bff9d6b3225b9ca87cbce0db94f05243c7232ead5f6607e8", - "0x824fde65f1ff4f1f83207d0045137070e0facc8e70070422369a3b72bbf486a9387375c5ef33f4cb6c658a04c3f2bd7e", - "0xb0ed68167a67490bd7d7d49e83341606d6e6fdd99b82e46747c2190d270719f81c5f5f8733646c246260f438a695aa3a", - "0xa87c2f13f2a824b7e2c39cfb63ca7b94ae6a11ade0c6b8e83f5092b933fa8b6157a5d2f09c23081f49d35cc85f5db36c", - "0x88f5e795cb36ab22bdcff01caca0e9d04db463c3d88cf656c3a0e0f5ac864b7092c738758b4c8f3b65e31995c6aaf267", - "0xac66f3a7041586ac1576e33598f01921e16d99afbf4249c3350f0ee1654de98bd37a61c243eb6a18a942db529e36af0d", - "0xaca69a4095567331a665e2841210655636a3273d7b7590e021925fe50757617898e1883532f9cfd46428c2e3d854f9f7", - "0x946d585d7aa452d37a8c89d404757c3cce2adf2410e18613483c19199abd88f7a12e206f87a43f6009e42f4e31ed20c0", - "0x9722c1079db7e2e1c49756288a02302b43b8fd92d5671585ac1ea7491123742a2744a526c12c9a0b4c4a80f26342a3a6", - "0xb80e8516598c59dddcf13fdb7a42d8f5a52c84e01bd6a39880f4acaefe8e4b8f09cc1b1a2423cd5121f4952201f20078", - "0x85bca2f86423a09014b562f7dc613246bedffdcb3aa41fee02270c13e6b00c8d6704dcbfbafc5997df6a90c7fc08c29f", - "0xa36dad4f7cba9f4cc843fe40f6240e1973a4c412cae29b4a68712598523cfaecb05272fc47d30772bf06906b5a26e282", - "0xa3d8610c2522d330df02511710e52b1d9bdc9f2b156deca12b1bf754266caeac4f449ed965d9863558df43ce9ae65a44", - "0xb3e313e79d905a3cc9cc8a86bd4dba7286fb641c2f93706adb3b932443e32eff2cbed695beeb26d93101c53d5f49d7db", - "0x88d8a32231ff2bfc39f1f9d39ccf638727b4ead866660b1b8bfbdf59c5ab4d76efddd76930eff49ea0af048b2e396b6c", - "0xa90d9502a9785e55c199630456fcb1e794bbeb0f5f8c022e66f238a0789998b126cf9911fd0b7d463b7706dc6f9ec128", - "0x8c627caf25eae6764501b9eff35aa90bd4f24952cad712aae20344579e83ecd104ad1f7915edc4f9023b17fddbdb4cd7", - "0x87d4b20bbe2dcd4f65f4e1087f58532d5140b39a5288e1a63fc0b7e97a6a56946eafdd90ba09300c3d1fef6356ac6b7c", - "0xa18f4464cf5cebade8ee280fa00e0917cbf1743aeb0dacc748ab68773b909e30dc60f40fdef3041b5f082e650985f7a6", - "0xa6ae4fd03fbb4e2150795f75a241ab3a95c622b4615f553bab342a1803b86b1c1a2fc93bd92ee12786bf2de22d455786", - "0xa89bc7548ea245ce9556eeee3fba98a3256f87499f54a7c5eec0c43b9fb4ef2fe8f6810867ed0df814a88ee100c245af", - "0x97f1a7370b4f5acf83b466f519da361c366915f560385dd7eff9d53700ad81b25c9862bc71d35428e82372a5ae555ea0", - "0x825359cfe68ad6a75578a94be6419179e0aa088170b6c20fc5c249dc3be7a260d687c93d8d8a343c7c72c2ed6a716de3", - "0xaa9b9cc039d147677aedd1e47ad9013fcc0da0164070ff7305b18e5786c7fac0471368637a3adbb78f3af174a5c1592a", - "0xa61687511b627bde7b3977e9a34cb7fddc2aaa509a7b99b6b6c7b97133845c721e1e69f99758698d82cca265d8703610", - "0x8853c582e86cf916750d670a621246a63c7fd78f68c556642053bcdfa7937de58885d728209736b7d5521b591387e9a7", - "0x82b8c013f24fe64b8e0337ae8b6a682cae336b8404eafc1404744f80f765efdb8b2873d1d3f31141e8dfe4d93346ac56", - "0x866ec39b9eda580d96bc2bff76af5cd4887b6788675149ab33bfefe38db82ad01b8d64c6b60704210918f3564cde1110", - "0x81337ebe90d6942d8b61922ea880c4d28ebc745ddc10a1acc85b745a15c6c8754af1a73b1b3483b6a5024b783510b35c", - "0x807c510df25c0ba10d4aa06a462e02f050c69a977c64c071401ab74f9ac1e60788aa504743b4cc1982da835ff9ac2541", - "0x96b1c82b85cdb8a7026fd3431bea9cd008f0261ee7f4179f4e69a399872837ab836a14e2dd45f5448d54800a4ae7c7f2", - "0xa48b1031ca2f5a5acb4dbdd0e9a2b4e9add5ccfc0b17d94818273c8df11e825193fade364e0aec10f1ff91d57d03a52f" - ], - "aggregate_pubkey": "0xa825959280c88c6716f6df807204feb84d745dfbee3cb3474ce81a1ef0c4cd142e5ca962a0335e68b7b4266769d631b8" - }, - "current_sync_committee_branch": [ - "0xbcfe80e1d24fbdad7bc058b011403a4c26cb56967654494cde51517f888023f4", - "0x4710ae46156553fee6231622052f7fb2f6945cdb59a5501cef824b1925c87445", - "0x6df62e05ef3e1ac92c659c3a519b8fa651d1b649c2b46fda58c48cdeffe8337c", - "0xd26ff22ef5958a707a8d98eb1ffaaf1f9f412e816c04b79f5434cb1792ccf608", - "0x90d5e61f0af673ab4d8b3ab0b978d05142a8295a163b198e6dea9d8c8f1c6d89" - ], - "validators_root": "0xd8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078", - "block_roots_root": "0x5078f286fa90b88a09dcccd4ac72f6c3615b77c0ab3132508cb8c0c07b20282d", - "block_roots_branch": [ - "0x558b658b1230e225ac3adce3daf0b066ed0484b4a768d55b74ba81579ca0e5d0", - "0x2cbb27d38065ff3f230247af918e67d1998b67bc7e2ce6c244bab7146e16b8ad", - "0xc63bfc96585f424385e3b4b39ce46e957017b716c54d105eb7e07c841d1d4309", - "0xe662b38f57427b58c46b09980db3856f17e56b60b36bd5471823b0f2cc1b6467", - "0x8b3bd99618b1e50cf284b4c3b03d0cc272312bce377d585eded77154aa5580a5" - ] -} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/initial-checkpoint.minimal.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/initial-checkpoint.minimal.json deleted file mode 100644 index a7e48f45901..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/initial-checkpoint.minimal.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "header": { - "slot": 3616, - "proposer_index": 7, - "parent_root": "0x6c5e8c7b32b7bfbb250fa8fd7bc348d7325fb2bfc869e4c506af6802fcad87f4", - "state_root": "0x3e467e3429a1ae36572fe3fe1c953381242e950254cf97c7527a8cea8aa6c9de", - "body_root": "0x7da749680d2b0b4f779047fcfe7d0c13d247f6d23478817fe9c6fbe07993adb2" - }, - "current_sync_committee": { - "pubkeys": [ - "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", - "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", - "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", - "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", - "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", - "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", - "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", - "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", - "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", - "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", - "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", - "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", - "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", - "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", - "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", - "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", - "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", - "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", - "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", - "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", - "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", - "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", - "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", - "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", - "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", - "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", - "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", - "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", - "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", - "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", - "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", - "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c" - ], - "aggregate_pubkey": "0x8fe11476a05750c52618deb79918e2e674f56dfbf12dbce55ae4386d108e8a1e83c6326f5957e2ef19137582ce270dc6" - }, - "current_sync_committee_branch": [ - "0x46af3f54acbea439b63aa5bb699c8f25ff584b23912366788f7c8e95011ce324", - "0x41dcb71ec3b3940399118d28e09fdc58a8e33b818b8c5cbb933c59929504ca08", - "0xfa53febb29348e3493a50c0e7c6d35796bf69c54dfc6f42f7600612789d0ed6d", - "0x5e7ea1693066b604fc60d4657b43e7a4aafd3f4f54d9a740d2abe765e92d8385", - "0x16c9bca64a82e80c23817bfec345d088e0adc3865e392965c1244f97979f816a" - ], - "validators_root": "0x270d43e74ce340de4bca2b1936beca0f4f5408d9e78aec4850920baf659d5b69", - "block_roots_root": "0x00f6bbdeac1e1a922a9bf0e78720c0bffe558d8195e8ede8cb72bbd295f242f2", - "block_roots_branch": [ - "0x7a61086fb9e53ab4dd87243d6288c51793696168a73773277630da5b20bf6091", - "0x60733905cdc5dd65d05161bb3138eecc47d6d6057ab36b0d36cf5a3200484143", - "0x86d7de634ae45de5b3cbbc562dd976de7d06a3d96f83147413536e6b108c7a39", - "0x0ada571c9e0da6fce8dd13e6d9ce173768521ac32e0af456634556176789fa6e", - "0x2341538fd0aafbc1ff0f513545e5dcd4b8905dc9e00d6173480c18a4e8086ebc" - ] -} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-finalized-header-update.mainnet.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-finalized-header-update.mainnet.json deleted file mode 100755 index 3440749102a..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-finalized-header-update.mainnet.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "attested_header": { - "slot": 4066880, - "proposer_index": 1904, - "parent_root": "0xcab3b6fe3ca0c3ec6f9a8290d1cb3ade42b019f399dca754060518eda41fd429", - "state_root": "0xc47d2d0ec566de4bd41082ee14aa6294c05f264a4fb6a73766c75df917b57a55", - "body_root": "0x5dc66f1cdd8fe849e0aa63b096a8083c16b00814f37edd213819852cc43317d6" - }, - "sync_aggregate": { - "sync_committee_bits": "0x9fffefffffbfebfffffffeffffffbfffffdfffbffffff7ffffff7fddfffffaffcfeffff7ff3e6ffefffffbfffffdefbffdffffffbffffefffffff7ffffbfdffe", - "sync_committee_signature": "0x9146a1a3cc2520a69415103446e2c30676fcd164ef2beb42933bf4beb753f5e94f28fdcb6296e3ceda302b2a93c716d515a890894365a36ed535e099da76c7e585b8d6ed5fc2ec3c316049b14da844add39bc79cd3829a455f552438669ab70c" - }, - "signature_slot": 4066881, - "next_sync_committee_update": null, - "finalized_header": { - "slot": 4066816, - "proposer_index": 1396, - "parent_root": "0x17d77d07327f42b16d6d87a06c6ab5e56ce02e3ebc65ed2d28a64dd0c3a33d15", - "state_root": "0x9b498175419bce5a027c432fbb844f35138dc00083540a04ec0f54c77eaf061d", - "body_root": "0x6650167595152e94d0741c7a7b64d2c10ed01b0d11519f7d0c615c8a60dfae2e" - }, - "finality_branch": [ - "0x70f0010000000000000000000000000000000000000000000000000000000000", - "0x3d4be5d019ba15ea3ef304a83b8a067f2e79f46a3fac8069306a6c814a0a35eb", - "0x452c63d803b8bf301447a73b2f7a747e49f37f9c9a096d8ddb6c8302666b809e", - "0xdfebfd48ce69c56abd05de8266c76478936901404ac3869f0c068c5cfd33b301", - "0x6f1a65d993b2f461764934642be084a68bccee505bd3adc20cc69e151bc6330a", - "0xbd65074f41adb20717d733e64d219d832064b6417b90f22de6d065cbbd6b3d83" - ], - "block_roots_root": "0x4729dbb81e8ebbbae1acc10857551a3991fd5da08c27dbd304b62673edcd46a0", - "block_roots_branch": [ - "0xa3c286182434bdd4d55be8ef6e7212917dc272c204a4daff2d0244fa993d86cd", - "0x00d2df4cb3c0b06bb4f2722f975d6630a7f3c2a1ff12d635e2109f08379e3922", - "0x135a357782eb8f46d14db6e62bd3e9ad611d01f16a3e573cad9ea0c53010bdc7", - "0xdb944338cc4e7b11242b39bd83159afb122504a1934569bb500a4228b884b8c6", - "0xd381920000999813479b975b7cf0e5663b52c3ab06bb6ac66e723731e8f41e9b" - ] -} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-finalized-header-update.minimal.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-finalized-header-update.minimal.json deleted file mode 100755 index 8f1ddc827c1..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-finalized-header-update.minimal.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "attested_header": { - "slot": 3696, - "proposer_index": 1, - "parent_root": "0x04a63c5dfb726c31a32a72c1c426ff89e21363223d7096486b629f1d58abe5d8", - "state_root": "0xbe20e69420cbf9400224ec5edeb0843776a2ccf945e9a3ba9311ae812cad1e30", - "body_root": "0x1d2acd1748f1c58096d1edc8badd3a1d7e1dc3c33bcb9229e4c03f3a84efeadb" - }, - "sync_aggregate": { - "sync_committee_bits": "0xffffffff", - "sync_committee_signature": "0xafa79bc0f3c731ab1eb6aeafc582a7dd1c100ea471df3af6ff485b58661b3ef8077264dea0b60df9aec2d3ca8ddab6770fc9d061462e5a6dc718146085425f863d00921c42413805cb5b4c5175f36f2087cfed740bb7d57e8d5b48352643cd5b" - }, - "signature_slot": 3697, - "next_sync_committee_update": null, - "finalized_header": { - "slot": 3680, - "proposer_index": 7, - "parent_root": "0x4d8f4fc47ad3eb045bd20cae13af6df02f96a3f8d7c8a285190ba10cfe2b84cf", - "state_root": "0xd498766d77277fe16a6a4609ab3ac3a6e9887d162d8dfffdfc9cc4ae833e4127", - "body_root": "0x9ba73bc9a4907cac0b887550e2b01a63dcc70473753ffcc243d33394cc64b4c0" - }, - "finality_branch": [ - "0xcc01000000000000000000000000000000000000000000000000000000000000", - "0x10c726fac935bf9657cc7476d3cfa7bedec5983dcfb59e8a7df6d0a619e108d7", - "0x142061c4bc3673bf774cb8c7b6085057bd0ca85672b43afa2d9581b0b6a44e54", - "0x48b8cd8ca9d9563e30c1cca2a854cd7f75eb4cb013d10809b3138a72d94ea0c5", - "0x9b39523d05013ac7cbb9f43e5d6f9dc033b12aa1d6d6edd994ddc4f5efe7be9d", - "0x066c9aa26107bc8cb28bc73e518da6cc865ec1d67516b6ca24663b6b7ae3cb21" - ], - "block_roots_root": "0xb15aa2483811d8c5616cb93710f4fcb809d97443caac9de163f943a30f385db6", - "block_roots_branch": [ - "0xf7a43ad317417daa4c2a1e93c54895895a824ef1e43320eb44eab16673da5a61", - "0xe4b8d640660f765c2ef4dc886025dc8e54c6e70b66192582f42837ed5e9d8d41", - "0x841f113dc81e76419b6cdec8b0cf2fc20f9381492ed3c79e9b49179b4d3eacbc", - "0xeb5fdc4d8b5282b653ecbc9caa93bcfe482f6d6a32cbb0d9eb011bef947579bb", - "0x1f328cc5640efb191ae6aa86223b1aa9d083b26ac3e1fa3c071327bb09dc5727" - ] -} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-sync-committee-update.mainnet.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-sync-committee-update.mainnet.json deleted file mode 100755 index c445bfb48a2..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-sync-committee-update.mainnet.json +++ /dev/null @@ -1,563 +0,0 @@ -{ - "attested_header": { - "slot": 4063296, - "proposer_index": 944, - "parent_root": "0x3e8712719bae71b519a25b7eeea9b412acb882ba6bbeeadc596b1682838cb6a6", - "state_root": "0x16add3b722d0b9075e7a3fe9cef6d237698053edeffe1b95f5b59a31f1bb4f1c", - "body_root": "0x724f1d72cbacde14baf82d273d3c4eafbbda3a56cb0f641cbfe76a426657327c" - }, - "sync_aggregate": { - "sync_committee_bits": "0x9fffefffffbfebfffffffeffffffbfffffdfffbffffff7ffffff7fddfffffaffcfeffff7ff3e6ffefffffbfffffdefbffdffffffbffffefffffff7ffffbfdffe", - "sync_committee_signature": "0xb2f86b054283455ef620757c13531ef64baaf8899527864aee1b86301c62c72b6c979865579e04880790c1ea418b53a717d7b8b85c70fda1760b2436ee04a25b13a8906d6aea8e94facef2444f33e4d5b4e91439adb981900c253186e742f1ec" - }, - "signature_slot": 4063297, - "next_sync_committee_update": { - "next_sync_committee": { - "pubkeys": [ - "0x936749ff47e5be307546564a5a4615bd8df52e2590034b2db19846939af3595a79ccabf0f6ff52ca46b9a1de3efd47a5", - "0x93fda62b785757b465e6f396f74674d5b95a08c938cf694e66beed7d2f317a4c9d736cb54d7c221d61e8cb3d64dca3ab", - "0xa39e96e33076fbb49c35a58b6e386d22fa7378337bb8b0d47699264f78e5ae8dc143f1f6d5f8b371deafc5c875adb60a", - "0xb5f69b7614fe07889b58142d7b438186d70214ff4cb209b6f271a3bf2bcdef5e6f1c7e95dbf5f2785aa471f0294cd029", - "0x987dd977d6b8d27c4065b61b3c078ec9ce3871fec02844ed00f5ad28c42f9cedecbe830ddd19e11a5c879b01eb0f8f80", - "0x9969ab62009b6aa81734579346766937d22ba73c008d24bebc183d1b3d3cfabc90b47f41b29bc6e23d70165594c2e774", - "0x840ac0e104b22eaebcaa1e49be43689f45434a6c5ddb71eec577323f38836ada5464b317fa3862773132166f2ac0a536", - "0xaf96a83f97ed0696fd29e59daa24e1857e16371f67089d08129f9c236753ea68c93590dce4d32c9e9818a21014da6f0d", - "0x8779a0376579008d0daa99895f548dd091b3abab37e91efc9cabf08835068c983ab0927e7c8eb0396eb83a5e0a713c56", - "0x99289672bfc48d2fbfd51a32d0d7f9d03fff37b8269ce45cbae1e9a091ee3983774d053efe8eae2f2d3f22a9eb532457", - "0xb60df25a7ac1ad14aef7e8809c4bfc190b715f94f14b0534cc2e4015ff6c322883cbdc5309e05d67dca4bc641c69725a", - "0x8c22f1f2a530879a93e744397fa6acca57b01fb62b62188ffa7487464815c605e1520ff4bb18e832753893649ab80d62", - "0xb3acfe8f25eb5153b880a03e07760f7fa30beca475843581b4878ac0412cd2038117f25a48c152e6d60ec16e4b1e9a45", - "0x8163eea18eacc062e71bb9f7406c58ebe1ce42a8b93656077dd781c2772e37775fe20e8d5b980dd52fdad98b72f10b71", - "0x8100b48ac2785477a123a7967bfcea8bacef59391680a411692880098a08771ff9786bd3b8dfb034cae00d5a7665621c", - "0x83bbd31e799ac14686085868e8ea7587c7c7969c7015bfe45fd8e3a3847ad5338005f9cdf58396b2ea833c4af98bd9ca", - "0xa59249e4dfb674dfdc648ae00b4226f85f8374076ecfccb43dfde2b9b299bb880943181e8b908ddeba2411843e288085", - "0x9793a74fa578ace75b083578277a1ae8766d41a5c508b0f1135fb97dff1d0826002393a7276b18cbc4b3c5671360ce0b", - "0xa734a3c947be4c7e6704639d4400aec2ccf5f1af0901b41a29e336afb37c53bf168774939ce51f32d4496bce1a32e612", - "0xb96a11048c7c327709d52e72e6f6ed0b7653329a374ea341ad909311b5b303e5629d6dcf11dcdb195e8c7592ceefac21", - "0xb3b7af9258af054362d461a74fcfeb6dcf3a37b6e33b6df32f8317d50d8be8e1970818a6e41c8232b89e1c8f964c6c1d", - "0x907c827a4fb5f698bf0e6f10ca07741c5b8e3ecb26aa53f938ba34ceb50c01be80c4afc5ac4358a5fda88eadea0cbe73", - "0x84173aeaf3d96368dc7ca1ad5e5575da279113567e5815a364a0356a720c5e08cb58ca1fdd891924f4871d3eaae5de40", - "0x92127d55535bf59f2b00511c82f74afe90529d4abfbaca6e53515d63303fe52b4b22383fb026a2a3f88e96d2bd235f6a", - "0xa9f261d19934fd26458421551e91f484d7a1522a7e7adbfb28f6371102a7650a5ae6efd49d9e33b03aefde647d134ce6", - "0x880b4ef2b278e1b2cccf36a3b5b7fbce94f106ed9fa2820cb9099a7a540a57e9fdeef5c0fb0a743049828fc2b8c46163", - "0xaace45334070c51cc8b3579598d4cd8cda2153bba51f56e3b1fe5e135c83ef70503c322756b9cad9d3cd28f1ecfc8227", - "0x97578474be98726192cb0eac3cb9195a54c7315e9c619d5c44c56b3f98671636c383416f73605d4ea7ca9fbeff8dd699", - "0xac5c01c51dac6ee1cb365c9b03f09906d9b7b9b4d1b73c44d9e8e06823025d7070f242898a975420bc87d6372382cab8", - "0xa9a591fdd18aec8746435eeead0a54bb88e055f55e91ffdd9bc663ce0bc2937fb296034ebb959d6adcf9af94bbd2f49b", - "0xb495404544c9335d5f184cd6873299a93174905fa34c14092f67d9b8545e71fab29545bc337e380dffcb533f7390e9cd", - "0xa3b7fabaabd4c2e555dce46add6c56851b68308c1bb7253576a9f32eda141522317b5c00a28b384ead3a880b8e7e40dc", - "0xae0beb452af7479134a7fbc31a5f59d248e8a67d4c7f73a0e30a51db9cd33a1da3f0ae947fa7e5983aea1343e7daf06a", - "0xa9d9a295590641b2b09d8473b50c0f6e036e1a009dcd1a0b16d84406763b4b078d5de6ca90898232e34f7f7bf147f61c", - "0xa5fe3dfb5031517bb8db0d5ade1e9f438e84bcf23221de003b03d2a2f4ea97629e81c79abc3769bdb8c69a512c189b91", - "0xb614910b247c6ade31001b0435686c3026b425b9bff80b6c23df81c55968633349e1408a9a5a9398a7d5d6ed5d9d3835", - "0xa19e7db50604f6b82cc28bc97135025459c8eac107a1c482919df10b8be2e4f24fceb93b963c0b8ac9f402e2f6ebf387", - "0xabf7da952c9d8f75fcc67fa7969fac0b26d4dc3e022961ed674ce85d734f11620a950fb1fb0ef830fba1d8b5bc3eced4", - "0xb382fa28670a5e14dc954b2db8ace250c73df71ab095304bd8ee28f455ab26cc54f82775a831428e110d1a3a2af709bb", - "0xb284286dd815e2897bb321e0b1f52f9c917b9ef36c9e85671f63b909c0b2c40a8132910325b20a543640b01dc63b48da", - "0xa2b1ea43f51460b3cb83657b4e296944658945d3ad6ae7b392e60f40829ba1da6a812d89f0380474578cbd0ab09801ac", - "0x8b886448cbbbeb40be3e71ccee251632186dccb51697f69eb5c746000b4327fd85be3a58fbd49f1df642a37f6388a8f2", - "0x9161ba220130eea190932ecdad9f114e385a31ec51c71cc8de451ffe5e75abcda37227c6a77f7090d4d8bbf134421bca", - "0xa24d05b51c7c128bb49979cbd9019e6618545d95275a44b5c3d1d03e71bf2ebffdf43fff50c30846ec27d279043cef4e", - "0x8cd1c73b7fe915e7169d351f88ade0f810d6a156fe20e4b52c7a697c3d93459e6d6c2f10dc1c6ec4114beae3e0a8c45a", - "0xb95e3032192bdc064306c683982d885f0ded8b907a532f15526a257ffeff2c8bdd7a2334c10d74b1484909b2e3ae0e47", - "0xac754a42f279472760bd36dd0cf36f5ec685e7fc2970c275811a70cd05843f94fe21745dddbd54135144edf1793aa0cc", - "0xb26b4d483bca73d3f3a976bb595a0e40f9a42094e0febbad3a1874934be1939a1b362ee4ea14a4f5cbfa9b1392796a12", - "0xa841594e74b66935efd295a6c06e2be03cc8c187b277cbf5cd2f590630d4812801ad55f3e502736d126441a2f22f1867", - "0xa845a8a3299f8e5fcf72358521a114c6077251e62ff6a885003f7281b0e1ee33715d9ca0b0082fbf7cb9d452d531c38c", - "0xa7b86e4f1366da44fd59a3ee68018a99c23ba3588789463bd88b0177a9b94030b58cb879a506e64421af966f261eaa86", - "0x85822227f6a96d3b6d6f5cf943e9fb819c8eaf42a9aa0bdd1527055442b1caf672522762831b2dac397af37a1c5ed702", - "0xb455f751232de0a48440d09983f4f4718b6169907979c9f282acf7177ab5b1f338fe1f2acd8d0bee4b4aad61d0340839", - "0xb97b2f1b2d6d744f2322812825ea1cf91453dfe1bbbb2678776e40e7d0fe682239d0dc8053f94d97e5a9678232b7a71f", - "0x815f53751f6d3e7d76c489f3c98d2b49214938cac8c2b417e2d17bb13446c285fa76fd32a97e9c4564a68f4faa069ad2", - "0x8ed7790f87f6975e0f3e501901b0bec1778c88bf39588989014c5dda76c2163732e7e5703c9cb2c1a6144ffdac5dcbab", - "0xb6cacc458ca5a0f04836c5640d34c70cab34cb5c87df28579a0d5e2c72edbc092814bdbe902747ebe3ce36808d8f4dac", - "0xab7c058199294c02e1edf9b790004f971cb8c41ae7efd25592705970141cdd5318e8eb187959f1ac8bf45c59f1ead0d9", - "0x99365fe5ab8ea8bd768ae7181a6ba49b79d240f512ce309b02f09d465fea276298ff55b5b9cb5b4162a901b390606024", - "0xb1afaefc9fb0e436c8fb93ba69feb5282e9f672c62cbb3a9fc56e5377985e9d8d1b8a068936a1007efa52ef8be55ce9c", - "0xb37334c41a3456b73b61d0eb0777260af9c2e400bbec0e0c0fdb45c39ce0dd19f021d9760f35da801f20486c6be30e9e", - "0x95757096c132e7f6c096d7b93a5a0d2594d5e609b9f13c4a9f878e95a389fa1a111b185dc1fd8f7d98b737dcf8d2af60", - "0x8f71f8edae59d6936846d8b50da29520f69b339f574ba9156d3d5f0cd4a279d36bad7ca7eb724dd48aefc4ca9ce26bdc", - "0xac2c98a0ab3f9d041fc115d9be4a6c77bd2219bb4b851cbee0d9257a4de5791251735b5b8fad09c55d16eb0d97080eff", - "0xa09f11d2bc6000d12a42b545ddc29c1973944a39787c5f27c96d4f6aa0d9c8fa9c479f2ed327fbd30376df3fa5b7d2a8", - "0xaa19a75f21a14ad5f170e336a0bd07e0c98b9f5d71f91e784d1dc28a5f5eb6870a4eb35bb41edcf9e6efe982ae5c2c5b", - "0x92a488068e1b70bf01e6e417f81e1dc3bcec71d51e7eabbc53b6736e8afdb8b67d191940fe09c55783be9210e1cbd73c", - "0x95cf2e038c790ce7a2960add7ab44804375f04ec6829f8cc63793dfe9fc48c7471079f81b932726509394fd3d46a52e9", - "0x87fdca39618051c4b3f03c816b13df2d4cd4c7c564e3d8693dcb58145b7b3b3db7884b0125b1e84d9bb82e91bed8bba3", - "0x815922ad356f490910e8cc3b0f7d3934b5e28c09711b5151ae8329876670f3de6d7a3a298fd97b580ac8f693305afb21", - "0x8bb4d08318386c91a0136d980a42da18c05743a5c52a861ce52a436e66a8ebe472dac7f7461db32ea5da59a23e9bd6c9", - "0xb0053550040ab3a3996cba5caf9ad5718867b5f5df273ed8c6520761571f03a94e50b5f8a6a8c42d725383cce97d3cae", - "0xa42c46a7e617d78b12053d7783f0d175fd9103db06d0c6982b38893a20b72fd8ad8501eacb3d47be06fd7c3ad89a8159", - "0x838ff6630dc3908a04c51fb44a29eca5a0d88330f48c1d0dd68b8890411a394fd728f14215482b03477d33f39645dceb", - "0x8ba45888012549a343983c43cea12a0c268d2f7884fcf563d98e8c0e08686064a9231ae83680f225e46d021a4e7959bb", - "0xa59a59db246f981e9c8e54aba52898c714d9787fef8969a6d8677fe6dec82950ff22a1364393b579f3e596cdf5bcd7b1", - "0x8722f3267a945f7123c1df8b6c2122456d81fed56e6369ba726b023c01c1f6738fc12e506e260d99e448fc920fd5e5af", - "0x89d356593ec09d838cd89306ce83c060ee797bf9eec8523f581cf263925699ef0f7161a790bd00bb09681534ed05ac82", - "0xb97fb8ebf2ee1bae5914cf96e5a07887ba41e712530eb2096ace318e989c0ad93060cfcf40507d927af6c7e945bcc289", - "0x88015bec478fd3ddff72efda0e8fc54b74faf804b0a3473cca38efbe5a7e6dc0be1cfe3dd62b8ac5a6a7a21971dcc58c", - "0x860c0eaee51b7de26e99033f352aa09c093943b59237f1313ecc35b0d711509bbe9f939c4bd646deb7de8103eea9ea13", - "0xaf9d13103868c854821ba518907b067cfba025d739125f1e9cce0a04fffc3a2a1f25506c1209a0cfe1d6c1572c229ff0", - "0xac7983d50ec447b65e62ed38054d8e8242c31b40030f630098ce0a4e93536da9179c3f3ae0b34a0b02aad427a97ee60d", - "0x8261f7e644b929d18197b3a5dcbba5897e03dea3f6270a7218119bd6ec3955591f369b693daff58133b62a07f4031394", - "0x8fa2d7b22af8e6b82679ebdfa13efdcb34289a554653ea6c1b16efb9f957f7fe64df787e7b03d8cdc8a732b91c916bd1", - "0x897eed8c65712e9b1ed8213abb85a6252ec30ab47eda4e36aeb8a72447ce7972861bc97957bc321714328c64af27544b", - "0x998c9ee20d33f96a2388b1df642aa602bc8900ba335e8810baab17060c1eace4bc5203672c257b9ae750008b707b0aa1", - "0x92378adc9d56996ce8ecdb9ed6510affccbcfd96712a23631edfd6ffdb1469847aa447db6b2bf61dad416ebcc5b7d1a7", - "0x83fc998e050cb1004fd016c7dc62885b07a95fc9b219fd6fde8ca2824c647f331f6b18ebdbd14569b906cd1ca1066189", - "0xa87c2f13f2a824b7e2c39cfb63ca7b94ae6a11ade0c6b8e83f5092b933fa8b6157a5d2f09c23081f49d35cc85f5db36c", - "0xa89bc7548ea245ce9556eeee3fba98a3256f87499f54a7c5eec0c43b9fb4ef2fe8f6810867ed0df814a88ee100c245af", - "0x8d52413f981bc611427ad0534d25e914113d0ebcd6960aab6421608bec6648b89ae4b2ca2153c57d3cf4f1f37212aa5c", - "0xb0a4c136fb93594913ffcebba98ee1cdf7bc60ad175af0bc2fb1afe7314524bbb85f620dd101e9af765588b7b4bf51d0", - "0xb7ac87da14b783914ab2e914fb7b536893b7a650cdc5baa1f3b4aca9da77b93a3336671335250e6467a8cd4aa8dc61e9", - "0xaaeb0005d77e120ef764f1764967833cba61f2b30b0e9fed1d3f0c90b5ad6588646b8153bdf1d66707ac2e59fd4a2671", - "0x8a60e066b13eabb372067a6b08704f3b6b98c0d468942738768127ebfcf122aef0ae2303f361c6338010fd371646769c", - "0xb7de6d7a4afb05984dce153e5570b104338265e45c8f0156f4d45c458f47add234a479e01c02d3c1817c170b5b65b100", - "0x983cb6bbfe83bce8326e699e83fca01ea2958c09808c703cac97a0ea777e5a5f3f5bba9169a47732de7459a3c7af47d2", - "0x8db19f6dd3789df179ab606508ca7e3da7967ad4340f630bda83df54c197d6bd3a14980c87fe10cbced7678c0c300ef1", - "0xb4e6bb207e08a1e096f6b27a5a60effc74fc8db0b6cdebc9ddbe88f434f4c8e0bd7fa77e015cc309db0f0922bd05b3f5", - "0x951d69f32685615df304c035151bd596d43bc3250f966e0c777544c506e3035d031afa4a3fcca1b85c41a4a041aefc01", - "0x942bee9ee880ac5e2f8ba35518b60890a211974d273b2ae415d34ce842803de7d29a4d26f6ee79c09e910559bdcac6d3", - "0xa0e68d24f784fcb2b71acc2d5871285623c829d0e939146b145e04908b904468a67c07a2f156e6b17bf531adc5777c4b", - "0x921da028f26a61a034f5425d6618eeb61adaa8ff10141bd65ac970adaefd3737a4bbd77d8a7a90cccfca35b0f4d585de", - "0xaf6911edd6c7ad30f905a0a3f78634808832fdeb4206b006934822d673bcced8e378779261b3c4b772b34b8871987f57", - "0xb044857d879d06e9be5dd70498b27a20aee758ef829d37d0ea12b92aa84b9d3c6194205368014d942ae0517cf6d0e201", - "0x8f90e72a54e6894d511061957162e753010812346afd4d90cfedb678b99ba1aacf2b6bd0e49b4b0e684da8082a048619", - "0x8317974fb1bdd174c7ef81a2a6478f887f44c1e8680c21730974e5c440846c4d43a76a3e90334b39508f507163e2ff8f", - "0x976eb5543e043b88d87fda18634470911dfe0e0cabab874ca38c1009e64d43026d9637d39dcd777bc7f809bbfc3e2110", - "0xb53fb1956a2a34a840de4ff0b5b1e0e2fb78a21ac8edbce6be6c26a4b4de6d37e9dce799110a802a344e8541912353d7", - "0x85bca2f86423a09014b562f7dc613246bedffdcb3aa41fee02270c13e6b00c8d6704dcbfbafc5997df6a90c7fc08c29f", - "0x8bca3560946189e4984126acb42153d8dad0b60e7f86518b55ea9ff7c899c9ec12821850943b6adeffbe9363bce4d217", - "0x952a95612aecce4321d2c17aabd2fb260b1cb41df5f76f5b82b46cf818d7a4f18e5e2944cddcd2280a993c0af4f834fe", - "0x9722c1079db7e2e1c49756288a02302b43b8fd92d5671585ac1ea7491123742a2744a526c12c9a0b4c4a80f26342a3a6", - "0x824c8a1399ab199498f84e4baa49ff2c905cf94d6ac176e27ec5e2c7985140dbaa9cc6303d906a07ab5d8e19adf25d8a", - "0x94bbc6b2742d21eff4fae77c720313015dd4bbcc5add8146bf1c4b89e32f6f5df46ca770e1f385fdd29dc5c7b9653361", - "0x90f7fa9a30d9f2812a20db97b3d03962a5b59719385c1881c61009e4c049809efe378b39cf74b64daa981358edd691de", - "0xa4632399c1a813e41fb2055ef293466098ea7752a9d3722d019aa01620f8c5ecdc5954f176c6c0901a770cbe6990eb11", - "0xac79f5491dbbd0eb47669225e781f94b98d04947cbc55baf287365831c100248bd0b39c911ac09b518715ba1ef0602f3", - "0xb9574edb9567f07f85c7c2e6ca6c02d90ad7c7b87d49796f1e2fb7240ad071fb755cf13ca8678668a56217c62df168eb", - "0x889a5cf9315383bf64dfe88e562d772213c256b0eed15ce27c41c3767c048afe06410d7675e5d59a2302993e7dc45d83", - "0xa0b3dff15982a38a2f56d8c6cfc5c5543c045bf2db24571d23387ccab42abe2756f34d5f0bf6a426bbad3c358b8bdb00", - "0x8009dff405aada0798a6cb7f418f73017d7a569a7576aff51348b15913a5e639dd232657cd775cfa0dd811ae5e301241", - "0xb31949c4a21181a54928f25f8598ea3dfcacab697a5653beb288d218d312133e5a93f434010ffdab3f3ebd0b43b207dd", - "0xb46f481155df4c4d576e5d76f1d4054e1129cc49398533ed32d0f681701276cecad4759e47b818f20d6a087989449529", - "0x88158d759eafd2205c770f166829fd61e8f17b2c13f440777eaf45f4d88a6e2028bc507680ff435882d5fb462f813735", - "0xa922d48a2a7da3540dd65bda3a8b5fb1f1741604e2335de285ac814c69c40b5373d92bc1babd3e4b2d32993f251c70b5", - "0xb7efcb232d3b639921ce21e80744c293ea77e25982b609e8cc82bd3999a734ca04ca43f41d9c7c15d162e0bbc3152495", - "0x96b1c82b85cdb8a7026fd3431bea9cd008f0261ee7f4179f4e69a399872837ab836a14e2dd45f5448d54800a4ae7c7f2", - "0x8295f613c162159f368340ca0fc2fd7776f7ad64eeafbd132bd3be1f1c30b5fbdc5f107f12fb0cff15b12c08621f457f", - "0x89e3ff351ce4f0d43cbb6385bac30b37431b31c7c073bacedbe0a60af3dd372aca672c6c4b4d05d2c4b7a040e80f3ef5", - "0xb075db32979df905cef986cfcd6db823ac21dd4013cecfe088885390ff8acd18d76dec793b80db5f7779426127daed7b", - "0xa18f4464cf5cebade8ee280fa00e0917cbf1743aeb0dacc748ab68773b909e30dc60f40fdef3041b5f082e650985f7a6", - "0x8fb51e3ef3c1047ae7c527dc24dc8824b2655faff2c4c78da1fcedde48b531d19abaf517363bf30605a87336b8642073", - "0x93e4d7740847caeeaca68e0b8f9a81b9475435108861506e3d3ccd3d716e05ced294ac30743eb9f45496acd6438b255d", - "0x946d585d7aa452d37a8c89d404757c3cce2adf2410e18613483c19199abd88f7a12e206f87a43f6009e42f4e31ed20c0", - "0xa4cfe97f6e61e45577ed6ce6eb7d1d9aca9e323b79b30736b407000555bf3e2ecbffd6314585b09000f09ee8381903af", - "0x87c5670e16a84e27529677881dbedc5c1d6ebb4e4ff58c13ece43d21d5b42dc89470f41059bfa6ebcf18167f97ddacaa", - "0xac7e49f2059e99ff65505742978f8d61a03f73f40141a2bd46fde5a2346f36ce5366e01ed7f0b7e807a5ce0730e9eaa9", - "0xb471c72bd2971353f4b44248b8e6cf5316812861a88ccfc20fd0d89a5e010428c387228b2f6f14c12f79e31afc9d0753", - "0x86b3a4ea9b1fde00cce79d5ae480353d60cb6ddce363c535bbbc3e41a4b8e39fcf2978eb430091ae1b10420d43193971", - "0x8167484b6a9bcbdef21464cee959a7a6aab5ac92ccc46214f4a2ed520cfb4d4de8917f9b9bd6fad71e66c17bd831eeeb", - "0x86ca8ed7c475d33455fae4242b05b1b3576e6ec05ac512ca7d3f9c8d44376e909c734c25cd0e33f0f6b4857d40452024", - "0xb49379bbb9f954d2ef5574199607bc6b3aa2cc3b48dcc3745cc77406bba2a394929844fec1b87c4ce65cd0ca0f83062d", - "0xab6366a7c6da8ca8ea43a3479e50ecf9a1f3b20ec01b8eae1d2a21ba2223a4ce62615836377c6395580a079c284947d3", - "0x9175ec473efbfaa029aadf1584f986371ecbeccd82ff6a52d1f6c66f51d7395e0ad67a5e8bef0600ffdb348978913e6e", - "0x8cfcdfa192b17321be4e447204e1a49ecaadca70a3b5dd96b0c70ab64d1a927d1f8c11a7e596367e5fa34e2307af86fc", - "0x905a97217fae8cfdc4a006b644e91b097df28e02da2f19f77e18f4b0c4aac2538ea83919a722eee5c0ff315a1daf3cc7", - "0x94b2d97448b452a986c039df1cfd651da59249b649182941556018af4ab61d2c6af82a29e69599153316f9b262efbcb5", - "0xb0eecd04c8d09fd364f9ca724036995c16ba6830d6c13a480b30eb2118c66c019cfdc9dacce6bfd8215abe025733e43d", - "0xb4d07d50fbc9634e5f4aeb884974068ea6b94e67e4527207f5f9c41a244943347d69d3c73af74d8de9ab3659d06c6d6a", - "0x8e54267871d8d3ce2a080e48786be3d97e5fc9404156436dc2a37bf05a588470b7656383bd79d58746d1667ceac54344", - "0x8277508c9aa4d1938c83b48d05fe3a440bfb50c5be79b30da1ac1853d19ee062797be19521f94b038cb991b1237abc59", - "0xb4aa92a60de61ad089cb027ef19a211c720ec0e51743b1166e3d71bac08a9ffff2f0687e250c6a7e1db866f7c4ae8f29", - "0xb9299f950db8cafd236a17f141cd2ea9ff441730749bab3571211d207ccafbf5a3990dc137400c405086c4d2879ab91f", - "0x8c38ab2a9558ac41c6ef736a5560e5960102e92f710efac3f631367a3f6d7227e0813579f349e661116bb29b2163b296", - "0xa5c11337eb91ce0e9b6d61bbdadea0a063beee1bc471cc02dc1d81c5dd2095315c400cbc6c33d23c77e98bba6bdf5439", - "0x8d3cba4d10f94bd3406a341c903ad144cfcfe6b61678d5c03084a56b4413bc30bd20d7a9fd5d839dbb565cc9b2aa99fe", - "0xac9f0b44105cf77ad721b97b0f04a37fddb2bb62c345b0d22a29e2870b8964d7484aad30e454c74608ce9901043501a5", - "0x8be4830a391aace561decdfea6aa610696d292a9e6b56448c6a590027df9f6762668671775272bac46ea335391ae157d", - "0x8e662149e22ce32383461ceb489b912f3c6320293d6edf61499164beaab7a265ffb9de3e0af6c95ca824d800718e1506", - "0x88b49b1130f9df26407ff3f6ac10539a6a67b6ddcc73eaf27fe2a18fb69aa2aff0581a5b0eef96b9ddd3cb761bdbbf51", - "0xa41cf5d678a007044005d62f5368b55958b733e3fdde302ba699842b1c4ecc000036eda22174a8e0c6d3e7ef93663659", - "0xa663c57b72e8acac40127fd3af579dcf9aba05910b26ed1155888543223d6558ee8e1c07f0a0e634e532ef6c5e9cf17c", - "0xaa103a329b699d4102f948101ce5fae27226419f75d866d235da8956f11367e71db5c0a179dd63007ed53f7eec333aaa", - "0x86c53fc078846c3d9bc47682506f8285ba4551475921fd388b96291741970c34b8de4210202e40d2de4acb6e2892072b", - "0xa7e0ddbae16e4491822684c0da3affecbbd17ef96c5c491ac093c6eb4e162fc7854c367535e296fd3d6265c2ed1210bb", - "0x88f0f11d0c2bf51453077cce0d3191931e73b104ee5c524da57e4eac0a88965f58b4abe423c1073f75fe3d3c666a209a", - "0xae8af784224b434b4dfa9ae94481da4c425602097936623e8abb875f25deb907aa7530bce357786a26ed64ef53d5e6b3", - "0x9408bfab1e7ac8b8b888c623bc0438b3a3460aff12436d13888315f496fdb808e9dc00894f272f348ed6aa475f848c49", - "0xabcf138d9363a73131f5bca56679d15606216bae1647c59c2857cb56818a0529c1b4b45e382273c993d62b7bcd552ded", - "0xab37a400dafa918d28ef43294b18dabcb4dd942261832f9839e59e53747c7b1bc44230967a9610b261f3abbd648e3dd8", - "0xa73b3c9d16f6c63659179b74b1aa5a0f4447c683ba38f9fc112efaccde4835e5b92c2f7041fa82cd90b2c4932704b9ac", - "0xa3fd9d8bbdc98394883022299fd9793e0c4f374d8e40d6ce89b2869d3173cb6a5476371d6095dad068ff217729f60af4", - "0xb4c5aa21659b3ae37fde62233b0bf41182fdd57c22fb5f47a236048e725a0e8636b9a595b13d9ecdf18c445f156ad7ee", - "0xb3a5497365bd40a81202b8a94a5e28a8a039cc2e639d73de289294cbda2c0e987c1f9468daba09ea4390f8e4e806f3c8", - "0x8cd49711b42af58a5aae75a38fea9ddc5e4183c467a3159b5b0629f01ba548513c577456d34c861911e85782e52c3b1b", - "0x868c13bb6bec7d56afd4e518f2f02b857a58d224fbe698be0e00bc178c1858e6bf5f0f7824fa013d5c8dd6f6e4147974", - "0x86f5a9bdeebd38fef93bf20a7451ef4c851d63f08e025a59109c68b46f4c61069a6c8c5fe90eb5af36943acc35e62f51", - "0x90c402a39cd1237c1c91ff04548d6af806663cbc57ff338ed309419c44121108d1fbe23f3166f61e4ab7502e728e31fd", - "0xa21477f0b51d73b0816b4b411c12db1e3a83698113ff9299ab2827e8da59baa85dbcc70afb831f5b0c038e0470562f00", - "0x82d09556978fa09b3d110e6066c20db31da2e18de90f973930f752970046f2df96b2a0248fdd833cbc50abad5c756026", - "0x92a346a321cfd73214be02f084ac2ff417900a1392d134b538099c92e7fdb7ba2174e9929c51b5e45bc3bcf718414dd2", - "0xac4b39bb8f0f62666a50574632764f8b6a1dc98afba5a5dad4409c920a0c0d5d2b5c2506c3a0d2f8727b7b7dce2ba1a8", - "0x8296f8caf58316af535def398a43357e48cb3b1e674b857eba1bd1b970da3dd045e22fe6d17dee4e9117f62ece3ec31c", - "0xa931bb29b6200899e8a8c257166400eff9888594daa1e37501390a1d219b019ed1b730d921a8f6d6fe62dff7b86ee387", - "0x8ae9585caa3c73e679fe9b00f2c691732f7b7ca096e22d88c475a89d4d55cb9fba3cd0fe0cedd64ce75c591211664955", - "0xb4a86fb5b0049718caead1bc036833a2caeb88e1afadbbbcb0cd021d95e1f33fcc916f0b97fc1b9226c37050e3463796", - "0xa15e0cb96a463ab81e661ca44c619b71a159680bbc04707ea5a5867ff38b15416e3abe55d2fabdab9aede1f157dd37e1", - "0x8b3f8fc8d2ec7a8db6ecadb8be90f55c1be4871bde10eb18c1773dc45dce042d93baa65b75c4688eb4125b6b7965c2d3", - "0xa4f964d672fa5579479e939d2d5dad6a5dac6fca4bcbf7d5ebbe7489f3809131667b41c3472addfe766d83202ea29c1a", - "0x86f0253db0918337e4e128e8056d2c793562c6b5cce8ba43695a02eae7df12605309722fd1e3b8c02ac513a4a49894a5", - "0x89cdbd610e7f57e86438e50874c3c7ba85afa63f5adcab9e454b5c203e4da65d74bb7cac5995a8652d10a6e438a1c2b8", - "0xaf2dc13a599c834b9af1b54a4fa675c0db92e807cab3bfc825f2c5571b3bc2e1c213cff941cc8b1080d894036f9f73f8", - "0xa0899189bba608887c6cb729580e570ecce9ca7107865ebd30def867afaaa250bac407c30dbee11b7ef6cd423269a8fd", - "0xa22542a4a2ebde18cc6aa29d5dace8b4f6720703f519610dcf01e671018392aff15728e3764730840272c9cfb074b612", - "0x88ce41025aa153a94f91f22e7b96f9342b5e0e1d76274fc70c4df7d08f66d9f7ac86e55a1c6e77693b8b01b2b38bf900", - "0xb76cb8cb446eb3cb4f682a5cd884f6c93086a8bf626c5b5c557a06499de9c13315618d48a0c5693512a3dc143a799c07", - "0xa7741c52498e0a24db3ce7699882de8f462a2b3ed5e9f77dc7200cbdf46b6cdd923b1128759909d6dddd64700c4c20c5", - "0xa211120e1bb3b10138df1fa58efb009a298b8771f884b82bb3de15822b1252124a68f3980f96122a775fb96f05ddc3d5", - "0x92ff79402d5005d463006e0a6991eaacc3136c4823487d912cc7eec1fe9f61caf24cd10022afdab5f6b4f85bfb3eee4f", - "0xa48b1031ca2f5a5acb4dbdd0e9a2b4e9add5ccfc0b17d94818273c8df11e825193fade364e0aec10f1ff91d57d03a52f", - "0xa0af9e02a7620e7ff119c3650d59d80169edd0ad452062b0e3e429c038cdaa4f55a18495e459367aaeb6a92c98003191", - "0xa61687511b627bde7b3977e9a34cb7fddc2aaa509a7b99b6b6c7b97133845c721e1e69f99758698d82cca265d8703610", - "0xb9691fb57be7aeb9d43995b8022051f199978d6ad635e1623a1bc1754b250fb8a94985cdc1e623e98767690a417e92a0", - "0xa6d6ef51a361df2e8f1d993980e4df93dbbb32248a8608e3e2b724093936f013edabb2e3374842b7cce9630e57c7e4dd", - "0x9820d98ef31bab813a0124ce48cacb9d99b2c1c625c41cb3d6e0b21f604ee215d5f37505c86766531dc302622d889766", - "0xa35ee5c2d7800489723c78008b495e1742f0542dbb487172ef438f60424c81aa41c2397095821248066140662133f6f4", - "0xae95ddcf3db88f6b107dcf5d8aa907b2035e0250f7d664027656146395a794349d08a6a306ce7317b728ca83f70f3eaf", - "0xa36dad4f7cba9f4cc843fe40f6240e1973a4c412cae29b4a68712598523cfaecb05272fc47d30772bf06906b5a26e282", - "0xaefc682f8784b18d36202a069269be7dba8ab67ae3543838e6d473fbc5713d103abcc8da1729a288503b786baac182d3", - "0xb551d1ce88cbf4ffbdcb0113a6e319513bd676d0078dd4e6a6f23ad336c1d0fb47a4e427bdedbe0fc8f152353971f81d", - "0xa11a7496c712734aec80738e30d2bf245758b34245076149854eb209fa6403be8bb0d4e515becc881b7f3610749260c0", - "0xb38e558a5e62ad196be361651264f5c28ced6ab7c2229d7e33fb04b7f4e441e9dcb82b463b118e73e05055dcc9ce64b6", - "0x9437ce85146202d3815df7f341a182678665dfb74b96006dc9d6acc16110d00b4a02717b702a765566457710ff5a7280", - "0x813bafdf6a64a9c40ef774e6c8cad52b19008f1207fc41bd10ad59c870fda8089299dd057fc6da34818e7a35b5a363e9", - "0xa5a1f7d42220d3740b3f353de74469fbd3a75ceccb3c84d0a87e43444855be0c51116a32a56cb1980294724d36bdda16", - "0xb4b80d7fbdb1dbf1567dfb30d8e814e63de670839a8f6ff434fe171416599fef831b8e978d6498851b8a81e0bc8dfb85", - "0x971882d02ad64729cc87251b49effc0b8db9880c25083bfa0ff34e7394e691288c7cefbb5cfdc76d6677ffb9da765dba", - "0x8144a5c583a61f809f6a9f5ba97dbed42f4086de71af955f5df5774f66a3581335926663502d7cc7b5129216da225f9c", - "0xb2eedff11e346518fa54e161be1d45db77136b724d497e337a55edfc896417de3a180bf90dd5f9d92c19db48e8574760", - "0xa6b434ac201b511dceeed63b731111d2b985934884f07d65c9d7642075b581604e8a66afc7164fbc0eb556282e8d83d2", - "0x85ab3c57517e3c348e7ec13a878b9303ff9aad78ec95b13242e087ec41f05f4a19366ae169fda8afec5300065db58f2f", - "0xa51f7858f1a7832b743a114127ebee1cffe176c988d4cb2348e45d4ebc52b43f80432c7276c6a5f8bfe39a432d4412ee", - "0x9332251b4b56579b201a2fd9e777e4be80aa213bc986ed5d1187cada9b225a7ed18f1f5bf68c2839bf330e00b2d63f22", - "0xb87e5f481b938ac8a481b775cc58be2a06604549e3c810fc4734bab76099e5c617f0243c4c140cb7dd6d36a6dc2286bf", - "0x83ca733849830cb8fc2ef469e7e464fd94def561ce49ff0aa352a6ecd0e52c7aefcd69ab59f3d1ed2d5b8536d0a7895d", - "0x8302ad0f2234535b55b975c5dd752c8a555d278b85b9e04e83b1db3bb2ae06f082f134d55216b5cacbf80444e1d0af84", - "0x8c627caf25eae6764501b9eff35aa90bd4f24952cad712aae20344579e83ecd104ad1f7915edc4f9023b17fddbdb4cd7", - "0x91066bac5341cead3d2cb168fde7da62b3dcf933ff5c1d379a4dd424b218c4e2ebcce038cc342e758795ecd4dbb8b790", - "0xa17e8874e2c59a2bdc31cc67095a271d31d5a4852ccf2a82eb7c457a3ba8c87ee5beb93a65a8f7bd04d10247e63d6b84", - "0xa15ebe9ab6de62a4d1ff30b7fc58acfb14ea54d7fa513cbcb045af3070db22bf9c1e987fa26c0c54356b9e38fa412626", - "0xa2ee6c29efa982e9b9abd3c5e4f14b99d5d0369d7bfc3c8edae1ab927398dc8a147a89e127b3324d7f4e3a7494c5d811", - "0x8cde690247d4831dfe312145ae879f4e53cb26641b3a3bb9eb4d590c56c11ece3cfe77180bd809468df5cddaea4f5ab1", - "0x8dc3c6478fe0150a2cc11b2bfb1b072620335516ad322dc5a644676a4a6aee71a8680eafb37db9065b5aa2f37696de07", - "0xa35fe9443b05f6632b080d0812e71142dba534b328f7d77e165aa89b370c158be708fed2ab8d8b3c60a3f83d6b1c4fd7", - "0x8266f9cc52944d85c50ba04d421c0ecb7ceac774f4485bca84115772ade238fdb5f5bf93f1f6c5288b3a44af177042e5", - "0x995194ca593943e772c58944789a30f8a91f20e58059967fa65364e4357b3483b0f94a3fe34e133bcf967859c5bd026d", - "0x83117ec2e506e292ff4759c270b3bca2ac221fc044ee7d3a4fcdd424ff0f4b961d6d268f7b9fce9ff07d29a4cb6ee3fd", - "0xb0a47515752c15e4dbeaf9ee27fab3b5c0db82f5c685e8f716fd7d8764164944340430fe3db1a5679e6ffea5a16dd919", - "0x91babaea18cf8f1e56feb0b89f0a3956c6469bb963d63312431057093b0ea0240a36abc3b7ac160e644e826cceb62530", - "0x9302bb41f741deaa5f2b6e3bca1427a6cf98b7ec2bf7967b7c0595efa258427323a022ef12f23426ff7a7c318462f07a", - "0x9022541f84e48b655e74bf3da484179e0e0040827fc71e777b68f19bcfd0e103d385ef957692e7091fe713561f38035c", - "0xa3b109249ac2900806f0f39338da72d4f2cc6d1ac403b59834b46da5705cf436af8499fa83717f954edb32312397c8d9", - "0xa94ccbf61b3a857744aa1540fc6d633afb8ab3c92d07fceef90a0dc54ecd2133490cbaac8832b26cf2f4b956471f36fe", - "0xaa744c552b5fc41e1ac6ca53184df87a1b7e54d73500751a6903674041f5f36af25711e7bc8a6fbba975dc247ddad52d", - "0xb544c692b046aad8b6f5c2e3493bc8f638659795f06327fff1e9f4ffc8e9f7abdbf4b7f6fcdfb8fe19654d8fa7d68170", - "0x94179fcc1fa644ff8a9776a4c03ac8bff759f1a810ca746a9be2b345546e01ddb58d871ddac4e6110b948173522eef06", - "0xa3a7196fecd25e9cc7cac79c35365676e48c7be1493df255676adff2209c0719f2190ceff3ce008d08efa07c244c11a6", - "0xb746447b0c0d7165f965672d71c318f2c1052a5ac6ebe320b14165c9276c839ed822a9183ea6e6dae63a4f826d421d65", - "0xa66d5b1cf24a38a598a45d16818d04e1c1331f8535591e7b9d3d13e390bfb466a0180098b4656131e087b72bf10be172", - "0xac1af27a7c67b1c6c082f0fe733046f8b155a7d66caa8ccc40a53ac5a55a4903d598b5f80543ea52c25205b02959f4f5", - "0xa485a082dee2987e528d1897dfc5ee99c8de9cdc0c955fc38c404c16c35b71bccd08770c93102110547381a2eb9d3782", - "0x900b9972180a2c8753f5ff49fdd2cfe18c700d9927b3c3e16deb6376ad6ee665c698be72d4837b94911a0b4c183cb140", - "0xb8454e8438641340b7fc8ac55b869abe54806f873ec0f2d8fc5425a1ba76ed8471425440621763b6e9d834b6e5451b98", - "0xb3ed0906d97f72f0fd5fe01cbd06b77d61c69f059f1e87a143a5630073ab69ef8876bc2a5e261d467a7f00f0050388d5", - "0x90a908b47d0c29a2d0e7e65a212d7e1788454062f46458c519c7f2ccd794ff21d4c24b91acf42a71a509aff6544f676a", - "0xb07d7c3f1d486f5657d5935e3d67403024ffdcf25da5c460fdadc980d8d6b931de623c4f8a3da5eb6af346193eb36573", - "0x87c2989f377be3751da3bc19172c5987d21c095cc3d851ee5120f67a5b3986d387b058688d54336d8510c49c6a66d754", - "0x8e70e4867d2731901d603928d72bbeb34b2e0339a4f5cf06e7a771640717421b4ea039c61dde951582a28c2ff152ff70", - "0x8336744d8ef3a3bb3e9ed3d6b83e08cafffc76b7438adedd3a7358b32acec0e73a4635aa3166362ab4e158e68576255d", - "0xa70132fe0c9580ecce2e3c0d4a531cabe48bbf6e7d1c1daf9ed2f315e81705bf1616b4cfda1c903b074e239ac6ab4c47", - "0xa978fb8ce8253f58e1a87da354f06af989b0bafaafec2fb3100bee272dd8664d2690f8ada7dd4817bc8b06ffb1fe23f9", - "0x94274299f0faca1152cca89282c10d00b5d3679cd4b7b02e018f653257b778262fb3c6c49d0eb83ce388869c283c3c05", - "0xb8233d647876eafe2746c10c1b41d99beea28b2627ea2ecb67a3eb0d166fadbceee34dfe942aa4ecf39e0d55f9d6d2a6", - "0x980a54f9e9d88a7ec08d04edbdd7c9222e99f270b1e978ce7140cc67e38a2e60cc1034dc5b0deb5b60e10697d3bc7295", - "0x8553bfd1a163df0d8bb1424383552b85a1c0d288dc1f46fdde90ce2d9be7e2688d7d06e1d6be06252c7099588d3488e5", - "0x8e8e48992d0394fcb9a0c56bbd3797400128e28fe395ad9acf582919d66d11a4811a7187897e60ee2ab4842800c8c36c", - "0x8853eff72fa4c7b4eda77e448e12bc8ee75f5cb0f35b721c7ee8184cf030a11e3e0278a4e76b326416fd645a9645d901", - "0x88e1e459ee5aeb8b36ed004f6d03da296101106fbe1b18f9bbf63e92321db51670c34050fd3b7dc56a4bad76403823ee", - "0x890def696fc04bbb9e9ed87a2a4965b896a9ae127bc0e1cc515549b88ddbcbc02647e983561cab691f7d25cf7c7eb254", - "0x95915d8ff2df795e7baac5433887c39ec6bbb9281c5d3406a4a1a2008f96c6f266adad4824c6c46429a158e36f5e1210", - "0xaf917d086e2e327d8d9e37ff85702536d7b15f444310d4aa832a61d850c7c3f09d31b3f5fd2a073e7fd64601275b6fca", - "0xa448516054e31866b54f1951b9a03f0a54fb13d938b105e3f67396ed3fbb015f290a37fa538baeb077fb4f9ac86c8305", - "0x8e58219fde5e9525e525b16b5332ef27fb6269e08e8c0bd3c20abb89397864b2c5bb55f5b6e03e8f0a0e0b04e5f72b14", - "0xa798a0371e8cc4dc42ccd79934b0db5a3a59f18a0ae09f2eb172596428fcb3f00312e783d6fd21cbc1610317f44e08cb", - "0xa8cbb85e8f38734d95b9d69346cbcb169c149b9801d9da46df5e27b5ff8d0ab7b870c83db3fac32a90d02efe5fb8fb49", - "0xa63868892ce200c7d82d7ae041db371c91ce03282adf796c8b1a1652732ec77add0945727b110339a80596c367c97deb", - "0xa0133deca5ae8f1100df8db69920b2d0c31aa21bd3849dbaf4c264eaeaec8937ab8f982770ce1ea17e0e258910a56d02", - "0xab88f81dc77f09a2b62078e7baf4b6c7503925a7a077bb30d72f4baeff8225039c5333242e325e824f7192d4d132b596", - "0xad83b3c5e9a08161950b1df9261d332dda2602cc68e0f5ee75bfa7e03bbef9edfb4945ca1f139df1bcb8affe8ae025da", - "0xa52c5a63b55a8001b6b67c5db4fd5e95923052f03618369312896ed9892d99354aebc0dee8c3b365bafa29e211a5c3f9", - "0x973dcf44ab60f55f5d10a8753ea16db9faedd839466a130729538f3a0724f00f74b3ca1de16987d7c6e24e9467f62bc7", - "0x991a7c93f06d50ec6a4340c6751b73eb5825bad02a954e44e1e2d424af928819ebbb590c6129ce35b3f1e908e2152f33", - "0xaa48afa77d5a81cd967b285c0035e941ca6d783493e1840d7cbc0f2829a114ace9146a8fbe31ecbd8e63e9b3c216a8c5", - "0x8c01b901e1067a89471927d911246a8b2f1284e93be9913406d7c88aba784694317e22a0a7635583dae7db45cafb73ed", - "0x942772b7c7c47d4e5957ccf1d6f1450070930af3e2b7eaab0dd7699372445df0cc910e6c0efcf501887dd1adabdaee23", - "0xafc555559b435c585b61096a34a15b8ad8722b2d3306ac8cbf158b46c135b293b08a5f37b109b138350dbcd1e0da9f8e", - "0xadc806dfa5fbf8ce659aab56fe6cfe0b9162ddd5874b6dcf6d658bd2a626379baeb7df80d765846fa16ad6aad0320540", - "0x80bdb82b7d583bf1e41653966b0ba3b4fec0e7df2ff08e3fa06fd9064bca0364263e075e1582741a5243bde786c9c32e", - "0x8d5776148c65e35d717da1902d74727b3bee21ceba8d337d77738932865f1b851e810b91346f705880da6cac63183717", - "0xb9d24940937b6e50a1797cad9ca58d4b2b2d8987bb8ec056ca2f397a2bdbb7af7939c0f4bcdf5a3b6fc80f65f9d535ce", - "0x81d6fc2f01633e8eab3ba4d72588e14f45b00e68ab887bdd4ec5e8558965db21189310df973837106216777b07fc0805", - "0xaf03bc1e94067741bca4978b9cf065cc6852090fde3aaf822bbe0744705ebda5baac6ed20b31144db0391309e474ba48", - "0x8cf8412bd48b21b008f0207b1f430ed96bc6512c3712dffbbecb66e493e33698c051b27a2998c5bddd89d6c373d02d06", - "0xb9c8a3894365780842a2096da49e48f7e77f05972e2acdeae8e8fed8ddc52a1e2fd754547087bc9292cf0c868155fbcd", - "0x85c8e7e1d7ee3ed366b530c5c9fe0a353f2907d8b80b16d00391780c04e3f7e060d433539780457732864e334039474f", - "0x8a3987de0131b7461bbbe54e59f6cefe8b3f5051ed3f35e4ad06e681c47beee6614b4e1fba2baa84dff8c94080dddda0", - "0x852ab89dc28bc26f6300800d9a3046bccfb3fe1491f29030f1389f40ca452f6b8a2f6d1541c1e523f1b59f8730823488", - "0xb5726aee939d8aee0d50bf15565f99e6d0c4df7388073b4534f581f572ad55893c5566eab1a7e22db8feeb8a90175b7d", - "0xa356e5b70bc478c625e32a38d29f0a619fdeb665503eedc304d1bf34562d4b6814dfc30aee5aee94ca4bc6394e412765", - "0x8b476b3b065a3b95a3d11ec60a749c2258ddcc5885bfb50b8a086d3fd1e49ff73e1dde733b8981c3d2d206aa0c87b09b", - "0x9171a7b23f3dbb32ab35712912ebf432bcc7d320c1e278d652200b5d49ad13a49ec8e56a0c85a90888be44de11fc11b5", - "0xaeddb53c6daac757916039e0992ec5305814e9deb113773f5ecf10355cc3723848fd9c55e0a6ffb6bcff4ad65ed5eb3c", - "0xb576c49c2a7b7c3445bbf9ba8eac10e685cc3760d6819de43b7d1e20769772bcab9f557df96f28fd24409ac8c84d05c4", - "0x8a277710379ba4fababb423026d9db3d8dcd484b2ee812439eb91b4b5177d03433b7a4486e43efbf2d2ce8ccfeabf323", - "0x80e30cabe1b6b4c3454bc8632b9ba068a0bcfd20ce5b6d44c8b1e2e39cbe84792fd96c51cf45cf9855c847dc92ce9437", - "0x804c021152c3304853941847e80480fdaceba3b9676fbe018268cf77d1a1856966c2f9686bb4d4aa0c4118a7e85f83cc", - "0x901f724ee1891ca876e5551bd8f4ad4da422576c618465f63d65700c2dd7953496d83abe148c6a4875a46a5a36c218cf", - "0x90fb5cac22a22fb8a6b619f1eacd95873be974d4d5d1f7080e523bb9b4b2644eda7340d780bd1ea8ce36407ca0410fea", - "0xa34eba9a41f2307891af1825ed501b74278f67eaef4bc57cae5c0c46202c19fa0d9a5dd8b91325f6c151a0644762ef29", - "0xa5c225b7bd946deb3e6df3197ce80d7448785a939e586413208227d5b8b4711dfd6518f091152d2da53bd4b905896f48", - "0x84888f2efd897a2aca04e34505774f6f4d62a02a5ae93f71405f2d3b326366b4038854458fd6553d12da6d4891788e59", - "0xb897fa90529458bdf3cede5ced3f3823dfb9b6d93b96b81429bf05e8f1a80f7c857d458045cfee58296b3ccbc4119abb", - "0x8117fbcf61d946bee1ce3dff9e568b83716907acfde9b352c3521cfed44158874af8dd5b3906b4a6b49da2fb212ef802", - "0xb6e9fe9fa3d4c833c3beae7f798f30f07e3cdf6f6c8eb8e2b70cad51b37af2549dc9f2e7f97f194e5897d4dedb904a45", - "0xa7555d66719916a2be7a7f0c8b7001aa2925bcb79723f78288f10831f9cec64923228b0e4b89dfd4342de8f70ce03cb4", - "0xa10788831a0cb2c3d14d8bc214d92bee6e2a9e92c423d2974760d84a6872a9465d12b628f9bd8a6e777a7db6f509b3a0", - "0x946948e31311703f64d34dc6faaae992e39b7ced92ecdc01df9761e3819a6db1266be718fdf434fbec912da37d1986f1", - "0x8675d210e67eddb3cefeed200b9e205679d36d8dcad70f09e678d8d1b3eb1059d12542f3aca300f384504458a881dd60", - "0xaaa18df4ad95f7443955accf8ec206f46d4d8ad9f1adb07b143b4225590917ed7ae050fc329d54310d3d0b198cedaf0b", - "0xad77fcac9753efba7a9d9ef8ff4ec9889aa4b9e43ba185e5df6bf6574a5cf9b9ad3f0f3ef2bcbea660c7eef869ce76c8", - "0xb201b0546f19c5db88df9c684cf55ed623bdb43927d06051bd595497df741feb1485961f64e8d3d1811d9e2e9e1e54ad", - "0x836075979eaf386ff6cb459cfd48fed171ae812b0ac3b38dc24dd8ca905cac1c600be717d4a0defa0a854f40cfaf8c33", - "0xa0617db822d559764a23c4361e849534d4b411e2cf9e1c4132c1104085175aa5f2ce475a6d1d5cb178056945ca782182", - "0x9831b8c836114f6d8213170dde1e7f48d5113974878ae831fc9b4da03f5ed3636342008228b380fd50d4affe909eb54a", - "0x97b43a6d1a47a1c415278344dba0cdfa952663a71fdcaf58d313c161e479ab5d1b980d8870055cc8f0d283bec8f97425", - "0x9340bfc34ffab8c28b1870a4125c559978ac2b278f76f462b5c859a00c3ba3426b176dc2c689096ad575b4cd4dbb76ae", - "0x88ad79a0320a896415e15b827a89969b4590d4dfa269b662bdc8f4633618f67b249f7e35a35884b131772d08025bfc32", - "0xa0230bdf83cd469c7248074bec535eba8280cfde587d7c63d307149e9626bc7642b4bacc9beff2d8e8f6ea398dc0ade7", - "0x8934e9a3feababa12ed142daa30e91bd6d28b432d182ac625501fe1dc82f973c67f0fe82d39c9b1da3613bb8bfe2f77b", - "0x87fd7e26a0749350ebdcd7c5d30e4b969a76bda530c831262fc98b36be932a4d025310f695d5b210ead89ee70eb7e53b", - "0x83a9cd621beecac8baebf7df4f7ee17bf4b70aac31df816ec3efb5cfef2dc5c0bf959c5227df3a7ef4c2b8d1e1b658a8", - "0x9529ea4a51324ed4ecd855faea43846a223da8cbb494e5854cef700ebbcf4d76119cef16192e6b7c51f82ab79371756e", - "0xb15e1b4ac64bafbc4fdfead9aeff126bf102fdd125c1c914f7979680ec1715fbeccf3dc35c77d284421ec1371ed8bc32", - "0x8f1d90034f998018c3f4b5947b40b139fcead2e40aa80fdec6a4337c60e9d5ff1923dda7f0b5b1731ff16f55027d41bf", - "0x86b706c5d3c5aca72cb23ddfb6452bc70dd3b1a98c8539a7c32f760778b401cbe90ef86c12d0468892dbcbd9a268a38b", - "0x9752561179783f336937757b619b2fdcb9dfce05aa3c4fce6d582dc966182eb85ab4ccb63e7e1736a7c5fad9d33cccd2", - "0x8bb51b380a8a52d61a94e7b382ff6ce601260fa9b8c5d616764a3df719b382ec43aec9266444a16951e102d8b1fb2f38", - "0x8097b13908662d245820f3b045d8c2c665fe9a054e9c661323924ec86dfa713b36b0c787ad4dfdeb979318810e687a48", - "0xa09b2a07d861e01645accfb088f7f9ad524186bd439712775459a60f8a1fbbd43ee084e4d6e23ffce06daa189cd1e654", - "0x941e2e3ba414a371a11c3fe92cabf688ff363da6230ec7c83ac7303f652a19ebc89cc494427c456d0c2ae84c72053f73", - "0x820cc2ac3eed5bce7dc72df2aa3214e71690b91445d8bb1634c0488a671e3669028efbe1eae52f7132bde29b16a020b7", - "0xb5222582ed6604b9856a48039bd643340f4bf1bf0fc805e8453a9eb7630d6cea1452d28536706d6fa3ec16617617991c", - "0x938bbaa0ba14597067ff4c0a7cfc1529c44160d6f61cfad12246526d84fb7a1ba964d3bbb065a348cf7a98356ee15234", - "0xa83371f44e007c708dc4bcafa7bd3581f9080a4583c9be88624265014fd92f060127e628de5af3c442a25f049c7e7766", - "0x8c17ccc763fcdf2ba7e27ea643654e52f62a6e3943ba25f66e1003fd52f728e38bfd1036c0d50eb3e3e878378bcc2e9d", - "0x9517cd84390fbbfb7862ca3e0171750b4c75a15ceb6030673e76b6fc1ce61ac264f6dd1758d817662abfc50095550bd3", - "0x936f7e20c96b97548fef667aa9fa9e6cfdc578f392774586abe124e7afc36be3a484735e88cc0d6de6d69cf4548b1227", - "0x908d762396519ce3c409551b3b5915033cdfe521a586d5c17f49c1d2faa6cb59fa51e1fb74f200487bea87a1d6f37477", - "0x8ec38c68afdfb6ba019204039c2fb49a35467058f561f626fa87314d705fd615a7b9966576052be1b3690028d3c5c7bc", - "0xb790669f1acb10911e520198795b259a18471cb3ac03f3885b4fa40626d414e26025790296fd078ef5c3681ebe4689cf", - "0xb659c05488f778fca3c918505d2d849c667471af03369ad9fa29e37bac4cc9caa18e749c62fcff22856945a74ef51356", - "0x97ffcbf88b668cde86b2839c7f14d19cb7f634a4cf05d977e65f3cd0e8051b2670e521ae74edc572d88201cff225e38a", - "0x9888c250b4b60306f4ecb1babbf95d0b6dbf6186503b2024b134478d721fb782d801bafd126cc3247bcdb1ee9d66de85", - "0x941f73b2138b4347ecafcc7b8c3d03f2a54dc49f580394ed08f22b0878ee7cb63d42978f1d320c09e7dbc67648c06f8c", - "0xac3195143035cdb4ddcd5f93c150035d327addee5503ea2087b1a10b2f73b02453ddd1a94d8e7d883e365f9f0e3c38c9", - "0xab6b47627cf76d9552c723818db5ebee7734542436b50ffe15b3a96e8e7a6b54f9a0965de78405e16e309193f147108d", - "0xb7c66da483b18f08344fc3c27bdf4914dabbcefd7ee7672fab651d05127d85d25ce363b0c338d6eed55c4e31f57bcb35", - "0xa641eaa149c366de228a2833907ad60eea423dd3edf47e76042fdf6f5dc47a5b5fc1f1b92c8b96c70e6d8a68d3b8896c", - "0x805c06e565ee67cab0cbccb92b6656fdb240b430766eade3c6b0a0b1b93c840e2b4f028601451dca135c783239463880", - "0x8528cf6ed82d9f729f9aee83c3ef763d85649d46019c4ca7dfb58d7824c2003f88ddb2bc5a40c4d78d86e68b675f4e56", - "0xac2955c1d48354e1f95f1b36e085b9ea9829e8de4f2a3e2418a403cb1286e2599ba00a6b82609dd489eda370218dcf4c", - "0xb043156fcd02b75dbe940c763fa8e8a7c7f6d74c1d5395db5ce544af3b6097eab61686950535a810aa95889ced12f74d", - "0x8e7d1dc7beb2de660b7da19ebf4cfef3ebb6a3d6f2f367e2dc91105653226e859137879171dccc586c10d9c4cccee7b6", - "0xa278bea51af1de8bbd2319f3a37ab14abc3bc0289ed31aae44f38897a7b24263a4dde1cb037e1441217bec0ddcf47266", - "0x8afa23226c47083bba80ab1be55b48c90c6629135533e3e4c14057d19febeba7f8e2cabe617b28ce1f0bd97a06972f66", - "0x9865218b0eb281e547e693055456d1d0c598bfcd0138dddb5edd5f5ff66cc2d52465f3e70c0f321246036d7ed8c606d1", - "0xa3a6d1ee35cc0ed9290a135086b32f136028b320650e1f3443434af7ff52dd74c546ffe2a1bebfc329f1b52cd72aca34", - "0x812d3ded3a3c9e58eecf13a29bb4cc13b01b2a0af322423a29bb0e4f6d9021d1d87ac4af7a2a6b88d34f44a8bc1b3c55", - "0x8d7dc174aa361d046cf183dd202cbc12fed780d7053f7047e11af9aded336318bf9928aab73ebfc81ca86f12007077b6", - "0xa9fdc2209bbf48970a404de3d803c65b11be96ab5a165183d05ed6477b3a0c633c3d6f0cb8eefb430fddb5b5be8cf887", - "0x83a798f47a4f62dcb8b531d463b0fd4a876d47a8ca990710290549255033c909de709471b4e823a60bf94d8baf8b5acf", - "0xa8b0bb9e1f8b0508c7d6e7382676663d27fb27e3f1c0e991a295e59498f4a5dbcc4cf89c73d3d587fb3b8f5838153885", - "0x80414adc7e0a9cb961b1f31682c33d8e01e3b8cf2aa2c2a911ab9b1f54d5c4bf92e18466cacf9b80333112ab015136d2", - "0x82d2b1053f6610064f838b3aeec585878f86323cac357c4aed054d87595c7734729a737b29b57940884ee839e984d612", - "0x91efdbcaad9931312d7c41d24de977f94d7f3f7b88090a1f72d9a097a1e30cc805c5ea16180f463022d9b26b8863f958", - "0x90ab68c372fd01bb210fb94094adb27296b7144d964bb1dd807ea8f718181747356b0f9db3feda78dd7a596209099ab8", - "0xb40a3bae2b08c13db00f993db49e2042be99cde3d6f4f03d9991e42297933d6049394c659e31f316fcb081b60461dabf", - "0x94402d05dbe02a7505da715c5b26438880d086e3130dce7d6c59a9cca1943fe88c44771619303ec71736774b3cc5b1f6", - "0x8adb748d5fa5c22ce4c76a1debf394b00d58add9f4e08524cf9c503f95981b36b8d0cb2dfaef0d59d07768e555733ecc", - "0xa129c9cf33df42b5a98ad98be9d940207ae154c715d3bde701b7160dfe45304679fb0481a4f9dde242c22a9849fc2d9c", - "0xb3180ded54610b1b3a2db7db539197ced6a75e9bb381d1f4b802ca7cd450f5418522ad2bee3df1956ed63ff1ffe95dc1", - "0x80e1dbf3296bdfa98aeec1a7560682165d13bc628061bd3257f345aa1ba13f8bd1bea14f117af562be22118f5a8265af", - "0x8d286e63f64a3e24c2e4c2b91bafb7c6a71d9438a2ffd7288c58ec6de9db6194eaf671b39c5a462c8658ad3cfce46f85", - "0xb4f4ed1bd274a852189719a8808a8f214c8386e844ca9ba13161b75d04c74633b1d8a758ce0b23ccbce8052494c81c3f", - "0xb1a3e6baed1cc37b9a67f38648f4fe365d23fb982027ab4202c3392d5459d7995264c2e9bb8e821a3e75e71390b6dc7c", - "0xabd7248ae069d3a3a45b0ef4dd5d7d54b62994e578ea20bdd3b7876596673953b94c5b109a6e4b953b517544b915368f", - "0x9377aab082c8ae33b26519d6a8c3f586c7c7fccc96ec29a6f698b67d72d9266ad07378ba90d18e8c86a2ec77ecc7f137", - "0x959675679fb41dd62595d8266e796834c1207dd70750e304b1ce45d3fc215ceb5214d6651fc97a061b6a570eba35b811", - "0xace7fda25c2fb7c18710603c16a0ff0f963352d1582a42a20c9f5603c66f485df8383465c35c31e8379b4cb2ec15b4c4", - "0xaaf15335f1fa2a187f24f3db7966fcda52c2859113ed8f460167538f5cde43429750349f9714edda0adb6705d401d27c", - "0xab99038a2a6f9228d5d7e67f47107abaf06af293586c3a6ab1adaf02aae373e3434ae3e26bb617302b8e3a7ce5107bd0", - "0xb3119de346a02c87743faa4a20fb90e7eac404a6f81ac681d593171cb29c5f79d4d5ab761b66ec71d4a86f43e0b4165c", - "0x89255902846cb35c706f6e8869a9122527afcf8a8b8f5f81497b5b71c6a96c601e7185acc78646e2a7884d148eeea815", - "0x8c26d4ec9fc8728b3f0340a457c5c05b14cc4345e6c0b9b9402f73e882812999e2b29b4bffdcb7fe645171071e2add88", - "0x903b9bf66c147ddfddacce63c8f12f62e45638383bf91b50e2fef29013ce54a3fd8c3eccc9b8961d91ca2920ba5b0c1e", - "0xb7a2c83971c4e4132f3fcaf3c4374872de67ea5d89814492309cf924520a23787401f9621681fcf526154e80849a7e72", - "0xb74f6e53b56856f88f8607b1c4e6c9e54aec15c5bb891e7bab00e2a13caab3b1d6529bf0d72d4ce99714b8cb8b973f1a", - "0xab8a8769c754008a7976b6799e81d7bfe97413d0a79b90715703c1f8f567675463ec93aabee59277121fc4df88b5c7a9", - "0xb34d4d2e15079e7e80fdba30cddf4fc0e6c9a61f7ab06a6ea0a4e55fd5bf632c6d72e021d6264d935439d321de883bb6", - "0x927c030d5a69f0908c08f95715f7a8d1e33bed5e95fc4cfb17f7743cb0262755b1e6b56d409adcfb7351b2706c964d3b", - "0x95718b06017ba9d45894867fd67148645d25d9db2229aa89971f444641ba9db4c5c6f0785f3b25cf2cd7fadaa6adc5eb", - "0xb30faf88fe203495aa268503bc82576f76a27f8bc8c4125b4c6f6e5e7b6880d495481cc9454713e0833317fa07da9b5f", - "0xa9ee291de5997232c68c9f6c3b568b05f46bfedfa18eb3776699d98cc7c6320003b7d862564d07fd28fc3691d1d28b21", - "0x8e54c7270d2c7041796f202e929ae921fd0fcdc8ef1e6eae7e67d461114fd45ecc7fb78247c072222e48d1292a12acf9", - "0xb7f146a357e02a63cd79ca47bf93998b193ce1174446953f12fa751f85dc2a54c9ed00c01a9308509152b3bad21d7230", - "0x8aadfcf3562f1c357068323352cb1745349a27a7362358d869e617c2410db747149b993ee9e881e252ecdd42fd75f351", - "0x8068da6d588f7633334da98340cb5316f61fcab31ddfca2ab0d085d02819b8e0131eb7cdef8507262ad891036280702c", - "0x89ab1e5c2565f154f92c9b3554160832d176613f1a2f872b6ed62ed925a33fb0b40b71b7443eaaa15099ab24693c8d13", - "0x8e9bccb749e66fbe47296f5dec33bd86e52987516263240f35ce9a212dbcf71348b60a016f830f2acd05482962403542", - "0x8fb74891a8642f25a55b5eda5818367aac2fdf9663ad1e3dbc0166b484c0cda581b243cc75131167f1afa9caaf6705a0", - "0x8027bc62b59f9f15613e38da74ccc71fc3eaee26f096d187c613068195ce6eb64176013f2d86b00c4b0b6a7c11b9a9e5", - "0x8658a15df961c25648fd444bdf48a8f7bb382d9212c0c65d56bf9cdb61aab3bd86604c687fb682260dbc0ad2dc84bf01", - "0xaf76d2de3664f45ed4024f1b944cd316cf758393232bb07bc695e5eaa7f04e7e09007f29e83f62ef6fa25d1000113ca9", - "0xa3c4269e6fdb75882f0bb83529388fb8e08d025d00d869a2ceefdbd38a060e59535bca43012815444cb84021787f6c7c", - "0x8784a8fa62e0ce23283386175007bb781a8ec91b06fd94f22a20cd869929de37259847a94a0f22078ab14bb74709fac6", - "0xa99cde5c7c85ae291c74c893e598cc0e6eb2dda2a81dbb504a638eb21dd2c41d6e5caf7baa29e3c1c32e94dca0d791f1", - "0x802f512bd4a97487491c0e07ab8a94d5580c72212032e34c42b7039b860a7cf8f1e2e24b7185b80d3ee00a9cd4c92903", - "0xb12fd5f747c5223c5150dca2728bb3a363c5bdade5a9d1415642b2201c51aa6bba20a988c51bb6452fee7e05a8586b42", - "0x99caf2cbdd4427666fcfb506bb6956772e058150b0638eacd5db2e8869c8565c1ff2c63f308bc3143874e0f31446292e", - "0xa9d47cb4c69fde551b2648a2444091502a56a778212ab544ac75cc1bd14d0f043f4e31de47fce9a890ef5428cc28dd41", - "0x94240350a53e7715c178382b174c4f918d35cde875faeda528c2f32073085c6032b47fcf00240dc264621041c105e0e8", - "0xa413befdecf9441fa6e6dd318af49173f19e8b95b8d928ebe1cc46cacc78b1377afa8867083be473457cd31dfff88221", - "0xb7c4e55e2b48ba55a71f72387475886e5b4715100e93cd2ae09582fd37e5646b54bd93fba311b65c842bd0aae1424bc7", - "0xb7ea5e0d3cfcf0570204b0371d69df1ab8f1fdc4e58688ecd2b884399644f7d318d660c23bd4d6d60d44a43aa9cf656d", - "0xa7c2174eea2b66b2a71cc8095fae39c423a353c7d5020ec2d0551317a66202fcf082c6119ba768755523fff49791bb4e", - "0x991e0fc7fddd0e316cf4bfe20478f10c15b8bbb618e6be52a5095e457ca52db8adc008f47d4624b6cf4f7d6c2b94a29e", - "0xa7d76c88daa3ba893d4bd023e039e1f587565d317609cc9ddce73f2d3c4d6d9facee20fca31c85322f10fdf15267fbec", - "0xb880555398668dc7d064a18ba82d574999a93a6843423703aa8e543fc196607239de7a4258710b85563f2889eacdd0fb", - "0x903f569a8de771406b9fd36384f1fea20d5d79374b8d9af24b4814f96c44739193662aa47be857543fa101aa70ab205d", - "0xb9ee3b7b95db0122edd90b641de3c07fbf63a4f70fee5f72051cbe25c92d88444314d0489a5ecdb1805f4f149f462ee6", - "0x8ee41011424da5e2ecea941cbf069ea32420749f2519434d3d8f9725ac789753404687a6745cffe4bd5dfc8fec71a719", - "0x8a978ee4be90254fd7003ee1e76e5257462cbb14a64dbca0b32cea078908d7da47588a40ffeb42af11a83a304608c0f7", - "0xab73a043ccdfe63437a339e6ee96ef1241264e04dd4d917f6d6bc99396006de54e1e156d38596ba3d15cb1aaa329f8f5", - "0x9439b663e4104d64433be7d49d0beaae263f20cfac0b5af402a59412056094bd71f0450bc52a294fc759ca8a3fddfee9", - "0xa53d2a4bef5f3d412fed35ac375f632eb72a6650efe811e2131a6ddcb530f88044f65b80b7d739998115b9f961bbe391", - "0x88e7a12a90428bb45bcf4b01442c11607433211fc2f9bee9545304eb66e0b4b5339360160bc782e185391385da7c5ad7", - "0xa163470735c16f800bed412bf0190d7c85cb2d3d588ffce245ec8e8d4872c756a109367e293caf4f5c0ca1ad31f8be5d", - "0x897d7a19b70dcef1af006df3365981d73068c81f18017f32fb9966599481496efd5f6caceef943b31c52750c46d9590d", - "0x90f4476224b64c2a5333198a4300ece8b3a59ae315469b23fd98dadcdceaaf38642d2076e9cd0bfacc515306f807819f", - "0xa8d152e5d94b75cb9e249230db21af31de4d4f3d4ef60ccbf2212babf69aed2a38435a993ee2f13cca410ad55a4875ab", - "0x95aafa379cc6a2b4bdd0cad30b7f0a47839952af41f584219ec201c6c4d54610eb2c04b67b29080acb8cecc5e7543fbc", - "0xa8795e7f4c4c5d025ead0077c3aa374daaf9858f1025c0d3024d72f5d6c03355ae6ac7418bf0757fe49c220acff89f7f", - "0x85e2013728a13c41601d4f984f0420a124db40154a98bbe8fddc99e87188b4a1272d20360406a9dbae9e49bfe3f1c11c", - "0xb380ee52038a0b622cd7eccf4bd52966573fadde4fe8f70f43fa9c43a5a99b3eaf58335a1948b561f5b368ab4e0710f6", - "0xb43fdb2ba9128fd24721209e958be7b9c84dca08387c982723f93ed4a272f933823ae084f1b1399ff6271e0da6f5aa3f", - "0xab2053c376c6bd113b89fdb2ae3b8401aa891135345885730c61cac7813f69ea7d906c531be752e28657f73af92d1f4e", - "0xb586e67ae1826a1cdd651ac785e4b38f8a0e042f103a9b7dbb0035626d5dec3ded04a4e2cc09e63b4b01aebe304e40d7", - "0xa86be58fef115445b909dffac6f51da3fe9214afd9c31fd564bb8f39b1dc3cb895b1222f2c63226b54b60b278ec45edb", - "0x8016d3229030424cfeff6c5b813970ea193f8d012cfa767270ca9057d58eddc556e96c14544bf4c038dbed5f24aa8da0", - "0xa8b593de2c6c90392325b2d7a6cb3f54ec441b33ed584076cc9da4ec6012e3aaf02cec64cc1fd222df32bf1c452cc024", - "0x860d581af35d522b5eb5fddd92a98a6b4cc483fda00820d1ce4530e07892890c096e99b33976ca3550bb900e830ad3b6", - "0x82212706111fb1cf5def02b5b0eb7ae9e6ea42b4c7a2b9fcacb7aec928326edb9ac940850dd933f2822f6cf519de0d50", - "0xa98f68569ced00cf2c9f85fe0b4bcaabed0652b9fbe438bb5a86612a0addb5975e3b98395f2a4788639c602cf21a8494", - "0x8600e2031c9113ad2a75c19872b5efef85765b524f74de98baf4efe4a75c6be563e9e19622388fbe9afe58aa6017b930", - "0x8e825c03c8409a3302266dc5f47fbfc381dfbafbadc37bd8d40f079ca8963d4c5ae6ef0d0ba6aef2d4688736f5f6bb45", - "0x8bff10f91b8c0abb6c9542588da17fa0118ffda4c82626a754887e333d7d69661b3ae4e400da15c49565f8d10a77d0d7", - "0x8421044f794a1bcb497de6d8705f57faaba7f70632f99982e1c66b7e7403a4fb10d9ef5fb2877b66da72fd556fd6ffb0", - "0xb504cb87a024fd71b7ee7bed2833115567461d1ae8902cccd26809005c4a56078617ec5d3fa5b29a1c5954adc3867a26", - "0xb5f32034d0f66bcbccefe2a177a60f31132d98c0899aa1ffff5ebf807546ff3104103077b1435fa6587bfe3e67ac0266", - "0x9604659740f6d473bd2c470c6751f2a129328e74e01b23368f692ad9b6cce0fe1509c3f82e9f01019b72f6bf3a8e4600", - "0xa6ae4fd03fbb4e2150795f75a241ab3a95c622b4615f553bab342a1803b86b1c1a2fc93bd92ee12786bf2de22d455786", - "0x8f142bde50abe4dac8e059003db41610436d5ca60d2dfe2660ecaa5f9628aeb8b5d443e1b57662076f77363c89a1479d", - "0x919b0dca4050f3304144debd653bce45768355d2faa698b99de06ca6ab8573a285764904cafc9262352c87d9287f0545", - "0xabf28b692bed19ee9152d5f8ade776f0a42a9762ea5f37d80f47ff219fc0a8ebe5e6eb920453e1ced3ea5bba19ae5be7", - "0xb67146b202afec0132ac0070c005cf664081e860339f8f4d45ac3e630dda05560936e646673e652d08cecd8d18fc64da", - "0xaa25208385573caee2a4830f09e1cc9bd041cdb78d3ee27a4b011815a62d0d2e0295c222480947ae427b1578fb5509f5", - "0xa35d9d6d5dd5428cce7616842203b5fa3721cb4b20f50c0113f138604954fe0cf214ca3d065b578f921054b9efe823df", - "0xa1c0c317e6e352e16e25c140820b927161ce5d2c4c2e10bca3057ba4d46b4f42ad7aba20de86dad9fc6368ea92695268", - "0xb9ed23f3f26fc9f31e1e30e8ae88482352fab6ef79a2eb8939dc78110580708f482ba3ab306ed6e09030653b9704a80e", - "0xb15978155af006d231888257c6e4beac0d3b0782bcbc99e61802a5c031252f05213c9ee9465e6816d9702e4a21cb9571", - "0x8c9fefe233d0d657349b7efcdc368f5aaead27071d224af780874751e7d241f6b88f7650fbb4133043b24bbebc12aa48", - "0x92f0bf3257e775c5c469cd9a43249421c9fd223996aeda09654045b885a512e86bd834b2947aef216b4d9dd5f8f2e9aa", - "0x81ad5baedeacae12f19cc6d268779c791ddbdbae859d218806cf887b91e83bee3472740b0736877c81c5c1969eeccfec", - "0xa54e104339286d3ce8271828fbac20f6cf7afd3b72d9b194b7cbaf65f6612416117be492bf4aa88faf6ada56cf4b6462", - "0xac2c341f0054876d28393d5125c84b913e754bafdadf769ded764b8dcd4b042b5dbc19b6f40ce8eb45edf7639b3d62d3", - "0x8eebee05702bf1574b12597b72a86d5badef064879fa9d1b9aff5ab75e5c71d81d8bc404f2614085855d6ed87f581238", - "0xa5a07bf219432e9c80c38596c93560b49c7de287f31e30b7a06fcb4d15982add4a24085adbc5b753c462be989c64c96d", - "0xa3d31b20198f326eac488e88fc5b9171276d4934b0bc573c8b55b2abd26380d5296d5bbea281de91c0945f34b37f42bb", - "0xb928a1a20f078a50f9c67da1d909e6656c3980f20b96bb8d06c0cc42557ccd290ed64cd78f9c9ca090cfdb9327eebd89", - "0x8a0a4b295761aa6d2d1b988fb0c65b4338cc3ea48410cc673671ca029ba6c51fd4e101b54472eae93611faee53d4eb2f", - "0x935f616bc620ddcde07f28b19a66c996798792b953264d1471f686e84f3c6f125e2a3d3a7a535c4175973c7ed2e4bece", - "0xa80deb10bba4bc7e729145e4caf009a39f5c69388a2a86eaba3de275b441d5217d615554a610466a33cfe0bbe09ef355", - "0x8dca376df4847cb8fc2e54a31894c820860c30b5e123b76670a37435e950f53312f089a8e9bd713f68f59fd1bf09202f", - "0xa04016e9e13ad845763cfe44af4e29fecf920b4aa42f581715fc34fb9ca27776feee45c82093c7274839eef1838b10c4", - "0xb8a0003e949cf994b1bb25e270cb61358200c93b1c6f611a041cf8536e2e0de59342453c5a8d13c6d4cc95ed8ce058f3", - "0xa50ab79cf3f6777a45f28d1b5cdad2c7ea718c60efeeb4c828d6307b29ef319445e6a9f98aa90f351c78b496575150c1", - "0x8253e3b0b85538d01b0ca90b0a1656ad80ee576d0c3fa6349df58df92683b510e56c524fa6144f79a5525f41e4a2ed34", - "0x917721639b1bd13c33ad5b332e4486c4202ed28ddd9fe97b4d2367a87829c742c9e4bfb508827f4b8cadd0bdab99708f", - "0xb0b8c15d67a443907315ba3e94a89491dfbfd04ff9238d856f46cd49a3324788ddff3be9d61b2987f6f5a3c7d852133c", - "0xb2a4000ce0ddd3f0543ebfe4906570853a85350d75418a1ff2608099c069f03510df576ea0cbb406b7ae8e4f21576811", - "0x801c126abff96fe9b042be8869d2907d0c6963a79901f9db46577a445418b7465a1f4b346933d433e539536a9a2df01c", - "0x9530f92929f61f9afeea5737bded7aaff3078367aaf65b2c75f0f4263b6e90990a2bf64927774c4f0289120d49558d6f", - "0xa065363b9c4b731b08fd361081f93d987ad336475487dd28bbda2dca92b0b5da4edf326995a4ae923a4b2add7aa1df4d", - "0x85c216e314eb7bd8ba02e092c90e132bc4bafb21c6a0fbe058b0dd4272cb76f183b83c6783fc321786065ff78c95f952", - "0xa53658aaddc51e20752454dcbc69dac133577a0163aaf8c7ff54018b39ba6c2e08259b0f31971eaff9cd463867f9fd2f", - "0xa013cc5e3fbb47951637426581c1d72764556798f93e413e1317849efd60f3ecb64c762f92544201eb5d6cfb68233050", - "0xb7e5497eda543c02a7b3245eece98d21dd4c587b5a05f21b5c785756a0b875715782f706fbbfeaa0edaa6faa6b03d8eb", - "0x8ded37d67b5368619a090266e9b5585fbff60319a90a4244a3c3342641f5bfa5130998dd97d7a42505cd896c29255530", - "0xa9b120a77d70c1cbc0178a12d97a78b2dd0b98d0584e8e780b937800ceb18c90eaa1f0a83c5b50e34cae1c20468f004f", - "0xa22b351f139096f9ed5baafe27affde1351685765805d458381e392e0bfc51cbd8af5909b3a1da05d0d176877028eb32", - "0xa16938f556b8c11d110d95b8584cecef8b95ef349ea64b59df806cc62c52ee48074d0b3f18d84533e41583aefd6a9d43", - "0xb95fc0ec39596deee2c4363f57bb4786f5bb8dfb345c1e5b14e2927be482615971d0d81f9a88b3389fac7079b3cb2f46", - "0x89ca7b7aecbb224d04839d36e4b323ae613c548a942830317aa0d51a111cb40d7e6d98600dc1a51e5a32f437951d6c7c", - "0xb28df3e04bde4ec373171401dbd0546f4cb6fa8e9a4a8019aadc653d4e05e0b5b9a64417715dd87f6df9e7b3145f6659", - "0x89df46082b8dc997c3e33fa94fb6ebfd19af29d619ed4d861f8ffcf83d02b9077b9754d0667c2fceb7aa31ab5f806f65", - "0xb0c707313762e66c681b0efe03ca11a49791173c1e5d42b235c3370e98c37ca4393e6babaabc3933e3d54e72843337d8", - "0xa4bf094dcd71e1a8dccca76dc7887476154e673551f25b0ca90d6dac8b3b3a2241bc601afeeb1564bde0432db1972999", - "0x8f88615a86867c4add4c6dbd2c717a7d5c9e6450e9540b56de14c31d9ff84e2495aca3f1d5be51940c183c6ced9da2d4", - "0x81351fd284d6d07092875f366bc5e53bfd7944b81eece85eab71a00443d1d2a9fc0337aaf34c980f6778dd211caa9f64", - "0xaf7616b8f2f56dc68e3e8ae5dc5dbb4b027e53ce652860687f1b15b2f820ea0349baea5af4e3ba4d865429330d3383d8" - ], - "aggregate_pubkey": "0x90ad8bc2718e8464a78d43480f280d3ae08068ad88c2686227ec6a25f4393099e7e21b6200e83ba1a8fc34a9c08f5069" - }, - "next_sync_committee_branch": [ - "0xbcfe80e1d24fbdad7bc058b011403a4c26cb56967654494cde51517f888023f4", - "0x621312d94927fb6e3633ca6b4a8f61e8fbc72799bd54639043f1abe818ba816f", - "0x16fc985fc30e89dee4524512296e2a5438c4c68d8f035d3377cdbc2c7f9e1804", - "0x88c597da85b7b1a0ca4f2e149ecaa3eb869e60e78e5127db801706005d3d0d3a", - "0x7b3e52c66c24e912c1c7aa3207753cd882ec3c691354ede99ec716da5fa0fe3e" - ] - }, - "finalized_header": { - "slot": 4063232, - "proposer_index": 1311, - "parent_root": "0x9f5209af620727873d563ec0386856f5100df2278ee157f8b058021e29a2d0a9", - "state_root": "0x9cfb7a4ceeb31d6be6dba26dace0a074066152dbe507e328886be16e8b38bd9c", - "body_root": "0x9b934ad271680073ffce322e54a0ba990caafa9a0ab95195e4553aa5936d3f41" - }, - "finality_branch": [ - "0x00f0010000000000000000000000000000000000000000000000000000000000", - "0x3d4be5d019ba15ea3ef304a83b8a067f2e79f46a3fac8069306a6c814a0a35eb", - "0x452c63d803b8bf301447a73b2f7a747e49f37f9c9a096d8ddb6c8302666b809e", - "0x16fc985fc30e89dee4524512296e2a5438c4c68d8f035d3377cdbc2c7f9e1804", - "0x88c597da85b7b1a0ca4f2e149ecaa3eb869e60e78e5127db801706005d3d0d3a", - "0x7b3e52c66c24e912c1c7aa3207753cd882ec3c691354ede99ec716da5fa0fe3e" - ], - "block_roots_root": "0x31ed28275cbaae8300426740b8f08d2d31b0bebac67939a5f6507adc361458d3", - "block_roots_branch": [ - "0x7fb8181acdb3d8c6c5e2db5dafd701f1439abfaf2da9435818dae5cc47683035", - "0xc439004cf29049836d890c28867350dc62197484a9c97ca0fcd7be38904e826b", - "0x433cf8bf2df73fd85edc9445bd609ffff88cdf3eaea77b593e3aa48e6648666e", - "0xf092d3324350b4889c0a16d9c2ed940798360d33e5d82b32e0049b6b25cad0a8", - "0x565c0d114cdf1e419edfdcda9941aabc3d9bb8ebf07a4afea082ba1ec2083331" - ] -} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-sync-committee-update.minimal.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-sync-committee-update.minimal.json deleted file mode 100755 index 8f1c8b9ce21..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/next-sync-committee-update.minimal.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "attested_header": { - "slot": 3664, - "proposer_index": 4, - "parent_root": "0x15ac23a0c16bfa81e8595621118040c3e6cbddd4b09bae6fb39ba5fefd0258e8", - "state_root": "0x6fb81aa3827e7d580bb05b4df2686c9a49508bde2f8342fd75be609a23dd8362", - "body_root": "0x9906a1ae8065d268f8acb7f1b3119408d2f7f8e6e0764370c16ea3d15134981f" - }, - "sync_aggregate": { - "sync_committee_bits": "0xffffffff", - "sync_committee_signature": "0xa9b5584ec9290a4ac6c5616639d031f9ab1064d63b4889f1da52f6f4d66b645fca48bbe2fe8484adb0c05c647edd694d0340cf684b8ccf8e34c6d8cf447cfcfdcb856f5abdcfd85ada5a4a04d4c8f6f40c6e99308893c3941485a436d6c8e5f7" - }, - "signature_slot": 3665, - "next_sync_committee_update": { - "next_sync_committee": { - "pubkeys": [ - "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", - "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", - "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", - "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", - "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", - "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", - "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", - "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", - "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", - "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", - "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", - "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", - "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", - "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", - "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", - "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", - "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", - "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", - "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", - "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", - "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", - "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", - "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", - "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", - "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", - "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", - "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", - "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", - "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", - "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", - "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", - "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373" - ], - "aggregate_pubkey": "0x8fe11476a05750c52618deb79918e2e674f56dfbf12dbce55ae4386d108e8a1e83c6326f5957e2ef19137582ce270dc6" - }, - "next_sync_committee_branch": [ - "0x46af3f54acbea439b63aa5bb699c8f25ff584b23912366788f7c8e95011ce324", - "0x5b118fe110ee4a1b0cf9823bc189fb38eb55a7b49adbdafcf466ec7cd4b7fd68", - "0xc2f12fb91a61abedb47f62a98258960edca21f31494cdf59b47a1c721e3e98f8", - "0x16fdfd5e6b591b3140a76efa4593a9c4d105b9e5c62d6f44edbd24790657be50", - "0xc8175ab66690cc94c0a24452754addd62a06948de5db9814e813437a130de452" - ] - }, - "finalized_header": { - "slot": 3648, - "proposer_index": 1, - "parent_root": "0x991ee98a70e8f90bdd61d0f5554e53d37473e75e16af171f6d88f27d20223dae", - "state_root": "0x59b04d660ac772005a13a7dc1d5f99bb0d0292f3c422f04f7365198d70dd30de", - "body_root": "0x5151f035e146258e7327ad9cf1df13f8ddec7a7842c19993cf739358717b5565" - }, - "finality_branch": [ - "0xc801000000000000000000000000000000000000000000000000000000000000", - "0x10c726fac935bf9657cc7476d3cfa7bedec5983dcfb59e8a7df6d0a619e108d7", - "0x142061c4bc3673bf774cb8c7b6085057bd0ca85672b43afa2d9581b0b6a44e54", - "0xc2f12fb91a61abedb47f62a98258960edca21f31494cdf59b47a1c721e3e98f8", - "0x16fdfd5e6b591b3140a76efa4593a9c4d105b9e5c62d6f44edbd24790657be50", - "0xc8175ab66690cc94c0a24452754addd62a06948de5db9814e813437a130de452" - ], - "block_roots_root": "0xe6e2adaaad45363d7112945ef670e21c66bcb3276dc450962ade1e8950230380", - "block_roots_branch": [ - "0x386ede102258966d4c23031c5a02de2af8180d475c4c1716b07fb5b9f142a817", - "0x35e6c89bc38d993a1957f8a9fb1fbeab7420688091ba2cd7ee7b19b7e187f7d6", - "0x99249309825cafef7e694c09c4fdf95eb4b1e8743d3b23f6959d9980ad2d69b0", - "0x5e028d1d905db6430f0ce4aafbc78f442047ec3a132b4e69557fdf804a4cfbf3", - "0xd34afeab37851937920243683a1c926c41c626aacb145718fce755782d4996dd" - ] -} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/sync-committee-update.mainnet.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/sync-committee-update.mainnet.json deleted file mode 100755 index 22a44e3cf79..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/sync-committee-update.mainnet.json +++ /dev/null @@ -1,563 +0,0 @@ -{ - "attested_header": { - "slot": 4055104, - "proposer_index": 1862, - "parent_root": "0x5f44df1f70338aca4b3046f9e5b144bda8b27276320ca000077389d0aba35317", - "state_root": "0x9daecfedc819b45231bf93819a73efd4304ca79528032fae2e852ebbe514cfdf", - "body_root": "0xa33f5cdc6732684e6f248e5a7636c7e7bf705f0bf709098a46ba15c660b4fc65" - }, - "sync_aggregate": { - "sync_committee_bits": "0xffffffffff7bfdfffff7fffff1effffef7f9ffbdfdffffffdffbfffbbf7ffffffffffefdf7ffbeffdffef7bfffffffffffbffffffffffbffffffffffffffdfda", - "sync_committee_signature": "0x880f147850ac0a94130b81f94203e2f69d512c929df8b954b6adc20cb1e8598aafadf366c074b590c0905d584dd980af18e0c8a837bbcadf6b4438507aa46ef95879c0acd9c2d273ccb13d93e4938e9c601f0dd466f53369ae94e1287955cae6" - }, - "signature_slot": 4055105, - "next_sync_committee_update": { - "next_sync_committee": { - "pubkeys": [ - "0xaedc2d47fa2662be6ab58ddd3682bd5e53f508162968fce8326c75f92fb3c1a25c4d4d0e6904f9b6cb1ccbaaa9dc28d8", - "0x8097b13908662d245820f3b045d8c2c665fe9a054e9c661323924ec86dfa713b36b0c787ad4dfdeb979318810e687a48", - "0x98aebd4bf15916512508a5fe89d814d5d76423c562cd3f0a0af504c8cde53be30f4df00e3ba0229cbf8528e198a0df11", - "0x86bba46d0031989d0f1baccea4174fc3fa0d595e60d35a464e86c33c233e2d6def84fced7a00f59afe397cf4fb5b67c5", - "0x845982c2672fdd44b33d2e56ad676e704c02f756b09e8765bea42b924c14724484567b55f0db42ac20cb70a7f5201c14", - "0x926dc729e135f1f0bff4662ee3d6823a64597fe189b763ada34f246e77705fd4e062d85506a338e9fa98c4d225a3b27a", - "0xb930ecc2a26183240f8da107e80979b59da4e05f090316d982815ed6151d7750490b85273187ec4e07eb221813a4f279", - "0x81564bee5a3bd09476f658cf7719326c353485e2f4fea58d110071c5dddd3cabc349a8d1ecea45d589ed4479952a2ba2", - "0xa66d5b1cf24a38a598a45d16818d04e1c1331f8535591e7b9d3d13e390bfb466a0180098b4656131e087b72bf10be172", - "0xb9b9b6113301bd2b409b71afa1ab9e31d22f84f8cb03badaa408e1d37032350094124e533de766622d7975a047fade6c", - "0x8eb3b3e3135720036c1120c4e8b8d405b00d002f2bdbe601a06f2c2fffb940a9966d18636ee34fc003dfef547d8f3b76", - "0x898deb30ede570d391266c81132a78239083aa9e27a9068e26a3bc14ff6468c3f2423484efb2f808b4996c16bfee0932", - "0xa90d9502a9785e55c199630456fcb1e794bbeb0f5f8c022e66f238a0789998b126cf9911fd0b7d463b7706dc6f9ec128", - "0xae8af784224b434b4dfa9ae94481da4c425602097936623e8abb875f25deb907aa7530bce357786a26ed64ef53d5e6b3", - "0xb544c692b046aad8b6f5c2e3493bc8f638659795f06327fff1e9f4ffc8e9f7abdbf4b7f6fcdfb8fe19654d8fa7d68170", - "0xac5c01c51dac6ee1cb365c9b03f09906d9b7b9b4d1b73c44d9e8e06823025d7070f242898a975420bc87d6372382cab8", - "0xa4632399c1a813e41fb2055ef293466098ea7752a9d3722d019aa01620f8c5ecdc5954f176c6c0901a770cbe6990eb11", - "0x85f7ae1a7a7c793c408750ddec2d7f58b985fc3cdf9fcf6b2192bc57092b8a271b2fb6ced0639baaffe0bec3203e568b", - "0xaaeb466f4316874c2107a0de38dafafa65ce50039c20723e8797815238011426f4e77e29fc573e7c6d2df85c1bbfefdd", - "0xa8fd63da16dd6a4aa1532568058d7f12831698134049c156a2d20264df6539318f65ec1e1a733e0f03a9845076bb8df8", - "0x93600f65c090814cee5cbd5f22f98e79c69e63510501a0be6a74b111e4c52441133fc1c198c7bf235f9005aeacf1d441", - "0xa69f0a66173645ebda4f0be19235c620c1a1024c66f90e76715068804b0d86a23dc68b60bca5a3e685cce2501d76de97", - "0xac6e7e9960207138d5b4b6a7f061756c01cc4a830e5988423d344f23544ed0eaa790aed63a22df375768f670cc9b9bd4", - "0x93042dd42e56671155bb40d85d9d56f42caf27bd965c6a7a7948b39089dba8487d4d5fd30522dba6ba392964e3ffd590", - "0x85bca2f86423a09014b562f7dc613246bedffdcb3aa41fee02270c13e6b00c8d6704dcbfbafc5997df6a90c7fc08c29f", - "0x9550072f64a48cb86bfa224d492be9a91e5a6c9def04b6a290b7a19d96981937d5a2c35de6515d1881bcb167f6e3d661", - "0x8d797819318cdf7b26405d1a327d80d4c289e56f830b28d4e303bcb019aeb0b3d69bfed58adcde8a2445dd5281b86af1", - "0x90c04eb3f3679cd630434418cb3a225a73254887692429960bd45b1613f85b2c14723cd8c7f1e875588ed82b7f5576b7", - "0x9953a7cbc152f101a60e3e381f2af17ebe7401e16ef6462d132b8f0f6c6a18837914a1299d1605f9f289b9561112f4bb", - "0xa9300a33927335f482dd0e44d0d57704ebeb278f732ae8301073cb7d5e457f02a0cb03268de71d284b8c23fb96947469", - "0x88554c83648ea97dac83d806cd81d92531980346b208d281fba489da15a0084fd4d9a00591d1ca67aad3c5793685d55f", - "0x9131874b09aa95ba186bcaa9e040fabc811b9c7b905b7dc79e902cf2bb5816d7ee39b0b55be609f22bc8c538760b2037", - "0x8368bb9b9bb2e17730c42ed1100eb870c88a8431601312aa8cb1e738cdb9ca2704dfd432cf1703c0db043259819631dc", - "0xb49379bbb9f954d2ef5574199607bc6b3aa2cc3b48dcc3745cc77406bba2a394929844fec1b87c4ce65cd0ca0f83062d", - "0x876afcd045c8a18967923733a3a43757652289b0974cd348238a693f30bb57f38664ecb97877a5e5f7d0185039a2bf54", - "0x8db19f6dd3789df179ab606508ca7e3da7967ad4340f630bda83df54c197d6bd3a14980c87fe10cbced7678c0c300ef1", - "0x997a91da55801acb6134d067ad65a9a44ead0b53d3871bb97b46ec36149d25e712d7230d38605479796190abd3d134b7", - "0xab1abf9cf630d6cbcac0c503df44603142ac81acd647784ae0e8fc97800ef04378bc9d7f2087f959ad4bbbeec65b8dfe", - "0x95718b06017ba9d45894867fd67148645d25d9db2229aa89971f444641ba9db4c5c6f0785f3b25cf2cd7fadaa6adc5eb", - "0x8ec38c68afdfb6ba019204039c2fb49a35467058f561f626fa87314d705fd615a7b9966576052be1b3690028d3c5c7bc", - "0xa5d72ac4cdcd847d67cb5a68c6141cde99a91303ca84165bbdc6fd7f643422faec783de60739e1b2753088280c90a68b", - "0xa778da56ddfe4a383816b43b027464d7a28689fc4a6b35b36883d3f36d9c41f0177bdbfc8f258afe8da90f02d3b64fea", - "0xa2ab566033062b6481eb7e4bbc64ed022407f56aa8dddc1aade76aa54a30ce3256052ce99218b66e6265f70837137a10", - "0xb9c347c1c350fb7ef6ee9ca6780cf0604f30e3a74e9d0234bca6b3e7faed26148f2b736d9fbff6b04f5b947fda458e8c", - "0x815f53751f6d3e7d76c489f3c98d2b49214938cac8c2b417e2d17bb13446c285fa76fd32a97e9c4564a68f4faa069ad2", - "0xb3f1319ae34ad1d59207288f01d3d7b7e1bad7733fb4a819a09b011d72a4d736bd3c7afeb74cf56da0e00cf712042ad2", - "0xabbfb501071148e98b6aa56308197356fd993c93e27fd58987eca82036c1ae0ea89f9fb1a06c82851234643904c58453", - "0xa0899189bba608887c6cb729580e570ecce9ca7107865ebd30def867afaaa250bac407c30dbee11b7ef6cd423269a8fd", - "0x88e7a12a90428bb45bcf4b01442c11607433211fc2f9bee9545304eb66e0b4b5339360160bc782e185391385da7c5ad7", - "0x82714b00a822c30b317ffc1d4ba163990cc1ffe5769f91906a7f71ad1f62b39865a5314433a4ab2ba762b1d62b01003e", - "0xa3a930dd70aeeaff0f2e3790927d5425db40467ee106261615de5fcb937bb1621be213ccd8b3a14d96c5908bedc2e421", - "0xb2902161b565dd5b8e8c54187b26f01741a39ea8bc1120598661bd367cf8fc73e21eda2f0f6f9ba2270c80a59ff5985e", - "0xb77cdf45f39bf85ab3e8c8afa602f159de8352188aba5378957d468315a2d2326daef83d8ac6b227f1e7a514488afbc6", - "0xa9e573274f5a131d6c7641bc0576a2621b6466a5bf2cecb21058160a854b1b9e0be176da2b6b9b3ed562fc36c5f09119", - "0x876561bba29e656b7122f1cb51a02dff1ac7d470217d8a4799c01e61816c4660eea91843a5a42502ddf842d2daeb0586", - "0xa0ebae60a998907a19baa396ae5a82bfe6aa22cf71bfca4e1b4df7d297bd9367bbeb2463bda37aa852ad8fd51803e482", - "0x84a6edac5ac68a7ca837c46d5ada8fab136748b6c3a3b9165dbbc231ec386b15328e4ef7d69a15d4cf354135348a4ee4", - "0x8b476b3b065a3b95a3d11ec60a749c2258ddcc5885bfb50b8a086d3fd1e49ff73e1dde733b8981c3d2d206aa0c87b09b", - "0xb48490c5a3bc9e66cdc78994f7c73e0f2724fec8a304b4147799e5142396df155ef7c42065ed6d2c0393d138fb4d2a0b", - "0x849ddbdc3ac55ff22a3b2f4bc51892fed694490ab4dd342165ac38c725c8b38921eaefe3c443962925fc3726aa41e236", - "0xb49c45d9da4aaa64967c28f1fd77b7f709f5a331b58823eb1613856fd8f92635135981830a287e8dbda3a0e0fc481c5b", - "0x93ccd8c5f82374e0bef6562e16576f742d79b6f400e3485ef36e148088b61fbd882c3d2bb38ab0b43fa1dac77f31d543", - "0x81522576ae4ec9358f1a16934cd1c1116de609634e68f552924a972101eb7215f037ab8e0582d7b13541537d55554d31", - "0xaad60e58a19598c5013b37e2e4adc6721eaa7e6e184960d1dc4e6f012246abbb58a047c0679064d5eaaaaff02de881e5", - "0xb4f034f2b53ff9989e8a0f12c1484c58ed7942432a429af58a6659feaf23f7d2bf20ff7b9a7e0a28a2e09c9a730681d8", - "0x88b2c68b425269850c1a4f4608aca194da5c641adeb99e2f7fb92e34b8245dff066e73bde072be60f7f2c3d3d13de3b6", - "0xa749ab53fc2662a0796489be84fcfa59bb723ff748bd8980df0cb4b3d1e2943845b0d7c67576fa0a33c8b0ff8a86932d", - "0xabd7248ae069d3a3a45b0ef4dd5d7d54b62994e578ea20bdd3b7876596673953b94c5b109a6e4b953b517544b915368f", - "0xa49da42c27d019a21cc6489ada7b712b98c4ede28ba25dbcfa916acef48446a2baf73e03a48be763378a09774d4a03fc", - "0xb3c36fa39f668bbc3fec028875a820057dbf96f727bb423280da96d5d50e885d23bc23fb73457bf79089691ce7663a7b", - "0x8dca376df4847cb8fc2e54a31894c820860c30b5e123b76670a37435e950f53312f089a8e9bd713f68f59fd1bf09202f", - "0x95d1f944b0c53eb3e9fcd5632713602bbb9195b87a172a370ae2df98504612a55f3968615a39b569ce6a0fe9fb559be7", - "0x8c9fefe233d0d657349b7efcdc368f5aaead27071d224af780874751e7d241f6b88f7650fbb4133043b24bbebc12aa48", - "0xa2ee6c29efa982e9b9abd3c5e4f14b99d5d0369d7bfc3c8edae1ab927398dc8a147a89e127b3324d7f4e3a7494c5d811", - "0xb7ea5e0d3cfcf0570204b0371d69df1ab8f1fdc4e58688ecd2b884399644f7d318d660c23bd4d6d60d44a43aa9cf656d", - "0xa07826925f401a7b4222d869bb8794b5714ef2fc66fba2b1170fcac98bed4ba85d976cf9ee268be8a349ae99e17ac075", - "0xb0a47515752c15e4dbeaf9ee27fab3b5c0db82f5c685e8f716fd7d8764164944340430fe3db1a5679e6ffea5a16dd919", - "0xb7de6d7a4afb05984dce153e5570b104338265e45c8f0156f4d45c458f47add234a479e01c02d3c1817c170b5b65b100", - "0xacd4d1e11f81f4833353b09d4473ec8b15b8ff31dbf39e97654f5338a26c4020306d51018f1f4b9c4efdb92992408a6e", - "0x80e09f3bf3ea87d48e04b53d8f3b43b7e53d61f445f8c8a5a35472b84f6bb4f58f17d9832f5881bb44fc06156151e5c5", - "0x98d6d46f603afebcbc561c130e416d5a588a7e6c1f17f89ed6e30538b7f8dbf4b3c75b8a3331425c4ca21e03fe8b57f3", - "0xab671eb947490c43fd05e42a787344b21af89babb705393c82748eaa0cfcf80bee498d275a1eaf1d647ca3b2923d76ea", - "0x80e1dbf3296bdfa98aeec1a7560682165d13bc628061bd3257f345aa1ba13f8bd1bea14f117af562be22118f5a8265af", - "0xaef456af90354ff88039d2dde02b0f5a6790aa762b23e0a9da8c6ec92c3b8b3320687bb21666608b4a22615843afd1ef", - "0xa5a07bf219432e9c80c38596c93560b49c7de287f31e30b7a06fcb4d15982add4a24085adbc5b753c462be989c64c96d", - "0x84d2eb008578aebd6f01254b7e46584c1524e6fd7a5a2ae5fa0ea560865ca50d52290cf2d12dd20b042f402e62181b4d", - "0xb8e5226ad3515627ae6840235f5f7b7ecd54e8f01079c324d126ec852f6665ebb77168b3f2b3b51580e04a6ff602d5b3", - "0x8c1de4264e04ff7e8282faf81c0bfb5943656451be52170211cb7adf4ff21bccbb789400735579c622f69982fcb8e9c6", - "0x90bfbe37ac3992432e68c95c0d4342a9712126d1f50089239c9f4f6c0c202b54334e08604d245b97dc8e8f6706f6992c", - "0xb0a771b9a0dd7e352d46c8efcc1834e610dd097711bf7117678a99d386890c93b9b901872d4dcacb6dcbcf3aea0883ea", - "0xa4eb903990bee2374b14fa66fc262d6821669537e9ba241c87b4b5c9e2b89b32fff4bfc28ab8471ef52e8eebc3e743d1", - "0xa6b74c706b33d3cae9b7adc5c7502ac98f7bf94a14d579d2bf77b613ae555634ad6fe631ba36dc14bf44526436355e24", - "0x8296f8caf58316af535def398a43357e48cb3b1e674b857eba1bd1b970da3dd045e22fe6d17dee4e9117f62ece3ec31c", - "0xa129c9cf33df42b5a98ad98be9d940207ae154c715d3bde701b7160dfe45304679fb0481a4f9dde242c22a9849fc2d9c", - "0x858b6f1bd3e68fc536bdf1f4bd96db032994eb76e71571e2d85af73b898478b82f9ab432732b0beebc0864ad8025ae33", - "0x8658a15df961c25648fd444bdf48a8f7bb382d9212c0c65d56bf9cdb61aab3bd86604c687fb682260dbc0ad2dc84bf01", - "0xa8d152e5d94b75cb9e249230db21af31de4d4f3d4ef60ccbf2212babf69aed2a38435a993ee2f13cca410ad55a4875ab", - "0x95757096c132e7f6c096d7b93a5a0d2594d5e609b9f13c4a9f878e95a389fa1a111b185dc1fd8f7d98b737dcf8d2af60", - "0xa22542a4a2ebde18cc6aa29d5dace8b4f6720703f519610dcf01e671018392aff15728e3764730840272c9cfb074b612", - "0x8f90e72a54e6894d511061957162e753010812346afd4d90cfedb678b99ba1aacf2b6bd0e49b4b0e684da8082a048619", - "0xb2affe048c187d311a185503d8958cacbe03796edf79bc32e8533941004d9178bd2e376e627e1ba61ed43850c0c455cf", - "0xb549d272a7f3180826a978d747507e4dc80d82784abb655cfcd3a69cc72e7d58c70febea1ce002a89852a8f934ea70fb", - "0xa9ef845ab489f61dbfdcd71abcc29fc38f3494a00243b9c20b9cd0dd9e8a0f23304df84939b9652cdf5542d9b3ee085e", - "0xaa744c552b5fc41e1ac6ca53184df87a1b7e54d73500751a6903674041f5f36af25711e7bc8a6fbba975dc247ddad52d", - "0xa802b9ffbd4f01b877791aba27da972be4bacacc64a1f45687be4af01b84bd4b83fe2ba1ea78e29d7683f6c777ab2543", - "0xb44d2d9510516c0abb4fc101241cf0e0223b179fb70686519628c27f0ef56381232961bc79a30f592ef093ffecbc4486", - "0xa684a09add047c0fe648d9c5618500d1816047168e055e8ac8c952c3544a462cc095b32fab07d939947a58fcb4ec7ba7", - "0xb5eb31e5cba0193e74968099ace5808dfc457c6f404f270fdc4949b60daa7607ba1811abab1bb19fccdad61d489b6657", - "0xa10f19657a9bc5a5c16ebab9f9fddc3f1d812749cd5d80cb331f51de651873ff899e0670f1b079b29a194572de387a17", - "0xaf61f03e3ceef5bef36afa29ba2edc7a3b01ca26cec2589edbc9d124dd46e41410e0e3afbae959c83a6f839bbcf8049a", - "0x8e6bbfe492ecbbb8dc8889d3dcd7037a58db605bc6bb79131a72a9b9c1bad630e75f5e5e0c1bc407e73f3d13b116739f", - "0x983fc1ddf17f9756c9cecc00b39bb2ad432587a5c6d1c3296a383b9f539c9afe84c6c818447a709c0b686ba26ce5ea3e", - "0x8d52413f981bc611427ad0534d25e914113d0ebcd6960aab6421608bec6648b89ae4b2ca2153c57d3cf4f1f37212aa5c", - "0xae075b66e5f211c2149c45b211d1297bbc1d9e6497cb3315363c492a9a51ae5b9d0a28bfecd755d68553736901ac6606", - "0xa02f7fec0661394399a82b2e3151009160b3f5392017ba579b301ed42c85100c295acbfed46b6c58a9d71796ed0930e6", - "0xa3a7196fecd25e9cc7cac79c35365676e48c7be1493df255676adff2209c0719f2190ceff3ce008d08efa07c244c11a6", - "0xa5fe3dfb5031517bb8db0d5ade1e9f438e84bcf23221de003b03d2a2f4ea97629e81c79abc3769bdb8c69a512c189b91", - "0x8cd9d7e953c7ae07ee785d68a999e702565960d376692d9ea468556ad141229b1f3bc97926818c078901f73ecc578e93", - "0x81d6fc2f01633e8eab3ba4d72588e14f45b00e68ab887bdd4ec5e8558965db21189310df973837106216777b07fc0805", - "0xb75ac3d5b3dad1edf40a9f6b5d8923a81872832eb3a38e515539cec871a353b07cb477f6d55cf15ba2815a70458aac32", - "0x94d3c9406dc6dd7241a726355643d706e46b35f1ffe4509ac43e97c64c07592821156ba02ec9a78978e66709995a0ac8", - "0xa3b109249ac2900806f0f39338da72d4f2cc6d1ac403b59834b46da5705cf436af8499fa83717f954edb32312397c8d9", - "0x8336744d8ef3a3bb3e9ed3d6b83e08cafffc76b7438adedd3a7358b32acec0e73a4635aa3166362ab4e158e68576255d", - "0x99b74edbac662fff69ba412de466a427a928ce2363c9e59dddd664f6fa50f2e1dd3d464701b01784aa224b3d96dedea3", - "0xb397ed7134f447d9bf1c511bf92f2d27d7b6d425b8b411365fbef696cff95c2175461cf5dd83d93bb700e50ebb99b949", - "0xa3e1fe11f38d3954a7f48c8b68ff956ea0b6f8a3e603fd258c9406ec2b685ff48241db5257179ea020a83c31dc963854", - "0x949cf015ce50e27cf5c2ff1b8e2e066679905ac91164e3423d3fb7e05c64429e77e432db0f549acb99f91fb134b6edad", - "0xa1c0c317e6e352e16e25c140820b927161ce5d2c4c2e10bca3057ba4d46b4f42ad7aba20de86dad9fc6368ea92695268", - "0x8d6e3df29419bd0da1deba52c1feebe37744108685b49ca703e1b76fb4d612e3959d3b60b822506e5c0aac50b2f5eee2", - "0xa15e0cb96a463ab81e661ca44c619b71a159680bbc04707ea5a5867ff38b15416e3abe55d2fabdab9aede1f157dd37e1", - "0xb6d6482ad7b9b412ffbefbbdcc28eb3d091b1291f54f77bdd53c4ac85f705c454940f466dc272dde7b03c26f0cd6ecb3", - "0x8391e3ad6ec2686bdc686671d579edac2d5efa8cf0923577df28fe0735e4d5103173d44452816e3c2b2a7fcc1fcc20d9", - "0x818202d7cb60e4148c71633ccbe1ce311de7b7ff93a1988e86ba29cc58037189f0f275b3323a6719dc9bdcfbc49c35c3", - "0xa7c0fcc422c6da878926cc6763ae6ec685a5d8fd1afe61269957be6bfb3f1705a8e4c6e6d85bd15636521f5a2ceb3a00", - "0x8f7bbaaac458bada6d852fe665c87c646133bab16c0d5136c3dc922095b9d647d93a9de7671cb7bfd4cbd138ae0709d1", - "0xb6e9fe9fa3d4c833c3beae7f798f30f07e3cdf6f6c8eb8e2b70cad51b37af2549dc9f2e7f97f194e5897d4dedb904a45", - "0xb455f751232de0a48440d09983f4f4718b6169907979c9f282acf7177ab5b1f338fe1f2acd8d0bee4b4aad61d0340839", - "0x8aadfcf3562f1c357068323352cb1745349a27a7362358d869e617c2410db747149b993ee9e881e252ecdd42fd75f351", - "0x91bf4c32fa8888d3829d3c33e12550d2ecb70762d5eeecd044d4902e4a7f8b7a2592cf6cb7736eb6bd9d312f85c2777c", - "0x859426bf6211e68924eefdb26cdc168ac0deab291aaff7036163997bff34d45809932f91e12d113784c05553ca773b15", - "0x81730b4bc5f755e5b99c321a6996c65e57ea2ebe6c0e4e404ed30920194fd76db65304635ad054a8b25bfd982cead47a", - "0xb26f5ed09f7d5bb640ec94ddd1df0b76466f69a943b4699f53d45296d5d6b8010bb61477539bc377d1a673d89074d22f", - "0xaa65c11071be23c9bddaa5203f3166e5cf043efe5fb8f4b26f8a9cabe71db701a450e79eb001c401da5752755d9cf1af", - "0xa019370ca799c2c98a605850910cf43531bfb616393039fdfc370848feedd3339b2427b750ccc91952b03a09f690e9ed", - "0x8f84cba7ceb7652023fc8ebde4b00ecde1f550935bab12feb630d6f49517b4148f3cde184bf55d4f6ec99a849fc6f862", - "0x838733220d1559c800cf1714db8a43a67a0c0d1d3a9fc1e2cdcf615d20406501e5146fe8b59bf64f4c5daa1a6d74f15c", - "0x9708cfcc9ff95cf23f544119e17518a338575018f153b1ef50118da0681304919a226b2089a417c2ab7b4320dffafc2a", - "0xa988cfed9f481bc98beb5fc188ed3f6893a3ebba27c3ebace669792f6abf0997727023c3b6930a6421224f5b257b8b49", - "0x812d3ded3a3c9e58eecf13a29bb4cc13b01b2a0af322423a29bb0e4f6d9021d1d87ac4af7a2a6b88d34f44a8bc1b3c55", - "0xb2baa7eba496ac4ef60ad8ef27a9677f9507820d95a1c572d322621c4d0226b36146bfc3a9ca1645d123acbd945de3f4", - "0x89ab1e5c2565f154f92c9b3554160832d176613f1a2f872b6ed62ed925a33fb0b40b71b7443eaaa15099ab24693c8d13", - "0x8982534f2c343dda20cccf5a9c8bf98240bba5f4e8eb2206e63a1847097deadb6bf0d24b358014d564c5ef1d0448c43e", - "0xa1e47798a782a024da340d6d6a1b1e5e15a0f2d8668adf349ca375086964414a563cc1eea3226ae637f87e78c0a630b3", - "0x847b58626f306ef2d785e3fe1b6515f98d9f72037eea0604d92e891a0219142fec485323bec4e93a4ee132af61026b80", - "0x8368a0f17c8427beb71dbf11a09a2fe8495a33f08c29c74a9a996a88aa01c0a09f9555abeb1ef1592cab99a9e05875cf", - "0xb38e558a5e62ad196be361651264f5c28ced6ab7c2229d7e33fb04b7f4e441e9dcb82b463b118e73e05055dcc9ce64b6", - "0x8018499ef720e28759133033833edfe17ed23e42f99058bb79fe844ddee823cfdc43916be2dc9724d18f9726e6f1b409", - "0xaa9b9cc039d147677aedd1e47ad9013fcc0da0164070ff7305b18e5786c7fac0471368637a3adbb78f3af174a5c1592a", - "0xa5c0e42851b769d2d822e39222e708068455aae3bdf782975b59d3201e67a58fd66e16d380558bf2086bcab890a92dd5", - "0xaf3f765fd293c253072b33a780ed68933f78d7e079d9a2079b6232755bedf6ebcbce9ba65c01f695602fa8ee17899867", - "0x8a0192ef0903d7a5ed2e5614a715901f2554b324ee72390974dc90727ff08dafa580041a21a8e6c48a3e08e1b042afab", - "0x907c827a4fb5f698bf0e6f10ca07741c5b8e3ecb26aa53f938ba34ceb50c01be80c4afc5ac4358a5fda88eadea0cbe73", - "0xa35ee5c2d7800489723c78008b495e1742f0542dbb487172ef438f60424c81aa41c2397095821248066140662133f6f4", - "0xb1925ee53c9228cf80e2f5ac0117008a91e98d878f69bf03d00d873ef45f4351cb6988772d89d4ccddb40778d11e0dd6", - "0x95aafa379cc6a2b4bdd0cad30b7f0a47839952af41f584219ec201c6c4d54610eb2c04b67b29080acb8cecc5e7543fbc", - "0x8f44c43b80a3c5f488118859fab054745cfe5b0824821944b82fcf870fda6d93489ea9ca4220c24db2f4ad09c6080cb7", - "0xaf861bb21f84c3e7cab55370839d18ac24c475a9e833607fcd7e65c773ee9d64bea203ee9e8fd9d337f1cd28d5ca0d90", - "0x8f6fde2ebbd7682c69026069cfe93aa5410071f05de9ccd7070c8c3299a6539b39b3798f01a0b4e9b1330510bdb51de7", - "0xa35d9d6d5dd5428cce7616842203b5fa3721cb4b20f50c0113f138604954fe0cf214ca3d065b578f921054b9efe823df", - "0x8d562d6c0e0d8325032e1fbf836022c82a8f600a6fbb56c553ee5d1fac0f052c7ce2504c0fd48c9fa6494a6bff63c9fc", - "0xb02ce594310f1eb8acc92bb80de524a43e663e12fb64fc28291ff207f9d8ae761631416410c3c8f4d6890b8b7e6ed24d", - "0xa258f8c0eff666c2bb70e505544c3d10d6b258310e4fb2206fd0999f69bfb739a1e232d1e810e7206f490f6c44f6934a", - "0xa8a77936ca91df3b2ee7394ea821f2bfe91c6ad8193f44651466c170b6ecca97ab356fa7d947ebb4b767e8967092f143", - "0x88ad79a0320a896415e15b827a89969b4590d4dfa269b662bdc8f4633618f67b249f7e35a35884b131772d08025bfc32", - "0xa3c66439724d737d20a640bceed8671b20cf6795671b6d442ed1ea5eda6723ae559396c24f44e982ba7751dcc6adef5c", - "0x8d0e6475acfa2b904e7d53bc7acd070a2ee4894ff5720a20e560e9ecb7872ea442a51cf2f2eee4bef66604a5c08ad9eb", - "0x804c021152c3304853941847e80480fdaceba3b9676fbe018268cf77d1a1856966c2f9686bb4d4aa0c4118a7e85f83cc", - "0xa6565a060dc98e2bfab26b59aff2e494777654015c3292653ecdcefbeeebd2ce9091a4f3d1da10f0a4061f81d721f6ec", - "0x8d5de60e934ea0471d9e0a46489f21e03abb9722f5b3633631a9a099b9524beac5d67716969c83d824498796d9c106b7", - "0x8c5a9f6eb0a3ea95e75362b06e5cd23968447a212cf22e1419c984d74432c51d290b717f80e8ed3e76b1232216f99758", - "0x918ebb73eef984d0ce28083306626d04817038056aab4a82ff9ac8176ffdfbf3173c0b05e936daf553248b323fe54f56", - "0x8f9aededb605db4e499d3c383b0984b1322007c748dea18dc2f1c73da104a5c0bece6bb41d83abdfac594954801b6b62", - "0xadb198f70a7f1969ed0958be4a9a60dcc1806bced79c63692b9aad6c5648ffea1fed60b24bf4b1862e817cf229e93e83", - "0xb118f77f99ac947df97e7682f0fb446175185b842380af4ee7394531e4f93002c72b41a57a7c1b923a4f24b10924c84f", - "0x944f722d9a4879b5997dc3a3b06299182d8f68d767229220a2c9e369c00539a7a076c95f998bea86595e8ec9f1b957bb", - "0xb7270f33011db1bad18e076a162d6e53d9123808609773eb46e3a4ac69c84c257407907bd5d05b6eb5e926b8d8c6d884", - "0xb09c0a505457c6b473fc7b2d634222905b36a6ffcc015dbdffa3bd62218c94e891615e77f28e6e18dd8474be8c156695", - "0x97d076617cf0a64ab3d1f030cfd72a303b6b252c0a7b96157ff7fc8af5970f00d14492c46e8f6f37caafe837d0dc95c7", - "0xb405520ef829a2a3b8947f1687ab56a7af4026c1a6f99f59aa192bc4f3b12a2de407862ff74ba1b2c51889b8d6b090c7", - "0x8bb045e7482b7abe670d72eb2f7afe4207b5a3d488364ff7bb4266f8784ea41893553a4bf7d01e78c99ed9008e2c13bb", - "0xb2df29442b469c8e9e85a03cb8ea6544598efe3e35109b14c8101a0d2da5837a0427d5559f4e48ae302dec73464fec04", - "0x99daf03fa434a482d9aa4d090884c99b7208c1f5380b9acbf304e1bc33d3d6902afa5d248d20ccf03795e26901356ede", - "0xb60df25a7ac1ad14aef7e8809c4bfc190b715f94f14b0534cc2e4015ff6c322883cbdc5309e05d67dca4bc641c69725a", - "0xb46a818f3e492e231d8fa8de8848c16f0d648a2e0d1c816adf9306a8596fdf45922e59cbf745430570a19e54f45e28f7", - "0xb3ca2ab7d64b71e40693bd3e2288a1f78741a139403c783d259cb9dc9c29f16c00796b6302cdcea4a4314e132b4f9d1c", - "0xaf3d3dffbe55842dfb4417295a6ed1a82d26a579199494b305445215045785759be4cb57dc870c7ddaffbc101a854a92", - "0xb21785008910a949804d1291e7533752641d31beae3cb518806488f81d58c38a5efe5ed9534ac692e68c3121e2f9d97d", - "0xab7eff4ef8696db334bce564bc273af0412bb4de547056326dff2037e1eca7abde039a51953948dd61d3d15925cd92f6", - "0x8bb4d08318386c91a0136d980a42da18c05743a5c52a861ce52a436e66a8ebe472dac7f7461db32ea5da59a23e9bd6c9", - "0xa1c84730a5c41dcab9a5ef9e1508a48213dbc69b00c8f814baf3f5e676355fc0b432d58a23ad542b55b527a3909b3af6", - "0x948f808c6b8e3e109a999657ef966e1e02c96a7aae6eecaf912344e1c7bf7ea51c911cecd3cea2b41ff55acc31df9454", - "0x8d264fbfeeebb6c4df37ff02224e75e245e508f53fb3446192cd786ecf10d0f704c4fc2e53e7f7318ae1407e46fc0fb8", - "0x8d47a7c2c62b459b91e8f67e9841b34a282ceb11e2c4b0549883b627c8526d9e0ebd7333ba70630bc0ec2478114b6ae8", - "0xa4348ad30c12bb7dd03dd014cca599c3499ddf348e7795b0392a18f998289979478374e374a8297b5b6c427441e2b5af", - "0x92ec1aeb2aa24c51cd5f724972c8b6095e77b237d83f93ed34ca0bc91a1dbf1ad95adccc59e0f0abbfef33f331f3298c", - "0x941f73b2138b4347ecafcc7b8c3d03f2a54dc49f580394ed08f22b0878ee7cb63d42978f1d320c09e7dbc67648c06f8c", - "0xa308ed8737b3a9346ff20dc9f112efccc193472e6fde6aa218ceae11e288bbd2c35fa45c1d8bb238696a96767cd68b46", - "0x8eb03001ac9e22c6956a682ed458e650785c36d23ddbcd51ac4d9cc991325c02519ff1958987a08eb29ff56ff6e2c293", - "0x80637db55287f891baa0e865d2423191b9a575620bc4493ea76166d47b99fd89ad8625c21f446b01e3ae17292c78f7ef", - "0xa5b3da08aad945effdb645c797a0a8bfa828c9d658df2783a214597acebda3ffc07ee48d0ce1147d77540b557d9ada91", - "0x8d5e0b8cde1f62cc8f15d9f596e31de09c221da91b10335b92ef1155802e742442def161223333573158723f3408bbd3", - "0x931923f0c1f75a197e6244d67525b524ceb07510a6aae8cb3d56167cc1aacc76d26fadfa1bdfc55d8439c6ee4d4d8174", - "0x963a298fc8876b702424a697929c7a1938d298075e38b616c8711f1c7116f74868113a7617e0b4783fc00f88c614e72d", - "0x91ead7dacf43905eb5d4b179af29f945479ed074126bad3b5a2bbc1663af5f664fe53a36684e9389ab5819e53f1344fc", - "0xb8a6c999068c13fb71a99d75eabadf7edd2d32e28607baf001a0aeec412fdd3575602c68d3feb4d743b90396705e37f3", - "0x938bbaa0ba14597067ff4c0a7cfc1529c44160d6f61cfad12246526d84fb7a1ba964d3bbb065a348cf7a98356ee15234", - "0x80e44d3577f12cabaed7074feeb57162ff80b61f86cce8f41d1d1250bc455070b09f6ea9d0c263b7b4824701480f4c14", - "0x8d74f4c192561ce3acf87ffadc523294197831f2c9ff764734baa61cbad179f8c59ef81c437faaf0480f2b1f0ba1d4c8", - "0xa0133deca5ae8f1100df8db69920b2d0c31aa21bd3849dbaf4c264eaeaec8937ab8f982770ce1ea17e0e258910a56d02", - "0xb6a25d493d708b035b853f1f7a6628d8e0b205d2678293f763d7ea4da11d298539533b22b43ed2e5f708648556f3094e", - "0xa58c3a4ba86d0d6b81c8411bb73a528b4f3bc2debac0e0208f788c080a3a96541d57c927143c165f595070afe14b0517", - "0xa52c15840b89d92897d1e140b2b8468a88886c5e1092861e598b3a433b340ded5b35b3d632a9879820fd56f20ca3a68b", - "0x8c122bea78deee98f00a86184ded61c10c97335bd672dadddc8224a1da21a325e221f8a7cfd4e723608ebcd85a2f19fe", - "0x87a51e0011dd0488009baac9c611fbde01878f9cf1584ea407599742bb32ef10586d9040dae3e9800a125de54f80c047", - "0x98181e9291622f3f3f72937c3828cee9a1661ca522250dfbbe1c39cda23b23be5b6e970faf400c6c7f15c9ca1d563868", - "0xb01a30d439def99e676c097e5f4b2aa249aa4d184eaace81819a698cb37d33f5a24089339916ee0acb539f0e62936d83", - "0x830e70476c6093d8b9c621ddf0468a7890942589cae744300416639a8b3bc59a57a7e1150b8207b6ab83dafcc5b65d3c", - "0x83ca733849830cb8fc2ef469e7e464fd94def561ce49ff0aa352a6ecd0e52c7aefcd69ab59f3d1ed2d5b8536d0a7895d", - "0xb76cb8cb446eb3cb4f682a5cd884f6c93086a8bf626c5b5c557a06499de9c13315618d48a0c5693512a3dc143a799c07", - "0x8b027c14affe47f83ee59b504d83b2fd2d9303de2c03ee59d169bb199d9f4bd6533d7f8c812dd7a6f1e8155e3e185689", - "0x8e6b888197010ebadd216da35b9716daa8675d93b3c33a96a19fd9ca42624f6b430b2ff115cd0f5b717341605dda24bf", - "0xb6652440bd01316523feefceb460158cd9ba268dd8dbe860a0271f0176230f057767597e4197885ba907318ca202ba06", - "0xa0b3dff15982a38a2f56d8c6cfc5c5543c045bf2db24571d23387ccab42abe2756f34d5f0bf6a426bbad3c358b8bdb00", - "0xa8b593de2c6c90392325b2d7a6cb3f54ec441b33ed584076cc9da4ec6012e3aaf02cec64cc1fd222df32bf1c452cc024", - "0x96b478b1e5e49d4ea3fd97c4846ae0f781dcc9f9ff61ee022ca92c3d8dfba89c513c46e8bb38b73e6b678a79b9b12177", - "0x946d585d7aa452d37a8c89d404757c3cce2adf2410e18613483c19199abd88f7a12e206f87a43f6009e42f4e31ed20c0", - "0x8c432e044af778fb5e5e5677dbd29cd52d6574a66b09b0cd6e2a5812e71c91559c3f257587bfc557b4b072a822973a60", - "0xad2cdae4ce412c92c6d0e6d7401639eecb9e31de949b5e6c09941aeafb89753a00ea1eb79fa70b54699acbfa31eda6b7", - "0xb504cb87a024fd71b7ee7bed2833115567461d1ae8902cccd26809005c4a56078617ec5d3fa5b29a1c5954adc3867a26", - "0xb8876bda1e709ab16e1347a1107852a7898a334a84af978de39920790b4d82eb0739cbfc34da1c7154dd6e9f7674759c", - "0x973dcf44ab60f55f5d10a8753ea16db9faedd839466a130729538f3a0724f00f74b3ca1de16987d7c6e24e9467f62bc7", - "0x94df5fe87661101a89b49091a3d4de89331cdbd88531ebb08a95f2629886ee53b3dcbcc26bb6bc68b443303d8d397141", - "0xa92beb343caf6a945990adcf84302c55d1fccdef96c34a21f2c00d3e206a9b2c6c6b412f66e5d4fafe26ef6446cde705", - "0xb298aa927713c86adfe0de1a8d6f4083b718c8be27156da9fd11abd8edb3a54a926ad487801eb39cfc9363a0a3be0d44", - "0xb34d4d2e15079e7e80fdba30cddf4fc0e6c9a61f7ab06a6ea0a4e55fd5bf632c6d72e021d6264d935439d321de883bb6", - "0xb4a86fb5b0049718caead1bc036833a2caeb88e1afadbbbcb0cd021d95e1f33fcc916f0b97fc1b9226c37050e3463796", - "0xb6cec65e5268818c82c0a4a029b02f8d23de98b68730a445119fee670118eb34027c23c987fac950f9b0151631328a4e", - "0x880b4ef2b278e1b2cccf36a3b5b7fbce94f106ed9fa2820cb9099a7a540a57e9fdeef5c0fb0a743049828fc2b8c46163", - "0xab2053c376c6bd113b89fdb2ae3b8401aa891135345885730c61cac7813f69ea7d906c531be752e28657f73af92d1f4e", - "0x8fa2d7b22af8e6b82679ebdfa13efdcb34289a554653ea6c1b16efb9f957f7fe64df787e7b03d8cdc8a732b91c916bd1", - "0x8e825c03c8409a3302266dc5f47fbfc381dfbafbadc37bd8d40f079ca8963d4c5ae6ef0d0ba6aef2d4688736f5f6bb45", - "0xa40ef3d2291d8782540961ce285054678b3d322d3cf7fc154207228c290708b1abfc37a4d7762dab3dfea582a112444a", - "0x8dbe8fcbcc414eb352245c52549973f73d987012de9d5f2b2f55dfdc43cf8cc9ea6b147abf149817f80f9e15aea566c6", - "0xa7e8775e04214e3b9898ffb9625dc8bcd1b683e333acdceddb8ca6db241df08a7b80e9d476a711b8b7d66aefca81e9cd", - "0x8b6ed54668f78a4a7624683b9bf3abf2bb0b6dccffccd8c0967df6297dadaf51732800fb9832b069437a6bf82ed7e6ae", - "0x9437ce85146202d3815df7f341a182678665dfb74b96006dc9d6acc16110d00b4a02717b702a765566457710ff5a7280", - "0x86a790072efa2cafa97be4b6b31f8c533f3b20cf3922fc0285fd403da436e4c49c65c5f08d77bfe823526c67bb58fab6", - "0x8ee8873de7cd28a54ba2c63a80b63399effed76b154e96ed26e7c0668b9f2476e298688b6a00c4b2ab9d020a897695d7", - "0x975c3261f0f32d59473e588f89593be38f5694cfa09394a861e4330b7800fb2528ea832106a928c54c76a303d49140e2", - "0xb5222582ed6604b9856a48039bd643340f4bf1bf0fc805e8453a9eb7630d6cea1452d28536706d6fa3ec16617617991c", - "0xb75c28941ee3f91b3535b4eaa0fb17b59ca65b5256601a1f6d0cf2bb4d66837fd16e51d6942856679012a5730a66e519", - "0x97b510f9f46bdf77a002b2403d8e42b6d6ad5329ea080940844429763ad3efd592652789c8d3d4fac0903c705f533cf7", - "0xa3fd9d8bbdc98394883022299fd9793e0c4f374d8e40d6ce89b2869d3173cb6a5476371d6095dad068ff217729f60af4", - "0xa57d5de556853484b1d88808d2529450238bc467376ded84cfd7b4a1ba258f6d43b5958220f962c57b033abcef1d5158", - "0x8465bd8be9bd9c2c6116d4ae44ec6618c109cb9aaee2d241e7a6ed906d398ef15a6fc18bc8b1d3398184241405954bba", - "0xab1cc44983e46a6ea2430aa6616ab28614f43624665e3e6ae31a9357c0c5434f34e56c720906e184327693cc4ebe1fa2", - "0xaafe14dd3b680f096010788226d8413ca628feedad79a2bc78cb04d47c6ad910f7f46ca87b8f8281744625d8f42d5eea", - "0x86a533b02ae929f67c301649a2d58651b98cdffe731b63fa32aa1013c271634bbb088c0d02865913c11bbb1bf57c0e12", - "0xb28df3e04bde4ec373171401dbd0546f4cb6fa8e9a4a8019aadc653d4e05e0b5b9a64417715dd87f6df9e7b3145f6659", - "0xac63fc758c1a3bc5cbff0f5e0b5a07a5aa801363b129d4e0360165c7dc1057ec37b0d808e9fd6b179e2c1e66bbc6090e", - "0x93f941b4fe6c05621e7a651b87669eefd60b6e8a4a8e630a51fa3fee27417b9eebce39f80a5bade9ca779133ad8388f6", - "0x96d7a69eaf2761bf0e5ebcd607b134d5dedba8e262ca1d6d3e8fbf23e6419a8ce1bbe4cd23b9e4b5f80db54a802a9795", - "0x8b62902fb2855300580e94830a4bc825d997ede33bf356fe3b7c08d6a8bd85a37879433fc6bee58f9b44ca280f4e8dfd", - "0xb043156fcd02b75dbe940c763fa8e8a7c7f6d74c1d5395db5ce544af3b6097eab61686950535a810aa95889ced12f74d", - "0x8614a7599c8d97aa9ca63b876f677977cf0daa969ff2a9a153f297a4a46e08fa5d91492995de94dc32cf009ce6bb5b5f", - "0x81351fd284d6d07092875f366bc5e53bfd7944b81eece85eab71a00443d1d2a9fc0337aaf34c980f6778dd211caa9f64", - "0x8c722aaf5d5dad1845056bf5e56dbff0f8b501f4846610f99da01130a49c96db9962bfd9be20670658cf276cc308be08", - "0x8effe3fb27c9f76bbd78687b743b52e6f3330eddc81bc9006ca81fd640f149d73630af578694f4530833c2151522dcc1", - "0xa3d327f48eb34998a3b19a745bca3fade6a71360022c9180efb60d5a6f4126c3f4dfa498f45b9a626ca567fdd66ffbff", - "0xa59a59db246f981e9c8e54aba52898c714d9787fef8969a6d8677fe6dec82950ff22a1364393b579f3e596cdf5bcd7b1", - "0xa15ebe9ab6de62a4d1ff30b7fc58acfb14ea54d7fa513cbcb045af3070db22bf9c1e987fa26c0c54356b9e38fa412626", - "0xb58396bce7d32ba6c70adbd37156d859e153c1932d2b0c7c874a1182ba831439e80d6fc6d7d88a870e193f515aef2264", - "0xb666dae42ea858c9b7d903ea3ca5279f619c71ac6e3fda7469e2bbba08c7e8e12d6a3c35ff2c6383673b1b7c21db5e0e", - "0x8eaaa21c8955f15bbcfd5756421a045e7b4825576379cc6229fe9751f7a7738b90be19ba52261db01c1e13af955675b0", - "0x8027bc62b59f9f15613e38da74ccc71fc3eaee26f096d187c613068195ce6eb64176013f2d86b00c4b0b6a7c11b9a9e5", - "0x8275eb1a7356f403d4e67a5a70d49e0e1ad13f368ab12527f8a84e71944f71dd0d725352157dbf09732160ec99f7b3b0", - "0xb8c41c09c228da62a548e49cfa107630166ac5c1469abf6d8aab55938ed1d142d5ddbc4f1043eed9496e9002cac99945", - "0x912750d2f1b21756662a400236f797b8ba76c73e5af95941a8c6ef9427838c4826715c80942cf8cb7ed01566bc490754", - "0x862af7dbb38ad7293a4e598cb52a8ac84dacee3d9bf007b5cb6a18a1acead0aa33f6dba796ce630e632c97aeb7100d68", - "0x890def696fc04bbb9e9ed87a2a4965b896a9ae127bc0e1cc515549b88ddbcbc02647e983561cab691f7d25cf7c7eb254", - "0xb835ffaf54c8b878d3c4262ca2bf5e6be2c691adced622b35d998ed72e1467ba907f4fde8d64ce43b43a8196f48e55db", - "0xa6d7e65bf9f889532090ae4f9067bb63f15b21f05f22c2540ff1bb5b0b5d98f205e150b1b1690e9aa13d0dee37222143", - "0x8ebfbcaccddd2489c4a29a374a2babc26987c3312607eadb2c4b0a53a17de97107c54eab34def09144b3098c082c286b", - "0x900b9972180a2c8753f5ff49fdd2cfe18c700d9927b3c3e16deb6376ad6ee665c698be72d4837b94911a0b4c183cb140", - "0xaa9679c01ecf1f1452c54688e01cb25bf157bde6b09b1ed460b8c175d65eba439c7ad4b7c1d72415f5622f3fbc068dc8", - "0x887a4277ee8754733f3692a90416eeac1ebee52ff23173a827f0ba569bd84efd806eb9139049f66cc577e370d3f0962d", - "0x951b27456e2af80436608aadec54ebd03bda37fa58452631da63bc5ff3eecb5ffb73d356b19f6c9c4225fcb0da8fda20", - "0x9104b5af82dbca914370eadb5518b26bee7ed7edeca74b741585ba8b249204e2c998bd47a02cef4335e236f8efafef94", - "0x8757e9a6a2dac742ab66011c53fa76edb5ebc3c2fbd9a7265529a3e5608b5c24b4482fed095725e9b8fed5a8319c17a4", - "0xa7acf82999de75f231fd80770bcb0f4c720d6b1e4a2558fa1ce854382fda92beb89fea5b5d229dad85fafee7a9e98329", - "0x8fb74891a8642f25a55b5eda5818367aac2fdf9663ad1e3dbc0166b484c0cda581b243cc75131167f1afa9caaf6705a0", - "0x897d7a19b70dcef1af006df3365981d73068c81f18017f32fb9966599481496efd5f6caceef943b31c52750c46d9590d", - "0x87ac804ccfe7f1fa156b8666664a397236832569f8945e11d4688a9e43ada4d4104efb3fda750f48ef655a29357c5e7d", - "0xaf18cf1e3d094b4d8423da072f98b3023d296f6a1f2a35d500f02bde522bb81dc65e9741c5bc74f7d5613bd78ce6bc03", - "0x9752561179783f336937757b619b2fdcb9dfce05aa3c4fce6d582dc966182eb85ab4ccb63e7e1736a7c5fad9d33cccd2", - "0x89e19b665ce7f6617884afaf854e88bb7b501ecdd195a5662c79802d721f5340eca8c48341ad1d6c78f519f82e5a9836", - "0x94402d05dbe02a7505da715c5b26438880d086e3130dce7d6c59a9cca1943fe88c44771619303ec71736774b3cc5b1f6", - "0xa76adeddf2454d131c91d5e2e3a464ef5d3c40ee6a2ab95e70ef2e49e0920d24f9b09276250ed7b29851affbdbc7885a", - "0x8934e9a3feababa12ed142daa30e91bd6d28b432d182ac625501fe1dc82f973c67f0fe82d39c9b1da3613bb8bfe2f77b", - "0xa5c11337eb91ce0e9b6d61bbdadea0a063beee1bc471cc02dc1d81c5dd2095315c400cbc6c33d23c77e98bba6bdf5439", - "0x92d00e64ed711951aeb852908aeb6fd379ea516872dd512384b1e773ef078e52e6d618beb202d437d2a46bcb78087f7a", - "0x97f1a7370b4f5acf83b466f519da361c366915f560385dd7eff9d53700ad81b25c9862bc71d35428e82372a5ae555ea0", - "0x95614544f65808f096c8297d7cf45b274fc9b2b1bd63f8c3a95d84393f1d0784d18cacb59a7ddd2caf2764b675fba272", - "0x8d474636a638e7b398566a39b3f939a314f1cf88e64d81db0f556ca60951ec1dca1b93e3906a6654ed9ba06f2c31d4ea", - "0xb87e5f481b938ac8a481b775cc58be2a06604549e3c810fc4734bab76099e5c617f0243c4c140cb7dd6d36a6dc2286bf", - "0x806efb61d1c948efc10dbf9bef30197d1c269e5e7fcf20a84367b26223d33fade413a0bbf4e33f0d1f1a00967289015e", - "0x880b99e77a6efb26c0a69583abb8e1e09a5307ac037962ddf752407cacaf8f46b5a67faf9126bdbcb9b75abf854f1c89", - "0x82ffe4de0e474109c9d99ad861f90afd33c99eae86ea7930551be40f08f0a6b44cad094cdfc9ed7dd165065b390579d0", - "0x941cd102228aa81ef99506313a4492a17c506e7169808c6b14dd330164e9e8b71b757cbe6e1bb02184372a8c26f7ad1f", - "0xae96dc808c316a677977831bad1e529ef965dadb5d6aea25ab008fe7bb1543e596e33052cfbe4279fa060201199d2c34", - "0xa2053719da2b7501dab42011ae144b3c8d72bd17493181bf3ae79a678068dc3ee2f19d29a60b5a323692c3f684f96392", - "0xb17171939519d90e243d41839c3c5ce7ac7e6a978e4a7e56b2c8e6a2b1b587c7eacea47f2e31a55d88555d252c810ebd", - "0xa958987c2b3c84df8176b600f5b75a8badef9653c71eff967e76648937def38826eaab4027a639f4f300b20019166250", - "0x854aafa329e2b2563355641eba95f2aba5b33d443ab16f5e342048f97d97c4e2812ff27c6f4180b8110272f3151be690", - "0x94d4a1e3a3d28a948f14d1507372701ac6fc884a4905405a63663e170831578a2719714ef56f920baa0ca27954823e39", - "0x826be957cf66db958028fa95655b54b2337f78fb6ef26bd29e2e3a64b130b90521333f31d132c04779e4b23a6b6cd951", - "0x8261f7e644b929d18197b3a5dcbba5897e03dea3f6270a7218119bd6ec3955591f369b693daff58133b62a07f4031394", - "0x84926cf2265981e5531d90d8f2da1041cb73bdb1a7e11eb8ab21dbe94fefad5bbd674f6cafbcaa597480567edf0b2029", - "0x8fb51e3ef3c1047ae7c527dc24dc8824b2655faff2c4c78da1fcedde48b531d19abaf517363bf30605a87336b8642073", - "0x8ba45888012549a343983c43cea12a0c268d2f7884fcf563d98e8c0e08686064a9231ae83680f225e46d021a4e7959bb", - "0x973ab82026d360e2cf5676d883906186bc61b43f60767ca58f11d0995e40780b163961e6e096299ccf1c86175203abde", - "0xb77416ea9a6b819e63ae427057d5741788bd6301b02d180083c7aa662200f5ebed14a486efae63c3de81572fe0d92a9c", - "0x820cc2ac3eed5bce7dc72df2aa3214e71690b91445d8bb1634c0488a671e3669028efbe1eae52f7132bde29b16a020b7", - "0xa6b434ac201b511dceeed63b731111d2b985934884f07d65c9d7642075b581604e8a66afc7164fbc0eb556282e8d83d2", - "0xb81821a79c9148b41d24d85dc997336a1e1719da0e31e42af30812b97a5af31708ca3e7bc2e803c3751cff23af5c509d", - "0xa013cc5e3fbb47951637426581c1d72764556798f93e413e1317849efd60f3ecb64c762f92544201eb5d6cfb68233050", - "0xb5f32034d0f66bcbccefe2a177a60f31132d98c0899aa1ffff5ebf807546ff3104103077b1435fa6587bfe3e67ac0266", - "0x86ca8ed7c475d33455fae4242b05b1b3576e6ec05ac512ca7d3f9c8d44376e909c734c25cd0e33f0f6b4857d40452024", - "0xb781956110d24e4510a8b5500b71529f8635aa419a009d314898e8c572a4f923ba643ae94bdfdf9224509177aa8e6b73", - "0xa3f9dcc48290883d233100b69404b0b05cf34df5f6e6f6833a17cc7b23a2612b85c39df03c1e6e3cd380f259402c6120", - "0xa104d4bad69f1720307ed12363d1ec97952acfe09d9e3650034c33f3f20c763271ebe0d5b50b1d3bd15c469f4573b09d", - "0x94bbc6b2742d21eff4fae77c720313015dd4bbcc5add8146bf1c4b89e32f6f5df46ca770e1f385fdd29dc5c7b9653361", - "0x951aa38464912a29df2101c60771d6de7fadb63f2db3f13527f8bdacb66e9e8a97aaac7b81b19e3d1025b54e2c8facff", - "0x919b5187af7dae210f151dc64a9cbd396d1ae04acadebf542a7123004efc7ce00d6e14c170d876fbc64dc1b5d141a5f4", - "0x88e1e459ee5aeb8b36ed004f6d03da296101106fbe1b18f9bbf63e92321db51670c34050fd3b7dc56a4bad76403823ee", - "0x86b3ec14a8ffb811a0ecc3771f600d8b08c098537d100fba66def19e7ee4d1c397a311977bf37e6cd2d47a8a2ee8c223", - "0x898c4873bd356ba8015f6f686d57088fa8f79f38a187a0ef177a6a5f2bc470f263454ee63d0863b62fca37e5a0292987", - "0xb471c72bd2971353f4b44248b8e6cf5316812861a88ccfc20fd0d89a5e010428c387228b2f6f14c12f79e31afc9d0753", - "0x8b7cb5b8de09a6dfceddcbaa498bc65f86297bcf95d107880c08854ed2289441a67721340285cfe1749c62e8ef0f3c58", - "0x983cb6bbfe83bce8326e699e83fca01ea2958c09808c703cac97a0ea777e5a5f3f5bba9169a47732de7459a3c7af47d2", - "0x8235a3f09078dd34ce2fc17cc625e061298713b113dda12d354b3d2ba80e11c443b1dd59c9eb5a29513a909645ae97d4", - "0x8bb51b380a8a52d61a94e7b382ff6ce601260fa9b8c5d616764a3df719b382ec43aec9266444a16951e102d8b1fb2f38", - "0x9579973ee2559da09b327c62b1cc0177f2859872885dca709e24dcfbb9bdf9224a6d26869aafce498f44c0e6bd8a996c", - "0x842ba3c847c99532bf3a9339380e84839326d39d404f9c2994821eaf265185c1ac87d3dc04a7f851df4961e540330323", - "0x99dad12f78e1a554f2163afc50aa26ee2a3067fc30f9c2382975d7da40c738313eaae7adbc2521f34c1c708f3a7475b7", - "0xb96e3ff8bdae47aa13067c29318b1e96a7fe3941869c17ce6662183b7b064bf261e1cea03e2a4643c993728a2606b5b5", - "0x955bc897171aa65d0159aa6e5d51855833f83d8bd5e65f93ad26c27781171783f3988a12bf987472edb39994bd071ea5", - "0xa59249e4dfb674dfdc648ae00b4226f85f8374076ecfccb43dfde2b9b299bb880943181e8b908ddeba2411843e288085", - "0xac2955c1d48354e1f95f1b36e085b9ea9829e8de4f2a3e2418a403cb1286e2599ba00a6b82609dd489eda370218dcf4c", - "0xb2eedff11e346518fa54e161be1d45db77136b724d497e337a55edfc896417de3a180bf90dd5f9d92c19db48e8574760", - "0x976eb5543e043b88d87fda18634470911dfe0e0cabab874ca38c1009e64d43026d9637d39dcd777bc7f809bbfc3e2110", - "0x8ea5f88a79f4eb9e7c0b6b29f8ef2d1cc4c15ed0ed798ab11a13d28b17ab99278d16cd59c3fa8217776c6dfae3aedf88", - "0xb7f146a357e02a63cd79ca47bf93998b193ce1174446953f12fa751f85dc2a54c9ed00c01a9308509152b3bad21d7230", - "0x87fd7e26a0749350ebdcd7c5d30e4b969a76bda530c831262fc98b36be932a4d025310f695d5b210ead89ee70eb7e53b", - "0xb9445bafb56298082c43ccbdabac4b0bf5c2f0a60a3f9e65916af4108d773d62ffc898a35b0b8efb72ea846e214faa02", - "0xb106c6d13ca17a4c8ea599306e84918127cf2de21027ac3fe5a57d35cf6f3b1d7671c70b866f6e02168ae4e7adb56860", - "0x9276e8051bed8f5dbfc6b35765aac577dd9351d9d6ac1bb14496bd98091005b9a4737b213e347336413743f681f5043b", - "0xaefc682f8784b18d36202a069269be7dba8ab67ae3543838e6d473fbc5713d103abcc8da1729a288503b786baac182d3", - "0x97578474be98726192cb0eac3cb9195a54c7315e9c619d5c44c56b3f98671636c383416f73605d4ea7ca9fbeff8dd699", - "0x99c34f9bd0fcb18b3d931e562988cf91886a417f8678f22651bf3cf138df2bbec3f675de90f62dda769e0eda03d72b7e", - "0xa0047e03c89a95248543618e6b7ca2c7aad7acda3c9f85771ec5c93fa898c651e8b2ea3b6b799d8cd592290a986cdd7d", - "0x993726e0b1c2277b97b83c80192e14b67977bf21b6ebcde2bda30261aa1897251cd2e277cfcb6193517f1eb156d2fe86", - "0x974a5180e55eab23d4c973fbee6ad1010335161ecdb849fe6520b34c1f96530a4faff80bd738fe281019b79d968c472c", - "0x8f1d90034f998018c3f4b5947b40b139fcead2e40aa80fdec6a4337c60e9d5ff1923dda7f0b5b1731ff16f55027d41bf", - "0xa7d9ae9621dd1f3da3cd2d435e891cc3579c4c0d60d6a4565cac86c315cea21a9ad883559fe7b897ae6e05f1aa989ad9", - "0x800f6be579b31ea950a50be65f7de8f678b23b7466579c01ac26ebf9c19599fb2b446da40ad4fc92c6109fcd6793303f", - "0x86fa3d4b60e8282827115c50b1b49b29a371b52aa9c9b8f83cd5268b535859f86e1a60aade6bf4f52e234777bea30bda", - "0xa80ac2a197002879ef4db6e2b1e1b9c239e4f6c0f0abf1cc9b9b7bf3da7e078a21893c01eaaab236a7e8618ac146b4a6", - "0xb4bf70468eff528bf8815a8d07080a7e98d1b03da1b499573e0dbbd9846408654535657062e7a87a54773d5493fc5079", - "0xae0e15a09238508b769de83b30582cc224b31cd854d04fdb7b8008d5d8d936dbdd3f4a70fff560a8be634c141772561b", - "0x936f7e20c96b97548fef667aa9fa9e6cfdc578f392774586abe124e7afc36be3a484735e88cc0d6de6d69cf4548b1227", - "0x8163eea18eacc062e71bb9f7406c58ebe1ce42a8b93656077dd781c2772e37775fe20e8d5b980dd52fdad98b72f10b71", - "0x86a6560763e95ba0b4c3aa16efd240b1873813386871681d075266511063b2f5077779a4fe49ffc35e1f320b613b8c94", - "0xb156d9d22722bb6e3b75b3b885b64642fa510ba7e6057657cd61bac43fb9c284d05bb09e2d4b78a2a4ddada85da9c702", - "0x9779ca2759dbed8081f0cbbfffcb3b842ba335e3ae48a60c5e5c77c7a2a0623e4c415ec3a023cc4e216885fcbac3ce52", - "0xb8137fd57ce7d3cfaf8bdbaa28704734d567d0e7a2d87fb84716722c524bb93acb2c1284249027f3c87bccc264c01f4e", - "0x8cf06b34e7021e9401eb705dde411ecf7e7e7185f8c0b0aeed949097df31812a9fdd4db7d18f9383a8a5a8d2d58fa176", - "0x8c65aa29a9ee9066b81cf24cf9e0beca3e8e8926e3df22d5ff1236297e158cc8bc7970a2c7016009cc4efa8f14b14347", - "0xac7e49f2059e99ff65505742978f8d61a03f73f40141a2bd46fde5a2346f36ce5366e01ed7f0b7e807a5ce0730e9eaa9", - "0xa1c25eb9b73723982be78180770aa63c5f7b23c2e54a2ed7e75a860c4512d273008066f1124ac8a43c60fe1e2a8bf03c", - "0x9310722e360a5652737362f6b9cb6e9c3969a0c9bb79b488b3c7d19d9e8c42ebd841df346258ded2e393895c99b413cf", - "0x893272a63650b08e5b8f9b3f17f8547b456192ad649c168bafd7166b4c08c5adf795c508b88fd2425f7be8334592afb2", - "0xb576c49c2a7b7c3445bbf9ba8eac10e685cc3760d6819de43b7d1e20769772bcab9f557df96f28fd24409ac8c84d05c4", - "0xaf17532b35bcb373ce1deebce1c84abe34f88a412082b97795b0c73570cb6b88ea4ba52e7f5eb5ca181277cdba7a2d6d", - "0x8b8813bd2c07001a4d745cd6d9491bc2c4a9177512459a75dc2a0fa989680d173de638f76f887de3303a266b1ede9480", - "0xab73a043ccdfe63437a339e6ee96ef1241264e04dd4d917f6d6bc99396006de54e1e156d38596ba3d15cb1aaa329f8f5", - "0xb67146b202afec0132ac0070c005cf664081e860339f8f4d45ac3e630dda05560936e646673e652d08cecd8d18fc64da", - "0xa750404e9d4b1a48f767d2b6aa699200c92c3b8102597f8c5c1dbaaf08112a0587c05801dfebb3612fb6dfd76ddc9ccb", - "0xb0d4231814e40e53ab4eed8333d418a6e2e4bd3910148b610dec5f91961df1ad63f4661d533137a503d809ea1ad576fa", - "0x81fc724846b5781f3736795c32b217458bb29972af36cc4483dd98ab91680d3d9bc18842db2661487d3a85430dc9e326", - "0xa5cf6f4fd67aecb845eebc8d7304c98c69806d774d4c468350f7f82ff0f5baeecc56837705e39432a8d246aa2a7075ed", - "0xa71d2c8374776f773bad4de6edfc5f3ff1ea41f06eb807787d3fba5b1f0f741aae63503dbca533e7d4d7d46ab8e4988a", - "0x825359cfe68ad6a75578a94be6419179e0aa088170b6c20fc5c249dc3be7a260d687c93d8d8a343c7c72c2ed6a716de3", - "0xb6aeb7a9b934a54e811921494f271d5d717924c561cd7a23ab3ef3dd3e86184d211c53c418f0746cdb3a12a26a334fc8", - "0x8c6fc89428c74f0c025e980c5a1e576deadf8685f57136e50600175fa2d19389c853d532bb45a3e22b4a879fab1fcb0d", - "0xae95ddcf3db88f6b107dcf5d8aa907b2035e0250f7d664027656146395a794349d08a6a306ce7317b728ca83f70f3eaf", - "0x8c03fb67dd8c11034bd03c74a53a3d55a75a5752ea390bd2e7f74090bf30c271541b83c984d495871d32c98018088939", - "0xb8d68610fdee190ec5a1f4be4c4f750b00ad78d3e9c96b576c6913eab9e7a81e1d6d6a675ee3c6efac5d02ed4b3c093a", - "0x87d4b20bbe2dcd4f65f4e1087f58532d5140b39a5288e1a63fc0b7e97a6a56946eafdd90ba09300c3d1fef6356ac6b7c", - "0x83e264b1d3d4622826ab98d06f28bbbd03014cc55a41aaf3f2a30eec50430877d62b28c9d6d4be98cb83e1e20f3b13db", - "0x97ffcbf88b668cde86b2839c7f14d19cb7f634a4cf05d977e65f3cd0e8051b2670e521ae74edc572d88201cff225e38a", - "0x91efdbcaad9931312d7c41d24de977f94d7f3f7b88090a1f72d9a097a1e30cc805c5ea16180f463022d9b26b8863f958", - "0xa4b507a4bc2bc424297bf8968bf385fae3acc686cff4b7933b4f5b6ef3149995393d5331dbac4b629e8adce01a91a4cc", - "0xa76a26c30d8abbbd4bf982bb8bd2066a2ec823a5eb6fbe37c664e67efbe2f72d8ce2d00223b900699149f8441bff5ada", - "0xb3a5497365bd40a81202b8a94a5e28a8a039cc2e639d73de289294cbda2c0e987c1f9468daba09ea4390f8e4e806f3c8", - "0xa09b2a07d861e01645accfb088f7f9ad524186bd439712775459a60f8a1fbbd43ee084e4d6e23ffce06daa189cd1e654", - "0xa41cf5d678a007044005d62f5368b55958b733e3fdde302ba699842b1c4ecc000036eda22174a8e0c6d3e7ef93663659", - "0xa698b04227e8593a6fed6a1f6f6d1eafe186b9e73f87e42e7997f264d97225165c3f76e929a3c562ec93ee2babe953ed", - "0x8bc66e370296649989a27117c17fbc705d5ac2bda37c5dad0e4990d44fcc40d3e1872945f8b11195538af97961b5c496", - "0x8bff10f91b8c0abb6c9542588da17fa0118ffda4c82626a754887e333d7d69661b3ae4e400da15c49565f8d10a77d0d7", - "0xac715c7b3d794860a61d9c7bd224a2b14a6023f696afa30345aad2ce0a6ea6dbc142f34af1ffe7f783542851a28e8ece", - "0x91c5e0b9146fe5403fcc309b8c0eede5933b0ab1de71ab02fac6614753caac5d1097369bdeed3a101f62bbcae258e927", - "0x8553748da4e0b695967e843277d0f6efeb8ba24b44aa9fa3230f4b731caec6ed5e87d3a2fcd31d8ee206e2e4414d6cf4", - "0xac722bd742374f925185ea7d4d62d7510b2d8a6ebf5c750af6ce83e2d8a28c95a3e298870ec8254ab2d1d0aa2a063c60", - "0xb083c4cefb555576bb37b71f30532822cb4b1e1998e35cb00ffb80ca14e2853193c16a6756417853d4a74d625744dd76", - "0x85745bd84c92ddfc55df11fe134cf70e3c340aa1c7cdd6188a03308cf3a840f4f19629f9730b2e6426424989ff03000d", - "0x845b4531dee808b583645f56fa98cbdecce3ea100db60524b64f68e29866173791f01137714f4dc7fb8612f7f7943263", - "0x93f03495d53c781be8b76e37e68b64aa260523004eff6455ddc8a8552af39854e5181f8c5365812b1f65926534fba5dd", - "0x801c126abff96fe9b042be8869d2907d0c6963a79901f9db46577a445418b7465a1f4b346933d433e539536a9a2df01c", - "0x952cf6782b0ad3e85625391cc5f486a16bb5b1f8ea20defcb6857bd7d068dcd2701bc7ed5c3b773a869180d9042f772b", - "0xb3b6eccb2ec8509b4eea8392877887180841ab5794c512b2447be5df7165466d7e293696deaabf063173e5f2238ce763", - "0xb63fd45023f850985813a3f54eceaccb523d98d4c2ba77310a21f396e19a47c4f655f906783b4891de32b61a05dc7933", - "0xa113b889be5dcc859a7f50421614a51516b3aadc60489a8c52f668e035c59d61640da74ba1a608856db4ff1fa1fe2dfd", - "0x87fec026beda4217b0a2014a2e86f5920e6113b54ac79ab727da2666f57ff8a9bc3a21b327ad7e091a07720a30c507c9", - "0xa3ee8fd53158dad3b6d9757033abf2f3d1d78a4da4022643920c233711ff5378ac4a94eadcaf0416fdcca525391d0c64", - "0x8d6bed5f6b3f47b1428f00c306df550784cd24212ebac7e6384a0b1226ab50129c0341d0a10d990bd59b229869e7665a", - "0xb549cef11bf7c8bcf4bb11e5cdf5a289fc4bf145826e96a446fb4c729a2c839a4d8d38629cc599eda7efa05f3cf3425b", - "0x982691766a549df56436acd0fe76da78132e027515f27174c10d117bfcc20ed73fc31f5465bd7a22a101094fe913e221", - "0x985af1d441b93fa2a86c86b6d7b70b16973d3971e4e89e093b65f0ae626d702202336869af8e3af3923e287547d5384b", - "0x994b7baecc8bb68d270a3a88c58e4054afdbd713b4472f9522b27c1762c637ef8f013d745ce9d1dc8fc4d986d4c9338c", - "0x827dabda84c7f7b1adc0f5ca0fccf0729e9d7f78e1ffa7c5e9c4f66610ff0ab776c880b00c77137cf7abe14df977febc", - "0xacd17cba1203748b55bd9d7b940a16bb7c02988c93007a80b87e0bdb049b91f5ecce577e3e4ea68a0abe998a72cd300d", - "0x989fa046d04b41fc95a04dabb7ab8b64e84afaa85c0aa49e1c6878d7b2814094402d62ae42dfbf3ac72e6770ee0926a8", - "0x99dc48a054f448792523dcdeec819e1b928b1bd66f60f457261f0554f8532eedd7152792df70ae5316ab2f9c02a57cdc", - "0xab33c65587ecb3278325948c706aed26547e47ed2b4bc027e9119bb37bec67ddf5489fbc30304ef6c80699c10662d392", - "0xae89e41d8cfbf26057a4078f8a5146978e658801b08814190cbce017d79beaeb71558231a72bde726fa592fb0828c01c", - "0xa9901df92e2d3abbb25f3bf4b913692c4cd57da327b01c8ee2362c02fbefcf66cdb792c17a81dcbde3c9b9dba313e4a1", - "0x8ee41011424da5e2ecea941cbf069ea32420749f2519434d3d8f9725ac789753404687a6745cffe4bd5dfc8fec71a719", - "0x8cfcdfa192b17321be4e447204e1a49ecaadca70a3b5dd96b0c70ab64d1a927d1f8c11a7e596367e5fa34e2307af86fc", - "0xb8a0003e949cf994b1bb25e270cb61358200c93b1c6f611a041cf8536e2e0de59342453c5a8d13c6d4cc95ed8ce058f3", - "0xadc806dfa5fbf8ce659aab56fe6cfe0b9162ddd5874b6dcf6d658bd2a626379baeb7df80d765846fa16ad6aad0320540", - "0xa83b036b01e12cadd7260b00a750093388666aff6d9b639e2ce7dfc771504ef8b2090da28ec4613988f2ec553d1d749e", - "0x825aca3d3dfa1d0b914e59fc3eeab6afcc5dc7e30fccd4879c592da4ea9a4e8a7a1057fc5b3faab12086e587126aa443", - "0x845a4a09941f48677e6c03699770f9a56ba72695089e432a6f232294dd8da6d34e394116a9a87f3b0902c78332af9439", - "0xb2f168afc35ed9b308ab86c8c4aaf1dcd6833ce09153bb5e124dad198b006e86a941832d387b1bd34b63c261c6b88678", - "0xa094cca9d120d92c0e92ce740bc774a89667c6f796b438b0d98df0b7aef0935d8c915d5b0dad4b53e383dc9f095c29fa", - "0x956ecb233b3529b2d9cb80ae49e48667f2a3120e4a0d7131d1e9ec36db3a59dc2ef2a579cbb99d6f14880ca83f02b64c", - "0x906cde18b34f777027d0c64b16c94c9d8f94250449d353e94972d42c94dd4d915aa1b6c73a581da2986e09f336af9673", - "0x824c8a1399ab199498f84e4baa49ff2c905cf94d6ac176e27ec5e2c7985140dbaa9cc6303d906a07ab5d8e19adf25d8a", - "0x889a5cf9315383bf64dfe88e562d772213c256b0eed15ce27c41c3767c048afe06410d7675e5d59a2302993e7dc45d83", - "0x95791fb6b08443445b8757906f3a2b1a8414a9016b5f8059c577752b701d6dc1fe9b784bac1fa57a1446b7adfd11c868", - "0x99049e9a23c59bb5e8df27976b9e09067d66e4a248926d28171d6c3fdd1ab338944a8b428b2eaae5e491932c68711c7c", - "0x95c810431c8d4af4aa2b889f9ab3d87892c65a3df793f2bfd35df5cfdb604ca0129010fa9f8acae594700bece707d67f", - "0x841d77b358c4567396925040dffe17b3b82c6f199285ac621b2a95aa401ddb2bc6f07ebd5fa500af01f64d3bb44de2df", - "0x90c402a39cd1237c1c91ff04548d6af806663cbc57ff338ed309419c44121108d1fbe23f3166f61e4ab7502e728e31fd", - "0x968d44188e2d9d1508b0659e96d6dabd0b46aa22df8d182e977c7f59e13aa05d5da09f293f14f6f2ee1b996071cd2f25", - "0x8ae9585caa3c73e679fe9b00f2c691732f7b7ca096e22d88c475a89d4d55cb9fba3cd0fe0cedd64ce75c591211664955", - "0x94b81d5ad72efb4dd60867e71afcd8e87e1f24bf958d42fc07db66f6185a1e610987ab9ceef63109a36fe5544a0cf826", - "0x8499a8c3d67d1f6eccf1c69274393dc498cff862ea8e6c11ffb8107ae190d258ddc1d294f2a8f050488df0212063ece2", - "0x921109a390e4d7fbc94dff3228db755f71cb00df70a1d48f92d1a6352f5169025bb68bcd04d96ac72f40000cc140f863", - "0xb464d763e5ef724ab7ee13a60015df5c9a7809a79188ff6a7e0d5e5400febd42ad7330406a59704a44a08f2289d659c8", - "0x96f1a36134e0d4137a7fe8bbb354f50aaa67f28f194ae2fdbe8be3eb24596678d8c9287765ee90c1f2778d0d607931e0", - "0xb031d93b8f119211af76cfafee7c157d3759b2167ee1495d79ad5f83647d38248b4345917309ef1a10ecaa579af34760", - "0x88a7dc337d89324f025f686f37d21240c7da9a1cb802259ea8d8a83e246dcc2adceca7ca3534bc7bf8f3ae1cbeafb5c0", - "0xb30e022b8a563655074e08e123b5f96956bbf0fe221cc629c5fedd2764a66b475916ceb98867f935b4a47212e53ae9f3", - "0xab6e3180dae399d41243f23545e5e6d118844f9b8edba502a3503fd1162ed826f9fc610889a1d685d374b6c21e86067d", - "0x96cf5760c79cfc830d1d5bd6df6cfd67596bef24e22eed52cee04c290ad418add74e77965ea5748b7f0fb34ee4f43232", - "0xa5817c74a394b0359a4376ef7e9e8f7dfa6a7829602da225074fb392b715e1fd52c50cae0f128a7006f28b22f233fbf5", - "0xa50ab79cf3f6777a45f28d1b5cdad2c7ea718c60efeeb4c828d6307b29ef319445e6a9f98aa90f351c78b496575150c1", - "0x8b300dea07e73dd2f07b05d477e51f8424589f6b2fa6f461240e1322a3a7ab5bf227b74544bb5d66a297702cdbf6c6bf", - "0xb13b5cb86dc8b8fe87125f1a51fe98db36bdde4f600401408b75059a44e70b1bbfefd874e539691f3f1bf6f54db883c8", - "0x8d06205cd66703ce6776b38b98c32b27f45c7b3f65ea2d05e2b702c24d553f51c69bf0b17e8db7382475e3d370d2e8d6", - "0xa11a7496c712734aec80738e30d2bf245758b34245076149854eb209fa6403be8bb0d4e515becc881b7f3610749260c0", - "0x9615800f8c95f95bf25055ae079b964e0a64fa0176cc98da272662014f57e7cd2745929daf838df0094b9f54be18b415", - "0xb19ca6e55f349bbb2dc3e429520ff5b2e817972470794f35c1aac8c118b37a694cfcc875b6d72225343799825d2f5c39", - "0xa650864b7eb6769aaf0625c254891447351e702e40d2be34dfd25f3b5367370de354318d8935ba18db7929270455ae6a", - "0xa649208372f44f32eb1cd895de458ca1b8be782746356f08ac8ef629429d0780a0799fcff85736e19aead0b79bfff261", - "0x89461cb2dadf51d6f1208b0965c8eabec895d7b19b7d90d3c6e49dbe75a75c30fd26db3dfb169dd46a4342280225032a", - "0xb5d6f664ec92e5343792d5d6b629919c5fd8cfb874677df2264daf02bcd9d12facf9b859d5402839c9022396e20d260b", - "0xa7179d338fe5a0e4669364a364e17f8d00cb6c59a80a069afd5f4f14510df2eee90c07826553e4f7fe46d28f72b2903e", - "0x8ded37d67b5368619a090266e9b5585fbff60319a90a4244a3c3342641f5bfa5130998dd97d7a42505cd896c29255530", - "0xa3fd63e87a00b48ba46a646a26187ae6dcb16779721973ada13a545853e2e51b5e4df04630d670884ad4a2304cc60c67", - "0x92761b7e31f0c758b3b1f5b43a194b25aabec668101946eb6511132863d3afb9d18f833d43a8338d0e7bc78d8689e523", - "0xab8a8769c754008a7976b6799e81d7bfe97413d0a79b90715703c1f8f567675463ec93aabee59277121fc4df88b5c7a9", - "0xb354d0d1bd942f79002a2eaf37eb99dab650170e7040c13c824803ed7c1670dc910ccae13bbe58bde003829b140b45ea", - "0xb9eed89e003894ad2cc9d9b93a45247e1367ac69a00b0ed5e3280c1188b4cb90eb870d449b83a852a798bd02f9d0c813", - "0xb900a55013d0427e5da6b21611d6ae3e648f54f794cb099b2d2beebae0a957477a94dc415e8ec5e68e9029ce50d43843", - "0xafbf44071c2c905f7c8ef396eaed7f13deb7a91719cb5e8b9226aaceb876d81a10076383edc6216bc2f5c38a480b2957", - "0x80bdb82b7d583bf1e41653966b0ba3b4fec0e7df2ff08e3fa06fd9064bca0364263e075e1582741a5243bde786c9c32e", - "0xa841fe9ff26db21ade698f6dbfba025d90ae9f81f02af9e008fa0a429b993fb04d06acb93e40a9f81c78f73334555a17", - "0x8cd49711b42af58a5aae75a38fea9ddc5e4183c467a3159b5b0629f01ba548513c577456d34c861911e85782e52c3b1b", - "0xa322b5d2a6e3cb98b8aaa4c068e097188affef5dec2f08c3e9ce29e73687340d4e5a743a8be5f10e138f9cabbe0c7211", - "0x942772b7c7c47d4e5957ccf1d6f1450070930af3e2b7eaab0dd7699372445df0cc910e6c0efcf501887dd1adabdaee23", - "0x9834f66e5c946c3a8241ca2bbde046a7e88072124911d5d15c037a95b61e82b88b5c2058fa4a3721537dee39dee5da18", - "0xa90cc5b9c4d84f36962d0d55d5bc123dbe5ec5f4fe7b6bf0d009028b3cf14e36c11bc5365391cb4ae548d5eb04fe371b", - "0xa7c2174eea2b66b2a71cc8095fae39c423a353c7d5020ec2d0551317a66202fcf082c6119ba768755523fff49791bb4e", - "0xab92b2a177dfa55d202a653532f0e04d1339ca301aebe6a0e8419bf45be3e573b6b9ae4d3d822cc8279367a3d2c39b06", - "0x8a9ad977988eb8d98d9f549e4fd2305348a34e6874674bcd6e467c793bba6d7a2f3c20fa44aabbf7151ca53ecb1612f6", - "0xa7d1676816e81a752267d309014de1772b571b109c2901dc7c9810f45417faa18c81965c114be489ed178e54ac3687a1", - "0xa575be185551c40eb8edbdb21a0df381c801b6e99467fcf5882dd7cb34916960ce47ac732c1920ad3218f497b690cef4", - "0xb50c306f78143b37986e68efa10dbe1fb047d58562e9b5c5439b341dd8f1896c7ae586afac0a3213759784a905c1caaa", - "0xb31e89b4a034c1b73d43b3d63ea3bddea682a6a5327eff389c70b13e9e72185b0327682a0cb1ff3c4a4f8ba08b13d898" - ], - "aggregate_pubkey": "0x948a4b8d91bd29969cd4470b1bc24d34586d38e73d5be71c98a9894899471a5f708747563276b4b6d2716fdb72860267" - }, - "next_sync_committee_branch": [ - "0xcb3fea582872d90706ddc6d029bac0d791ea75d43c3ab04f056f62a11b89d27b", - "0xf26b4bb68eb7e6906c8ef4a9958398a48e4450bf9c8a462fafa4fde51cd5628f", - "0x690925f92c1d322d2ff2a5636539094825dfd2c9bf7538fe111b2358e03a71de", - "0x51d977e358166401c7cd3f6185468c1a8c69a4c3d8577535dd583bc427692e02", - "0x88d2089aaf2f6fd8f6e4ae499c6fe33cc34289eb9310780861e772204f07b670" - ] - }, - "finalized_header": { - "slot": 4055040, - "proposer_index": 854, - "parent_root": "0x8adf3b288deb17566a553fa7a06a2f63f4ac4cea4868af4d89ddca41f73ae9b9", - "state_root": "0x595e9ebaaa23f027672b4d2a33173a22b2839baac709c7f8e66d3219f492ee9f", - "body_root": "0xacf37b466d4f6b5d1db5b6ffe5d77c13972d116c2b0809de924427fd597d391a" - }, - "finality_branch": [ - "0x00ef010000000000000000000000000000000000000000000000000000000000", - "0x3d4be5d019ba15ea3ef304a83b8a067f2e79f46a3fac8069306a6c814a0a35eb", - "0xa2e2a28c0bb0ad56c25f3c461a4bfe4f3b3b894bc0105a62e85f43a4ae1adc3f", - "0x690925f92c1d322d2ff2a5636539094825dfd2c9bf7538fe111b2358e03a71de", - "0x51d977e358166401c7cd3f6185468c1a8c69a4c3d8577535dd583bc427692e02", - "0x88d2089aaf2f6fd8f6e4ae499c6fe33cc34289eb9310780861e772204f07b670" - ], - "block_roots_root": "0x7054ba439f83e9b2223911e25fad48eb28f5c362d94c0de2455a45436cc93897", - "block_roots_branch": [ - "0xc99a842c81d0b956eef988dbcd90499457d61f942375c6cbf67262909b708db5", - "0x5d32345aeb10aa3ede4be021d2231dac47cc2074f74b72466f0b042e69adf70f", - "0xb69608a2377956c1a39c3423d3399ccfb12307623c9df6358f5fcfca64a80102", - "0xcefd9b668e49ece82bd4b0ee2f1efc88ecaf0d9af464fb622735663aaf106c4c", - "0xc113ad1c971779b15c64772ab69cd775edfb926a60447974913bb6f58fbd12fb" - ] -} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/sync-committee-update.minimal.json b/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/sync-committee-update.minimal.json deleted file mode 100644 index a962a0c87c4..00000000000 --- a/snowbridge/parachain/pallets/ethereum-client/tests/fixtures/sync-committee-update.minimal.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "attested_header": { - "slot": 3600, - "proposer_index": 7, - "parent_root": "0xdf60c2d58beccd89678b9267c689e9ba1cf1d58ce5114ad5c16e8341459cfd75", - "state_root": "0x023f14c7a38ef4d6ec19b522edfb427c6b70c6ffbd8610ca802dd1491c92c852", - "body_root": "0x0f78a1c45e42711efc5fb7b7f6238be1bee9273f7c44ff6892d815858bb77e25" - }, - "sync_aggregate": { - "sync_committee_bits": "0xffffffff", - "sync_committee_signature": "0xa4dd8f0991de88ca6f81476f72f48cdb67b9414ad7bf6bba37f627c5ec84dd2c2ebc12cddd5d2e7c927276cee2d3d144158b4c067db3e9911fe52fe1875b14c93f90e4eb57bf5e8f0e6e6effe22f9ba076f30207e0ec683354961ae8e9779556" - }, - "signature_slot": 3601, - "next_sync_committee_update": { - "next_sync_committee": { - "pubkeys": [ - "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", - "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", - "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", - "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", - "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", - "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", - "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", - "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", - "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", - "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", - "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", - "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", - "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", - "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", - "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", - "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", - "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", - "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", - "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", - "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", - "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", - "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", - "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", - "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", - "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", - "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", - "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", - "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", - "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", - "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", - "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", - "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c" - ], - "aggregate_pubkey": "0x8fe11476a05750c52618deb79918e2e674f56dfbf12dbce55ae4386d108e8a1e83c6326f5957e2ef19137582ce270dc6" - }, - "next_sync_committee_branch": [ - "0x1446606d0129c324a4ea374bd29a625175e0659512cd8650097e0a9c38ce6379", - "0xd92466c7e9a53b7b55f4fdb151746a3058931d7559b7e84e7b15384ddc903ca0", - "0x9fd10c3f68b75cfd3ebd2af0d4e2cbbfbe120e0b5423dde89ff0f743c7a4f937", - "0x1ed6aac0ab29a883de2bb2e3579ad4d6807ddcf3db8afcaf0ae25a076ac9a5f4", - "0xf17a840df410a15f0e4e48abf521c29ad0d296d3fb4e8b847ea37f2cc8236f1f" - ] - }, - "finalized_header": { - "slot": 3584, - "proposer_index": 1, - "parent_root": "0x91c285af2ec25d485310391afe667108b787ec570cdbb0e3fd87b1e0e2c47bd7", - "state_root": "0xccc4baf90024e035f1252520d2f2ef1e50f840ff0ecc8e6e365721e083871a32", - "body_root": "0x91df5e0077434aad609aaa7e030005cee77cca83868ffc2724e5befe9a3f6a02" - }, - "finality_branch": [ - "0xc001000000000000000000000000000000000000000000000000000000000000", - "0x10c726fac935bf9657cc7476d3cfa7bedec5983dcfb59e8a7df6d0a619e108d7", - "0x83c3d5360d254f4a44be712c1f433e88e810b6d1e0e789e90bada9e36126b857", - "0x9fd10c3f68b75cfd3ebd2af0d4e2cbbfbe120e0b5423dde89ff0f743c7a4f937", - "0x1ed6aac0ab29a883de2bb2e3579ad4d6807ddcf3db8afcaf0ae25a076ac9a5f4", - "0xf17a840df410a15f0e4e48abf521c29ad0d296d3fb4e8b847ea37f2cc8236f1f" - ], - "block_roots_root": "0x9eab8a05c396a29c32f4f8ac9654fc0fb7cd97ec659236392ede48951a794505", - "block_roots_branch": [ - "0x5c175efdbafacdfdab21c93a318b0e8e2291a5a86c40b1fc564f91ad33c106d4", - "0x5c1e0b76176ab033858b2835f90d5e25d708b563f77efd7d9938f0faa1c20878", - "0x7aea32464adee801e2a05c3af227f24231d3c088e3b7265a5fada9ac850549fe", - "0x9d9fca29e23c5d4ae433adf17e7fd9a0e4d1b09b68f5c45e7ca1b13ebe4a9e98", - "0x6b35238f188021c859d6b317457ebb6fe4cf362cab35c988010cb1343eabbfc5" - ] -} \ No newline at end of file diff --git a/snowbridge/parachain/pallets/inbound-queue/Cargo.toml b/snowbridge/parachain/pallets/inbound-queue/Cargo.toml deleted file mode 100644 index f645b4224d1..00000000000 --- a/snowbridge/parachain/pallets/inbound-queue/Cargo.toml +++ /dev/null @@ -1,100 +0,0 @@ -[package] -name = "snowbridge-pallet-inbound-queue" -description = "Snowbridge Inbound Queue Pallet" -version = "0.9.0" -authors = ["Snowfork "] -edition.workspace = true -repository.workspace = true -license = "Apache-2.0" -categories = ["cryptography::cryptocurrencies"] - -[lints] -workspace = true - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0.195", 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 } -log = { version = "0.4.20", default-features = false } -alloy-primitives = { version = "0.4.2", default-features = false, features = ["rlp"] } -alloy-sol-types = { version = "0.4.2", default-features = false } -alloy-rlp = { version = "0.3.3", default-features = false, features = ["derive"] } -num-traits = { version = "0.2.16", default-features = false } - -frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking", default-features = false, optional = true } -frame-support = { path = "../../../../../substrate/frame/support", default-features = false } -frame-system = { path = "../../../../../substrate/frame/system", default-features = false } -pallet-balances = { path = "../../../../../substrate/frame/balances", default-features = false } -sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } -sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } -sp-io = { path = "../../../../../substrate/primitives/io", default-features = false } -sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } - -xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } -xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false } -xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false } - -snowbridge-core = { path = "../../primitives/core", default-features = false } -snowbridge-ethereum = { path = "../../primitives/ethereum", default-features = false } -snowbridge-router-primitives = { path = "../../primitives/router", default-features = false } -snowbridge-beacon-primitives = { path = "../../primitives/beacon", default-features = false, optional = true } - -[dev-dependencies] -frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking" } -sp-keyring = { path = "../../../../../substrate/primitives/keyring" } -snowbridge-beacon-primitives = { path = "../../primitives/beacon" } -snowbridge-pallet-ethereum-client = { path = "../../pallets/ethereum-client" } -hex-literal = { version = "0.4.1" } - -[features] -default = ["std"] -std = [ - "alloy-primitives/std", - "alloy-rlp/std", - "alloy-sol-types/std", - "codec/std", - "frame-benchmarking/std", - "frame-support/std", - "frame-system/std", - "log/std", - "num-traits/std", - "pallet-balances/std", - "scale-info/std", - "serde", - "snowbridge-core/std", - "snowbridge-ethereum/std", - "snowbridge-router-primitives/std", - "sp-core/std", - "sp-io/std", - "sp-runtime/std", - "sp-std/std", - "xcm-builder/std", - "xcm-executor/std", - "xcm/std", -] -runtime-benchmarks = [ - "frame-benchmarking", - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "hex-literal", - "pallet-balances/runtime-benchmarks", - "snowbridge-beacon-primitives", - "snowbridge-core/runtime-benchmarks", - "snowbridge-pallet-ethereum-client/runtime-benchmarks", - "snowbridge-router-primitives/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", - "xcm-executor/runtime-benchmarks", -] -try-runtime = [ - "frame-support/try-runtime", - "frame-system/try-runtime", - "pallet-balances/try-runtime", - "snowbridge-pallet-ethereum-client/try-runtime", - "sp-runtime/try-runtime", -] diff --git a/snowbridge/parachain/pallets/inbound-queue/README.md b/snowbridge/parachain/pallets/inbound-queue/README.md deleted file mode 100644 index cc2f7c636e6..00000000000 --- a/snowbridge/parachain/pallets/inbound-queue/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Ethereum Inbound Queue - -Reads messages from Ethereum and sends it to intended destination on Polkadot, using XCM. diff --git a/snowbridge/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs b/snowbridge/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs deleted file mode 100644 index 4f2382d072a..00000000000 --- a/snowbridge/parachain/pallets/inbound-queue/src/benchmarking/fixtures.rs +++ /dev/null @@ -1,40 +0,0 @@ -use hex_literal::hex; -use snowbridge_beacon_primitives::CompactExecutionHeader; -use snowbridge_core::inbound::{Log, Message, Proof}; -use sp_std::vec; - -pub struct InboundQueueTest { - pub execution_header: CompactExecutionHeader, - pub message: Message, -} - -pub fn make_create_message() -> InboundQueueTest { - InboundQueueTest{ - execution_header: CompactExecutionHeader{ - parent_hash: hex!("b5608f0af7c3b6fe5c593772fc25436b8d6549eb236adb0855c6ad33e0004e04").into(), - block_number: 115, - state_root: hex!("47ed174789836c622499d9659a4ac32c3b91a7b15642d39b0a11b82ff23995c1").into(), - receipts_root: hex!("42c08b5303fcdf9e49c833fe5f1182cdbc8206bf8aec581125fc34aba11e1f1a").into(), - }, - message: Message { - event_log: Log { - address: hex!("eda338e4dc46038493b885327842fd3e301cab39").into(), - topics: vec![ - hex!("7153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84f").into(), - hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539").into(), - hex!("5f7060e971b0dc81e63f0aa41831091847d97c1a4693ac450cc128c7214e65e0").into(), - ], - data: hex!("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002e00a736aa00000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7d00e40b54020000000000000000000000000000000000000000000000000000000000").into(), - }, - proof: Proof { - block_hash: hex!("add15f439c8a57fe375d0a679870b1359921d70cb0e3e44f0dd3e272849f4097").into(), - tx_index: 0, - data: (vec![ - hex!("42c08b5303fcdf9e49c833fe5f1182cdbc8206bf8aec581125fc34aba11e1f1a").to_vec(), - ], vec![ - hex!("f9028e822080b9028802f90284018301ed20b9010000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000080000000000000000000000000000004000000000080000000000000000000000000000000000010100000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000040004000000000000002000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000200000000000010f90179f85894eda338e4dc46038493b885327842fd3e301cab39e1a0f78bb28d4b1d7da699e5c0bc2be29c2b04b5aab6aacf6298fe5304f9db9c6d7ea000000000000000000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7df9011c94eda338e4dc46038493b885327842fd3e301cab39f863a07153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84fa0c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539a05f7060e971b0dc81e63f0aa41831091847d97c1a4693ac450cc128c7214e65e0b8a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002e00a736aa00000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7d00e40b54020000000000000000000000000000000000000000000000000000000000").to_vec(), - ]), - }, - }, - } -} diff --git a/snowbridge/parachain/pallets/inbound-queue/src/benchmarking/mod.rs b/snowbridge/parachain/pallets/inbound-queue/src/benchmarking/mod.rs deleted file mode 100644 index c10de9dff2f..00000000000 --- a/snowbridge/parachain/pallets/inbound-queue/src/benchmarking/mod.rs +++ /dev/null @@ -1,55 +0,0 @@ -mod fixtures; - -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use super::*; - -use crate::Pallet as InboundQueue; -use frame_benchmarking::v2::*; -use frame_support::assert_ok; -use frame_system::RawOrigin; - -#[benchmarks] -mod benchmarks { - use super::*; - use crate::benchmarking::fixtures::make_create_message; - - #[benchmark] - fn submit() -> Result<(), BenchmarkError> { - let caller: T::AccountId = whitelisted_caller(); - - let create_message = make_create_message(); - - T::Helper::initialize_storage( - create_message.message.proof.block_hash, - create_message.execution_header, - ); - - let sovereign_account = sibling_sovereign_account::(1000u32.into()); - - let minimum_balance = T::Token::minimum_balance(); - - // So that the receiving account exists - assert_ok!(T::Token::mint_into(&caller, minimum_balance)); - // Fund the sovereign account (parachain sovereign account) so it can transfer a reward - // fee to the caller account - assert_ok!(T::Token::mint_into( - &sovereign_account, - 3_000_000_000_000u128 - .try_into() - .unwrap_or_else(|_| panic!("unable to cast sovereign account balance")), - )); - - #[block] - { - assert_ok!(InboundQueue::::submit( - RawOrigin::Signed(caller.clone()).into(), - create_message.message, - )); - } - - Ok(()) - } - - impl_benchmark_test_suite!(InboundQueue, crate::mock::new_tester(), crate::mock::Test); -} diff --git a/snowbridge/parachain/pallets/inbound-queue/src/envelope.rs b/snowbridge/parachain/pallets/inbound-queue/src/envelope.rs deleted file mode 100644 index 826d535c2cb..00000000000 --- a/snowbridge/parachain/pallets/inbound-queue/src/envelope.rs +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use snowbridge_core::{inbound::Log, ChannelId}; - -use sp_core::{RuntimeDebug, H160, H256}; -use sp_std::{convert::TryFrom, prelude::*}; - -use alloy_primitives::B256; -use alloy_sol_types::{sol, SolEvent}; - -sol! { - event OutboundMessageAccepted(bytes32 indexed channel_id, uint64 nonce, bytes32 indexed message_id, bytes payload); -} - -/// An inbound message that has had its outer envelope decoded. -#[derive(Clone, RuntimeDebug)] -pub struct Envelope { - /// The address of the outbound queue on Ethereum that emitted this message as an event log - pub gateway: H160, - /// The message Channel - pub channel_id: ChannelId, - /// A nonce for enforcing replay protection and ordering. - pub nonce: u64, - /// An id for tracing the message on its route (has no role in bridge consensus) - pub message_id: H256, - /// The inner payload generated from the source application. - pub payload: Vec, -} - -#[derive(Copy, Clone, RuntimeDebug)] -pub struct EnvelopeDecodeError; - -impl TryFrom<&Log> for Envelope { - type Error = EnvelopeDecodeError; - - fn try_from(log: &Log) -> Result { - let topics: Vec = log.topics.iter().map(|x| B256::from_slice(x.as_ref())).collect(); - - let event = OutboundMessageAccepted::decode_log(topics, &log.data, true) - .map_err(|_| EnvelopeDecodeError)?; - - Ok(Self { - gateway: log.address, - channel_id: ChannelId::from(event.channel_id.as_ref()), - nonce: event.nonce, - message_id: H256::from(event.message_id.as_ref()), - payload: event.payload, - }) - } -} diff --git a/snowbridge/parachain/pallets/inbound-queue/src/lib.rs b/snowbridge/parachain/pallets/inbound-queue/src/lib.rs deleted file mode 100644 index bdc21fcf037..00000000000 --- a/snowbridge/parachain/pallets/inbound-queue/src/lib.rs +++ /dev/null @@ -1,372 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! Inbound Queue -//! -//! # Overview -//! -//! Receives messages emitted by the Gateway contract on Ethereum, whereupon they are verified, -//! translated to XCM, and finally sent to their final destination parachain. -//! -//! The message relayers are rewarded using native currency from the sovereign account of the -//! destination parachain. -//! -//! # Extrinsics -//! -//! ## Governance -//! -//! * [`Call::set_operating_mode`]: Set the operating mode of the pallet. Can be used to disable -//! processing of inbound messages. -//! -//! ## Message Submission -//! -//! * [`Call::submit`]: Submit a message for verification and dispatch the final destination -//! parachain. -#![cfg_attr(not(feature = "std"), no_std)] - -mod envelope; - -#[cfg(feature = "runtime-benchmarks")] -mod benchmarking; - -#[cfg(feature = "runtime-benchmarks")] -use snowbridge_beacon_primitives::CompactExecutionHeader; - -pub mod weights; - -#[cfg(test)] -mod mock; - -#[cfg(test)] -mod test; - -use codec::{Decode, DecodeAll, Encode}; -use envelope::Envelope; -use frame_support::{ - traits::{ - fungible::{Inspect, Mutate}, - tokens::Preservation, - }, - weights::WeightToFee, - PalletError, -}; -use frame_system::ensure_signed; -use scale_info::TypeInfo; -use sp_core::{H160, H256}; -use sp_std::{convert::TryFrom, vec}; -use xcm::prelude::{ - send_xcm, Instruction::SetTopic, Junction::*, Location, SendError as XcmpSendError, SendXcm, - Xcm, XcmContext, XcmHash, -}; -use xcm_executor::traits::TransactAsset; - -use snowbridge_core::{ - inbound::{Message, VerificationError, Verifier}, - sibling_sovereign_account, BasicOperatingMode, Channel, ChannelId, ParaId, PricingParameters, - StaticLookup, -}; -use snowbridge_router_primitives::{ - inbound, - inbound::{ConvertMessage, ConvertMessageError}, -}; -use sp_runtime::{traits::Saturating, SaturatedConversion, TokenError}; - -pub use weights::WeightInfo; - -type BalanceOf = - <::Token as Inspect<::AccountId>>::Balance; - -pub use pallet::*; - -pub const LOG_TARGET: &str = "snowbridge-inbound-queue"; - -#[frame_support::pallet] -pub mod pallet { - use super::*; - - use frame_support::pallet_prelude::*; - use frame_system::pallet_prelude::*; - - #[pallet::pallet] - pub struct Pallet(_); - - #[cfg(feature = "runtime-benchmarks")] - pub trait BenchmarkHelper { - fn initialize_storage(block_hash: H256, header: CompactExecutionHeader); - } - - #[pallet::config] - pub trait Config: frame_system::Config { - type RuntimeEvent: From> + IsType<::RuntimeEvent>; - - /// The verifier for inbound messages from Ethereum - type Verifier: Verifier; - - /// Message relayers are rewarded with this asset - type Token: Mutate + Inspect; - - /// XCM message sender - type XcmSender: SendXcm; - - // Address of the Gateway contract - #[pallet::constant] - type GatewayAddress: Get; - - /// Convert inbound message to XCM - type MessageConverter: ConvertMessage< - AccountId = Self::AccountId, - Balance = BalanceOf, - >; - - /// Lookup a channel descriptor - type ChannelLookup: StaticLookup; - - /// Lookup pricing parameters - type PricingParameters: Get>>; - - type WeightInfo: WeightInfo; - - #[cfg(feature = "runtime-benchmarks")] - type Helper: BenchmarkHelper; - - /// Convert a weight value into deductible balance type. - type WeightToFee: WeightToFee>; - - /// Convert a length value into deductible balance type - type LengthToFee: WeightToFee>; - - /// The upper limit here only used to estimate delivery cost - type MaxMessageSize: Get; - - /// To withdraw and deposit an asset. - type AssetTransactor: TransactAsset; - } - - #[pallet::hooks] - impl Hooks> for Pallet {} - - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] - pub enum Event { - /// A message was received from Ethereum - MessageReceived { - /// The message channel - channel_id: ChannelId, - /// The message nonce - nonce: u64, - /// ID of the XCM message which was forwarded to the final destination parachain - message_id: [u8; 32], - /// Fee burned for the teleport - fee_burned: BalanceOf, - }, - /// Set OperatingMode - OperatingModeChanged { mode: BasicOperatingMode }, - } - - #[pallet::error] - pub enum Error { - /// Message came from an invalid outbound channel on the Ethereum side. - InvalidGateway, - /// Message has an invalid envelope. - InvalidEnvelope, - /// Message has an unexpected nonce. - InvalidNonce, - /// Message has an invalid payload. - InvalidPayload, - /// Message channel is invalid - InvalidChannel, - /// The max nonce for the type has been reached - MaxNonceReached, - /// Cannot convert location - InvalidAccountConversion, - /// Pallet is halted - Halted, - /// Message verification error, - Verification(VerificationError), - /// XCMP send failure - Send(SendError), - /// Message conversion error - ConvertMessage(ConvertMessageError), - } - - #[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, TypeInfo, PalletError)] - pub enum SendError { - NotApplicable, - NotRoutable, - Transport, - DestinationUnsupported, - ExceedsMaxMessageSize, - MissingArgument, - Fees, - } - - impl From for Error { - fn from(e: XcmpSendError) -> Self { - match e { - 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::MissingArgument => Error::::Send(SendError::MissingArgument), - XcmpSendError::Fees => Error::::Send(SendError::Fees), - } - } - } - - /// The current nonce for each channel - #[pallet::storage] - pub type Nonce = StorageMap<_, Twox64Concat, ChannelId, u64, ValueQuery>; - - /// The current operating mode of the pallet. - #[pallet::storage] - #[pallet::getter(fn operating_mode)] - pub type OperatingMode = StorageValue<_, BasicOperatingMode, ValueQuery>; - - #[pallet::call] - impl Pallet { - /// Submit an inbound message originating from the Gateway contract on Ethereum - #[pallet::call_index(0)] - #[pallet::weight(T::WeightInfo::submit())] - pub fn submit(origin: OriginFor, message: Message) -> DispatchResult { - let who = ensure_signed(origin)?; - ensure!(!Self::operating_mode().is_halted(), Error::::Halted); - - // submit message to verifier for verification - T::Verifier::verify(&message.event_log, &message.proof) - .map_err(|e| Error::::Verification(e))?; - - // Decode event log into an Envelope - let envelope = - Envelope::try_from(&message.event_log).map_err(|_| Error::::InvalidEnvelope)?; - - // Verify that the message was submitted from the known Gateway contract - ensure!(T::GatewayAddress::get() == envelope.gateway, Error::::InvalidGateway); - - // Retrieve the registered channel for this message - let channel = - T::ChannelLookup::lookup(envelope.channel_id).ok_or(Error::::InvalidChannel)?; - - // Verify message nonce - >::try_mutate(envelope.channel_id, |nonce| -> DispatchResult { - if *nonce == u64::MAX { - return Err(Error::::MaxNonceReached.into()) - } - if envelope.nonce != nonce.saturating_add(1) { - Err(Error::::InvalidNonce.into()) - } else { - *nonce = nonce.saturating_add(1); - Ok(()) - } - })?; - - // Reward relayer from the sovereign account of the destination parachain - // Expected to fail if sovereign account has no funds - let sovereign_account = sibling_sovereign_account::(channel.para_id); - let delivery_cost = Self::calculate_delivery_cost(message.encode().len() as u32); - T::Token::transfer(&sovereign_account, &who, delivery_cost, Preservation::Preserve)?; - - // Decode message into XCM - let (xcm, fee) = - match inbound::VersionedMessage::decode_all(&mut envelope.payload.as_ref()) { - Ok(message) => Self::do_convert(envelope.message_id, message)?, - Err(_) => return Err(Error::::InvalidPayload.into()), - }; - - log::info!( - target: LOG_TARGET, - "💫 xcm decoded as {:?} with fee {:?}", - xcm, - fee - ); - - // Burning fees for teleport - Self::burn_fees(channel.para_id, fee)?; - - // Attempt to send XCM to a dest parachain - let message_id = Self::send_xcm(xcm, channel.para_id)?; - - Self::deposit_event(Event::MessageReceived { - channel_id: envelope.channel_id, - nonce: envelope.nonce, - message_id, - fee_burned: fee, - }); - - Ok(()) - } - - /// Halt or resume all pallet operations. May only be called by root. - #[pallet::call_index(1)] - #[pallet::weight((T::DbWeight::get().reads_writes(1, 1), DispatchClass::Operational))] - pub fn set_operating_mode( - origin: OriginFor, - mode: BasicOperatingMode, - ) -> DispatchResult { - ensure_root(origin)?; - OperatingMode::::set(mode); - Self::deposit_event(Event::OperatingModeChanged { mode }); - Ok(()) - } - } - - impl Pallet { - pub fn do_convert( - message_id: H256, - message: inbound::VersionedMessage, - ) -> Result<(Xcm<()>, BalanceOf), Error> { - let (mut xcm, fee) = - T::MessageConverter::convert(message).map_err(|e| Error::::ConvertMessage(e))?; - // Append the message id as an XCM topic - xcm.inner_mut().extend(vec![SetTopic(message_id.into())]); - Ok((xcm, fee)) - } - - pub fn send_xcm(xcm: Xcm<()>, dest: ParaId) -> Result> { - let dest = Location::new(1, [Parachain(dest.into())]); - let (xcm_hash, _) = send_xcm::(dest, xcm).map_err(Error::::from)?; - Ok(xcm_hash) - } - - pub fn calculate_delivery_cost(length: u32) -> BalanceOf { - let weight_fee = T::WeightToFee::weight_to_fee(&T::WeightInfo::submit()); - let len_fee = T::LengthToFee::weight_to_fee(&Weight::from_parts(length as u64, 0)); - weight_fee - .saturating_add(len_fee) - .saturating_add(T::PricingParameters::get().rewards.local) - } - - /// Burn the amount of the fee embedded into the XCM for teleports - pub fn burn_fees(para_id: ParaId, fee: BalanceOf) -> DispatchResult { - let dummy_context = - XcmContext { origin: None, message_id: Default::default(), topic: None }; - let dest = Location::new(1, [Parachain(para_id.into())]); - let fees = (Location::parent(), fee.saturated_into::()).into(); - T::AssetTransactor::can_check_out(&dest, &fees, &dummy_context).map_err(|error| { - log::error!( - target: LOG_TARGET, - "XCM asset check out failed with error {:?}", error - ); - TokenError::FundsUnavailable - })?; - T::AssetTransactor::check_out(&dest, &fees, &dummy_context); - T::AssetTransactor::withdraw_asset(&fees, &dest, None).map_err(|error| { - log::error!( - target: LOG_TARGET, - "XCM asset withdraw failed with error {:?}", error - ); - TokenError::FundsUnavailable - })?; - Ok(()) - } - } - - /// API for accessing the delivery cost of a message - impl Get> for Pallet { - fn get() -> BalanceOf { - // Cost here based on MaxMessagePayloadSize(the worst case) - Self::calculate_delivery_cost(T::MaxMessageSize::get()) - } - } -} diff --git a/snowbridge/parachain/pallets/inbound-queue/src/mock.rs b/snowbridge/parachain/pallets/inbound-queue/src/mock.rs deleted file mode 100644 index 39374aa3d71..00000000000 --- a/snowbridge/parachain/pallets/inbound-queue/src/mock.rs +++ /dev/null @@ -1,344 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use super::*; - -use frame_support::{ - parameter_types, - traits::{ConstU128, ConstU32, Everything}, - weights::IdentityFee, -}; -use hex_literal::hex; -use snowbridge_beacon_primitives::{Fork, ForkVersions}; -use snowbridge_core::{ - gwei, - inbound::{Log, Proof, VerificationError}, - meth, Channel, ChannelId, PricingParameters, Rewards, StaticLookup, -}; -use snowbridge_router_primitives::inbound::MessageToXcm; -use sp_core::{H160, H256}; -use sp_runtime::{ - traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Verify}, - BuildStorage, FixedU128, MultiSignature, -}; -use sp_std::convert::From; -use xcm::v4::{prelude::*, SendXcm}; -use xcm_executor::AssetsInHolding; - -use crate::{self as inbound_queue}; - -type Block = frame_system::mocking::MockBlock; - -frame_support::construct_runtime!( - pub enum Test - { - System: frame_system::{Pallet, Call, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - EthereumBeaconClient: snowbridge_pallet_ethereum_client::{Pallet, Call, Storage, Event}, - InboundQueue: inbound_queue::{Pallet, Call, Storage, Event}, - } -); - -pub type Signature = MultiSignature; -pub type AccountId = <::Signer as IdentifyAccount>::AccountId; - -parameter_types! { - pub const BlockHashCount: u64 = 250; -} - -type Balance = u128; - -impl frame_system::Config for Test { - type BaseCallFilter = Everything; - type BlockWeights = (); - type BlockLength = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type RuntimeTask = RuntimeTask; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; - type Nonce = u64; - type Block = Block; -} - -impl pallet_balances::Config for Test { - type MaxLocks = (); - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; - type Balance = Balance; - type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); - type ExistentialDeposit = ConstU128<1>; - type AccountStore = System; - type WeightInfo = (); - type FreezeIdentifier = (); - type MaxFreezes = (); - type RuntimeHoldReason = (); - type RuntimeFreezeReason = (); - type MaxHolds = (); -} - -parameter_types! { - pub const ExecutionHeadersPruneThreshold: u32 = 10; - pub const ChainForkVersions: ForkVersions = ForkVersions{ - genesis: Fork { - version: [0, 0, 0, 1], // 0x00000001 - epoch: 0, - }, - altair: Fork { - version: [1, 0, 0, 1], // 0x01000001 - epoch: 0, - }, - bellatrix: Fork { - version: [2, 0, 0, 1], // 0x02000001 - epoch: 0, - }, - capella: Fork { - version: [3, 0, 0, 1], // 0x03000001 - epoch: 0, - }, - }; -} - -impl snowbridge_pallet_ethereum_client::Config for Test { - type RuntimeEvent = RuntimeEvent; - type ForkVersions = ChainForkVersions; - type MaxExecutionHeadersToKeep = ExecutionHeadersPruneThreshold; - type WeightInfo = (); -} - -// Mock verifier -pub struct MockVerifier; - -impl Verifier for MockVerifier { - fn verify(_: &Log, _: &Proof) -> Result<(), VerificationError> { - Ok(()) - } -} - -const GATEWAY_ADDRESS: [u8; 20] = hex!["eda338e4dc46038493b885327842fd3e301cab39"]; - -parameter_types! { - pub const EthereumNetwork: xcm::v3::NetworkId = xcm::v3::NetworkId::Ethereum { chain_id: 11155111 }; - pub const GatewayAddress: H160 = H160(GATEWAY_ADDRESS); - pub const CreateAssetCall: [u8;2] = [53, 0]; - pub const CreateAssetExecutionFee: u128 = 2_000_000_000; - pub const CreateAssetDeposit: u128 = 100_000_000_000; - pub const SendTokenExecutionFee: u128 = 1_000_000_000; - pub const InitialFund: u128 = 1_000_000_000_000; - pub const InboundQueuePalletInstance: u8 = 80; -} - -#[cfg(feature = "runtime-benchmarks")] -impl BenchmarkHelper for Test { - // not implemented since the MockVerifier is used for tests - fn initialize_storage(_: H256, _: CompactExecutionHeader) {} -} - -// Mock XCM sender that always succeeds -pub struct MockXcmSender; - -impl SendXcm for MockXcmSender { - type Ticket = Xcm<()>; - - fn validate( - dest: &mut Option, - xcm: &mut Option>, - ) -> SendResult { - if let Some(location) = dest { - match location.unpack() { - (_, [Parachain(1001)]) => return Err(XcmpSendError::NotApplicable), - _ => Ok((xcm.clone().unwrap(), Assets::default())), - } - } else { - Ok((xcm.clone().unwrap(), Assets::default())) - } - } - - fn deliver(xcm: Self::Ticket) -> core::result::Result { - let hash = xcm.using_encoded(sp_io::hashing::blake2_256); - Ok(hash) - } -} - -parameter_types! { - pub const OwnParaId: ParaId = ParaId::new(1013); - pub Parameters: PricingParameters = PricingParameters { - exchange_rate: FixedU128::from_rational(1, 400), - fee_per_gas: gwei(20), - rewards: Rewards { local: DOT, remote: meth(1) } - }; -} - -pub const DOT: u128 = 10_000_000_000; - -pub struct MockChannelLookup; -impl StaticLookup for MockChannelLookup { - type Source = ChannelId; - type Target = Channel; - - fn lookup(channel_id: Self::Source) -> Option { - if channel_id != - hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539").into() - { - return None - } - Some(Channel { agent_id: H256::zero(), para_id: ASSET_HUB_PARAID.into() }) - } -} - -pub struct SuccessfulTransactor; -impl TransactAsset for SuccessfulTransactor { - fn can_check_in(_origin: &Location, _what: &Asset, _context: &XcmContext) -> XcmResult { - Ok(()) - } - - fn can_check_out(_dest: &Location, _what: &Asset, _context: &XcmContext) -> XcmResult { - Ok(()) - } - - fn deposit_asset(_what: &Asset, _who: &Location, _context: Option<&XcmContext>) -> XcmResult { - Ok(()) - } - - fn withdraw_asset( - _what: &Asset, - _who: &Location, - _context: Option<&XcmContext>, - ) -> Result { - Ok(AssetsInHolding::default()) - } - - fn internal_transfer_asset( - _what: &Asset, - _from: &Location, - _to: &Location, - _context: &XcmContext, - ) -> Result { - Ok(AssetsInHolding::default()) - } -} - -impl inbound_queue::Config for Test { - type RuntimeEvent = RuntimeEvent; - type Verifier = MockVerifier; - type Token = Balances; - type XcmSender = MockXcmSender; - type WeightInfo = (); - type GatewayAddress = GatewayAddress; - type MessageConverter = MessageToXcm< - CreateAssetCall, - CreateAssetDeposit, - InboundQueuePalletInstance, - AccountId, - Balance, - >; - type PricingParameters = Parameters; - type ChannelLookup = MockChannelLookup; - #[cfg(feature = "runtime-benchmarks")] - type Helper = Test; - type WeightToFee = IdentityFee; - type LengthToFee = IdentityFee; - type MaxMessageSize = ConstU32<1024>; - type AssetTransactor = SuccessfulTransactor; -} - -pub fn last_events(n: usize) -> Vec { - frame_system::Pallet::::events() - .into_iter() - .rev() - .take(n) - .rev() - .map(|e| e.event) - .collect() -} - -pub fn expect_events(e: Vec) { - assert_eq!(last_events(e.len()), e); -} - -pub fn setup() { - System::set_block_number(1); - Balances::mint_into( - &sibling_sovereign_account::(ASSET_HUB_PARAID.into()), - InitialFund::get(), - ) - .unwrap(); - Balances::mint_into( - &sibling_sovereign_account::(TEMPLATE_PARAID.into()), - InitialFund::get(), - ) - .unwrap(); -} - -pub fn new_tester() -> sp_io::TestExternalities { - let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); - let mut ext: sp_io::TestExternalities = storage.into(); - ext.execute_with(setup); - ext -} - -// Generated from smoketests: -// cd smoketests -// ./make-bindings -// cargo test --test register_token -- --nocapture -pub fn mock_event_log() -> Log { - Log { - // gateway address - address: hex!("eda338e4dc46038493b885327842fd3e301cab39").into(), - topics: vec![ - hex!("7153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84f").into(), - // channel id - hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539").into(), - // message id - hex!("5f7060e971b0dc81e63f0aa41831091847d97c1a4693ac450cc128c7214e65e0").into(), - ], - // Nonce + Payload - data: hex!("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002e000f000000000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7d00e40b54020000000000000000000000000000000000000000000000000000000000").into(), - } -} - -pub fn mock_event_log_invalid_channel() -> Log { - Log { - address: hex!("eda338e4dc46038493b885327842fd3e301cab39").into(), - topics: vec![ - hex!("7153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84f").into(), - // invalid channel id - hex!("0000000000000000000000000000000000000000000000000000000000000000").into(), - hex!("5f7060e971b0dc81e63f0aa41831091847d97c1a4693ac450cc128c7214e65e0").into(), - ], - data: hex!("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001e000f000000000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7d0000").into(), - } -} - -pub fn mock_event_log_invalid_gateway() -> Log { - Log { - // gateway address - address: H160::zero(), - topics: vec![ - hex!("7153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84f").into(), - // channel id - hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539").into(), - // message id - hex!("5f7060e971b0dc81e63f0aa41831091847d97c1a4693ac450cc128c7214e65e0").into(), - ], - // Nonce + Payload - data: hex!("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001e000f000000000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7d0000").into(), - } -} - -pub const ASSET_HUB_PARAID: u32 = 1000u32; -pub const TEMPLATE_PARAID: u32 = 1001u32; diff --git a/snowbridge/parachain/pallets/inbound-queue/src/test.rs b/snowbridge/parachain/pallets/inbound-queue/src/test.rs deleted file mode 100644 index 9a47e475b8c..00000000000 --- a/snowbridge/parachain/pallets/inbound-queue/src/test.rs +++ /dev/null @@ -1,212 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use super::*; - -use frame_support::{assert_noop, assert_ok}; -use hex_literal::hex; -use snowbridge_core::{inbound::Proof, ChannelId}; -use sp_keyring::AccountKeyring as Keyring; -use sp_runtime::{DispatchError, TokenError}; -use sp_std::convert::From; - -use crate::{Error, Event as InboundQueueEvent}; - -use crate::mock::*; - -#[test] -fn test_submit_happy_path() { - new_tester().execute_with(|| { - let relayer: AccountId = Keyring::Bob.into(); - let channel_sovereign = sibling_sovereign_account::(ASSET_HUB_PARAID.into()); - - let origin = RuntimeOrigin::signed(relayer.clone()); - - // Submit message - let message = Message { - event_log: mock_event_log(), - proof: Proof { - block_hash: Default::default(), - tx_index: Default::default(), - data: Default::default(), - }, - }; - - let initial_fund = InitialFund::get(); - assert_eq!(Balances::balance(&relayer), 0); - assert_eq!(Balances::balance(&channel_sovereign), initial_fund); - - assert_ok!(InboundQueue::submit(origin.clone(), message.clone())); - expect_events(vec![InboundQueueEvent::MessageReceived { - channel_id: hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539") - .into(), - nonce: 1, - message_id: [ - 57, 61, 232, 3, 66, 61, 25, 190, 234, 188, 193, 174, 13, 186, 1, 64, 237, 94, 73, - 83, 14, 18, 209, 213, 78, 121, 43, 108, 251, 245, 107, 67, - ], - fee_burned: 110000000000, - } - .into()]); - - let delivery_cost = InboundQueue::calculate_delivery_cost(message.encode().len() as u32); - assert!( - Parameters::get().rewards.local < delivery_cost, - "delivery cost exceeds pure reward" - ); - - assert_eq!(Balances::balance(&relayer), delivery_cost, "relayer was rewarded"); - assert!( - Balances::balance(&channel_sovereign) <= initial_fund - delivery_cost, - "sovereign account paid reward" - ); - }); -} - -#[test] -fn test_submit_xcm_invalid_channel() { - new_tester().execute_with(|| { - let relayer: AccountId = Keyring::Bob.into(); - let origin = RuntimeOrigin::signed(relayer); - - // Deposit funds into sovereign account of parachain 1001 - let sovereign_account = sibling_sovereign_account::(TEMPLATE_PARAID.into()); - println!("account: {}", sovereign_account); - let _ = Balances::mint_into(&sovereign_account, 10000); - - // Submit message - let message = Message { - event_log: mock_event_log_invalid_channel(), - proof: Proof { - block_hash: Default::default(), - tx_index: Default::default(), - data: Default::default(), - }, - }; - assert_noop!( - InboundQueue::submit(origin.clone(), message.clone()), - Error::::InvalidChannel, - ); - }); -} - -#[test] -fn test_submit_with_invalid_gateway() { - new_tester().execute_with(|| { - let relayer: AccountId = Keyring::Bob.into(); - let origin = RuntimeOrigin::signed(relayer); - - // Deposit funds into sovereign account of Asset Hub (Statemint) - let sovereign_account = sibling_sovereign_account::(ASSET_HUB_PARAID.into()); - let _ = Balances::mint_into(&sovereign_account, 10000); - - // Submit message - let message = Message { - event_log: mock_event_log_invalid_gateway(), - proof: Proof { - block_hash: Default::default(), - tx_index: Default::default(), - data: Default::default(), - }, - }; - assert_noop!( - InboundQueue::submit(origin.clone(), message.clone()), - Error::::InvalidGateway - ); - }); -} - -#[test] -fn test_submit_with_invalid_nonce() { - new_tester().execute_with(|| { - let relayer: AccountId = Keyring::Bob.into(); - let origin = RuntimeOrigin::signed(relayer); - - // Deposit funds into sovereign account of Asset Hub (Statemint) - let sovereign_account = sibling_sovereign_account::(ASSET_HUB_PARAID.into()); - let _ = Balances::mint_into(&sovereign_account, 10000); - - // Submit message - let message = Message { - event_log: mock_event_log(), - proof: Proof { - block_hash: Default::default(), - tx_index: Default::default(), - data: Default::default(), - }, - }; - assert_ok!(InboundQueue::submit(origin.clone(), message.clone())); - - let nonce: u64 = >::get(ChannelId::from(hex!( - "c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539" - ))); - assert_eq!(nonce, 1); - - // Submit the same again - assert_noop!( - InboundQueue::submit(origin.clone(), message.clone()), - Error::::InvalidNonce - ); - }); -} - -#[test] -fn test_submit_no_funds_to_reward_relayers() { - new_tester().execute_with(|| { - let relayer: AccountId = Keyring::Bob.into(); - let origin = RuntimeOrigin::signed(relayer); - - // Reset balance of sovereign_account to zero so to trigger the FundsUnavailable error - let sovereign_account = sibling_sovereign_account::(ASSET_HUB_PARAID.into()); - Balances::set_balance(&sovereign_account, 0); - - // Submit message - let message = Message { - event_log: mock_event_log(), - proof: Proof { - block_hash: Default::default(), - tx_index: Default::default(), - data: Default::default(), - }, - }; - assert_noop!( - InboundQueue::submit(origin.clone(), message.clone()), - TokenError::FundsUnavailable - ); - }); -} - -#[test] -fn test_set_operating_mode() { - new_tester().execute_with(|| { - let relayer: AccountId = Keyring::Bob.into(); - let origin = RuntimeOrigin::signed(relayer); - let message = Message { - event_log: mock_event_log(), - proof: Proof { - block_hash: Default::default(), - tx_index: Default::default(), - data: Default::default(), - }, - }; - - assert_ok!(InboundQueue::set_operating_mode( - RuntimeOrigin::root(), - snowbridge_core::BasicOperatingMode::Halted - )); - - assert_noop!(InboundQueue::submit(origin, message), Error::::Halted); - }); -} - -#[test] -fn test_set_operating_mode_root_only() { - new_tester().execute_with(|| { - assert_noop!( - InboundQueue::set_operating_mode( - RuntimeOrigin::signed(Keyring::Bob.into()), - snowbridge_core::BasicOperatingMode::Halted - ), - DispatchError::BadOrigin - ); - }); -} diff --git a/snowbridge/parachain/pallets/inbound-queue/src/weights.rs b/snowbridge/parachain/pallets/inbound-queue/src/weights.rs deleted file mode 100644 index c2c665f40d9..00000000000 --- a/snowbridge/parachain/pallets/inbound-queue/src/weights.rs +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! Autogenerated weights for `snowbridge_inbound_queue` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-07-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `macbook pro 14 m2`, CPU: `m2-arm64` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weight functions needed for ethereum_beacon_client. -pub trait WeightInfo { - fn submit() -> Weight; -} - -// For backwards compatibility and tests -impl WeightInfo for () { - fn submit() -> Weight { - Weight::from_parts(70_000_000, 0) - .saturating_add(Weight::from_parts(0, 3601)) - .saturating_add(RocksDbWeight::get().reads(2)) - .saturating_add(RocksDbWeight::get().writes(2)) - } -} diff --git a/snowbridge/parachain/pallets/outbound-queue/Cargo.toml b/snowbridge/parachain/pallets/outbound-queue/Cargo.toml deleted file mode 100644 index de4487553cb..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/Cargo.toml +++ /dev/null @@ -1,82 +0,0 @@ -[package] -name = "snowbridge-pallet-outbound-queue" -description = "Snowbridge Outbound Queue Pallet" -version = "0.9.0" -authors = ["Snowfork "] -edition.workspace = true -repository.workspace = true -license = "Apache-2.0" -categories = ["cryptography::cryptocurrencies"] - -[lints] -workspace = true - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0.195", features = ["alloc", "derive"], default-features = false } -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 } - -frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking", default-features = false, optional = true } -frame-support = { path = "../../../../../substrate/frame/support", default-features = false } -frame-system = { path = "../../../../../substrate/frame/system", default-features = false } -sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } -sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } -sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } -sp-io = { path = "../../../../../substrate/primitives/io", default-features = false } -sp-arithmetic = { path = "../../../../../substrate/primitives/arithmetic", default-features = false } - -bridge-hub-common = { path = "../../../../../cumulus/parachains/runtimes/bridge-hubs/common", default-features = false } - -snowbridge-core = { path = "../../primitives/core", features = ["serde"], 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 = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } - -[dev-dependencies] -pallet-message-queue = { path = "../../../../../substrate/frame/message-queue", default-features = false } -sp-keyring = { path = "../../../../../substrate/primitives/keyring" } -hex-literal = { version = "0.4.1" } - -[features] -default = ["std"] -std = [ - "bridge-hub-common/std", - "codec/std", - "ethabi/std", - "frame-benchmarking/std", - "frame-support/std", - "frame-system/std", - "pallet-message-queue/std", - "scale-info/std", - "serde/std", - "snowbridge-core/std", - "snowbridge-outbound-queue-merkle-tree/std", - "sp-arithmetic/std", - "sp-core/std", - "sp-io/std", - "sp-runtime/std", - "sp-std/std", - "xcm/std", -] -runtime-benchmarks = [ - "bridge-hub-common/runtime-benchmarks", - "frame-benchmarking", - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "hex-literal", - "pallet-message-queue/runtime-benchmarks", - "snowbridge-core/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", -] -try-runtime = [ - "frame-support/try-runtime", - "frame-system/try-runtime", - "pallet-message-queue/try-runtime", - "sp-runtime/try-runtime", -] diff --git a/snowbridge/parachain/pallets/outbound-queue/README.md b/snowbridge/parachain/pallets/outbound-queue/README.md deleted file mode 100644 index 19638f90e6a..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Ethereum Outbound Queue - -Sends messages from an origin in the Polkadot ecosystem to Ethereum. diff --git a/snowbridge/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml b/snowbridge/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml deleted file mode 100644 index 27c4ae02e52..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/merkle-tree/Cargo.toml +++ /dev/null @@ -1,37 +0,0 @@ -[package] -name = "snowbridge-outbound-queue-merkle-tree" -description = "Snowbridge Outbound Queue Merkle Tree" -version = "0.9.0" -authors = ["Snowfork "] -edition.workspace = true -repository.workspace = true -license = "Apache-2.0" -categories = ["cryptography::cryptocurrencies"] - -[lints] -workspace = true - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -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 = { path = "../../../../../../substrate/primitives/core", default-features = false } -sp-runtime = { path = "../../../../../../substrate/primitives/runtime", default-features = false } - -[dev-dependencies] -hex-literal = { version = "0.4.1" } -env_logger = "0.9" -hex = "0.4" -array-bytes = "4.1" - -[features] -default = ["std"] -std = [ - "codec/std", - "scale-info/std", - "sp-core/std", - "sp-runtime/std", -] diff --git a/snowbridge/parachain/pallets/outbound-queue/merkle-tree/README.md b/snowbridge/parachain/pallets/outbound-queue/merkle-tree/README.md deleted file mode 100644 index a3afef1d671..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/merkle-tree/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Snowbridge Outbound Queue Merkle Tree - -This crate implements a simple binary Merkle Tree utilities required for inter-op with Ethereum -bridge & Solidity contract. diff --git a/snowbridge/parachain/pallets/outbound-queue/merkle-tree/src/lib.rs b/snowbridge/parachain/pallets/outbound-queue/merkle-tree/src/lib.rs deleted file mode 100644 index d03eb578ef4..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/merkle-tree/src/lib.rs +++ /dev/null @@ -1,464 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -// SPDX-FileCopyrightText: 2021-2022 Parity Technologies (UK) Ltd. -#![cfg_attr(not(feature = "std"), no_std)] -#![warn(missing_docs)] - -//! This crate implements a simple binary Merkle Tree utilities required for inter-op with Ethereum -//! bridge & Solidity contract. -//! -//! The implementation is optimised for usage within Substrate Runtime and supports no-std -//! compilation targets. -//! -//! Merkle Tree is constructed from arbitrary-length leaves, that are initially hashed using the -//! same `\[`Hasher`\]` as the inner nodes. -//! Inner nodes are created by concatenating child hashes and hashing again. The implementation -//! does not perform any sorting of the input data (leaves) nor when inner nodes are created. -//! -//! If the number of leaves is not even, last leaf (hash of) is promoted to the upper layer. - -#[cfg(not(feature = "std"))] -extern crate alloc; -#[cfg(not(feature = "std"))] -use alloc::vec; -#[cfg(not(feature = "std"))] -use alloc::vec::Vec; - -use codec::{Decode, Encode}; -use scale_info::TypeInfo; -use sp_core::{RuntimeDebug, H256}; -use sp_runtime::traits::Hash; - -/// Construct a root hash of a Binary Merkle Tree created from given leaves. -/// -/// See crate-level docs for details about Merkle Tree construction. -/// -/// In case an empty list of leaves is passed the function returns a 0-filled hash. -pub fn merkle_root(leaves: I) -> H256 -where - H: Hash, - I: Iterator, -{ - merkelize::(leaves, &mut ()) -} - -fn merkelize(leaves: I, visitor: &mut V) -> H256 -where - H: Hash, - V: Visitor, - I: Iterator, -{ - let upper = Vec::with_capacity(leaves.size_hint().0); - let mut next = match merkelize_row::(leaves, upper, visitor) { - Ok(root) => return root, - Err(next) if next.is_empty() => return H256::default(), - Err(next) => next, - }; - - let mut upper = Vec::with_capacity((next.len() + 1) / 2); - loop { - visitor.move_up(); - - match merkelize_row::(next.drain(..), upper, visitor) { - Ok(root) => return root, - Err(t) => { - // swap collections to avoid allocations - upper = next; - next = t; - }, - }; - } -} - -/// A generated merkle proof. -/// -/// The structure contains all necessary data to later on verify the proof and the leaf itself. -#[derive(Encode, Decode, RuntimeDebug, PartialEq, Eq, TypeInfo)] -pub struct MerkleProof { - /// Root hash of generated merkle tree. - pub root: H256, - /// Proof items (does not contain the leaf hash, nor the root obviously). - /// - /// This vec contains all inner node hashes necessary to reconstruct the root hash given the - /// leaf hash. - pub proof: Vec, - /// Number of leaves in the original tree. - /// - /// This is needed to detect a case where we have an odd number of leaves that "get promoted" - /// to upper layers. - pub number_of_leaves: u64, - /// Index of the leaf the proof is for (0-based). - pub leaf_index: u64, - /// Leaf content (hashed). - pub leaf: H256, -} - -/// A trait of object inspecting merkle root creation. -/// -/// It can be passed to [`merkelize_row`] or [`merkelize`] functions and will be notified -/// about tree traversal. -trait Visitor { - /// We are moving one level up in the tree. - fn move_up(&mut self); - - /// We are creating an inner node from given `left` and `right` nodes. - /// - /// Note that in case of last odd node in the row `right` might be empty. - /// The method will also visit the `root` hash (level 0). - /// - /// The `index` is an index of `left` item. - fn visit(&mut self, index: u64, left: &Option, right: &Option); -} - -/// No-op implementation of the visitor. -impl Visitor for () { - fn move_up(&mut self) {} - fn visit(&mut self, _index: u64, _left: &Option, _right: &Option) {} -} - -/// Construct a Merkle Proof for leaves given by indices. -/// -/// The function constructs a (partial) Merkle Tree first and stores all elements required -/// to prove the requested item (leaf) given the root hash. -/// -/// Both the Proof and the Root Hash are returned. -/// -/// # Panic -/// -/// The function will panic if given `leaf_index` is greater than the number of leaves. -pub fn merkle_proof(leaves: I, leaf_index: u64) -> MerkleProof -where - H: Hash, - I: Iterator, -{ - let mut leaf = None; - let mut hashes = vec![]; - let mut number_of_leaves = 0; - for (idx, l) in (0u64..).zip(leaves) { - // count the leaves - number_of_leaves = idx + 1; - hashes.push(l); - // find the leaf for the proof - if idx == leaf_index { - leaf = Some(l); - } - } - - /// The struct collects a proof for single leaf. - struct ProofCollection { - proof: Vec, - position: u64, - } - - impl ProofCollection { - fn new(position: u64) -> Self { - ProofCollection { proof: Default::default(), position } - } - } - - impl Visitor for ProofCollection { - fn move_up(&mut self) { - self.position /= 2; - } - - fn visit(&mut self, index: u64, left: &Option, right: &Option) { - // we are at left branch - right goes to the proof. - if self.position == index { - if let Some(right) = right { - self.proof.push(*right); - } - } - // we are at right branch - left goes to the proof. - if self.position == index + 1 { - if let Some(left) = left { - self.proof.push(*left); - } - } - } - } - - let mut collect_proof = ProofCollection::new(leaf_index); - - let root = merkelize::(hashes.into_iter(), &mut collect_proof); - let leaf = leaf.expect("Requested `leaf_index` is greater than number of leaves."); - - #[cfg(feature = "debug")] - log::debug!( - "[merkle_proof] Proof: {:?}", - collect_proof.proof.iter().map(hex::encode).collect::>() - ); - - MerkleProof { root, proof: collect_proof.proof, number_of_leaves, leaf_index, leaf } -} - -/// Leaf node for proof verification. -/// -/// Can be either a value that needs to be hashed first, -/// or the hash itself. -#[derive(Debug, PartialEq, Eq)] -pub enum Leaf<'a> { - /// Leaf content. - Value(&'a [u8]), - /// Hash of the leaf content. - Hash(H256), -} - -impl<'a, T: AsRef<[u8]>> From<&'a T> for Leaf<'a> { - fn from(v: &'a T) -> Self { - Leaf::Value(v.as_ref()) - } -} - -impl<'a> From for Leaf<'a> { - fn from(v: H256) -> Self { - Leaf::Hash(v) - } -} - -/// Verify Merkle Proof correctness versus given root hash. -/// -/// The proof is NOT expected to contain leaf hash as the first -/// element, but only all adjacent nodes required to eventually by process of -/// concatenating and hashing end up with given root hash. -/// -/// The proof must not contain the root hash. -pub fn verify_proof<'a, H, P, L>( - root: &'a H256, - proof: P, - number_of_leaves: u64, - leaf_index: u64, - leaf: L, -) -> bool -where - H: Hash, - P: IntoIterator, - L: Into>, -{ - if leaf_index >= number_of_leaves { - return false - } - - let leaf_hash = match leaf.into() { - Leaf::Value(content) => ::hash(content), - Leaf::Hash(hash) => hash, - }; - - let hash_len = ::LENGTH; - let mut combined = [0_u8; 64]; - let computed = proof.into_iter().fold(leaf_hash, |a, b| { - if a < b { - combined[..hash_len].copy_from_slice(a.as_ref()); - combined[hash_len..].copy_from_slice(b.as_ref()); - } else { - combined[..hash_len].copy_from_slice(b.as_ref()); - combined[hash_len..].copy_from_slice(a.as_ref()); - } - ::hash(&combined) - }); - - root == &computed -} - -/// Processes a single row (layer) of a tree by taking pairs of elements, -/// concatenating them, hashing and placing into resulting vector. -/// -/// In case only one element is provided it is returned via `Ok` result, in any other case (also an -/// empty iterator) an `Err` with the inner nodes of upper layer is returned. -fn merkelize_row( - mut iter: I, - mut next: Vec, - visitor: &mut V, -) -> Result> -where - H: Hash, - V: Visitor, - I: Iterator, -{ - #[cfg(feature = "debug")] - log::debug!("[merkelize_row]"); - next.clear(); - - let hash_len = ::LENGTH; - let mut index = 0; - let mut combined = vec![0_u8; hash_len * 2]; - loop { - let a = iter.next(); - let b = iter.next(); - visitor.visit(index, &a, &b); - - #[cfg(feature = "debug")] - log::debug!(" {:?}\n {:?}", a.as_ref().map(hex::encode), b.as_ref().map(hex::encode)); - - index += 2; - match (a, b) { - (Some(a), Some(b)) => { - if a < b { - combined[..hash_len].copy_from_slice(a.as_ref()); - combined[hash_len..].copy_from_slice(b.as_ref()); - } else { - combined[..hash_len].copy_from_slice(b.as_ref()); - combined[hash_len..].copy_from_slice(a.as_ref()); - } - - next.push(::hash(&combined)); - }, - // Odd number of items. Promote the item to the upper layer. - (Some(a), None) if !next.is_empty() => { - next.push(a); - }, - // Last item = root. - (Some(a), None) => return Ok(a), - // Finish up, no more items. - _ => { - #[cfg(feature = "debug")] - log::debug!( - "[merkelize_row] Next: {:?}", - next.iter().map(hex::encode).collect::>() - ); - return Err(next) - }, - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - use hex_literal::hex; - use sp_core::keccak_256; - use sp_runtime::traits::Keccak256; - - fn make_leaves(count: u64) -> Vec { - (0..count).map(|i| keccak_256(&i.to_le_bytes()).into()).collect() - } - - #[test] - fn should_generate_empty_root() { - // given - let _ = env_logger::try_init(); - let data = vec![]; - - // when - let out = merkle_root::(data.into_iter()); - - // then - assert_eq!( - hex::encode(out), - "0000000000000000000000000000000000000000000000000000000000000000" - ); - } - - #[test] - fn should_generate_single_root() { - // given - let _ = env_logger::try_init(); - let data = make_leaves(1); - - // when - let out = merkle_root::(data.into_iter()); - - // then - assert_eq!( - hex::encode(out), - "011b4d03dd8c01f1049143cf9c4c817e4b167f1d1b83e5c6f0f10d89ba1e7bce" - ); - } - - #[test] - fn should_generate_root_pow_2() { - // given - let _ = env_logger::try_init(); - let data = make_leaves(2); - - // when - let out = merkle_root::(data.into_iter()); - - // then - assert_eq!( - hex::encode(out), - "e497bd1c13b13a60af56fa0d2703517c232fde213ad20d2c3dd60735c6604512" - ); - } - - #[test] - fn should_generate_root_complex() { - let _ = env_logger::try_init(); - let test = |root, data: Vec| { - assert_eq!( - array_bytes::bytes2hex("", merkle_root::(data.into_iter()).as_ref()), - root - ); - }; - - test("816cc37bd8d39f7b0851838ebc875faf2afe58a03e95aca3b1333b3693f39dd3", make_leaves(3)); - - test("7501ea976cb92f305cca65ab11254589ea28bb8b59d3161506350adaa237d22f", make_leaves(4)); - - test("d26ba4eb398747bdd39255b1fadb99b803ce39696021b3b0bff7301ac146ee4e", make_leaves(10)); - } - - #[test] - #[ignore] - fn should_generate_and_verify_proof() { - // given - let _ = env_logger::try_init(); - let data: Vec = make_leaves(3); - - // when - let proof0 = merkle_proof::(data.clone().into_iter(), 0); - assert!(verify_proof::( - &proof0.root, - proof0.proof.clone(), - data.len() as u64, - proof0.leaf_index, - &data[0], - )); - - let proof1 = merkle_proof::(data.clone().into_iter(), 1); - assert!(verify_proof::( - &proof1.root, - proof1.proof, - data.len() as u64, - proof1.leaf_index, - &proof1.leaf, - )); - - let proof2 = merkle_proof::(data.clone().into_iter(), 2); - assert!(verify_proof::( - &proof2.root, - proof2.proof, - data.len() as u64, - proof2.leaf_index, - &proof2.leaf - )); - - // then - assert_eq!(hex::encode(proof0.root), hex::encode(proof1.root)); - assert_eq!(hex::encode(proof2.root), hex::encode(proof1.root)); - - assert!(!verify_proof::( - &H256::from_slice(&hex!( - "fb3b3be94be9e983ba5e094c9c51a7d96a4fa2e5d8e891df00ca89ba05bb1239" - )), - proof0.proof, - data.len() as u64, - proof0.leaf_index, - &proof0.leaf - )); - - assert!(!verify_proof::( - &proof0.root, - vec![], - data.len() as u64, - proof0.leaf_index, - &proof0.leaf - )); - } - - #[test] - #[should_panic] - fn should_panic_on_invalid_leaf_index() { - let _ = env_logger::try_init(); - merkle_proof::(make_leaves(1).into_iter(), 5); - } -} diff --git a/snowbridge/parachain/pallets/outbound-queue/runtime-api/Cargo.toml b/snowbridge/parachain/pallets/outbound-queue/runtime-api/Cargo.toml deleted file mode 100644 index 1f2b51a6752..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/runtime-api/Cargo.toml +++ /dev/null @@ -1,38 +0,0 @@ -[package] -name = "snowbridge-outbound-queue-runtime-api" -description = "Snowbridge Outbound Queue Runtime API" -version = "0.9.0" -authors = ["Snowfork "] -edition.workspace = true -repository.workspace = true -license = "Apache-2.0" -categories = ["cryptography::cryptocurrencies"] - -[lints] -workspace = true - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -codec = { version = "3.1.5", package = "parity-scale-codec", features = ["derive"], default-features = false } -sp-core = { path = "../../../../../../substrate/primitives/core", default-features = false } -sp-std = { path = "../../../../../../substrate/primitives/std", default-features = false } -sp-api = { path = "../../../../../../substrate/primitives/api", default-features = false } -frame-support = { path = "../../../../../../substrate/frame/support", default-features = false } -xcm = { package = "staging-xcm", path = "../../../../../../polkadot/xcm", default-features = false } -snowbridge-outbound-queue-merkle-tree = { path = "../merkle-tree", default-features = false } -snowbridge-core = { path = "../../../primitives/core", default-features = false } - -[features] -default = ["std"] -std = [ - "codec/std", - "frame-support/std", - "snowbridge-core/std", - "snowbridge-outbound-queue-merkle-tree/std", - "sp-api/std", - "sp-core/std", - "sp-std/std", - "xcm/std", -] diff --git a/snowbridge/parachain/pallets/outbound-queue/runtime-api/README.md b/snowbridge/parachain/pallets/outbound-queue/runtime-api/README.md deleted file mode 100644 index 98ae01fb33d..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/runtime-api/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Ethereum Outbound Queue Runtime API - -Provides an API: - -- to generate merkle proofs for outbound messages -- calculate delivery fee for delivering messages to Ethereum diff --git a/snowbridge/parachain/pallets/outbound-queue/runtime-api/src/lib.rs b/snowbridge/parachain/pallets/outbound-queue/runtime-api/src/lib.rs deleted file mode 100644 index 51f46a7b49c..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/runtime-api/src/lib.rs +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -#![cfg_attr(not(feature = "std"), no_std)] - -use frame_support::traits::tokens::Balance as BalanceT; -use snowbridge_core::outbound::Message; -use snowbridge_outbound_queue_merkle_tree::MerkleProof; - -sp_api::decl_runtime_apis! { - pub trait OutboundQueueApi where Balance: BalanceT - { - /// Generate a merkle proof for a committed message identified by `leaf_index`. - /// The merkle root is stored in the block header as a - /// `\[`sp_runtime::generic::DigestItem::Other`\]` - fn prove_message(leaf_index: u64) -> Option; - - /// Calculate the delivery fee for `message` - fn calculate_fee(message: Message) -> Option; - } -} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/api.rs b/snowbridge/parachain/pallets/outbound-queue/src/api.rs deleted file mode 100644 index 44d63f1e2d2..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/src/api.rs +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! Helpers for implementing runtime api - -use crate::{Config, MessageLeaves}; -use frame_support::storage::StorageStreamIter; -use snowbridge_core::outbound::{Message, SendMessage}; -use snowbridge_outbound_queue_merkle_tree::{merkle_proof, MerkleProof}; - -pub fn prove_message(leaf_index: u64) -> Option -where - T: Config, -{ - if !MessageLeaves::::exists() { - return None - } - let proof = - merkle_proof::<::Hashing, _>(MessageLeaves::::stream_iter(), leaf_index); - Some(proof) -} - -pub fn calculate_fee(message: Message) -> Option -where - T: Config, -{ - match crate::Pallet::::validate(&message) { - Ok((_, fees)) => Some(fees.total()), - _ => None, - } -} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/benchmarking.rs b/snowbridge/parachain/pallets/outbound-queue/src/benchmarking.rs deleted file mode 100644 index ee5754e8696..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/src/benchmarking.rs +++ /dev/null @@ -1,85 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use super::*; - -use bridge_hub_common::AggregateMessageOrigin; -use codec::Encode; -use frame_benchmarking::v2::*; -use snowbridge_core::{ - outbound::{Command, Initializer}, - ChannelId, -}; -use sp_core::{H160, H256}; - -#[allow(unused_imports)] -use crate::Pallet as OutboundQueue; - -#[benchmarks( - where - ::MaxMessagePayloadSize: Get, -)] -mod benchmarks { - use super::*; - - /// Benchmark for processing a message. - #[benchmark] - fn do_process_message() -> Result<(), BenchmarkError> { - let enqueued_message = QueuedMessage { - id: H256::zero(), - channel_id: ChannelId::from([1; 32]), - command: Command::Upgrade { - impl_address: H160::zero(), - impl_code_hash: H256::zero(), - initializer: Some(Initializer { - params: [7u8; 256].into_iter().collect(), - maximum_required_gas: 200_000, - }), - }, - }; - let origin = AggregateMessageOrigin::Snowbridge([1; 32].into()); - let encoded_enqueued_message = enqueued_message.encode(); - - #[block] - { - let _ = OutboundQueue::::do_process_message(origin, &encoded_enqueued_message); - } - - assert_eq!(MessageLeaves::::decode_len().unwrap(), 1); - - Ok(()) - } - - /// Benchmark for producing final messages commitment - #[benchmark] - fn commit() -> Result<(), BenchmarkError> { - // Assume worst case, where `MaxMessagesPerBlock` messages need to be committed. - for i in 0..T::MaxMessagesPerBlock::get() { - let leaf_data: [u8; 1] = [i as u8]; - let leaf = ::Hashing::hash(&leaf_data); - MessageLeaves::::append(leaf); - } - - #[block] - { - OutboundQueue::::commit(); - } - - Ok(()) - } - - /// Benchmark for producing commitment for a single message - #[benchmark] - fn commit_single() -> Result<(), BenchmarkError> { - let leaf = ::Hashing::hash(&[100; 1]); - MessageLeaves::::append(leaf); - - #[block] - { - OutboundQueue::::commit(); - } - - Ok(()) - } - - impl_benchmark_test_suite!(OutboundQueue, crate::mock::new_tester(), crate::mock::Test,); -} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/lib.rs b/snowbridge/parachain/pallets/outbound-queue/src/lib.rs deleted file mode 100644 index 9e949a4791a..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/src/lib.rs +++ /dev/null @@ -1,406 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! Pallet for committing outbound messages for delivery to Ethereum -//! -//! # Overview -//! -//! Messages come either from sibling parachains via XCM, or BridgeHub itself -//! via the `snowbridge-pallet-system`: -//! -//! 1. `snowbridge_router_primitives::outbound::EthereumBlobExporter::deliver` -//! 2. `snowbridge_pallet_system::Pallet::send` -//! -//! The message submission pipeline works like this: -//! 1. The message is first validated via the implementation for -//! [`snowbridge_core::outbound::SendMessage::validate`] -//! 2. The message is then enqueued for later processing via the implementation for -//! [`snowbridge_core::outbound::SendMessage::deliver`] -//! 3. The underlying message queue is implemented by [`Config::MessageQueue`] -//! 4. The message queue delivers messages back to this pallet via the implementation for -//! [`frame_support::traits::ProcessMessage::process_message`] -//! 5. The message is processed in `Pallet::do_process_message`: a. Assigned a nonce b. ABI-encoded, -//! hashed, and stored in the `MessageLeaves` vector -//! 6. At the end of the block, a merkle root is constructed from all the leaves in `MessageLeaves`. -//! 7. This merkle root is inserted into the parachain header as a digest item -//! 8. Offchain relayers are able to relay the message to Ethereum after: a. Generating a merkle -//! proof for the committed message using the `prove_message` runtime API b. Reading the actual -//! message content from the `Messages` vector in storage -//! -//! On the Ethereum side, the message root is ultimately the thing being -//! verified by the Polkadot light client. -//! -//! # Message Priorities -//! -//! The processing of governance commands can never be halted. This effectively -//! allows us to pause processing of normal user messages while still allowing -//! governance commands to be sent to Ethereum. -//! -//! # Fees -//! -//! An upfront fee must be paid for delivering a message. This fee covers several -//! components: -//! 1. The weight of processing the message locally -//! 2. The gas refund paid out to relayers for message submission -//! 3. An additional reward paid out to relayers for message submission -//! -//! Messages are weighed to determine the maximum amount of gas they could -//! consume on Ethereum. Using this upper bound, a final fee can be calculated. -//! -//! The fee calculation also requires the following parameters: -//! * ETH/DOT exchange rate -//! * Ether fee per unit of gas -//! -//! By design, it is expected that governance should manually update these -//! parameters every few weeks using the `set_pricing_parameters` extrinsic in the -//! system pallet. -//! -//! ## Fee Computation Function -//! -//! ```text -//! LocalFee(Message) = WeightToFee(ProcessMessageWeight(Message)) -//! RemoteFee(Message) = MaxGasRequired(Message) * FeePerGas + Reward -//! Fee(Message) = LocalFee(Message) + (RemoteFee(Message) / Ratio("ETH/DOT")) -//! ``` -//! -//! By design, the computed fee is always going to conservative, to cover worst-case -//! costs of dispatch on Ethereum. In future iterations of the design, we will optimize -//! this, or provide a mechanism to asynchronously refund a portion of collected fees. -//! -//! # Extrinsics -//! -//! * [`Call::set_operating_mode`]: Set the operating mode -//! -//! # Runtime API -//! -//! * `prove_message`: Generate a merkle proof for a committed message -//! * `calculate_fee`: Calculate the delivery fee for a message -#![cfg_attr(not(feature = "std"), no_std)] -pub mod api; -pub mod process_message_impl; -pub mod send_message_impl; -pub mod types; -pub mod weights; - -#[cfg(feature = "runtime-benchmarks")] -mod benchmarking; - -#[cfg(test)] -mod mock; - -#[cfg(test)] -mod test; - -use bridge_hub_common::{AggregateMessageOrigin, CustomDigestItem}; -use codec::Decode; -use frame_support::{ - storage::StorageStreamIter, - traits::{tokens::Balance, Contains, Defensive, EnqueueMessage, Get, ProcessMessageError}, - weights::{Weight, WeightToFee}, -}; -use snowbridge_core::{ - outbound::{Fee, GasMeter, QueuedMessage, VersionedQueuedMessage, ETHER_DECIMALS}, - BasicOperatingMode, ChannelId, -}; -use snowbridge_outbound_queue_merkle_tree::merkle_root; -pub use snowbridge_outbound_queue_merkle_tree::MerkleProof; -use sp_core::{H256, U256}; -use sp_runtime::{ - traits::{CheckedDiv, Hash}, - DigestItem, -}; -use sp_std::prelude::*; -pub use types::{CommittedMessage, ProcessMessageOriginOf}; -pub use weights::WeightInfo; - -pub use pallet::*; - -#[frame_support::pallet] -pub mod pallet { - use super::*; - use frame_support::pallet_prelude::*; - use frame_system::pallet_prelude::*; - use snowbridge_core::PricingParameters; - use sp_arithmetic::FixedU128; - - #[pallet::pallet] - pub struct Pallet(_); - - #[pallet::config] - pub trait Config: frame_system::Config { - type RuntimeEvent: From> + IsType<::RuntimeEvent>; - - type Hashing: Hash; - - type MessageQueue: EnqueueMessage; - - /// Measures the maximum gas used to execute a command on Ethereum - type GasMeter: GasMeter; - - type Balance: Balance + From; - - /// Number of decimal places in native currency - #[pallet::constant] - type Decimals: Get; - - /// Max bytes in a message payload - #[pallet::constant] - type MaxMessagePayloadSize: Get; - - /// Max number of messages processed per block - #[pallet::constant] - type MaxMessagesPerBlock: Get; - - /// Check whether a channel exists - type Channels: Contains; - - type PricingParameters: Get>; - - /// Convert a weight value into a deductible fee based. - type WeightToFee: WeightToFee; - - /// Weight information for extrinsics in this pallet - type WeightInfo: WeightInfo; - } - - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] - pub enum Event { - /// Message has been queued and will be processed in the future - MessageQueued { - /// ID of the message. Usually the XCM message hash or a SetTopic. - id: H256, - }, - /// Message will be committed at the end of current block. From now on, to track the - /// progress the message, use the `nonce` of `id`. - MessageAccepted { - /// ID of the message - id: H256, - /// The nonce assigned to this message - nonce: u64, - }, - /// Some messages have been committed - MessagesCommitted { - /// Merkle root of the committed messages - root: H256, - /// number of committed messages - count: u64, - }, - /// Set OperatingMode - OperatingModeChanged { mode: BasicOperatingMode }, - } - - #[pallet::error] - pub enum Error { - /// The message is too large - MessageTooLarge, - /// The pallet is halted - Halted, - /// Invalid Channel - InvalidChannel, - } - - /// Messages to be committed in the current block. This storage value is killed in - /// `on_initialize`, so should never go into block PoV. - /// - /// Is never read in the runtime, only by offchain message relayers. - /// - /// Inspired by the `frame_system::Pallet::Events` storage value - #[pallet::storage] - #[pallet::unbounded] - pub(super) type Messages = StorageValue<_, Vec, ValueQuery>; - - /// Hashes of the ABI-encoded messages in the [`Messages`] storage value. Used to generate a - /// merkle root during `on_finalize`. This storage value is killed in - /// `on_initialize`, so should never go into block PoV. - #[pallet::storage] - #[pallet::unbounded] - #[pallet::getter(fn message_leaves)] - pub(super) type MessageLeaves = StorageValue<_, Vec, ValueQuery>; - - /// The current nonce for each message origin - #[pallet::storage] - pub type Nonce = StorageMap<_, Twox64Concat, ChannelId, u64, ValueQuery>; - - /// The current operating mode of the pallet. - #[pallet::storage] - #[pallet::getter(fn operating_mode)] - pub type OperatingMode = StorageValue<_, BasicOperatingMode, ValueQuery>; - - #[pallet::hooks] - impl Hooks> for Pallet - where - T::AccountId: AsRef<[u8]>, - { - fn on_initialize(_: BlockNumberFor) -> Weight { - // Remove storage from previous block - Messages::::kill(); - MessageLeaves::::kill(); - // Reserve some weight for the `on_finalize` handler - T::WeightInfo::commit() - } - - fn on_finalize(_: BlockNumberFor) { - Self::commit(); - } - - fn integrity_test() { - let decimals = T::Decimals::get(); - assert!(decimals == 10 || decimals == 12, "Decimals should be 10 or 12"); - } - } - - #[pallet::call] - impl Pallet { - /// Halt or resume all pallet operations. May only be called by root. - #[pallet::call_index(0)] - #[pallet::weight((T::DbWeight::get().reads_writes(1, 1), DispatchClass::Operational))] - pub fn set_operating_mode( - origin: OriginFor, - mode: BasicOperatingMode, - ) -> DispatchResult { - ensure_root(origin)?; - OperatingMode::::put(mode); - Self::deposit_event(Event::OperatingModeChanged { mode }); - Ok(()) - } - } - - impl Pallet { - /// Generate a messages commitment and insert it into the header digest - pub(crate) fn commit() { - let count = MessageLeaves::::decode_len().unwrap_or_default() as u64; - if count == 0 { - return - } - - // Create merkle root of messages - let root = merkle_root::<::Hashing, _>(MessageLeaves::::stream_iter()); - - let digest_item: DigestItem = CustomDigestItem::Snowbridge(root).into(); - - // Insert merkle root into the header digest - >::deposit_log(digest_item); - - Self::deposit_event(Event::MessagesCommitted { root, count }); - } - - /// Process a message delivered by the MessageQueue pallet - pub(crate) fn do_process_message( - _: ProcessMessageOriginOf, - mut message: &[u8], - ) -> Result { - use ProcessMessageError::*; - - // Yield if the maximum number of messages has been processed this block. - // This ensures that the weight of `on_finalize` has a known maximum bound. - ensure!( - MessageLeaves::::decode_len().unwrap_or(0) < - T::MaxMessagesPerBlock::get() as usize, - Yield - ); - - // Decode bytes into versioned message - let versioned_queued_message: VersionedQueuedMessage = - VersionedQueuedMessage::decode(&mut message).map_err(|_| Corrupt)?; - - // Convert versioned message into latest supported message version - let queued_message: QueuedMessage = - versioned_queued_message.try_into().map_err(|_| Unsupported)?; - - // Obtain next nonce - let nonce = >::try_mutate( - queued_message.channel_id, - |nonce| -> Result { - *nonce = nonce.checked_add(1).ok_or(Unsupported)?; - Ok(*nonce) - }, - )?; - - let pricing_params = T::PricingParameters::get(); - let command = queued_message.command.index(); - let params = queued_message.command.abi_encode(); - let max_dispatch_gas = - T::GasMeter::maximum_dispatch_gas_used_at_most(&queued_message.command); - let reward = pricing_params.rewards.remote; - - // Construct the final committed message - let message = CommittedMessage { - channel_id: queued_message.channel_id, - nonce, - command, - params, - max_dispatch_gas, - max_fee_per_gas: pricing_params - .fee_per_gas - .try_into() - .defensive_unwrap_or(u128::MAX), - reward: reward.try_into().defensive_unwrap_or(u128::MAX), - id: queued_message.id, - }; - - // ABI-encode and hash the prepared message - let message_abi_encoded = ethabi::encode(&[message.clone().into()]); - let message_abi_encoded_hash = ::Hashing::hash(&message_abi_encoded); - - Messages::::append(Box::new(message)); - MessageLeaves::::append(message_abi_encoded_hash); - - Self::deposit_event(Event::MessageAccepted { id: queued_message.id, nonce }); - - Ok(true) - } - - /// Calculate total fee in native currency to cover all costs of delivering a message to the - /// remote destination. See module-level documentation for more details. - pub(crate) fn calculate_fee( - gas_used_at_most: u64, - params: PricingParameters, - ) -> Fee { - // Remote fee in ether - let fee = Self::calculate_remote_fee( - gas_used_at_most, - params.fee_per_gas, - params.rewards.remote, - ); - - // downcast to u128 - let fee: u128 = fee.try_into().defensive_unwrap_or(u128::MAX); - - // convert to local currency - let fee = FixedU128::from_inner(fee) - .checked_div(¶ms.exchange_rate) - .expect("exchange rate is not zero; qed") - .into_inner(); - - // adjust fixed point to match local currency - let fee = Self::convert_from_ether_decimals(fee); - - Fee::from((Self::calculate_local_fee(), fee)) - } - - /// Calculate fee in remote currency for dispatching a message on Ethereum - pub(crate) fn calculate_remote_fee( - gas_used_at_most: u64, - fee_per_gas: U256, - reward: U256, - ) -> U256 { - fee_per_gas.saturating_mul(gas_used_at_most.into()).saturating_add(reward) - } - - /// The local component of the message processing fees in native currency - pub(crate) fn calculate_local_fee() -> T::Balance { - T::WeightToFee::weight_to_fee( - &T::WeightInfo::do_process_message().saturating_add(T::WeightInfo::commit_single()), - ) - } - - // 1 DOT has 10 digits of precision - // 1 KSM has 12 digits of precision - // 1 ETH has 18 digits of precision - pub(crate) fn convert_from_ether_decimals(value: u128) -> T::Balance { - let decimals = ETHER_DECIMALS.saturating_sub(T::Decimals::get()) as u32; - let denom = 10u128.saturating_pow(decimals); - value.checked_div(denom).expect("divisor is non-zero; qed").into() - } - } -} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/mock.rs b/snowbridge/parachain/pallets/outbound-queue/src/mock.rs deleted file mode 100644 index dd8fee4e2ed..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/src/mock.rs +++ /dev/null @@ -1,189 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use super::*; - -use frame_support::{ - parameter_types, - traits::{Everything, Hooks}, - weights::IdentityFee, -}; - -use snowbridge_core::{ - gwei, meth, - outbound::*, - pricing::{PricingParameters, Rewards}, - ParaId, PRIMARY_GOVERNANCE_CHANNEL, -}; -use sp_core::{ConstU32, ConstU8, H160, H256}; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup, Keccak256}, - AccountId32, BuildStorage, FixedU128, -}; -use sp_std::marker::PhantomData; - -type Block = frame_system::mocking::MockBlock; -type AccountId = AccountId32; - -frame_support::construct_runtime!( - pub enum Test - { - System: frame_system::{Pallet, Call, Storage, Event}, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event}, - OutboundQueue: crate::{Pallet, Storage, Event}, - } -); - -parameter_types! { - pub const BlockHashCount: u64 = 250; -} - -impl frame_system::Config for Test { - type BaseCallFilter = Everything; - type BlockWeights = (); - type BlockLength = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type RuntimeTask = RuntimeTask; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; - type Nonce = u64; - type Block = Block; -} - -parameter_types! { - pub const HeapSize: u32 = 32 * 1024; - pub const MaxStale: u32 = 32; - pub static ServiceWeight: Option = Some(Weight::from_parts(100, 100)); -} - -impl pallet_message_queue::Config for Test { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = (); - type MessageProcessor = OutboundQueue; - type Size = u32; - type QueueChangeHandler = (); - type HeapSize = HeapSize; - type MaxStale = MaxStale; - type ServiceWeight = ServiceWeight; - type QueuePausedQuery = (); -} - -parameter_types! { - pub const OwnParaId: ParaId = ParaId::new(1013); - pub Parameters: PricingParameters = PricingParameters { - exchange_rate: FixedU128::from_rational(1, 400), - fee_per_gas: gwei(20), - rewards: Rewards { local: DOT, remote: meth(1) } - }; -} - -pub const DOT: u128 = 10_000_000_000; - -impl crate::Config for Test { - type RuntimeEvent = RuntimeEvent; - type Hashing = Keccak256; - type MessageQueue = MessageQueue; - type Decimals = ConstU8<12>; - type MaxMessagePayloadSize = ConstU32<1024>; - type MaxMessagesPerBlock = ConstU32<20>; - type GasMeter = ConstantGasMeter; - type Balance = u128; - type PricingParameters = Parameters; - type Channels = Everything; - type WeightToFee = IdentityFee; - type WeightInfo = (); -} - -fn setup() { - System::set_block_number(1); -} - -pub fn new_tester() -> sp_io::TestExternalities { - let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); - let mut ext: sp_io::TestExternalities = storage.into(); - ext.execute_with(setup); - ext -} - -pub fn run_to_end_of_next_block() { - // finish current block - MessageQueue::on_finalize(System::block_number()); - OutboundQueue::on_finalize(System::block_number()); - System::on_finalize(System::block_number()); - // start next block - System::set_block_number(System::block_number() + 1); - System::on_initialize(System::block_number()); - OutboundQueue::on_initialize(System::block_number()); - MessageQueue::on_initialize(System::block_number()); - // finish next block - MessageQueue::on_finalize(System::block_number()); - OutboundQueue::on_finalize(System::block_number()); - System::on_finalize(System::block_number()); -} - -pub fn mock_governance_message() -> Message -where - T: Config, -{ - let _marker = PhantomData::; // for clippy - - Message { - id: None, - channel_id: PRIMARY_GOVERNANCE_CHANNEL, - command: Command::Upgrade { - impl_address: H160::zero(), - impl_code_hash: H256::zero(), - initializer: None, - }, - } -} - -// Message should fail validation as it is too large -pub fn mock_invalid_governance_message() -> Message -where - T: Config, -{ - let _marker = PhantomData::; // for clippy - - Message { - id: None, - channel_id: PRIMARY_GOVERNANCE_CHANNEL, - command: Command::Upgrade { - impl_address: H160::zero(), - impl_code_hash: H256::zero(), - initializer: Some(Initializer { - params: (0..1000).map(|_| 1u8).collect::>(), - maximum_required_gas: 0, - }), - }, - } -} - -pub fn mock_message(sibling_para_id: u32) -> Message { - Message { - id: None, - channel_id: ParaId::from(sibling_para_id).into(), - command: Command::AgentExecute { - agent_id: Default::default(), - command: AgentExecuteCommand::TransferToken { - token: Default::default(), - recipient: Default::default(), - amount: 0, - }, - }, - } -} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/process_message_impl.rs b/snowbridge/parachain/pallets/outbound-queue/src/process_message_impl.rs deleted file mode 100644 index 575ed9e0e7c..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/src/process_message_impl.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! Implementation for [`frame_support::traits::ProcessMessage`] -use super::*; -use crate::weights::WeightInfo; -use frame_support::{ - traits::{ProcessMessage, ProcessMessageError}, - weights::WeightMeter, -}; - -impl ProcessMessage for Pallet { - type Origin = AggregateMessageOrigin; - fn process_message( - message: &[u8], - origin: Self::Origin, - meter: &mut WeightMeter, - _: &mut [u8; 32], - ) -> Result { - let weight = T::WeightInfo::do_process_message(); - if meter.try_consume(weight).is_err() { - return Err(ProcessMessageError::Overweight(weight)) - } - Self::do_process_message(origin, message) - } -} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/send_message_impl.rs b/snowbridge/parachain/pallets/outbound-queue/src/send_message_impl.rs deleted file mode 100644 index a84e2c520e5..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/src/send_message_impl.rs +++ /dev/null @@ -1,98 +0,0 @@ -//! Implementation for [`snowbridge_core::outbound::SendMessage`] -use super::*; -use bridge_hub_common::AggregateMessageOrigin; -use codec::Encode; -use frame_support::{ - ensure, - traits::{EnqueueMessage, Get}, - CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, -}; -use frame_system::unique; -use snowbridge_core::{ - outbound::{ - Fee, Message, QueuedMessage, SendError, SendMessage, SendMessageFeeProvider, - VersionedQueuedMessage, - }, - ChannelId, PRIMARY_GOVERNANCE_CHANNEL, -}; -use sp_core::H256; -use sp_runtime::BoundedVec; - -/// The maximal length of an enqueued message, as determined by the MessageQueue pallet -pub type MaxEnqueuedMessageSizeOf = - <::MessageQueue as EnqueueMessage>::MaxMessageLen; - -#[derive(Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound)] -pub struct Ticket -where - T: Config, -{ - pub message_id: H256, - pub channel_id: ChannelId, - pub message: BoundedVec>, -} - -impl SendMessage for Pallet -where - T: Config, -{ - type Ticket = Ticket; - - fn validate( - message: &Message, - ) -> Result<(Self::Ticket, Fee<::Balance>), SendError> { - // The inner payload should not be too large - let payload = message.command.abi_encode(); - ensure!( - payload.len() < T::MaxMessagePayloadSize::get() as usize, - SendError::MessageTooLarge - ); - - // Ensure there is a registered channel we can transmit this message on - ensure!(T::Channels::contains(&message.channel_id), SendError::InvalidChannel); - - // Generate a unique message id unless one is provided - let message_id: H256 = message - .id - .unwrap_or_else(|| unique((message.channel_id, &message.command)).into()); - - let gas_used_at_most = T::GasMeter::maximum_gas_used_at_most(&message.command); - let fee = Self::calculate_fee(gas_used_at_most, T::PricingParameters::get()); - - let queued_message: VersionedQueuedMessage = QueuedMessage { - id: message_id, - channel_id: message.channel_id, - command: message.command.clone(), - } - .into(); - // The whole message should not be too large - let encoded = queued_message.encode().try_into().map_err(|_| SendError::MessageTooLarge)?; - - let ticket = Ticket { message_id, channel_id: message.channel_id, message: encoded }; - - Ok((ticket, fee)) - } - - fn deliver(ticket: Self::Ticket) -> Result { - let origin = AggregateMessageOrigin::Snowbridge(ticket.channel_id); - - if ticket.channel_id != PRIMARY_GOVERNANCE_CHANNEL { - ensure!(!Self::operating_mode().is_halted(), SendError::Halted); - } - - let message = ticket.message.as_bounded_slice(); - - T::MessageQueue::enqueue_message(message, origin); - Self::deposit_event(Event::MessageQueued { id: ticket.message_id }); - Ok(ticket.message_id) - } -} - -impl SendMessageFeeProvider for Pallet { - type Balance = T::Balance; - - /// The local component of the message processing fees in native currency - fn local_fee() -> Self::Balance { - Self::calculate_local_fee() - } -} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/test.rs b/snowbridge/parachain/pallets/outbound-queue/src/test.rs deleted file mode 100644 index 0028d75e7b7..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/src/test.rs +++ /dev/null @@ -1,268 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use crate::{mock::*, *}; - -use frame_support::{ - assert_err, assert_noop, assert_ok, - traits::{Hooks, ProcessMessage, ProcessMessageError}, - weights::WeightMeter, -}; - -use codec::Encode; -use snowbridge_core::{ - outbound::{Command, SendError, SendMessage}, - ParaId, -}; -use sp_arithmetic::FixedU128; -use sp_core::H256; -use sp_runtime::FixedPointNumber; - -#[test] -fn submit_messages_and_commit() { - new_tester().execute_with(|| { - for para_id in 1000..1004 { - let message = mock_message(para_id); - let (ticket, _) = OutboundQueue::validate(&message).unwrap(); - assert_ok!(OutboundQueue::deliver(ticket)); - } - - ServiceWeight::set(Some(Weight::MAX)); - run_to_end_of_next_block(); - - for para_id in 1000..1004 { - let origin: ParaId = (para_id as u32).into(); - let channel_id: ChannelId = origin.into(); - assert_eq!(Nonce::::get(channel_id), 1); - } - - let digest = System::digest(); - let digest_items = digest.logs(); - assert!(digest_items.len() == 1 && digest_items[0].as_other().is_some()); - assert_eq!(Messages::::decode_len(), Some(4)); - }); -} - -#[test] -fn submit_message_fail_too_large() { - new_tester().execute_with(|| { - let message = mock_invalid_governance_message::(); - assert_err!(OutboundQueue::validate(&message), SendError::MessageTooLarge); - }); -} - -#[test] -fn convert_from_ether_decimals() { - assert_eq!( - OutboundQueue::convert_from_ether_decimals(1_000_000_000_000_000_000), - 1_000_000_000_000 - ); -} - -#[test] -fn commit_exits_early_if_no_processed_messages() { - new_tester().execute_with(|| { - // on_finalize should do nothing, nor should it panic - OutboundQueue::on_finalize(System::block_number()); - - let digest = System::digest(); - let digest_items = digest.logs(); - assert_eq!(digest_items.len(), 0); - }); -} - -#[test] -fn process_message_yields_on_max_messages_per_block() { - new_tester().execute_with(|| { - for _ in 0..::MaxMessagesPerBlock::get() { - MessageLeaves::::append(H256::zero()) - } - - let channel_id: ChannelId = ParaId::from(1000).into(); - let origin = AggregateMessageOrigin::Snowbridge(channel_id); - let message = QueuedMessage { - id: Default::default(), - channel_id, - command: Command::Upgrade { - impl_address: Default::default(), - impl_code_hash: Default::default(), - initializer: None, - }, - } - .encode(); - - let mut meter = WeightMeter::new(); - - assert_noop!( - OutboundQueue::process_message(message.as_slice(), origin, &mut meter, &mut [0u8; 32]), - ProcessMessageError::Yield - ); - }) -} - -#[test] -fn process_message_fails_on_max_nonce_reached() { - new_tester().execute_with(|| { - let sibling_id = 1000; - let channel_id: ChannelId = ParaId::from(sibling_id).into(); - let origin = AggregateMessageOrigin::Snowbridge(channel_id); - let message: QueuedMessage = QueuedMessage { - id: H256::zero(), - channel_id, - command: mock_message(sibling_id).command, - }; - let versioned_queued_message: VersionedQueuedMessage = message.try_into().unwrap(); - let encoded = versioned_queued_message.encode(); - let mut meter = WeightMeter::with_limit(Weight::MAX); - - Nonce::::set(channel_id, u64::MAX); - - assert_noop!( - OutboundQueue::process_message(encoded.as_slice(), origin, &mut meter, &mut [0u8; 32]), - ProcessMessageError::Unsupported - ); - }) -} - -#[test] -fn process_message_fails_on_overweight_message() { - new_tester().execute_with(|| { - let sibling_id = 1000; - let channel_id: ChannelId = ParaId::from(sibling_id).into(); - let origin = AggregateMessageOrigin::Snowbridge(channel_id); - let message: QueuedMessage = QueuedMessage { - id: H256::zero(), - channel_id, - command: mock_message(sibling_id).command, - }; - let versioned_queued_message: VersionedQueuedMessage = message.try_into().unwrap(); - let encoded = versioned_queued_message.encode(); - let mut meter = WeightMeter::with_limit(Weight::from_parts(1, 1)); - assert_noop!( - OutboundQueue::process_message(encoded.as_slice(), origin, &mut meter, &mut [0u8; 32]), - ProcessMessageError::Overweight(::WeightInfo::do_process_message()) - ); - }) -} - -// Governance messages should be able to bypass a halted operating mode -// Other message sends should fail when halted -#[test] -fn submit_upgrade_message_success_when_queue_halted() { - new_tester().execute_with(|| { - // halt the outbound queue - OutboundQueue::set_operating_mode(RuntimeOrigin::root(), BasicOperatingMode::Halted) - .unwrap(); - - // submit a high priority message from bridge_hub should success - let message = mock_governance_message::(); - let (ticket, _) = OutboundQueue::validate(&message).unwrap(); - assert_ok!(OutboundQueue::deliver(ticket)); - - // submit a low priority message from asset_hub will fail as pallet is halted - let message = mock_message(1000); - let (ticket, _) = OutboundQueue::validate(&message).unwrap(); - assert_noop!(OutboundQueue::deliver(ticket), SendError::Halted); - }); -} - -#[test] -fn governance_message_does_not_get_the_chance_to_processed_in_same_block_when_congest_of_low_priority_sibling_messages( -) { - use snowbridge_core::PRIMARY_GOVERNANCE_CHANNEL; - use AggregateMessageOrigin::*; - - let sibling_id: u32 = 1000; - let sibling_channel_id: ChannelId = ParaId::from(sibling_id).into(); - - new_tester().execute_with(|| { - // submit a lot of low priority messages from asset_hub which will need multiple blocks to - // execute(20 messages for each block so 40 required at least 2 blocks) - let max_messages = 40; - for _ in 0..max_messages { - // submit low priority message - let message = mock_message(sibling_id); - let (ticket, _) = OutboundQueue::validate(&message).unwrap(); - OutboundQueue::deliver(ticket).unwrap(); - } - - let footprint = MessageQueue::footprint(Snowbridge(sibling_channel_id)); - assert_eq!(footprint.storage.count, (max_messages) as u64); - - let message = mock_governance_message::(); - let (ticket, _) = OutboundQueue::validate(&message).unwrap(); - OutboundQueue::deliver(ticket).unwrap(); - - // move to next block - ServiceWeight::set(Some(Weight::MAX)); - run_to_end_of_next_block(); - - // first process 20 messages from sibling channel - let footprint = MessageQueue::footprint(Snowbridge(sibling_channel_id)); - assert_eq!(footprint.storage.count, 40 - 20); - - // and governance message does not have the chance to execute in same block - let footprint = MessageQueue::footprint(Snowbridge(PRIMARY_GOVERNANCE_CHANNEL)); - assert_eq!(footprint.storage.count, 1); - - // move to next block - ServiceWeight::set(Some(Weight::MAX)); - run_to_end_of_next_block(); - - // now governance message get executed in this block - let footprint = MessageQueue::footprint(Snowbridge(PRIMARY_GOVERNANCE_CHANNEL)); - assert_eq!(footprint.storage.count, 0); - - // and this time process 19 messages from sibling channel so we have 1 message left - let footprint = MessageQueue::footprint(Snowbridge(sibling_channel_id)); - assert_eq!(footprint.storage.count, 1); - - // move to the next block, the last 1 message from sibling channel get executed - ServiceWeight::set(Some(Weight::MAX)); - run_to_end_of_next_block(); - let footprint = MessageQueue::footprint(Snowbridge(sibling_channel_id)); - assert_eq!(footprint.storage.count, 0); - }); -} - -#[test] -fn convert_local_currency() { - new_tester().execute_with(|| { - let fee: u128 = 1_000_000; - let fee1 = FixedU128::from_inner(fee).into_inner(); - let fee2 = FixedU128::from(fee) - .into_inner() - .checked_div(FixedU128::accuracy()) - .expect("accuracy is not zero; qed"); - assert_eq!(fee, fee1); - assert_eq!(fee, fee2); - }); -} - -#[test] -fn encode_digest_item_with_correct_index() { - new_tester().execute_with(|| { - let digest_item: DigestItem = CustomDigestItem::Snowbridge(H256::default()).into(); - let enum_prefix = match digest_item { - DigestItem::Other(data) => data[0], - _ => u8::MAX, - }; - assert_eq!(enum_prefix, 0); - }); -} - -#[test] -fn encode_digest_item() { - new_tester().execute_with(|| { - let digest_item: DigestItem = CustomDigestItem::Snowbridge([5u8; 32].into()).into(); - let digest_item_raw = digest_item.encode(); - assert_eq!(digest_item_raw[0], 0); // DigestItem::Other - assert_eq!(digest_item_raw[2], 0); // CustomDigestItem::Snowbridge - assert_eq!( - digest_item_raw, - [ - 0, 132, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5 - ] - ); - }); -} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/types.rs b/snowbridge/parachain/pallets/outbound-queue/src/types.rs deleted file mode 100644 index 28d400bb9d4..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/src/types.rs +++ /dev/null @@ -1,57 +0,0 @@ -use codec::{Decode, Encode}; -use ethabi::Token; -use frame_support::traits::ProcessMessage; -use scale_info::TypeInfo; -use sp_core::H256; -use sp_runtime::RuntimeDebug; -use sp_std::prelude::*; - -use super::Pallet; - -use snowbridge_core::ChannelId; -pub use snowbridge_outbound_queue_merkle_tree::MerkleProof; - -pub type ProcessMessageOriginOf = as ProcessMessage>::Origin; - -pub const LOG_TARGET: &str = "snowbridge-outbound-queue"; - -/// Message which has been assigned a nonce and will be committed at the end of a block -#[derive(Encode, Decode, Clone, PartialEq, RuntimeDebug, TypeInfo)] -pub struct CommittedMessage { - /// Message channel - pub channel_id: ChannelId, - /// Unique nonce to prevent replaying messages - #[codec(compact)] - pub nonce: u64, - /// Command to execute in the Gateway contract - pub command: u8, - /// Params for the command - pub params: Vec, - /// Maximum gas allowed for message dispatch - #[codec(compact)] - pub max_dispatch_gas: u64, - /// Maximum fee per gas - #[codec(compact)] - pub max_fee_per_gas: u128, - /// Reward in ether for delivering this message, in addition to the gas refund - #[codec(compact)] - pub reward: u128, - /// Message ID (Used for tracing messages across route, has no role in consensus) - pub id: H256, -} - -/// Convert message into an ABI-encoded form for delivery to the InboundQueue contract on Ethereum -impl From for Token { - fn from(x: CommittedMessage) -> Token { - Token::Tuple(vec![ - Token::FixedBytes(Vec::from(x.channel_id.as_ref())), - Token::Uint(x.nonce.into()), - Token::Uint(x.command.into()), - Token::Bytes(x.params.to_vec()), - Token::Uint(x.max_dispatch_gas.into()), - Token::Uint(x.max_fee_per_gas.into()), - Token::Uint(x.reward.into()), - Token::FixedBytes(Vec::from(x.id.as_ref())), - ]) - } -} diff --git a/snowbridge/parachain/pallets/outbound-queue/src/weights.rs b/snowbridge/parachain/pallets/outbound-queue/src/weights.rs deleted file mode 100644 index 87eee1a31e8..00000000000 --- a/snowbridge/parachain/pallets/outbound-queue/src/weights.rs +++ /dev/null @@ -1,81 +0,0 @@ - -//! Autogenerated weights for `snowbridge-pallet-outbound-queue` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-10-19, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `192.168.1.7`, CPU: `` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: `1024` - -// Executed Command: -// target/release/polkadot-parachain -// benchmark -// pallet -// --chain=bridge-hub-rococo-dev -// --pallet=snowbridge-pallet-outbound-queue -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --template -// ../parachain/templates/module-weight-template.hbs -// --output -// ../parachain/pallets/outbound-queue/src/weights.rs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; - -/// Weight functions needed for `snowbridge-pallet-outbound-queue`. -pub trait WeightInfo { - fn do_process_message() -> Weight; - fn commit() -> Weight; - fn commit_single() -> Weight; -} - -// For backwards compatibility and tests. -impl WeightInfo for () { - /// Storage: EthereumOutboundQueue MessageLeaves (r:1 w:1) - /// Proof Skipped: EthereumOutboundQueue MessageLeaves (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: EthereumOutboundQueue PendingHighPriorityMessageCount (r:1 w:1) - /// Proof: EthereumOutboundQueue PendingHighPriorityMessageCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: EthereumOutboundQueue Nonce (r:1 w:1) - /// Proof: EthereumOutboundQueue Nonce (max_values: None, max_size: Some(20), added: 2495, mode: MaxEncodedLen) - /// Storage: EthereumOutboundQueue Messages (r:1 w:1) - /// Proof Skipped: EthereumOutboundQueue Messages (max_values: Some(1), max_size: None, mode: Measured) - fn do_process_message() -> Weight { - // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `3485` - // Minimum execution time: 39_000_000 picoseconds. - Weight::from_parts(39_000_000, 3485) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) - } - /// Storage: EthereumOutboundQueue MessageLeaves (r:1 w:0) - /// Proof Skipped: EthereumOutboundQueue MessageLeaves (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: System Digest (r:1 w:1) - /// Proof Skipped: System Digest (max_values: Some(1), max_size: None, mode: Measured) - fn commit() -> Weight { - // Proof Size summary in bytes: - // Measured: `1094` - // Estimated: `2579` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(28_000_000, 2579) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - - fn commit_single() -> Weight { - // Proof Size summary in bytes: - // Measured: `1094` - // Estimated: `2579` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(9_000_000, 1586) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } -} diff --git a/snowbridge/parachain/pallets/system/Cargo.toml b/snowbridge/parachain/pallets/system/Cargo.toml deleted file mode 100644 index 70155370d19..00000000000 --- a/snowbridge/parachain/pallets/system/Cargo.toml +++ /dev/null @@ -1,87 +0,0 @@ -[package] -name = "snowbridge-pallet-system" -description = "Snowbridge System Pallet" -version = "0.9.0" -authors = ["Snowfork "] -edition.workspace = true -repository.workspace = true -license = "Apache-2.0" -categories = ["cryptography::cryptocurrencies"] - -[lints] -workspace = true - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -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"] } -frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking", default-features = false, optional = true } -frame-support = { path = "../../../../../substrate/frame/support", default-features = false } -frame-system = { path = "../../../../../substrate/frame/system", default-features = false } -log = { version = "0.4.20", default-features = false } - -sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } -sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } -sp-io = { path = "../../../../../substrate/primitives/io", default-features = false } -sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } - -xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } -xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false } -xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false } - -ethabi = { git = "https://github.com/Snowfork/ethabi-decode.git", package = "ethabi-decode", branch = "master", default-features = false } -snowbridge-core = { path = "../../primitives/core", default-features = false } - -[dev-dependencies] -hex = "0.4.1" -hex-literal = { version = "0.4.1" } -pallet-balances = { path = "../../../../../substrate/frame/balances" } -sp-keyring = { path = "../../../../../substrate/primitives/keyring" } -polkadot-primitives = { path = "../../../../../polkadot/primitives" } -pallet-message-queue = { path = "../../../../../substrate/frame/message-queue" } -snowbridge-pallet-outbound-queue = { path = "../outbound-queue" } - -[features] -default = ["std"] -std = [ - "codec/std", - "ethabi/std", - "frame-benchmarking?/std", - "frame-support/std", - "frame-system/std", - "log/std", - "scale-info/std", - "snowbridge-core/std", - "sp-core/std", - "sp-io/std", - "sp-runtime/std", - "sp-std/std", - "xcm-builder/std", - "xcm-executor/std", - "xcm/std", -] -runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-message-queue/runtime-benchmarks", - "polkadot-primitives/runtime-benchmarks", - "snowbridge-core/runtime-benchmarks", - "snowbridge-pallet-outbound-queue/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", - "xcm-executor/runtime-benchmarks", -] -try-runtime = [ - "frame-support/try-runtime", - "frame-system/try-runtime", - "pallet-balances/try-runtime", - "pallet-message-queue/try-runtime", - "snowbridge-pallet-outbound-queue/try-runtime", - "sp-runtime/try-runtime", -] diff --git a/snowbridge/parachain/pallets/system/README.md b/snowbridge/parachain/pallets/system/README.md deleted file mode 100644 index 5ab11d45eae..00000000000 --- a/snowbridge/parachain/pallets/system/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Ethereum System - -Contains management functions to manage functions on Ethereum. For example, creating agents and channels. diff --git a/snowbridge/parachain/pallets/system/runtime-api/Cargo.toml b/snowbridge/parachain/pallets/system/runtime-api/Cargo.toml deleted file mode 100644 index 96d5aa522c0..00000000000 --- a/snowbridge/parachain/pallets/system/runtime-api/Cargo.toml +++ /dev/null @@ -1,36 +0,0 @@ -[package] -name = "snowbridge-system-runtime-api" -description = "Snowbridge System Runtime API" -version = "0.9.0" -authors = ["Snowfork "] -edition.workspace = true -repository.workspace = true -license = "Apache-2.0" -categories = ["cryptography::cryptocurrencies"] - -[lints] -workspace = true - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = [ - "derive", -] } -sp-core = { path = "../../../../../../substrate/primitives/core", default-features = false } -sp-std = { path = "../../../../../../substrate/primitives/std", default-features = false } -sp-api = { path = "../../../../../../substrate/primitives/api", default-features = false } -xcm = { package = "staging-xcm", path = "../../../../../../polkadot/xcm", default-features = false } -snowbridge-core = { path = "../../../primitives/core", default-features = false } - -[features] -default = ["std"] -std = [ - "codec/std", - "snowbridge-core/std", - "sp-api/std", - "sp-core/std", - "sp-std/std", - "xcm/std", -] diff --git a/snowbridge/parachain/pallets/system/runtime-api/README.md b/snowbridge/parachain/pallets/system/runtime-api/README.md deleted file mode 100644 index 99827c9c2fc..00000000000 --- a/snowbridge/parachain/pallets/system/runtime-api/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Ethereum System Runtime API - -Provides an API for looking up an agent ID on Ethereum. diff --git a/snowbridge/parachain/pallets/system/runtime-api/src/lib.rs b/snowbridge/parachain/pallets/system/runtime-api/src/lib.rs deleted file mode 100644 index 7f119809546..00000000000 --- a/snowbridge/parachain/pallets/system/runtime-api/src/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -#![cfg_attr(not(feature = "std"), no_std)] - -use snowbridge_core::AgentId; -use xcm::VersionedLocation; - -sp_api::decl_runtime_apis! { - pub trait ControlApi - { - fn agent_id(location: VersionedLocation) -> Option; - } -} diff --git a/snowbridge/parachain/pallets/system/src/api.rs b/snowbridge/parachain/pallets/system/src/api.rs deleted file mode 100644 index ef12b03e1d7..00000000000 --- a/snowbridge/parachain/pallets/system/src/api.rs +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! Helpers for implementing runtime api - -use snowbridge_core::AgentId; -use xcm::{prelude::*, VersionedLocation}; - -use crate::{agent_id_of, Config}; - -pub fn agent_id(location: VersionedLocation) -> Option -where - Runtime: Config, -{ - let location: Location = location.try_into().ok()?; - agent_id_of::(&location).ok() -} diff --git a/snowbridge/parachain/pallets/system/src/benchmarking.rs b/snowbridge/parachain/pallets/system/src/benchmarking.rs deleted file mode 100644 index ef908ad6a3f..00000000000 --- a/snowbridge/parachain/pallets/system/src/benchmarking.rs +++ /dev/null @@ -1,167 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! Benchmarking setup for pallet-template -use super::*; - -#[allow(unused)] -use crate::Pallet as SnowbridgeControl; -use frame_benchmarking::v2::*; -use frame_system::RawOrigin; -use snowbridge_core::{eth, outbound::OperatingMode}; -use sp_runtime::SaturatedConversion; -use xcm::prelude::*; - -#[allow(clippy::result_large_err)] -fn fund_sovereign_account(para_id: ParaId) -> Result<(), BenchmarkError> { - let amount: BalanceOf = (10_000_000_000_000_u64).saturated_into::().saturated_into(); - let sovereign_account = sibling_sovereign_account::(para_id); - T::Token::mint_into(&sovereign_account, amount)?; - Ok(()) -} - -#[benchmarks] -mod benchmarks { - use super::*; - - #[benchmark] - fn upgrade() -> Result<(), BenchmarkError> { - let impl_address = H160::repeat_byte(1); - let impl_code_hash = H256::repeat_byte(1); - - // Assume 256 bytes passed to initializer - let params: Vec = (0..256).map(|_| 1u8).collect(); - - #[extrinsic_call] - _( - RawOrigin::Root, - impl_address, - impl_code_hash, - Some(Initializer { params, maximum_required_gas: 100000 }), - ); - - Ok(()) - } - - #[benchmark] - fn set_operating_mode() -> Result<(), BenchmarkError> { - #[extrinsic_call] - _(RawOrigin::Root, OperatingMode::RejectingOutboundMessages); - - Ok(()) - } - - #[benchmark] - fn set_pricing_parameters() -> Result<(), BenchmarkError> { - let params = T::DefaultPricingParameters::get(); - - #[extrinsic_call] - _(RawOrigin::Root, params); - - Ok(()) - } - - #[benchmark] - fn create_agent() -> Result<(), BenchmarkError> { - let origin_para_id = 2000; - let origin_location = Location::new(1, [Parachain(origin_para_id)]); - let origin = T::Helper::make_xcm_origin(origin_location); - fund_sovereign_account::(origin_para_id.into())?; - - #[extrinsic_call] - _(origin as T::RuntimeOrigin); - - Ok(()) - } - - #[benchmark] - fn create_channel() -> Result<(), BenchmarkError> { - let origin_para_id = 2000; - let origin_location = Location::new(1, [Parachain(origin_para_id)]); - let origin = T::Helper::make_xcm_origin(origin_location); - fund_sovereign_account::(origin_para_id.into())?; - - SnowbridgeControl::::create_agent(origin.clone())?; - - #[extrinsic_call] - _(origin as T::RuntimeOrigin, OperatingMode::Normal); - - Ok(()) - } - - #[benchmark] - fn update_channel() -> Result<(), BenchmarkError> { - let origin_para_id = 2000; - let origin_location = Location::new(1, [Parachain(origin_para_id)]); - let origin = T::Helper::make_xcm_origin(origin_location); - fund_sovereign_account::(origin_para_id.into())?; - SnowbridgeControl::::create_agent(origin.clone())?; - SnowbridgeControl::::create_channel(origin.clone(), OperatingMode::Normal)?; - - #[extrinsic_call] - _(origin as T::RuntimeOrigin, OperatingMode::RejectingOutboundMessages); - - Ok(()) - } - - #[benchmark] - fn force_update_channel() -> Result<(), BenchmarkError> { - let origin_para_id = 2000; - let origin_location = Location::new(1, [Parachain(origin_para_id)]); - let origin = T::Helper::make_xcm_origin(origin_location); - let channel_id: ChannelId = ParaId::from(origin_para_id).into(); - - fund_sovereign_account::(origin_para_id.into())?; - SnowbridgeControl::::create_agent(origin.clone())?; - SnowbridgeControl::::create_channel(origin.clone(), OperatingMode::Normal)?; - - #[extrinsic_call] - _(RawOrigin::Root, channel_id, OperatingMode::RejectingOutboundMessages); - - Ok(()) - } - - #[benchmark] - fn transfer_native_from_agent() -> Result<(), BenchmarkError> { - let origin_para_id = 2000; - let origin_location = Location::new(1, [Parachain(origin_para_id)]); - let origin = T::Helper::make_xcm_origin(origin_location); - fund_sovereign_account::(origin_para_id.into())?; - SnowbridgeControl::::create_agent(origin.clone())?; - SnowbridgeControl::::create_channel(origin.clone(), OperatingMode::Normal)?; - - #[extrinsic_call] - _(origin as T::RuntimeOrigin, H160::default(), 1); - - Ok(()) - } - - #[benchmark] - fn force_transfer_native_from_agent() -> Result<(), BenchmarkError> { - let origin_para_id = 2000; - let origin_location = Location::new(1, [Parachain(origin_para_id)]); - let origin = T::Helper::make_xcm_origin(origin_location.clone()); - fund_sovereign_account::(origin_para_id.into())?; - SnowbridgeControl::::create_agent(origin.clone())?; - - let versioned_location: VersionedLocation = origin_location.into(); - - #[extrinsic_call] - _(RawOrigin::Root, Box::new(versioned_location), H160::default(), 1); - - Ok(()) - } - - #[benchmark] - fn set_token_transfer_fees() -> Result<(), BenchmarkError> { - #[extrinsic_call] - _(RawOrigin::Root, 1, 1, eth(1)); - - Ok(()) - } - - impl_benchmark_test_suite!( - SnowbridgeControl, - crate::mock::new_test_ext(true), - crate::mock::Test - ); -} diff --git a/snowbridge/parachain/pallets/system/src/lib.rs b/snowbridge/parachain/pallets/system/src/lib.rs deleted file mode 100644 index e742bd8e110..00000000000 --- a/snowbridge/parachain/pallets/system/src/lib.rs +++ /dev/null @@ -1,681 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! Governance API for controlling the Ethereum side of the bridge -//! -//! # Extrinsics -//! -//! ## Agents -//! -//! Agents are smart contracts on Ethereum that act as proxies for consensus systems on Polkadot -//! networks. -//! -//! * [`Call::create_agent`]: Create agent for a sibling parachain -//! * [`Call::transfer_native_from_agent`]: Withdraw ether from an agent -//! -//! The `create_agent` extrinsic should be called via an XCM `Transact` instruction from the sibling -//! parachain. -//! -//! ## Channels -//! -//! Each sibling parachain has its own dedicated messaging channel for sending and receiving -//! messages. As a prerequisite to creating a channel, the sibling should have already created -//! an agent using the `create_agent` extrinsic. -//! -//! * [`Call::create_channel`]: Create channel for a sibling -//! * [`Call::update_channel`]: Update a channel for a sibling -//! -//! ## Governance -//! -//! Only Polkadot governance itself can call these extrinsics. Delivery fees are waived. -//! -//! * [`Call::upgrade`]`: Upgrade the gateway contract -//! * [`Call::set_operating_mode`]: Update the operating mode of the gateway contract -//! * [`Call::force_update_channel`]: Allow root to update a channel for a sibling -//! * [`Call::force_transfer_native_from_agent`]: Allow root to withdraw ether from an agent -//! -//! Typically, Polkadot governance will use the `force_transfer_native_from_agent` and -//! `force_update_channel` and extrinsics to manage agents and channels for system parachains. -#![cfg_attr(not(feature = "std"), no_std)] - -pub use pallet::*; - -#[cfg(test)] -mod mock; - -#[cfg(test)] -mod tests; - -#[cfg(feature = "runtime-benchmarks")] -mod benchmarking; -pub mod migration; - -pub mod api; -pub mod weights; -pub use weights::*; - -use frame_support::{ - pallet_prelude::*, - traits::{ - fungible::{Inspect, Mutate}, - tokens::Preservation, - Contains, EnsureOrigin, - }, -}; -use frame_system::pallet_prelude::*; -use snowbridge_core::{ - meth, - outbound::{Command, Initializer, Message, OperatingMode, SendError, SendMessage}, - sibling_sovereign_account, AgentId, Channel, ChannelId, ParaId, - PricingParameters as PricingParametersRecord, PRIMARY_GOVERNANCE_CHANNEL, - SECONDARY_GOVERNANCE_CHANNEL, -}; -use sp_core::{RuntimeDebug, H160, H256}; -use sp_io::hashing::blake2_256; -use sp_runtime::{traits::BadOrigin, DispatchError, SaturatedConversion}; -use sp_std::prelude::*; -use xcm::prelude::*; -use xcm_executor::traits::ConvertLocation; - -#[cfg(feature = "runtime-benchmarks")] -use frame_support::traits::OriginTrait; - -pub use pallet::*; - -pub type BalanceOf = - <::Token as Inspect<::AccountId>>::Balance; -pub type AccountIdOf = ::AccountId; -pub type PricingParametersOf = PricingParametersRecord>; - -/// Ensure origin location is a sibling -fn ensure_sibling(location: &Location) -> Result<(ParaId, H256), DispatchError> -where - T: Config, -{ - match location.unpack() { - (1, [Parachain(para_id)]) => { - let agent_id = agent_id_of::(location)?; - Ok(((*para_id).into(), agent_id)) - }, - _ => Err(BadOrigin.into()), - } -} - -/// Hash the location to produce an agent id -fn agent_id_of(location: &Location) -> Result { - T::AgentIdOf::convert_location(location).ok_or(Error::::LocationConversionFailed.into()) -} - -#[cfg(feature = "runtime-benchmarks")] -pub trait BenchmarkHelper -where - O: OriginTrait, -{ - fn make_xcm_origin(location: Location) -> O; -} - -/// Whether a fee should be withdrawn to an account for sending an outbound message -#[derive(Clone, PartialEq, RuntimeDebug)] -pub enum PaysFee -where - T: Config, -{ - /// Fully charge includes (local + remote fee) - Yes(AccountIdOf), - /// Partially charge includes local fee only - Partial(AccountIdOf), - /// No charge - No, -} - -#[frame_support::pallet] -pub mod pallet { - use snowbridge_core::StaticLookup; - use sp_core::U256; - - use super::*; - - #[pallet::pallet] - pub struct Pallet(_); - - #[pallet::config] - pub trait Config: frame_system::Config { - type RuntimeEvent: From> + IsType<::RuntimeEvent>; - - /// Send messages to Ethereum - type OutboundQueue: SendMessage>; - - /// Origin check for XCM locations that can create agents - type SiblingOrigin: EnsureOrigin; - - /// Converts Location to AgentId - type AgentIdOf: ConvertLocation; - - /// Token reserved for control operations - type Token: Mutate; - - /// TreasuryAccount to collect fees - #[pallet::constant] - type TreasuryAccount: Get; - - /// Number of decimal places of local currency - type DefaultPricingParameters: Get>; - - /// Cost of delivering a message from Ethereum - type InboundDeliveryCost: Get>; - - type WeightInfo: WeightInfo; - - #[cfg(feature = "runtime-benchmarks")] - type Helper: BenchmarkHelper; - } - - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] - pub enum Event { - /// An Upgrade message was sent to the Gateway - Upgrade { - impl_address: H160, - impl_code_hash: H256, - initializer_params_hash: Option, - }, - /// An CreateAgent message was sent to the Gateway - CreateAgent { - location: Box, - agent_id: AgentId, - }, - /// An CreateChannel message was sent to the Gateway - CreateChannel { - channel_id: ChannelId, - agent_id: AgentId, - }, - /// An UpdateChannel message was sent to the Gateway - UpdateChannel { - channel_id: ChannelId, - mode: OperatingMode, - }, - /// An SetOperatingMode message was sent to the Gateway - SetOperatingMode { - mode: OperatingMode, - }, - /// An TransferNativeFromAgent message was sent to the Gateway - TransferNativeFromAgent { - agent_id: AgentId, - recipient: H160, - amount: u128, - }, - /// A SetTokenTransferFees message was sent to the Gateway - SetTokenTransferFees { - create_asset_xcm: u128, - transfer_asset_xcm: u128, - register_token: U256, - }, - PricingParametersChanged { - params: PricingParametersOf, - }, - } - - #[pallet::error] - pub enum Error { - LocationConversionFailed, - AgentAlreadyCreated, - NoAgent, - ChannelAlreadyCreated, - NoChannel, - UnsupportedLocationVersion, - InvalidLocation, - Send(SendError), - InvalidTokenTransferFees, - InvalidPricingParameters, - } - - /// The set of registered agents - #[pallet::storage] - #[pallet::getter(fn agents)] - pub type Agents = StorageMap<_, Twox64Concat, AgentId, (), OptionQuery>; - - /// The set of registered channels - #[pallet::storage] - #[pallet::getter(fn channels)] - pub type Channels = StorageMap<_, Twox64Concat, ChannelId, Channel, OptionQuery>; - - #[pallet::storage] - #[pallet::getter(fn parameters)] - pub type PricingParameters = - StorageValue<_, PricingParametersOf, ValueQuery, T::DefaultPricingParameters>; - - #[pallet::genesis_config] - #[derive(frame_support::DefaultNoBound)] - pub struct GenesisConfig { - // Own parachain id - pub para_id: ParaId, - // AssetHub's parachain id - pub asset_hub_para_id: ParaId, - #[serde(skip)] - pub _config: PhantomData, - } - - #[pallet::genesis_build] - impl BuildGenesisConfig for GenesisConfig { - fn build(&self) { - Pallet::::initialize(self.para_id, self.asset_hub_para_id).expect("infallible; qed"); - } - } - - #[pallet::call] - impl Pallet { - /// Sends command to the Gateway contract to upgrade itself with a new implementation - /// contract - /// - /// Fee required: No - /// - /// - `origin`: Must be `Root`. - /// - `impl_address`: The address of the implementation contract. - /// - `impl_code_hash`: The codehash of the implementation contract. - /// - `initializer`: Optionally call an initializer on the implementation contract. - #[pallet::call_index(0)] - #[pallet::weight((T::WeightInfo::upgrade(), DispatchClass::Operational))] - pub fn upgrade( - origin: OriginFor, - impl_address: H160, - impl_code_hash: H256, - initializer: Option, - ) -> DispatchResult { - ensure_root(origin)?; - - let initializer_params_hash: Option = - initializer.as_ref().map(|i| H256::from(blake2_256(i.params.as_ref()))); - let command = Command::Upgrade { impl_address, impl_code_hash, initializer }; - Self::send(PRIMARY_GOVERNANCE_CHANNEL, command, PaysFee::::No)?; - - Self::deposit_event(Event::::Upgrade { - impl_address, - impl_code_hash, - initializer_params_hash, - }); - Ok(()) - } - - /// Sends a message to the Gateway contract to change its operating mode - /// - /// Fee required: No - /// - /// - `origin`: Must be `Location` - #[pallet::call_index(1)] - #[pallet::weight((T::WeightInfo::set_operating_mode(), DispatchClass::Operational))] - pub fn set_operating_mode(origin: OriginFor, mode: OperatingMode) -> DispatchResult { - ensure_root(origin)?; - - let command = Command::SetOperatingMode { mode }; - Self::send(PRIMARY_GOVERNANCE_CHANNEL, command, PaysFee::::No)?; - - Self::deposit_event(Event::::SetOperatingMode { mode }); - Ok(()) - } - - /// Set pricing parameters on both sides of the bridge - /// - /// Fee required: No - /// - /// - `origin`: Must be root - #[pallet::call_index(2)] - #[pallet::weight((T::WeightInfo::set_pricing_parameters(), DispatchClass::Operational))] - pub fn set_pricing_parameters( - origin: OriginFor, - params: PricingParametersOf, - ) -> DispatchResult { - ensure_root(origin)?; - params.validate().map_err(|_| Error::::InvalidPricingParameters)?; - PricingParameters::::put(params.clone()); - - let command = Command::SetPricingParameters { - exchange_rate: params.exchange_rate.into(), - delivery_cost: T::InboundDeliveryCost::get().saturated_into::(), - }; - Self::send(PRIMARY_GOVERNANCE_CHANNEL, command, PaysFee::::No)?; - - Self::deposit_event(Event::PricingParametersChanged { params }); - Ok(()) - } - - /// Sends a command to the Gateway contract to instantiate a new agent contract representing - /// `origin`. - /// - /// Fee required: Yes - /// - /// - `origin`: Must be `Location` of a sibling parachain - #[pallet::call_index(3)] - #[pallet::weight(T::WeightInfo::create_agent())] - pub fn create_agent(origin: OriginFor) -> DispatchResult { - let origin_location: Location = T::SiblingOrigin::ensure_origin(origin)?; - - // Ensure that origin location is some consensus system on a sibling parachain - let (para_id, agent_id) = ensure_sibling::(&origin_location)?; - - // Record the agent id or fail if it has already been created - ensure!(!Agents::::contains_key(agent_id), Error::::AgentAlreadyCreated); - Agents::::insert(agent_id, ()); - - let command = Command::CreateAgent { agent_id }; - let pays_fee = PaysFee::::Yes(sibling_sovereign_account::(para_id)); - Self::send(SECONDARY_GOVERNANCE_CHANNEL, command, pays_fee)?; - - Self::deposit_event(Event::::CreateAgent { - location: Box::new(origin_location), - agent_id, - }); - Ok(()) - } - - /// Sends a message to the Gateway contract to create a new channel representing `origin` - /// - /// Fee required: Yes - /// - /// This extrinsic is permissionless, so a fee is charged to prevent spamming and pay - /// for execution costs on the remote side. - /// - /// The message is sent over the bridge on BridgeHub's own channel to the Gateway. - /// - /// - `origin`: Must be `Location` - /// - `mode`: Initial operating mode of the channel - #[pallet::call_index(4)] - #[pallet::weight(T::WeightInfo::create_channel())] - pub fn create_channel(origin: OriginFor, mode: OperatingMode) -> DispatchResult { - let origin_location: Location = T::SiblingOrigin::ensure_origin(origin)?; - - // Ensure that origin location is a sibling parachain - let (para_id, agent_id) = ensure_sibling::(&origin_location)?; - - let channel_id: ChannelId = para_id.into(); - - ensure!(Agents::::contains_key(agent_id), Error::::NoAgent); - ensure!(!Channels::::contains_key(channel_id), Error::::ChannelAlreadyCreated); - - let channel = Channel { agent_id, para_id }; - Channels::::insert(channel_id, channel); - - let command = Command::CreateChannel { channel_id, agent_id, mode }; - let pays_fee = PaysFee::::Yes(sibling_sovereign_account::(para_id)); - Self::send(SECONDARY_GOVERNANCE_CHANNEL, command, pays_fee)?; - - Self::deposit_event(Event::::CreateChannel { channel_id, agent_id }); - Ok(()) - } - - /// Sends a message to the Gateway contract to update a channel configuration - /// - /// The origin must already have a channel initialized, as this message is sent over it. - /// - /// A partial fee will be charged for local processing only. - /// - /// - `origin`: Must be `Location` - /// - `mode`: Initial operating mode of the channel - #[pallet::call_index(5)] - #[pallet::weight(T::WeightInfo::update_channel())] - pub fn update_channel(origin: OriginFor, mode: OperatingMode) -> DispatchResult { - let origin_location: Location = T::SiblingOrigin::ensure_origin(origin)?; - - // Ensure that origin location is a sibling parachain - let (para_id, _) = ensure_sibling::(&origin_location)?; - - let channel_id: ChannelId = para_id.into(); - - ensure!(Channels::::contains_key(channel_id), Error::::NoChannel); - - let command = Command::UpdateChannel { channel_id, mode }; - let pays_fee = PaysFee::::Partial(sibling_sovereign_account::(para_id)); - - // Parachains send the update message on their own channel - Self::send(channel_id, command, pays_fee)?; - - Self::deposit_event(Event::::UpdateChannel { channel_id, mode }); - Ok(()) - } - - /// Sends a message to the Gateway contract to update an arbitrary channel - /// - /// Fee required: No - /// - /// - `origin`: Must be root - /// - `channel_id`: ID of channel - /// - `mode`: Initial operating mode of the channel - /// - `outbound_fee`: Fee charged to users for sending outbound messages to Polkadot - #[pallet::call_index(6)] - #[pallet::weight(T::WeightInfo::force_update_channel())] - pub fn force_update_channel( - origin: OriginFor, - channel_id: ChannelId, - mode: OperatingMode, - ) -> DispatchResult { - ensure_root(origin)?; - - ensure!(Channels::::contains_key(channel_id), Error::::NoChannel); - - let command = Command::UpdateChannel { channel_id, mode }; - Self::send(PRIMARY_GOVERNANCE_CHANNEL, command, PaysFee::::No)?; - - Self::deposit_event(Event::::UpdateChannel { channel_id, mode }); - Ok(()) - } - - /// Sends a message to the Gateway contract to transfer ether from an agent to `recipient`. - /// - /// A partial fee will be charged for local processing only. - /// - /// - `origin`: Must be `Location` - #[pallet::call_index(7)] - #[pallet::weight(T::WeightInfo::transfer_native_from_agent())] - pub fn transfer_native_from_agent( - origin: OriginFor, - recipient: H160, - amount: u128, - ) -> DispatchResult { - let origin_location: Location = T::SiblingOrigin::ensure_origin(origin)?; - - // Ensure that origin location is some consensus system on a sibling parachain - let (para_id, agent_id) = ensure_sibling::(&origin_location)?; - - // Since the origin is also the owner of the channel, they only need to pay - // the local processing fee. - let pays_fee = PaysFee::::Partial(sibling_sovereign_account::(para_id)); - - Self::do_transfer_native_from_agent( - agent_id, - para_id.into(), - recipient, - amount, - pays_fee, - ) - } - - /// Sends a message to the Gateway contract to transfer ether from an agent to `recipient`. - /// - /// Privileged. Can only be called by root. - /// - /// Fee required: No - /// - /// - `origin`: Must be root - /// - `location`: Location used to resolve the agent - /// - `recipient`: Recipient of funds - /// - `amount`: Amount to transfer - #[pallet::call_index(8)] - #[pallet::weight(T::WeightInfo::force_transfer_native_from_agent())] - pub fn force_transfer_native_from_agent( - origin: OriginFor, - location: Box, - recipient: H160, - amount: u128, - ) -> DispatchResult { - ensure_root(origin)?; - - // Ensure that location is some consensus system on a sibling parachain - let location: Location = - (*location).try_into().map_err(|_| Error::::UnsupportedLocationVersion)?; - let (_, agent_id) = - ensure_sibling::(&location).map_err(|_| Error::::InvalidLocation)?; - - let pays_fee = PaysFee::::No; - - Self::do_transfer_native_from_agent( - agent_id, - PRIMARY_GOVERNANCE_CHANNEL, - recipient, - amount, - pays_fee, - ) - } - - /// Sends a message to the Gateway contract to update fee related parameters for - /// token transfers. - /// - /// Privileged. Can only be called by root. - /// - /// Fee required: No - /// - /// - `origin`: Must be root - /// - `create_asset_xcm`: The XCM execution cost for creating a new asset class on AssetHub, - /// in DOT - /// - `transfer_asset_xcm`: The XCM execution cost for performing a reserve transfer on - /// AssetHub, in DOT - /// - `register_token`: The Ether fee for registering a new token, to discourage spamming - #[pallet::call_index(9)] - #[pallet::weight((T::WeightInfo::set_token_transfer_fees(), DispatchClass::Operational))] - pub fn set_token_transfer_fees( - origin: OriginFor, - create_asset_xcm: u128, - transfer_asset_xcm: u128, - register_token: U256, - ) -> DispatchResult { - ensure_root(origin)?; - - // Basic validation of new costs. Particularly for token registration, we want to ensure - // its relatively expensive to discourage spamming. Like at least 100 USD. - ensure!( - create_asset_xcm > 0 && transfer_asset_xcm > 0 && register_token > meth(100), - Error::::InvalidTokenTransferFees - ); - - let command = Command::SetTokenTransferFees { - create_asset_xcm, - transfer_asset_xcm, - register_token, - }; - Self::send(PRIMARY_GOVERNANCE_CHANNEL, command, PaysFee::::No)?; - - Self::deposit_event(Event::::SetTokenTransferFees { - create_asset_xcm, - transfer_asset_xcm, - register_token, - }); - Ok(()) - } - } - - impl Pallet { - /// Send `command` to the Gateway on the Channel identified by `channel_id` - fn send(channel_id: ChannelId, command: Command, pays_fee: PaysFee) -> DispatchResult { - let message = Message { id: None, channel_id, command }; - let (ticket, fee) = - T::OutboundQueue::validate(&message).map_err(|err| Error::::Send(err))?; - - let payment = match pays_fee { - PaysFee::Yes(account) => Some((account, fee.total())), - PaysFee::Partial(account) => Some((account, fee.local)), - PaysFee::No => None, - }; - - if let Some((payer, fee)) = payment { - T::Token::transfer( - &payer, - &T::TreasuryAccount::get(), - fee, - Preservation::Preserve, - )?; - } - - T::OutboundQueue::deliver(ticket).map_err(|err| Error::::Send(err))?; - Ok(()) - } - - /// Issue a `Command::TransferNativeFromAgent` command. The command will be sent on the - /// channel `channel_id` - pub fn do_transfer_native_from_agent( - agent_id: H256, - channel_id: ChannelId, - recipient: H160, - amount: u128, - pays_fee: PaysFee, - ) -> DispatchResult { - ensure!(Agents::::contains_key(agent_id), Error::::NoAgent); - - let command = Command::TransferNativeFromAgent { agent_id, recipient, amount }; - Self::send(channel_id, command, pays_fee)?; - - Self::deposit_event(Event::::TransferNativeFromAgent { - agent_id, - recipient, - amount, - }); - Ok(()) - } - - /// Initializes agents and channels. - pub fn initialize(para_id: ParaId, asset_hub_para_id: ParaId) -> Result<(), DispatchError> { - // Asset Hub - let asset_hub_location: Location = - ParentThen(Parachain(asset_hub_para_id.into()).into()).into(); - let asset_hub_agent_id = agent_id_of::(&asset_hub_location)?; - let asset_hub_channel_id: ChannelId = asset_hub_para_id.into(); - Agents::::insert(asset_hub_agent_id, ()); - Channels::::insert( - asset_hub_channel_id, - Channel { agent_id: asset_hub_agent_id, para_id: asset_hub_para_id }, - ); - - // Governance channels - let bridge_hub_agent_id = agent_id_of::(&Location::here())?; - // Agent for BridgeHub - Agents::::insert(bridge_hub_agent_id, ()); - - // Primary governance channel - Channels::::insert( - PRIMARY_GOVERNANCE_CHANNEL, - Channel { agent_id: bridge_hub_agent_id, para_id }, - ); - - // Secondary governance channel - Channels::::insert( - SECONDARY_GOVERNANCE_CHANNEL, - Channel { agent_id: bridge_hub_agent_id, para_id }, - ); - - Ok(()) - } - - /// Checks if the pallet has been initialized. - pub(crate) fn is_initialized() -> bool { - let primary_exists = Channels::::contains_key(PRIMARY_GOVERNANCE_CHANNEL); - let secondary_exists = Channels::::contains_key(SECONDARY_GOVERNANCE_CHANNEL); - primary_exists && secondary_exists - } - } - - impl StaticLookup for Pallet { - type Source = ChannelId; - type Target = Channel; - fn lookup(channel_id: Self::Source) -> Option { - Channels::::get(channel_id) - } - } - - impl Contains for Pallet { - fn contains(channel_id: &ChannelId) -> bool { - Channels::::get(channel_id).is_some() - } - } - - impl Get> for Pallet { - fn get() -> PricingParametersOf { - PricingParameters::::get() - } - } -} diff --git a/snowbridge/parachain/pallets/system/src/migration.rs b/snowbridge/parachain/pallets/system/src/migration.rs deleted file mode 100644 index ee94fc091bd..00000000000 --- a/snowbridge/parachain/pallets/system/src/migration.rs +++ /dev/null @@ -1,74 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! Governance API for controlling the Ethereum side of the bridge -use super::*; -use frame_support::traits::OnRuntimeUpgrade; -use log; - -#[cfg(feature = "try-runtime")] -use sp_runtime::TryRuntimeError; - -pub mod v0 { - use frame_support::{pallet_prelude::*, weights::Weight}; - - use super::*; - - const LOG_TARGET: &str = "ethereum_system::migration"; - - pub struct InitializeOnUpgrade( - sp_std::marker::PhantomData<(T, BridgeHubParaId, AssetHubParaId)>, - ); - impl OnRuntimeUpgrade - for InitializeOnUpgrade - where - T: Config, - BridgeHubParaId: Get, - AssetHubParaId: Get, - { - fn on_runtime_upgrade() -> Weight { - if !Pallet::::is_initialized() { - Pallet::::initialize( - BridgeHubParaId::get().into(), - AssetHubParaId::get().into(), - ) - .expect("infallible; qed"); - log::info!( - target: LOG_TARGET, - "Ethereum system initialized." - ); - T::DbWeight::get().reads_writes(2, 5) - } else { - log::info!( - target: LOG_TARGET, - "Ethereum system already initialized. Skipping." - ); - T::DbWeight::get().reads(2) - } - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, TryRuntimeError> { - if !Pallet::::is_initialized() { - log::info!( - target: LOG_TARGET, - "Agents and channels not initialized. Initialization will run." - ); - } else { - log::info!( - target: LOG_TARGET, - "Agents and channels are initialized. Initialization will not run." - ); - } - Ok(vec![]) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(_: Vec) -> Result<(), TryRuntimeError> { - frame_support::ensure!( - Pallet::::is_initialized(), - "Agents and channels were not initialized." - ); - Ok(()) - } - } -} diff --git a/snowbridge/parachain/pallets/system/src/mock.rs b/snowbridge/parachain/pallets/system/src/mock.rs deleted file mode 100644 index bc229578132..00000000000 --- a/snowbridge/parachain/pallets/system/src/mock.rs +++ /dev/null @@ -1,270 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use crate as snowbridge_system; -use frame_support::{ - parameter_types, - traits::{tokens::fungible::Mutate, ConstU128, ConstU16, ConstU64, ConstU8}, - weights::IdentityFee, - PalletId, -}; -use sp_core::H256; -use xcm_executor::traits::ConvertLocation; - -use snowbridge_core::{ - gwei, meth, outbound::ConstantGasMeter, sibling_sovereign_account, AgentId, AllowSiblingsOnly, - ParaId, PricingParameters, Rewards, -}; -use sp_runtime::{ - traits::{AccountIdConversion, BlakeTwo256, IdentityLookup, Keccak256}, - AccountId32, BuildStorage, FixedU128, -}; -use xcm::prelude::*; - -#[cfg(feature = "runtime-benchmarks")] -use crate::BenchmarkHelper; - -type Block = frame_system::mocking::MockBlock; -type Balance = u128; - -pub type AccountId = AccountId32; - -// A stripped-down version of pallet-xcm that only inserts an XCM origin into the runtime -#[allow(dead_code)] -#[frame_support::pallet] -mod pallet_xcm_origin { - use frame_support::{ - pallet_prelude::*, - traits::{Contains, OriginTrait}, - }; - use xcm::latest::prelude::*; - - #[pallet::pallet] - pub struct Pallet(_); - - #[pallet::config] - pub trait Config: frame_system::Config { - type RuntimeOrigin: From + From<::RuntimeOrigin>; - } - - // Insert this custom Origin into the aggregate RuntimeOrigin - #[pallet::origin] - #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] - pub struct Origin(pub Location); - - impl From for Origin { - fn from(location: Location) -> Origin { - Origin(location) - } - } - - /// `EnsureOrigin` implementation succeeding with a `Location` value to recognize and - /// filter the contained location - pub struct EnsureXcm(PhantomData); - impl, F: Contains> EnsureOrigin for EnsureXcm - where - O::PalletsOrigin: From + TryInto, - { - type Success = Location; - - fn try_origin(outer: O) -> Result { - outer.try_with_caller(|caller| { - caller.try_into().and_then(|o| match o { - Origin(location) if F::contains(&location) => Ok(location), - o => Err(o.into()), - }) - }) - } - - #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin() -> Result { - Ok(O::from(Origin(Location::new(1, [Parachain(2000)])))) - } - } -} - -// Configure a mock runtime to test the pallet. -frame_support::construct_runtime!( - pub enum Test - { - System: frame_system, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - XcmOrigin: pallet_xcm_origin::{Pallet, Origin}, - OutboundQueue: snowbridge_pallet_outbound_queue::{Pallet, Call, Storage, Event}, - EthereumSystem: snowbridge_system, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} - } -); - -impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type RuntimeTask = RuntimeTask; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = ConstU64<250>; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = ConstU16<42>; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; - type Nonce = u64; - type Block = Block; -} - -impl pallet_balances::Config for Test { - type MaxLocks = (); - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; - type Balance = Balance; - type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); - type ExistentialDeposit = ConstU128<1>; - type AccountStore = System; - type WeightInfo = (); - type FreezeIdentifier = (); - type MaxFreezes = (); - type RuntimeHoldReason = (); - type RuntimeFreezeReason = (); - type MaxHolds = (); -} - -impl pallet_xcm_origin::Config for Test { - type RuntimeOrigin = RuntimeOrigin; -} - -parameter_types! { - pub const HeapSize: u32 = 32 * 1024; - pub const MaxStale: u32 = 32; - pub static ServiceWeight: Option = Some(Weight::from_parts(100, 100)); -} - -impl pallet_message_queue::Config for Test { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = (); - type MessageProcessor = OutboundQueue; - type Size = u32; - type QueueChangeHandler = (); - type HeapSize = HeapSize; - type MaxStale = MaxStale; - type ServiceWeight = ServiceWeight; - type QueuePausedQuery = (); -} - -parameter_types! { - pub const MaxMessagePayloadSize: u32 = 1024; - pub const MaxMessagesPerBlock: u32 = 20; - pub const OwnParaId: ParaId = ParaId::new(1013); -} - -impl snowbridge_pallet_outbound_queue::Config for Test { - type RuntimeEvent = RuntimeEvent; - type Hashing = Keccak256; - type MessageQueue = MessageQueue; - type Decimals = ConstU8<10>; - type MaxMessagePayloadSize = MaxMessagePayloadSize; - type MaxMessagesPerBlock = MaxMessagesPerBlock; - type GasMeter = ConstantGasMeter; - type Balance = u128; - type PricingParameters = EthereumSystem; - type Channels = EthereumSystem; - type WeightToFee = IdentityFee; - type WeightInfo = (); -} - -parameter_types! { - pub const SS58Prefix: u8 = 42; - pub const AnyNetwork: Option = None; - pub const RelayNetwork: Option = Some(NetworkId::Kusama); - pub const RelayLocation: Location = Location::parent(); - pub UniversalLocation: InteriorLocation = - [GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(1013)].into(); -} - -pub const DOT: u128 = 10_000_000_000; - -parameter_types! { - pub TreasuryAccount: AccountId = PalletId(*b"py/trsry").into_account_truncating(); - pub Fee: u64 = 1000; - pub const RococoNetwork: NetworkId = NetworkId::Rococo; - pub const InitialFunding: u128 = 1_000_000_000_000; - pub AssetHubParaId: ParaId = ParaId::new(1000); - pub TestParaId: u32 = 2000; - pub Parameters: PricingParameters = PricingParameters { - exchange_rate: FixedU128::from_rational(1, 400), - fee_per_gas: gwei(20), - rewards: Rewards { local: DOT, remote: meth(1) } - }; - pub const InboundDeliveryCost: u128 = 1_000_000_000; - -} - -#[cfg(feature = "runtime-benchmarks")] -impl BenchmarkHelper for () { - fn make_xcm_origin(location: Location) -> RuntimeOrigin { - RuntimeOrigin::from(pallet_xcm_origin::Origin(location)) - } -} - -impl crate::Config for Test { - type RuntimeEvent = RuntimeEvent; - type OutboundQueue = OutboundQueue; - type SiblingOrigin = pallet_xcm_origin::EnsureXcm; - type AgentIdOf = snowbridge_core::AgentIdOf; - type TreasuryAccount = TreasuryAccount; - type Token = Balances; - type DefaultPricingParameters = Parameters; - type WeightInfo = (); - type InboundDeliveryCost = InboundDeliveryCost; - #[cfg(feature = "runtime-benchmarks")] - type Helper = (); -} - -// Build genesis storage according to the mock runtime. -pub fn new_test_ext(genesis_build: bool) -> sp_io::TestExternalities { - let mut storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); - - if genesis_build { - crate::GenesisConfig:: { - para_id: OwnParaId::get(), - asset_hub_para_id: AssetHubParaId::get(), - _config: Default::default(), - } - .assimilate_storage(&mut storage) - .unwrap(); - } - - let mut ext: sp_io::TestExternalities = storage.into(); - let initial_amount = InitialFunding::get(); - let test_para_id = TestParaId::get(); - let sovereign_account = sibling_sovereign_account::(test_para_id.into()); - let treasury_account = TreasuryAccount::get(); - ext.execute_with(|| { - System::set_block_number(1); - Balances::mint_into(&AccountId32::from([0; 32]), initial_amount).unwrap(); - Balances::mint_into(&sovereign_account, initial_amount).unwrap(); - Balances::mint_into(&treasury_account, initial_amount).unwrap(); - }); - ext -} - -// Test helpers - -pub fn make_xcm_origin(location: Location) -> RuntimeOrigin { - pallet_xcm_origin::Origin(location).into() -} - -pub fn make_agent_id(location: Location) -> AgentId { - ::AgentIdOf::convert_location(&location) - .expect("convert location") -} diff --git a/snowbridge/parachain/pallets/system/src/tests.rs b/snowbridge/parachain/pallets/system/src/tests.rs deleted file mode 100644 index 8b417c258ea..00000000000 --- a/snowbridge/parachain/pallets/system/src/tests.rs +++ /dev/null @@ -1,649 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use crate::{mock::*, *}; -use frame_support::{assert_noop, assert_ok}; -use hex_literal::hex; -use snowbridge_core::{eth, sibling_sovereign_account_raw}; -use sp_core::H256; -use sp_runtime::{AccountId32, DispatchError::BadOrigin, TokenError}; - -#[test] -fn create_agent() { - new_test_ext(true).execute_with(|| { - let origin_para_id = 2000; - let origin_location = Location::new(1, [Parachain(origin_para_id)]); - let agent_id = make_agent_id(origin_location.clone()); - let sovereign_account = sibling_sovereign_account::(origin_para_id.into()); - - // fund sovereign account of origin - let _ = Balances::mint_into(&sovereign_account, 10000); - - assert!(!Agents::::contains_key(agent_id)); - - let origin = make_xcm_origin(origin_location); - assert_ok!(EthereumSystem::create_agent(origin)); - - assert!(Agents::::contains_key(agent_id)); - }); -} - -#[test] -fn test_agent_for_here() { - new_test_ext(true).execute_with(|| { - let origin_location = Location::here(); - let agent_id = make_agent_id(origin_location); - assert_eq!( - agent_id, - hex!("03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314").into(), - ) - }); -} - -#[test] -fn create_agent_fails_on_funds_unavailable() { - new_test_ext(true).execute_with(|| { - let origin_location = Location::new(1, [Parachain(2000)]); - let origin = make_xcm_origin(origin_location); - // Reset balance of sovereign_account to zero so to trigger the FundsUnavailable error - let sovereign_account = sibling_sovereign_account::(2000.into()); - Balances::set_balance(&sovereign_account, 0); - assert_noop!(EthereumSystem::create_agent(origin), TokenError::FundsUnavailable); - }); -} - -#[test] -fn create_agent_bad_origin() { - new_test_ext(true).execute_with(|| { - // relay chain location not allowed - assert_noop!( - EthereumSystem::create_agent(make_xcm_origin(Location::new(1, [],))), - BadOrigin, - ); - - // local account location not allowed - assert_noop!( - EthereumSystem::create_agent(make_xcm_origin(Location::new( - 0, - [Junction::AccountId32 { network: None, id: [67u8; 32] }], - ))), - BadOrigin, - ); - - // Signed origin not allowed - assert_noop!( - EthereumSystem::create_agent(RuntimeOrigin::signed([14; 32].into())), - BadOrigin - ); - - // None origin not allowed - assert_noop!(EthereumSystem::create_agent(RuntimeOrigin::none()), BadOrigin); - }); -} - -#[test] -fn upgrade_as_root() { - new_test_ext(true).execute_with(|| { - let origin = RuntimeOrigin::root(); - let address: H160 = Default::default(); - let code_hash: H256 = Default::default(); - - assert_ok!(EthereumSystem::upgrade(origin, address, code_hash, None)); - - System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::Upgrade { - impl_address: address, - impl_code_hash: code_hash, - initializer_params_hash: None, - })); - }); -} - -#[test] -fn upgrade_as_signed_fails() { - new_test_ext(true).execute_with(|| { - let origin = RuntimeOrigin::signed(AccountId32::new([0; 32])); - let address: H160 = Default::default(); - let code_hash: H256 = Default::default(); - - assert_noop!(EthereumSystem::upgrade(origin, address, code_hash, None), BadOrigin); - }); -} - -#[test] -fn upgrade_with_params() { - new_test_ext(true).execute_with(|| { - let origin = RuntimeOrigin::root(); - let address: H160 = Default::default(); - let code_hash: H256 = Default::default(); - let initializer: Option = - Some(Initializer { params: [0; 256].into(), maximum_required_gas: 10000 }); - assert_ok!(EthereumSystem::upgrade(origin, address, code_hash, initializer)); - }); -} - -#[test] -fn set_operating_mode() { - new_test_ext(true).execute_with(|| { - let origin = RuntimeOrigin::root(); - let mode = OperatingMode::RejectingOutboundMessages; - - assert_ok!(EthereumSystem::set_operating_mode(origin, mode)); - - System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::SetOperatingMode { - mode, - })); - }); -} - -#[test] -fn set_operating_mode_as_signed_fails() { - new_test_ext(true).execute_with(|| { - let origin = RuntimeOrigin::signed([14; 32].into()); - let mode = OperatingMode::RejectingOutboundMessages; - - assert_noop!(EthereumSystem::set_operating_mode(origin, mode), BadOrigin); - }); -} - -#[test] -fn set_pricing_parameters() { - new_test_ext(true).execute_with(|| { - let origin = RuntimeOrigin::root(); - let mut params = Parameters::get(); - params.rewards.local = 7; - - assert_ok!(EthereumSystem::set_pricing_parameters(origin, params)); - - assert_eq!(PricingParameters::::get().rewards.local, 7); - }); -} - -#[test] -fn set_pricing_parameters_as_signed_fails() { - new_test_ext(true).execute_with(|| { - let origin = RuntimeOrigin::signed([14; 32].into()); - let params = Parameters::get(); - - assert_noop!(EthereumSystem::set_pricing_parameters(origin, params), BadOrigin); - }); -} - -#[test] -fn set_pricing_parameters_invalid() { - new_test_ext(true).execute_with(|| { - let origin = RuntimeOrigin::root(); - let mut params = Parameters::get(); - params.rewards.local = 0; - - assert_noop!( - EthereumSystem::set_pricing_parameters(origin.clone(), params), - Error::::InvalidPricingParameters - ); - - let mut params = Parameters::get(); - params.exchange_rate = 0u128.into(); - assert_noop!( - EthereumSystem::set_pricing_parameters(origin.clone(), params), - Error::::InvalidPricingParameters - ); - params = Parameters::get(); - params.fee_per_gas = sp_core::U256::zero(); - assert_noop!( - EthereumSystem::set_pricing_parameters(origin.clone(), params), - Error::::InvalidPricingParameters - ); - params = Parameters::get(); - params.rewards.local = 0; - assert_noop!( - EthereumSystem::set_pricing_parameters(origin.clone(), params), - Error::::InvalidPricingParameters - ); - params = Parameters::get(); - params.rewards.remote = sp_core::U256::zero(); - assert_noop!( - EthereumSystem::set_pricing_parameters(origin, params), - Error::::InvalidPricingParameters - ); - }); -} - -#[test] -fn set_token_transfer_fees() { - new_test_ext(true).execute_with(|| { - let origin = RuntimeOrigin::root(); - - assert_ok!(EthereumSystem::set_token_transfer_fees(origin, 1, 1, eth(1))); - }); -} - -#[test] -fn set_token_transfer_fees_root_only() { - new_test_ext(true).execute_with(|| { - let origin = RuntimeOrigin::signed([14; 32].into()); - - assert_noop!(EthereumSystem::set_token_transfer_fees(origin, 1, 1, 1.into()), BadOrigin); - }); -} - -#[test] -fn set_token_transfer_fees_invalid() { - new_test_ext(true).execute_with(|| { - let origin = RuntimeOrigin::root(); - - assert_noop!( - EthereumSystem::set_token_transfer_fees(origin, 0, 0, 0.into()), - Error::::InvalidTokenTransferFees - ); - }); -} - -#[test] -fn create_channel() { - new_test_ext(true).execute_with(|| { - let origin_para_id = 2000; - let origin_location = Location::new(1, [Parachain(origin_para_id)]); - let sovereign_account = sibling_sovereign_account::(origin_para_id.into()); - let origin = make_xcm_origin(origin_location); - - // fund sovereign account of origin - let _ = Balances::mint_into(&sovereign_account, 10000); - - assert_ok!(EthereumSystem::create_agent(origin.clone())); - assert_ok!(EthereumSystem::create_channel(origin, OperatingMode::Normal)); - }); -} - -#[test] -fn create_channel_fail_already_exists() { - new_test_ext(true).execute_with(|| { - let origin_para_id = 2000; - let origin_location = Location::new(1, [Parachain(origin_para_id)]); - let sovereign_account = sibling_sovereign_account::(origin_para_id.into()); - let origin = make_xcm_origin(origin_location); - - // fund sovereign account of origin - let _ = Balances::mint_into(&sovereign_account, 10000); - - assert_ok!(EthereumSystem::create_agent(origin.clone())); - assert_ok!(EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal)); - - assert_noop!( - EthereumSystem::create_channel(origin, OperatingMode::Normal), - Error::::ChannelAlreadyCreated - ); - }); -} - -#[test] -fn create_channel_bad_origin() { - new_test_ext(true).execute_with(|| { - // relay chain location not allowed - assert_noop!( - EthereumSystem::create_channel( - make_xcm_origin(Location::new(1, [])), - OperatingMode::Normal, - ), - BadOrigin, - ); - - // child of sibling location not allowed - assert_noop!( - EthereumSystem::create_channel( - make_xcm_origin(Location::new( - 1, - [Parachain(2000), Junction::AccountId32 { network: None, id: [67u8; 32] }], - )), - OperatingMode::Normal, - ), - BadOrigin, - ); - - // local account location not allowed - assert_noop!( - EthereumSystem::create_channel( - make_xcm_origin(Location::new( - 0, - [Junction::AccountId32 { network: None, id: [67u8; 32] }], - )), - OperatingMode::Normal, - ), - BadOrigin, - ); - - // Signed origin not allowed - assert_noop!( - EthereumSystem::create_channel( - RuntimeOrigin::signed([14; 32].into()), - OperatingMode::Normal, - ), - BadOrigin - ); - - // None origin not allowed - assert_noop!(EthereumSystem::create_agent(RuntimeOrigin::none()), BadOrigin); - }); -} - -#[test] -fn update_channel() { - new_test_ext(true).execute_with(|| { - let origin_para_id = 2000; - let origin_location = Location::new(1, [Parachain(origin_para_id)]); - let sovereign_account = sibling_sovereign_account::(origin_para_id.into()); - let origin = make_xcm_origin(origin_location); - - // First create the channel - let _ = Balances::mint_into(&sovereign_account, 10000); - assert_ok!(EthereumSystem::create_agent(origin.clone())); - assert_ok!(EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal)); - - // Now try to update it - assert_ok!(EthereumSystem::update_channel(origin, OperatingMode::Normal)); - - System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::UpdateChannel { - channel_id: ParaId::from(2000).into(), - mode: OperatingMode::Normal, - })); - }); -} - -#[test] -fn update_channel_bad_origin() { - new_test_ext(true).execute_with(|| { - let mode = OperatingMode::Normal; - - // relay chain location not allowed - assert_noop!( - EthereumSystem::update_channel(make_xcm_origin(Location::new(1, [])), mode,), - BadOrigin, - ); - - // child of sibling location not allowed - assert_noop!( - EthereumSystem::update_channel( - make_xcm_origin(Location::new( - 1, - [Parachain(2000), Junction::AccountId32 { network: None, id: [67u8; 32] }], - )), - mode, - ), - BadOrigin, - ); - - // local account location not allowed - assert_noop!( - EthereumSystem::update_channel( - make_xcm_origin(Location::new( - 0, - [Junction::AccountId32 { network: None, id: [67u8; 32] }], - )), - mode, - ), - BadOrigin, - ); - - // Signed origin not allowed - assert_noop!( - EthereumSystem::update_channel(RuntimeOrigin::signed([14; 32].into()), mode), - BadOrigin - ); - - // None origin not allowed - assert_noop!(EthereumSystem::update_channel(RuntimeOrigin::none(), mode), BadOrigin); - }); -} - -#[test] -fn update_channel_fails_not_exist() { - new_test_ext(true).execute_with(|| { - let origin_location = Location::new(1, [Parachain(2000)]); - let origin = make_xcm_origin(origin_location); - - // Now try to update it - assert_noop!( - EthereumSystem::update_channel(origin, OperatingMode::Normal), - Error::::NoChannel - ); - }); -} - -#[test] -fn force_update_channel() { - new_test_ext(true).execute_with(|| { - let origin_para_id = 2000; - let origin_location = Location::new(1, [Parachain(origin_para_id)]); - let sovereign_account = sibling_sovereign_account::(origin_para_id.into()); - let origin = make_xcm_origin(origin_location); - - let channel_id: ChannelId = ParaId::from(origin_para_id).into(); - - // First create the channel - let _ = Balances::mint_into(&sovereign_account, 10000); - assert_ok!(EthereumSystem::create_agent(origin.clone())); - assert_ok!(EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal)); - - // Now try to force update it - let force_origin = RuntimeOrigin::root(); - assert_ok!(EthereumSystem::force_update_channel( - force_origin, - channel_id, - OperatingMode::Normal, - )); - - System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::UpdateChannel { - channel_id: ParaId::from(2000).into(), - mode: OperatingMode::Normal, - })); - }); -} - -#[test] -fn force_update_channel_bad_origin() { - new_test_ext(true).execute_with(|| { - let mode = OperatingMode::Normal; - - // signed origin not allowed - assert_noop!( - EthereumSystem::force_update_channel( - RuntimeOrigin::signed([14; 32].into()), - ParaId::from(1000).into(), - mode, - ), - BadOrigin, - ); - }); -} - -#[test] -fn transfer_native_from_agent() { - new_test_ext(true).execute_with(|| { - let origin_location = Location::new(1, [Parachain(2000)]); - let origin = make_xcm_origin(origin_location.clone()); - let recipient: H160 = [27u8; 20].into(); - let amount = 103435; - - // First create the agent and channel - assert_ok!(EthereumSystem::create_agent(origin.clone())); - assert_ok!(EthereumSystem::create_channel(origin, OperatingMode::Normal)); - - let origin = make_xcm_origin(origin_location.clone()); - assert_ok!(EthereumSystem::transfer_native_from_agent(origin, recipient, amount),); - - System::assert_last_event(RuntimeEvent::EthereumSystem( - crate::Event::TransferNativeFromAgent { - agent_id: make_agent_id(origin_location), - recipient, - amount, - }, - )); - }); -} - -#[test] -fn force_transfer_native_from_agent() { - new_test_ext(true).execute_with(|| { - let origin = RuntimeOrigin::root(); - let location = Location::new(1, [Parachain(2000)]); - let versioned_location: Box = Box::new(location.clone().into()); - let recipient: H160 = [27u8; 20].into(); - let amount = 103435; - - // First create the agent - Agents::::insert(make_agent_id(location.clone()), ()); - - assert_ok!(EthereumSystem::force_transfer_native_from_agent( - origin, - versioned_location, - recipient, - amount - ),); - - System::assert_last_event(RuntimeEvent::EthereumSystem( - crate::Event::TransferNativeFromAgent { - agent_id: make_agent_id(location), - recipient, - amount, - }, - )); - }); -} - -#[test] -fn force_transfer_native_from_agent_bad_origin() { - new_test_ext(true).execute_with(|| { - let recipient: H160 = [27u8; 20].into(); - let amount = 103435; - - // signed origin not allowed - assert_noop!( - EthereumSystem::force_transfer_native_from_agent( - RuntimeOrigin::signed([14; 32].into()), - Box::new( - Location::new( - 1, - [Parachain(2000), Junction::AccountId32 { network: None, id: [67u8; 32] }], - ) - .into() - ), - recipient, - amount, - ), - BadOrigin, - ); - }); -} - -// NOTE: The following tests are not actually tests and are more about obtaining location -// conversions for devops purposes. They need to be removed here and incorporated into a command -// line utility. - -#[ignore] -#[test] -fn check_sibling_sovereign_account() { - new_test_ext(true).execute_with(|| { - let para_id = 1001; - let sovereign_account = sibling_sovereign_account::(para_id.into()); - let sovereign_account_raw = sibling_sovereign_account_raw(para_id.into()); - println!( - "Sovereign account for parachain {}: {:#?}", - para_id, - hex::encode(sovereign_account.clone()) - ); - assert_eq!(sovereign_account, sovereign_account_raw.into()); - }); -} - -#[test] -fn charge_fee_for_create_agent() { - new_test_ext(true).execute_with(|| { - let para_id: u32 = TestParaId::get(); - let origin_location = Location::new(1, [Parachain(para_id)]); - let origin = make_xcm_origin(origin_location.clone()); - let sovereign_account = sibling_sovereign_account::(para_id.into()); - let (_, agent_id) = ensure_sibling::(&origin_location).unwrap(); - - let initial_sovereign_balance = Balances::balance(&sovereign_account); - assert_ok!(EthereumSystem::create_agent(origin.clone())); - let fee_charged = initial_sovereign_balance - Balances::balance(&sovereign_account); - - assert_ok!(EthereumSystem::create_channel(origin, OperatingMode::Normal)); - - // assert sovereign_balance decreased by (fee.base_fee + fee.delivery_fee) - let message = Message { - id: None, - channel_id: ParaId::from(para_id).into(), - command: Command::CreateAgent { agent_id }, - }; - let (_, fee) = OutboundQueue::validate(&message).unwrap(); - assert_eq!(fee.local + fee.remote, fee_charged); - - // and treasury_balance increased - let treasury_balance = Balances::balance(&TreasuryAccount::get()); - assert!(treasury_balance > InitialFunding::get()); - - let final_sovereign_balance = Balances::balance(&sovereign_account); - // (sovereign_balance + treasury_balance) keeps the same - assert_eq!(final_sovereign_balance + treasury_balance, { InitialFunding::get() * 2 }); - }); -} - -#[test] -fn charge_fee_for_transfer_native_from_agent() { - new_test_ext(true).execute_with(|| { - let para_id: u32 = TestParaId::get(); - let origin_location = Location::new(1, [Parachain(para_id)]); - let recipient: H160 = [27u8; 20].into(); - let amount = 103435; - let origin = make_xcm_origin(origin_location.clone()); - let (_, agent_id) = ensure_sibling::(&origin_location).unwrap(); - - let sovereign_account = sibling_sovereign_account::(para_id.into()); - - // create_agent & create_channel first - assert_ok!(EthereumSystem::create_agent(origin.clone())); - assert_ok!(EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal)); - - // assert sovereign_balance decreased by only the base_fee - let sovereign_balance_before = Balances::balance(&sovereign_account); - assert_ok!(EthereumSystem::transfer_native_from_agent(origin.clone(), recipient, amount)); - let message = Message { - id: None, - channel_id: ParaId::from(para_id).into(), - command: Command::TransferNativeFromAgent { agent_id, recipient, amount }, - }; - let (_, fee) = OutboundQueue::validate(&message).unwrap(); - let sovereign_balance_after = Balances::balance(&sovereign_account); - assert_eq!(sovereign_balance_after + fee.local, sovereign_balance_before); - }); -} - -#[test] -fn charge_fee_for_upgrade() { - new_test_ext(true).execute_with(|| { - let para_id: u32 = TestParaId::get(); - let origin = RuntimeOrigin::root(); - let address: H160 = Default::default(); - let code_hash: H256 = Default::default(); - let initializer: Option = - Some(Initializer { params: [0; 256].into(), maximum_required_gas: 10000 }); - assert_ok!(EthereumSystem::upgrade(origin, address, code_hash, initializer.clone())); - - // assert sovereign_balance does not change as we do not charge for sudo operations - let sovereign_account = sibling_sovereign_account::(para_id.into()); - let sovereign_balance = Balances::balance(&sovereign_account); - assert_eq!(sovereign_balance, InitialFunding::get()); - }); -} - -#[test] -fn genesis_build_initializes_correctly() { - new_test_ext(true).execute_with(|| { - assert!(EthereumSystem::is_initialized(), "Ethereum uninitialized."); - }); -} - -#[test] -fn no_genesis_build_is_uninitialized() { - new_test_ext(false).execute_with(|| { - assert!(!EthereumSystem::is_initialized(), "Ethereum initialized."); - }); -} diff --git a/snowbridge/parachain/pallets/system/src/weights.rs b/snowbridge/parachain/pallets/system/src/weights.rs deleted file mode 100644 index 6e532a0d8a8..00000000000 --- a/snowbridge/parachain/pallets/system/src/weights.rs +++ /dev/null @@ -1,249 +0,0 @@ - -//! Autogenerated weights for `snowbridge_system` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-10-09, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `crake.local`, CPU: `` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: `1024` - -// Executed Command: -// target/release/polkadot-parachain -// benchmark -// pallet -// --chain -// bridge-hub-rococo-dev -// --pallet=snowbridge_system -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --template -// ../parachain/templates/module-weight-template.hbs -// --output -// ../parachain/pallets/control/src/weights.rs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; - -/// Weight functions needed for `snowbridge_system`. -pub trait WeightInfo { - fn upgrade() -> Weight; - fn create_agent() -> Weight; - fn create_channel() -> Weight; - fn update_channel() -> Weight; - fn force_update_channel() -> Weight; - fn set_operating_mode() -> Weight; - fn transfer_native_from_agent() -> Weight; - fn force_transfer_native_from_agent() -> Weight; - fn set_token_transfer_fees() -> Weight; - fn set_pricing_parameters() -> Weight; -} - -// For backwards compatibility and tests. -impl WeightInfo for () { - /// Storage: ParachainInfo ParachainId (r:1 w:0) - /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) - /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: MessageQueue BookStateFor (r:1 w:1) - /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) - /// Storage: MessageQueue ServiceHead (r:1 w:1) - /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: MessageQueue Pages (r:0 w:1) - /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) - fn upgrade() -> Weight { - // Proof Size summary in bytes: - // Measured: `80` - // Estimated: `3517` - // Minimum execution time: 44_000_000 picoseconds. - Weight::from_parts(44_000_000, 3517) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: EthereumSystem Agents (r:1 w:1) - /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: ParachainInfo ParachainId (r:1 w:0) - /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) - /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: MessageQueue BookStateFor (r:1 w:1) - /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) - /// Storage: MessageQueue ServiceHead (r:1 w:1) - /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: MessageQueue Pages (r:0 w:1) - /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) - fn create_agent() -> Weight { - // Proof Size summary in bytes: - // Measured: `187` - // Estimated: `6196` - // Minimum execution time: 85_000_000 picoseconds. - Weight::from_parts(85_000_000, 6196) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().writes(6_u64)) - } - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: EthereumSystem Agents (r:1 w:0) - /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: EthereumSystem Channels (r:1 w:1) - /// Proof: EthereumSystem Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) - /// Storage: ParachainInfo ParachainId (r:1 w:0) - /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) - /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: MessageQueue BookStateFor (r:1 w:1) - /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) - /// Storage: MessageQueue Pages (r:1 w:1) - /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) - fn create_channel() -> Weight { - // Proof Size summary in bytes: - // Measured: `602` - // Estimated: `69050` - // Minimum execution time: 83_000_000 picoseconds. - Weight::from_parts(83_000_000, 69050) - .saturating_add(RocksDbWeight::get().reads(8_u64)) - .saturating_add(RocksDbWeight::get().writes(5_u64)) - } - /// Storage: EthereumSystem Channels (r:1 w:0) - /// Proof: EthereumSystem Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) - /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) - /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: MessageQueue BookStateFor (r:2 w:2) - /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) - /// Storage: MessageQueue ServiceHead (r:1 w:0) - /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: MessageQueue Pages (r:0 w:1) - /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) - fn update_channel() -> Weight { - // Proof Size summary in bytes: - // Measured: `256` - // Estimated: `6044` - // Minimum execution time: 40_000_000 picoseconds. - Weight::from_parts(40_000_000, 6044) - .saturating_add(RocksDbWeight::get().reads(5_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: EthereumSystem Channels (r:1 w:0) - /// Proof: EthereumSystem Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) - /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) - /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: MessageQueue BookStateFor (r:2 w:2) - /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) - /// Storage: MessageQueue ServiceHead (r:1 w:0) - /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: MessageQueue Pages (r:0 w:1) - /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) - fn force_update_channel() -> Weight { - // Proof Size summary in bytes: - // Measured: `256` - // Estimated: `6044` - // Minimum execution time: 41_000_000 picoseconds. - Weight::from_parts(41_000_000, 6044) - .saturating_add(RocksDbWeight::get().reads(5_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: ParachainInfo ParachainId (r:1 w:0) - /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) - /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: MessageQueue BookStateFor (r:1 w:1) - /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) - /// Storage: MessageQueue ServiceHead (r:1 w:1) - /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: MessageQueue Pages (r:0 w:1) - /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) - fn set_operating_mode() -> Weight { - // Proof Size summary in bytes: - // Measured: `80` - // Estimated: `3517` - // Minimum execution time: 31_000_000 picoseconds. - Weight::from_parts(31_000_000, 3517) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: EthereumSystem Agents (r:1 w:0) - /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) - /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: MessageQueue BookStateFor (r:2 w:2) - /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) - /// Storage: MessageQueue ServiceHead (r:1 w:0) - /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: MessageQueue Pages (r:0 w:1) - /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) - fn transfer_native_from_agent() -> Weight { - // Proof Size summary in bytes: - // Measured: `252` - // Estimated: `6044` - // Minimum execution time: 45_000_000 picoseconds. - Weight::from_parts(45_000_000, 6044) - .saturating_add(RocksDbWeight::get().reads(5_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: EthereumSystem Agents (r:1 w:0) - /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) - /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: MessageQueue BookStateFor (r:2 w:2) - /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) - /// Storage: MessageQueue ServiceHead (r:1 w:0) - /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: MessageQueue Pages (r:0 w:1) - /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) - fn force_transfer_native_from_agent() -> Weight { - // Proof Size summary in bytes: - // Measured: `252` - // Estimated: `6044` - // Minimum execution time: 42_000_000 picoseconds. - Weight::from_parts(42_000_000, 6044) - .saturating_add(RocksDbWeight::get().reads(5_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - - /// Storage: ParachainInfo ParachainId (r:1 w:0) - /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) - /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: MessageQueue BookStateFor (r:1 w:1) - /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) - /// Storage: MessageQueue ServiceHead (r:1 w:1) - /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: MessageQueue Pages (r:0 w:1) - /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) - fn set_token_transfer_fees() -> Weight { - // Proof Size summary in bytes: - // Measured: `80` - // Estimated: `3517` - // Minimum execution time: 31_000_000 picoseconds. - Weight::from_parts(42_000_000, 3517) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - - /// Storage: ParachainInfo ParachainId (r:1 w:0) - /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) - /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: MessageQueue BookStateFor (r:1 w:1) - /// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) - /// Storage: MessageQueue ServiceHead (r:1 w:1) - /// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) - /// Storage: MessageQueue Pages (r:0 w:1) - /// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen) - fn set_pricing_parameters() -> Weight { - // Proof Size summary in bytes: - // Measured: `80` - // Estimated: `3517` - // Minimum execution time: 31_000_000 picoseconds. - Weight::from_parts(42_000_000, 3517) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } -} diff --git a/snowbridge/parachain/primitives/beacon/Cargo.toml b/snowbridge/parachain/primitives/beacon/Cargo.toml deleted file mode 100644 index 8294e903dfb..00000000000 --- a/snowbridge/parachain/primitives/beacon/Cargo.toml +++ /dev/null @@ -1,57 +0,0 @@ -[package] -name = "snowbridge-beacon-primitives" -description = "Snowbridge Beacon Primitives" -version = "0.9.0" -authors = ["Snowfork "] -edition.workspace = true -repository.workspace = true -license = "Apache-2.0" -categories = ["cryptography::cryptocurrencies"] - -[lints] -workspace = true - -[dependencies] -serde = { version = "1.0.195", optional = true, features = ["derive"] } -hex = { version = "0.4", default-features = false } -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 = { path = "../../../../../substrate/frame/support", default-features = false } -frame-system = { path = "../../../../../substrate/frame/system", default-features = false } -sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } -sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } -sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } -sp-io = { path = "../../../../../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 } -byte-slice-cast = { version = "1.2.1", default-features = false } - -snowbridge-ethereum = { path = "../../primitives/ethereum", default-features = false } -static_assertions = { version = "1.1.0" } -milagro_bls = { git = "https://github.com/snowfork/milagro_bls", default-features = false, rev = "a6d66e4eb89015e352fb1c9f7b661ecdbb5b2176" } - -[dev-dependencies] -hex-literal = { version = "0.4.1" } - -[features] -default = ["std"] -std = [ - "byte-slice-cast/std", - "codec/std", - "frame-support/std", - "frame-system/std", - "hex/std", - "milagro_bls/std", - "rlp/std", - "scale-info/std", - "serde", - "snowbridge-ethereum/std", - "sp-core/std", - "sp-io/std", - "sp-runtime/std", - "sp-std/std", - "ssz_rs/std", -] diff --git a/snowbridge/parachain/primitives/beacon/README.md b/snowbridge/parachain/primitives/beacon/README.md deleted file mode 100644 index 658d7c5be7d..00000000000 --- a/snowbridge/parachain/primitives/beacon/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Beacon Primitives - -Crate with low-level supporting functions for the beacon client, including: - -- bls12-381 signature handling to verify signatures on the beacon chain -- merkle proofs -- receipt verification -- ssz types - -The code in this crate relates to the Ethereum consensus chain, commonly referred to as the beacon chain. diff --git a/snowbridge/parachain/primitives/beacon/src/bits.rs b/snowbridge/parachain/primitives/beacon/src/bits.rs deleted file mode 100644 index 72b7135ee29..00000000000 --- a/snowbridge/parachain/primitives/beacon/src/bits.rs +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use sp_std::{convert::TryInto, prelude::*}; -use ssz_rs::{Bitvector, Deserialize}; - -pub fn decompress_sync_committee_bits< - const SYNC_COMMITTEE_SIZE: usize, - const SYNC_COMMITTEE_BITS_SIZE: usize, ->( - input: [u8; SYNC_COMMITTEE_BITS_SIZE], -) -> [u8; SYNC_COMMITTEE_SIZE] { - Bitvector::<{ SYNC_COMMITTEE_SIZE }>::deserialize(&input) - .expect("checked statically; qed") - .iter() - .map(|bit| u8::from(bit == true)) - .collect::>() - .try_into() - .expect("checked statically; qed") -} diff --git a/snowbridge/parachain/primitives/beacon/src/bls.rs b/snowbridge/parachain/primitives/beacon/src/bls.rs deleted file mode 100644 index 589b72e6734..00000000000 --- a/snowbridge/parachain/primitives/beacon/src/bls.rs +++ /dev/null @@ -1,87 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use crate::{PublicKey, Signature}; -use codec::{Decode, Encode}; -use frame_support::{ensure, PalletError}; -pub use milagro_bls::{ - AggregatePublicKey, AggregateSignature, PublicKey as PublicKeyPrepared, - Signature as SignaturePrepared, -}; -use scale_info::TypeInfo; -use sp_core::H256; -use sp_runtime::RuntimeDebug; -use sp_std::prelude::*; - -#[derive(Copy, Clone, Encode, Decode, Eq, PartialEq, TypeInfo, RuntimeDebug, PalletError)] -pub enum BlsError { - InvalidSignature, - InvalidPublicKey, - InvalidAggregatePublicKeys, - SignatureVerificationFailed, -} - -/// fast_aggregate_verify optimized with aggregate key subtracting absent ones. -pub fn fast_aggregate_verify( - aggregate_pubkey: &PublicKeyPrepared, - absent_pubkeys: &Vec, - message: H256, - signature: &Signature, -) -> Result<(), BlsError> { - let agg_sig = prepare_aggregate_signature(signature)?; - let agg_key = prepare_aggregate_pubkey_from_absent(aggregate_pubkey, absent_pubkeys)?; - fast_aggregate_verify_pre_aggregated(agg_sig, agg_key, message) -} - -/// Decompress one public key into a point in G1. -pub fn prepare_milagro_pubkey(pubkey: &PublicKey) -> Result { - PublicKeyPrepared::from_bytes_unchecked(&pubkey.0).map_err(|_| BlsError::InvalidPublicKey) -} - -/// Prepare for G1 public keys. -pub fn prepare_g1_pubkeys(pubkeys: &[PublicKey]) -> Result, BlsError> { - pubkeys - .iter() - // Deserialize one public key from compressed bytes - .map(prepare_milagro_pubkey) - .collect::, BlsError>>() -} - -/// Prepare for G1 AggregatePublicKey. -pub fn prepare_aggregate_pubkey( - pubkeys: &[PublicKeyPrepared], -) -> Result { - AggregatePublicKey::into_aggregate(pubkeys).map_err(|_| BlsError::InvalidPublicKey) -} - -/// Prepare for G1 AggregatePublicKey. -pub fn prepare_aggregate_pubkey_from_absent( - aggregate_key: &PublicKeyPrepared, - absent_pubkeys: &Vec, -) -> Result { - let mut aggregate_pubkey = AggregatePublicKey::from_public_key(aggregate_key); - if !absent_pubkeys.is_empty() { - let absent_aggregate_key = prepare_aggregate_pubkey(absent_pubkeys)?; - aggregate_pubkey.point.sub(&absent_aggregate_key.point); - } - Ok(AggregatePublicKey { point: aggregate_pubkey.point }) -} - -/// Prepare for G2 AggregateSignature, normally more expensive than G1 operation. -pub fn prepare_aggregate_signature(signature: &Signature) -> Result { - Ok(AggregateSignature::from_signature( - &SignaturePrepared::from_bytes(&signature.0).map_err(|_| BlsError::InvalidSignature)?, - )) -} - -/// fast_aggregate_verify_pre_aggregated which is the most expensive call in beacon light client. -pub fn fast_aggregate_verify_pre_aggregated( - agg_sig: AggregateSignature, - aggregate_key: AggregatePublicKey, - message: H256, -) -> Result<(), BlsError> { - ensure!( - agg_sig.fast_aggregate_verify_pre_aggregated(&message[..], &aggregate_key), - BlsError::SignatureVerificationFailed - ); - Ok(()) -} diff --git a/snowbridge/parachain/primitives/beacon/src/config.rs b/snowbridge/parachain/primitives/beacon/src/config.rs deleted file mode 100644 index aa5fda706f9..00000000000 --- a/snowbridge/parachain/primitives/beacon/src/config.rs +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -pub const MAX_PROOF_SIZE: u32 = 20; - -pub const FEE_RECIPIENT_SIZE: usize = 20; -pub const EXTRA_DATA_SIZE: usize = 32; -pub const LOGS_BLOOM_SIZE: usize = 256; - -pub const PUBKEY_SIZE: usize = 48; -pub const SIGNATURE_SIZE: usize = 96; diff --git a/snowbridge/parachain/primitives/beacon/src/lib.rs b/snowbridge/parachain/primitives/beacon/src/lib.rs deleted file mode 100644 index 3527e1ff0d1..00000000000 --- a/snowbridge/parachain/primitives/beacon/src/lib.rs +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -#![cfg_attr(not(feature = "std"), no_std)] - -pub mod bits; -pub mod bls; -pub mod config; -pub mod merkle_proof; -pub mod receipt; -pub mod ssz; -pub mod types; -pub mod updates; - -#[cfg(feature = "std")] -mod serde_utils; - -pub use types::{ - BeaconHeader, CompactBeaconState, CompactExecutionHeader, ExecutionHeaderState, - ExecutionPayloadHeader, FinalizedHeaderState, Fork, ForkData, ForkVersion, ForkVersions, Mode, - PublicKey, Signature, SigningData, SyncAggregate, SyncCommittee, SyncCommitteePrepared, -}; -pub use updates::{CheckpointUpdate, ExecutionHeaderUpdate, NextSyncCommitteeUpdate, Update}; - -pub use bits::decompress_sync_committee_bits; -pub use bls::{ - fast_aggregate_verify, prepare_aggregate_pubkey, prepare_aggregate_pubkey_from_absent, - prepare_aggregate_signature, prepare_g1_pubkeys, AggregatePublicKey, AggregateSignature, - BlsError, PublicKeyPrepared, SignaturePrepared, -}; -pub use merkle_proof::verify_merkle_branch; -pub use receipt::verify_receipt_proof; diff --git a/snowbridge/parachain/primitives/beacon/src/merkle_proof.rs b/snowbridge/parachain/primitives/beacon/src/merkle_proof.rs deleted file mode 100644 index a6ee6e9452c..00000000000 --- a/snowbridge/parachain/primitives/beacon/src/merkle_proof.rs +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use sp_core::H256; -use sp_io::hashing::sha2_256; - -/// Specified by -/// with improvements from -pub fn verify_merkle_branch( - leaf: H256, - branch: &[H256], - index: usize, - depth: usize, - root: H256, -) -> bool { - // verify the proof length - if branch.len() != depth { - return false - } - // verify the computed merkle root - root == compute_merkle_root(leaf, branch, index) -} - -fn compute_merkle_root(leaf: H256, proof: &[H256], index: usize) -> H256 { - let mut value: [u8; 32] = leaf.into(); - for (i, node) in proof.iter().enumerate() { - let mut data = [0u8; 64]; - if generalized_index_bit(index, i) { - // right node - data[0..32].copy_from_slice(node.as_bytes()); - data[32..64].copy_from_slice(&value); - value = sha2_256(&data); - } else { - // left node - data[0..32].copy_from_slice(&value); - data[32..64].copy_from_slice(node.as_bytes()); - value = sha2_256(&data); - } - } - value.into() -} - -/// Spec: -fn generalized_index_bit(index: usize, position: usize) -> bool { - index & (1 << position) > 0 -} - -/// Spec: -pub const fn subtree_index(generalized_index: usize) -> usize { - generalized_index % (1 << generalized_index_length(generalized_index)) -} - -/// Spec: -pub const fn generalized_index_length(generalized_index: usize) -> usize { - match generalized_index.checked_ilog2() { - Some(v) => v as usize, - None => panic!("checked statically; qed"), - } -} diff --git a/snowbridge/parachain/primitives/beacon/src/receipt.rs b/snowbridge/parachain/primitives/beacon/src/receipt.rs deleted file mode 100644 index 0588f3f73f7..00000000000 --- a/snowbridge/parachain/primitives/beacon/src/receipt.rs +++ /dev/null @@ -1,96 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use sp_core::H256; -use sp_io::hashing::keccak_256; -use sp_std::prelude::*; - -use snowbridge_ethereum::{mpt, Receipt}; - -pub fn verify_receipt_proof( - receipts_root: H256, - proof: &[Vec], -) -> Option> { - match apply_merkle_proof(proof) { - Some((root, data)) if root == receipts_root => Some(rlp::decode(&data)), - Some((_, _)) => None, - None => None, - } -} - -fn apply_merkle_proof(proof: &[Vec]) -> Option<(H256, Vec)> { - let mut iter = proof.iter().rev(); - let first_bytes = match iter.next() { - Some(b) => b, - None => return None, - }; - let item_to_prove: mpt::ShortNode = rlp::decode(first_bytes).ok()?; - - let final_hash: Option<[u8; 32]> = iter.try_fold(keccak_256(first_bytes), |acc, x| { - let node: Box = x.as_slice().try_into().ok()?; - if (*node).contains_hash(acc.into()) { - return Some(keccak_256(x)) - } - None - }); - - final_hash.map(|hash| (hash.into(), item_to_prove.value)) -} - -#[cfg(test)] -mod tests { - use super::*; - use hex_literal::hex; - - #[test] - fn test_verify_receipt_proof() { - let root: H256 = - hex!("fd5e397a84884641f53c496804f24b5276cbb8c5c9cfc2342246be8e3ce5ad02").into(); - - // Valid proof - let proof_receipt5 = vec!( - hex!("f90131a0b5ba404eb5a6a88e56579f4d37ef9813b5ad7f86f0823ff3b407ac5a6bb465eca0398ead2655e78e03c127ce22c5830e90f18b1601ec055f938336c084feb915a9a026d322c26e46c50942c1aabde50e36df5cde572aed650ce73ea3182c6e90a02ca00600a356135f4db1db0d9842264cdff2652676f881669e91e316c0b6dd783011a0837f1deb4075336da320388c1edfffc56c448a43f4a5ba031300d32a7b509fc5a01c3ac82fd65b4aba7f9afaf604d9c82ec7e2deb573a091ae235751bc5c0c288da05d454159d9071b0f68b6e0503d290f23ac7602c1db0c569dee4605d8f5298f09a00bbed10350ec954448df795f6fd46e3faefc800ede061b3840eedc6e2b07a74da0acb02d26a3650f2064c14a435fdf1f668d8655daf455ebdf671713a7c089b3898080808080808080").to_vec(), - hex!("f901f180a00046a08d4f0bdbdc6b31903086ce323182bce6725e7d9415f7ff91ee8f4820bda0e7cd26ad5f3d2771e4b5ab788e268a14a10209f94ee918eb6c829d21d3d11c1da00d4a56d9e9a6751874fd86c7e3cb1c6ad5a848da62751325f478978a00ea966ea064b81920c8f04a8a1e21f53a8280e739fbb7b00b2ab92493ca3f610b70e8ac85a0b1040ed4c55a73178b76abb16f946ce5bebd6b93ab873c83327df54047d12c27a0de6485e9ac58dc6e2b04b4bb38f562684f0b1a2ee586cc11079e7d9a9dc40b32a0d394f4d3532c3124a65fa36e69147e04fd20453a72ee9c50660f17e13ce9df48a066501003fc3e3478efd2803cd0eded6bbe9243ca01ba754d6327071ddbcbc649a0b2684e518f325fee39fc8ea81b68f3f5c785be00d087f3bed8857ae2ee8da26ea071060a5c52042e8d7ce21092f8ecf06053beb9a0b773a6f91a30c4220aa276b2a0fc22436632574ccf6043d0986dede27ea94c9ca9a3bb5ec03ce776a4ddef24a9a05a8a1d6698c4e7d8cc3a2506cb9b12ea9a079c9c7099bc919dc804033cc556e4a0170c468b0716fd36d161f0bf05875f15756a2976de92f9efe7716320509d79c9a0182f909a90cab169f3efb62387f9cccdd61440acc4deec42f68a4f7ca58075c7a055cf0e9202ac75689b76318f1171f3a44465eddc06aae0713bfb6b34fdd27b7980").to_vec(), - hex!("f904de20b904daf904d701830652f0b9010004200000000000000000000080020000000000010000000000010000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000000000008000000220000000000400010000000000000000000000000000000000000000000000000000000000000040000000010000100000000000800000000004000000000000000000000000000080000004000000000020000000000020000000000000000000000000000000000000000000004000000000002000000000100000000000000000000000000001000000002000020000010200000000000010000000000000000000000000000000000000010000000f903ccf89b9421130f34829b4c343142047a28ce96ec07814b15f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa00000000000000000000000007d843005c7433c16b27ff939cb37471541561ebda0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a000000000000000000000000000000000000000000000000000000005d09b7380f89b9421130f34829b4c343142047a28ce96ec07814b15f863a08c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a00000000000000000000000007d843005c7433c16b27ff939cb37471541561ebda00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da0ffffffffffffffffffffffffffffffffffffffffffffffffffffffcc840c6920f89b94c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da000000000000000000000000000000000000000000000000003e973b5a5d1078ef87994e9c1281aae66801fa35ec404d5f2aea393ff6988e1a01c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1b840000000000000000000000000000000000000000000000000000001f1420ad1d40000000000000000000000000000000000000000000000014ad400879d159a38f8fc94e9c1281aae66801fa35ec404d5f2aea393ff6988f863a0d78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488db88000000000000000000000000000000000000000000000000000000005d415f3320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e973b5a5d1078ef87a94c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f842a07fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da000000000000000000000000000000000000000000000000003e973b5a5d1078e").to_vec(), - ); - assert!(verify_receipt_proof(root, &proof_receipt5).is_some()); - - // Various invalid proofs - let proof_empty: Vec> = vec![]; - let proof_missing_full_node = vec![proof_receipt5[0].clone(), proof_receipt5[2].clone()]; - let proof_missing_short_node1 = vec![proof_receipt5[0].clone(), proof_receipt5[1].clone()]; - let proof_missing_short_node2 = vec![proof_receipt5[0].clone()]; - let proof_invalid_encoding = vec![proof_receipt5[2][2..].to_vec()]; - let proof_no_full_node = vec![proof_receipt5[2].clone(), proof_receipt5[2].clone()]; - assert!(verify_receipt_proof(root, &proof_empty).is_none()); - assert!(verify_receipt_proof(root, &proof_missing_full_node).is_none()); - - assert_eq!( - verify_receipt_proof(root, &proof_missing_short_node1), - Some(Err(rlp::DecoderError::Custom("Unsupported receipt type"))) - ); - - assert_eq!( - verify_receipt_proof(root, &proof_missing_short_node2), - Some(Err(rlp::DecoderError::Custom("Unsupported receipt type"))) - ); - - assert!(verify_receipt_proof(root, &proof_invalid_encoding).is_none()); - assert!(verify_receipt_proof(root, &proof_no_full_node).is_none()); - } - - #[test] - fn test_verify_receipt_proof_with_intermediate_short_node() { - let root: H256 = - hex!("d128e3a57142d2bf15bc0cbcac7ad54f40750d571b5c3097e425882c10c9ba66").into(); - - let proof_receipt263 = vec![ - hex!("f90131a00d3cb8d3f57ac1c0e12918a2ebe0cafed8c273577b9dd73e7ed1079b403ef494a0678b9835b834f8a287c0dd33a8fca9146e456ca688555ed4ec1361a2180b778da0fe42da181a46677a043b3d9d4b8bb05a6a17b7b5c010c17e7c1d31cfb7c4f911a0c89f0e2c53241cdb578e1f2b4caf6ba36e00500bdc57fecd66b84a6a58394c19a086c3c1fae5a0575940b5d38e111c469d07883106c26856f3ef608469a2081f13a06c5992ff00aab6226a70a032fd2f571ba22f797321f45e2daa73020d638d21b0a050861e9503ef68728f6c90a44f7fe1bceb2a9bdab6957bbe7136166bd849561ea006aa6eaca8a07e57176e9aa41e6a09edfb7678d1a112404e0ec779d7e567e82ea0bb0b430d303ba21b0af11c487b8a218bd75db54c98940b3f11bad8ff47cad3ef8080808080808080").to_vec(), - hex!("f871a0246de222036ee6a03329b0105da0a6b3f916fc95a9ed5a403a581a0c4d74242ca0ac108a49a88b57a05ac34a108b39f1e45f6f167f2b9fbc8d52fb58e2e5a6af1ea0fcfe07ac2ccd3c28b6eab68d1bce112f6f6dbd9023e4ec3c05b96615aa803d798080808080808080808080808080").to_vec(), - hex!("e4820001a04fff54398cad4d05ea6abfd8b0f3b4fe14c04d7ff5f5211c5b927d9cf72ac1d8").to_vec(), - hex!("f851a096d010643ca2d47412ca66898286b5f2412963b9ec051b33e570d575914c9c5ca028cd24c652989542fe89479ec6388eac4592432242af5ba97563b3ac7c71c019808080808080808080808080808080").to_vec(), - hex!("f90211a0bb35a84c5b1dcb78ec9d32614912c696e62df77bebf9ab326ee55b5d3acdde46a01084b30dac8df0accfcd0fd6330b7f6fc72a4651246d0694be9162151686a620a03eed50afdce7909d784c6157c445a444c806b5f23d31f3b63786f600c84a95b2a0af5232f1df6c6d41879804d081abe867002abe26ba3e5f8e0254a83a54769831a0607915fb13dd5da594256389a45007a67a7f7a86e95d38d8462792b6c98a722ea00e1260fda1730f2738c650ce2bfba83857bc10f8fb119ebc4fb39acba24e6fbaa0d11de17e417327457812675ca3b84ae8e1b64827abfe01420953697c8313d5b1a05fcaf2f7a88f76336a0c32ffc78acb87ae2005454bd25d658035331be3173b46a03f94f4952ab9e650f83cfd0e7f367b1bcc493aacf39a06f16c4a2e1b5605da48a0bdb4ec79785ca8ae22d60f1bbd42d707b4d7ec4aff231a3ebab755e315b35053a043a67c3f2bcef37c8f47a673adcb7061007a553696d1092408601c11b2e6846aa0c519d5af48cae87c7f4538845417c9735813bee892a6fe2dda79f5c414e8576aa0f7058256e09589501d7c231d739e61c84a850e139690989d24fda6058b432e98a081a52faab520978cb19ce14400dba0cd5bcdc4e5a3c0740678aa8f97ee0e5c56a0bcecc61cadeae52518e3b68a48af4b11603dfd9d99d99d7985efa6d2de44f904a02cba4accfc6f39bc5adb6d4440eb6358b4a5103ef93298e4e694f1f940f8b48280").to_vec(), - hex!("f901ae20b901aaf901a70183bb444eb9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000001000000000000000000000000000100000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000010000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000002000000000000000000081000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000f89df89b94dac17f958d2ee523a2206206994597c13d831ec7f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa00000000000000000000000002e514404ff6823f1b46a8318a709251db414e5e1a000000000000000000000000055021c55847c00d764357a352e5803237d328954a0000000000000000000000000000000000000000000000000000000000201c370").to_vec(), - ]; - assert!(verify_receipt_proof(root, &proof_receipt263).is_some()); - } -} diff --git a/snowbridge/parachain/primitives/beacon/src/serde_utils.rs b/snowbridge/parachain/primitives/beacon/src/serde_utils.rs deleted file mode 100644 index 07f5cbe724e..00000000000 --- a/snowbridge/parachain/primitives/beacon/src/serde_utils.rs +++ /dev/null @@ -1,130 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use sp_core::U256; - -use core::fmt::Formatter; -use serde::{Deserialize, Deserializer}; - -// helper to deserialize arbitrary arrays like [T; N] -pub mod arrays { - use std::{convert::TryInto, marker::PhantomData}; - - use serde::{ - de::{SeqAccess, Visitor}, - ser::SerializeTuple, - Deserialize, Deserializer, Serialize, Serializer, - }; - - pub fn serialize( - data: &[T; N], - ser: S, - ) -> Result { - let mut s = ser.serialize_tuple(N)?; - for item in data { - s.serialize_element(item)?; - } - s.end() - } - - struct ArrayVisitor(PhantomData); - - impl<'de, T, const N: usize> Visitor<'de> for ArrayVisitor - where - T: Deserialize<'de>, - { - type Value = [T; N]; - - fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { - formatter.write_str(&format!("an array of length {}", N)) - } - - #[inline] - fn visit_seq(self, mut seq: A) -> Result - where - A: SeqAccess<'de>, - { - // can be optimized using MaybeUninit - let mut data = Vec::with_capacity(N); - for _ in 0..N { - match (seq.next_element())? { - Some(val) => data.push(val), - None => return Err(serde::de::Error::invalid_length(N, &self)), - } - } - match data.try_into() { - Ok(arr) => Ok(arr), - Err(_) => unreachable!(), - } - } - } - - pub fn deserialize<'de, D, T, const N: usize>(deserializer: D) -> Result<[T; N], D::Error> - where - D: Deserializer<'de>, - T: Deserialize<'de>, - { - deserializer.deserialize_tuple(N, ArrayVisitor::(PhantomData)) - } -} - -pub(crate) fn from_hex_to_bytes<'de, D>(deserializer: D) -> Result, D::Error> -where - D: Deserializer<'de>, -{ - let s = String::deserialize(deserializer)?; - - let str_without_0x = match s.strip_prefix("0x") { - Some(val) => val, - None => &s, - }; - - let hex_bytes = match hex::decode(str_without_0x) { - Ok(bytes) => bytes, - Err(e) => return Err(serde::de::Error::custom(e.to_string())), - }; - - Ok(hex_bytes) -} - -pub(crate) fn from_int_to_u256<'de, D>(deserializer: D) -> Result -where - D: Deserializer<'de>, -{ - let number = u128::deserialize(deserializer)?; - - Ok(U256::from(number)) -} - -pub struct HexVisitor(); - -impl<'de, const LENGTH: usize> serde::de::Visitor<'de> for HexVisitor { - type Value = [u8; LENGTH]; - - fn expecting(&self, formatter: &mut Formatter) -> sp_std::fmt::Result { - formatter.write_str("a hex string with an '0x' prefix") - } - - fn visit_str(self, v: &str) -> Result - where - E: serde::de::Error, - { - let stripped = match v.strip_prefix("0x") { - Some(stripped) => stripped, - None => v, - }; - - let decoded = match hex::decode(stripped) { - Ok(decoded) => decoded, - Err(e) => return Err(serde::de::Error::custom(e.to_string())), - }; - if decoded.len() != LENGTH { - return Err(serde::de::Error::custom("publickey expected to be 48 characters")) - } - - let data: Self::Value = decoded - .try_into() - .map_err(|_e| serde::de::Error::custom("hex data has unexpected length"))?; - - Ok(data) - } -} diff --git a/snowbridge/parachain/primitives/beacon/src/ssz.rs b/snowbridge/parachain/primitives/beacon/src/ssz.rs deleted file mode 100644 index 4f8b19ca889..00000000000 --- a/snowbridge/parachain/primitives/beacon/src/ssz.rs +++ /dev/null @@ -1,194 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use crate::{ - config::{EXTRA_DATA_SIZE, FEE_RECIPIENT_SIZE, LOGS_BLOOM_SIZE, PUBKEY_SIZE, SIGNATURE_SIZE}, - types::{ - BeaconHeader, ExecutionPayloadHeader, ForkData, SigningData, SyncAggregate, SyncCommittee, - }, -}; -use byte_slice_cast::AsByteSlice; -use sp_core::H256; -use sp_std::{vec, vec::Vec}; -use ssz_rs::{ - prelude::{List, Vector}, - Bitvector, Deserialize, DeserializeError, SimpleSerialize, SimpleSerializeError, Sized, U256, -}; -use ssz_rs_derive::SimpleSerialize as SimpleSerializeDerive; - -#[derive(Default, SimpleSerializeDerive, Clone, Debug)] -pub struct SSZBeaconBlockHeader { - pub slot: u64, - pub proposer_index: u64, - pub parent_root: [u8; 32], - pub state_root: [u8; 32], - pub body_root: [u8; 32], -} - -impl From for SSZBeaconBlockHeader { - fn from(beacon_header: BeaconHeader) -> Self { - SSZBeaconBlockHeader { - slot: beacon_header.slot, - proposer_index: beacon_header.proposer_index, - parent_root: beacon_header.parent_root.to_fixed_bytes(), - state_root: beacon_header.state_root.to_fixed_bytes(), - body_root: beacon_header.body_root.to_fixed_bytes(), - } - } -} - -#[derive(Default, SimpleSerializeDerive, Clone)] -pub struct SSZSyncCommittee { - pub pubkeys: Vector, COMMITTEE_SIZE>, - pub aggregate_pubkey: Vector, -} - -impl From> - for SSZSyncCommittee -{ - fn from(sync_committee: SyncCommittee) -> Self { - let mut pubkeys_vec = Vec::new(); - - for pubkey in sync_committee.pubkeys.iter() { - // The only thing that can go wrong in the conversion from vec to Vector (ssz type) is - // that the Vector size is 0, or that the given data to create the Vector from does not - // match the expected size N. Because these sizes are statically checked (i.e. - // PublicKey's size is 48, and const PUBKEY_SIZE is 48, it is impossible for "try_from" - // to return an error condition. - let conv_pubkey = Vector::::try_from(pubkey.0.to_vec()) - .expect("checked statically; qed"); - - pubkeys_vec.push(conv_pubkey); - } - - let pubkeys = Vector::, { COMMITTEE_SIZE }>::try_from(pubkeys_vec) - .expect("checked statically; qed"); - - let aggregate_pubkey = - Vector::::try_from(sync_committee.aggregate_pubkey.0.to_vec()) - .expect("checked statically; qed"); - - SSZSyncCommittee { pubkeys, aggregate_pubkey } - } -} - -#[derive(Default, Debug, SimpleSerializeDerive, Clone)] -pub struct SSZSyncAggregate { - pub sync_committee_bits: Bitvector, - pub sync_committee_signature: Vector, -} - -impl - From> for SSZSyncAggregate -{ - fn from(sync_aggregate: SyncAggregate) -> Self { - SSZSyncAggregate { - sync_committee_bits: Bitvector::::deserialize( - &sync_aggregate.sync_committee_bits, - ) - .expect("checked statically; qed"), - sync_committee_signature: Vector::::try_from( - sync_aggregate.sync_committee_signature.0.to_vec(), - ) - .expect("checked statically; qed"), - } - } -} - -#[derive(Default, SimpleSerializeDerive, Clone)] -pub struct SSZForkData { - pub current_version: [u8; 4], - pub genesis_validators_root: [u8; 32], -} - -impl From for SSZForkData { - fn from(fork_data: ForkData) -> Self { - SSZForkData { - current_version: fork_data.current_version, - genesis_validators_root: fork_data.genesis_validators_root, - } - } -} - -#[derive(Default, SimpleSerializeDerive, Clone)] -pub struct SSZSigningData { - pub object_root: [u8; 32], - pub domain: [u8; 32], -} - -impl From for SSZSigningData { - fn from(signing_data: SigningData) -> Self { - SSZSigningData { - object_root: signing_data.object_root.into(), - domain: signing_data.domain.into(), - } - } -} - -#[derive(Default, SimpleSerializeDerive, Clone, Debug)] -pub struct SSZExecutionPayloadHeader { - pub parent_hash: [u8; 32], - pub fee_recipient: Vector, - pub state_root: [u8; 32], - pub receipts_root: [u8; 32], - pub logs_bloom: Vector, - pub prev_randao: [u8; 32], - pub block_number: u64, - pub gas_limit: u64, - pub gas_used: u64, - pub timestamp: u64, - pub extra_data: List, - pub base_fee_per_gas: U256, - pub block_hash: [u8; 32], - pub transactions_root: [u8; 32], - pub withdrawals_root: [u8; 32], -} - -impl TryFrom for SSZExecutionPayloadHeader { - type Error = SimpleSerializeError; - - fn try_from(payload: ExecutionPayloadHeader) -> Result { - Ok(SSZExecutionPayloadHeader { - parent_hash: payload.parent_hash.to_fixed_bytes(), - fee_recipient: Vector::::try_from( - payload.fee_recipient.to_fixed_bytes().to_vec(), - ) - .expect("checked statically; qed"), - state_root: payload.state_root.to_fixed_bytes(), - receipts_root: payload.receipts_root.to_fixed_bytes(), - // Logs bloom bytes size is not constrained, so here we do need to check the try_from - // error - logs_bloom: Vector::::try_from(payload.logs_bloom) - .map_err(|(_, err)| err)?, - prev_randao: payload.prev_randao.to_fixed_bytes(), - block_number: payload.block_number, - gas_limit: payload.gas_limit, - gas_used: payload.gas_used, - timestamp: payload.timestamp, - // Extra data bytes size is not constrained, so here we do need to check the try_from - // error - extra_data: List::::try_from(payload.extra_data) - .map_err(|(_, err)| err)?, - base_fee_per_gas: U256::from_bytes_le( - payload - .base_fee_per_gas - .as_byte_slice() - .try_into() - .expect("checked in prep; qed"), - ), - block_hash: payload.block_hash.to_fixed_bytes(), - transactions_root: payload.transactions_root.to_fixed_bytes(), - withdrawals_root: payload.withdrawals_root.to_fixed_bytes(), - }) - } -} - -pub fn hash_tree_root(mut object: T) -> Result { - match object.hash_tree_root() { - Ok(node) => { - let fixed_bytes: [u8; 32] = - node.as_ref().try_into().expect("Node is a newtype over [u8; 32]; qed"); - Ok(fixed_bytes.into()) - }, - Err(err) => Err(err.into()), - } -} diff --git a/snowbridge/parachain/primitives/beacon/src/types.rs b/snowbridge/parachain/primitives/beacon/src/types.rs deleted file mode 100644 index f893551d9d1..00000000000 --- a/snowbridge/parachain/primitives/beacon/src/types.rs +++ /dev/null @@ -1,512 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use codec::{Decode, Encode, MaxEncodedLen}; -use frame_support::{CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound}; -use scale_info::TypeInfo; -use sp_core::{H160, H256, U256}; -use sp_runtime::RuntimeDebug; -use sp_std::{boxed::Box, prelude::*}; - -use crate::config::{PUBKEY_SIZE, SIGNATURE_SIZE}; - -#[cfg(feature = "std")] -use serde::{Deserialize, Deserializer, Serialize, Serializer}; - -#[cfg(feature = "std")] -use crate::serde_utils::HexVisitor; - -use crate::ssz::{ - hash_tree_root, SSZBeaconBlockHeader, SSZExecutionPayloadHeader, SSZForkData, SSZSigningData, - SSZSyncAggregate, SSZSyncCommittee, -}; -use ssz_rs::SimpleSerializeError; - -pub use crate::bits::decompress_sync_committee_bits; - -use crate::bls::{prepare_g1_pubkeys, prepare_milagro_pubkey, BlsError}; -use milagro_bls::PublicKey as PublicKeyPrepared; - -pub type ValidatorIndex = u64; -pub type ForkVersion = [u8; 4]; - -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] -pub struct ForkVersions { - pub genesis: Fork, - pub altair: Fork, - pub bellatrix: Fork, - pub capella: Fork, -} - -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] -pub struct Fork { - pub version: [u8; 4], - pub epoch: u64, -} - -#[derive(Copy, Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] -pub struct PublicKey(pub [u8; PUBKEY_SIZE]); - -impl Default for PublicKey { - fn default() -> Self { - PublicKey([0u8; PUBKEY_SIZE]) - } -} - -impl From<[u8; PUBKEY_SIZE]> for PublicKey { - fn from(v: [u8; PUBKEY_SIZE]) -> Self { - Self(v) - } -} - -impl MaxEncodedLen for PublicKey { - fn max_encoded_len() -> usize { - PUBKEY_SIZE - } -} - -#[cfg(feature = "std")] -impl<'de> Deserialize<'de> for PublicKey { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - deserializer.deserialize_str(HexVisitor::()).map(|v| v.into()) - } -} - -#[cfg(feature = "std")] -impl Serialize for PublicKey { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - serializer.serialize_bytes(&self.0) - } -} - -#[derive(Copy, Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] -pub struct Signature(pub [u8; SIGNATURE_SIZE]); - -impl Default for Signature { - fn default() -> Self { - Signature([0u8; SIGNATURE_SIZE]) - } -} - -impl From<[u8; SIGNATURE_SIZE]> for Signature { - fn from(v: [u8; SIGNATURE_SIZE]) -> Self { - Self(v) - } -} - -#[cfg(feature = "std")] -impl<'de> Deserialize<'de> for Signature { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - deserializer.deserialize_str(HexVisitor::()).map(|v| v.into()) - } -} - -#[derive(Copy, Clone, Default, Encode, Decode, TypeInfo, MaxEncodedLen)] -pub struct ExecutionHeaderState { - pub beacon_block_root: H256, - pub beacon_slot: u64, - pub block_hash: H256, - pub block_number: u64, -} - -#[derive(Copy, Clone, Default, Encode, Decode, TypeInfo, MaxEncodedLen)] -pub struct FinalizedHeaderState { - pub beacon_block_root: H256, - pub beacon_slot: u64, -} - -#[derive(Clone, Default, Encode, Decode, PartialEq, RuntimeDebug)] -pub struct ForkData { - // 1 or 0 bit, indicates whether a sync committee participated in a vote - pub current_version: [u8; 4], - pub genesis_validators_root: [u8; 32], -} - -impl ForkData { - pub fn hash_tree_root(&self) -> Result { - hash_tree_root::(self.clone().into()) - } -} - -#[derive(Clone, Default, Encode, Decode, PartialEq, RuntimeDebug)] -pub struct SigningData { - pub object_root: H256, - pub domain: H256, -} - -impl SigningData { - pub fn hash_tree_root(&self) -> Result { - hash_tree_root::(self.clone().into()) - } -} - -/// Sync committee as it is stored in the runtime storage. -#[derive( - Encode, Decode, PartialEqNoBound, CloneNoBound, RuntimeDebugNoBound, TypeInfo, MaxEncodedLen, -)] -#[cfg_attr( - feature = "std", - derive(Serialize, Deserialize), - serde(deny_unknown_fields, bound(serialize = ""), bound(deserialize = "")) -)] -#[codec(mel_bound())] -pub struct SyncCommittee { - #[cfg_attr(feature = "std", serde(with = "crate::serde_utils::arrays"))] - pub pubkeys: [PublicKey; COMMITTEE_SIZE], - pub aggregate_pubkey: PublicKey, -} - -impl Default for SyncCommittee { - fn default() -> Self { - SyncCommittee { - pubkeys: [Default::default(); COMMITTEE_SIZE], - aggregate_pubkey: Default::default(), - } - } -} - -impl SyncCommittee { - pub fn hash_tree_root(&self) -> Result { - hash_tree_root::>(self.clone().into()) - } -} - -/// Prepared G1 public key of sync committee as it is stored in the runtime storage. -#[derive(Clone, PartialEq, Eq, Encode, Decode, TypeInfo, MaxEncodedLen)] -pub struct SyncCommitteePrepared { - pub root: H256, - pub pubkeys: Box<[PublicKeyPrepared; COMMITTEE_SIZE]>, - pub aggregate_pubkey: PublicKeyPrepared, -} - -impl Default for SyncCommitteePrepared { - fn default() -> Self { - SyncCommitteePrepared { - root: H256::default(), - pubkeys: Box::new([PublicKeyPrepared::default(); COMMITTEE_SIZE]), - aggregate_pubkey: PublicKeyPrepared::default(), - } - } -} - -impl TryFrom<&SyncCommittee> - for SyncCommitteePrepared -{ - type Error = BlsError; - - fn try_from(sync_committee: &SyncCommittee) -> Result { - let g1_pubkeys = prepare_g1_pubkeys(&sync_committee.pubkeys)?; - let sync_committee_root = sync_committee.hash_tree_root().expect("checked statically; qed"); - - Ok(SyncCommitteePrepared:: { - pubkeys: g1_pubkeys.try_into().expect("checked statically; qed"), - aggregate_pubkey: prepare_milagro_pubkey(&sync_committee.aggregate_pubkey)?, - root: sync_committee_root, - }) - } -} - -/// Beacon block header as it is stored in the runtime storage. The block root is the -/// Merkleization of a BeaconHeader. -#[derive( - Copy, Clone, Default, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen, -)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub struct BeaconHeader { - // The slot for which this block is created. Must be greater than the slot of the block defined - // by parent root. - pub slot: u64, - // The index of the validator that proposed the block. - pub proposer_index: ValidatorIndex, - // The block root of the parent block, forming a block chain. - pub parent_root: H256, - // The hash root of the post state of running the state transition through this block. - pub state_root: H256, - // The hash root of the beacon block body - pub body_root: H256, -} - -impl BeaconHeader { - pub fn hash_tree_root(&self) -> Result { - hash_tree_root::((*self).into()) - } -} - -#[derive(Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo)] -#[cfg_attr( - feature = "std", - derive(Deserialize), - serde( - try_from = "IntermediateSyncAggregate", - deny_unknown_fields, - bound(serialize = ""), - bound(deserialize = "") - ) -)] -#[codec(mel_bound())] -pub struct SyncAggregate { - pub sync_committee_bits: [u8; COMMITTEE_BITS_SIZE], - pub sync_committee_signature: Signature, -} - -impl Default - for SyncAggregate -{ - fn default() -> Self { - SyncAggregate { - sync_committee_bits: [0; COMMITTEE_BITS_SIZE], - sync_committee_signature: Default::default(), - } - } -} - -impl - SyncAggregate -{ - pub fn hash_tree_root(&self) -> Result { - hash_tree_root::>(self.clone().into()) - } -} - -/// Serde deserialization helper for SyncAggregate -#[cfg(feature = "std")] -#[derive(Deserialize)] -struct IntermediateSyncAggregate { - #[cfg_attr(feature = "std", serde(deserialize_with = "crate::serde_utils::from_hex_to_bytes"))] - pub sync_committee_bits: Vec, - pub sync_committee_signature: Signature, -} - -#[cfg(feature = "std")] -impl - TryFrom for SyncAggregate -{ - type Error = String; - - fn try_from(other: IntermediateSyncAggregate) -> Result { - Ok(Self { - sync_committee_bits: other - .sync_committee_bits - .try_into() - .map_err(|_| "unexpected length".to_owned())?, - sync_committee_signature: other.sync_committee_signature, - }) - } -} - -/// ExecutionPayloadHeader -/// -#[derive( - Default, Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo, -)] -#[cfg_attr( - feature = "std", - derive(Deserialize), - serde(deny_unknown_fields, bound(serialize = ""), bound(deserialize = "")) -)] -#[codec(mel_bound())] -pub struct ExecutionPayloadHeader { - pub parent_hash: H256, - pub fee_recipient: H160, - pub state_root: H256, - pub receipts_root: H256, - #[cfg_attr(feature = "std", serde(deserialize_with = "crate::serde_utils::from_hex_to_bytes"))] - pub logs_bloom: Vec, - pub prev_randao: H256, - pub block_number: u64, - pub gas_limit: u64, - pub gas_used: u64, - pub timestamp: u64, - #[cfg_attr(feature = "std", serde(deserialize_with = "crate::serde_utils::from_hex_to_bytes"))] - pub extra_data: Vec, - #[cfg_attr(feature = "std", serde(deserialize_with = "crate::serde_utils::from_int_to_u256"))] - pub base_fee_per_gas: U256, - pub block_hash: H256, - pub transactions_root: H256, - pub withdrawals_root: H256, -} - -impl ExecutionPayloadHeader { - pub fn hash_tree_root(&self) -> Result { - hash_tree_root::(self.clone().try_into()?) - } -} - -#[derive( - Default, - Encode, - Decode, - CloneNoBound, - PartialEqNoBound, - RuntimeDebugNoBound, - TypeInfo, - MaxEncodedLen, -)] -pub struct CompactExecutionHeader { - pub parent_hash: H256, - #[codec(compact)] - pub block_number: u64, - pub state_root: H256, - pub receipts_root: H256, -} - -impl From for CompactExecutionHeader { - fn from(execution_payload: ExecutionPayloadHeader) -> Self { - Self { - parent_hash: execution_payload.parent_hash, - block_number: execution_payload.block_number, - state_root: execution_payload.state_root, - receipts_root: execution_payload.receipts_root, - } - } -} - -#[derive( - Default, - Encode, - Decode, - Copy, - Clone, - PartialEqNoBound, - RuntimeDebugNoBound, - TypeInfo, - MaxEncodedLen, -)] -pub struct CompactBeaconState { - #[codec(compact)] - pub slot: u64, - pub block_roots_root: H256, -} - -#[cfg(test)] -mod tests { - use super::*; - use hex_literal::hex; - - #[test] - pub fn test_hash_beacon_header1() { - let hash_root = BeaconHeader { - slot: 3, - proposer_index: 2, - parent_root: hex!("796ea53efb534eab7777809cc5ee2d84e7f25024b9d0c4d7e5bcaab657e4bdbd") - .into(), - state_root: hex!("ba3ff080912be5c9c158b2e962c1b39a91bc0615762ba6fa2ecacafa94e9ae0a") - .into(), - body_root: hex!("a18d7fcefbb74a177c959160e0ee89c23546482154e6831237710414465dcae5") - .into(), - } - .hash_tree_root(); - - assert!(hash_root.is_ok()); - assert_eq!( - hash_root.unwrap(), - hex!("7d42595818709e805dd2fa710a2d2c1f62576ef1ab7273941ac9130fb94b91f7").into() - ); - } - - #[test] - pub fn test_hash_beacon_header2() { - let hash_root = BeaconHeader { - slot: 3476424, - proposer_index: 314905, - parent_root: hex!("c069d7b49cffd2b815b0fb8007eb9ca91202ea548df6f3db60000f29b2489f28") - .into(), - state_root: hex!("444d293e4533501ee508ad608783a7d677c3c566f001313e8a02ce08adf590a3") - .into(), - body_root: hex!("6508a0241047f21ba88f05d05b15534156ab6a6f8e029a9a5423da429834e04a") - .into(), - } - .hash_tree_root(); - - assert!(hash_root.is_ok()); - assert_eq!( - hash_root.unwrap(), - hex!("0aa41166ff01e58e111ac8c42309a738ab453cf8d7285ed8477b1c484acb123e").into() - ); - } - - #[test] - pub fn test_hash_fork_data() { - let hash_root = ForkData { - current_version: hex!("83f38a34"), - genesis_validators_root: hex!( - "22370bbbb358800f5711a10ea9845284272d8493bed0348cab87b8ab1e127930" - ), - } - .hash_tree_root(); - - assert!(hash_root.is_ok()); - assert_eq!( - hash_root.unwrap(), - hex!("57c12c4246bc7152b174b51920506bf943eff9c7ffa50b9533708e9cc1f680fc").into() - ); - } - - #[test] - pub fn test_hash_signing_data() { - let hash_root = SigningData { - object_root: hex!("63654cbe64fc07853f1198c165dd3d49c54fc53bc417989bbcc66da15f850c54") - .into(), - domain: hex!("037da907d1c3a03c0091b2254e1480d9b1783476e228ab29adaaa8f133e08f7a").into(), - } - .hash_tree_root(); - - assert!(hash_root.is_ok()); - assert_eq!( - hash_root.unwrap(), - hex!("b9eb2caf2d691b183c2d57f322afe505c078cd08101324f61c3641714789a54e").into() - ); - } - - #[test] - pub fn test_hash_sync_aggregate() { - let hash_root = SyncAggregate::<512, 64>{ - sync_committee_bits: hex!("cefffffefffffff767fffbedffffeffffeeffdffffdebffffff7f7dbdf7fffdffffbffcfffdff79dfffbbfefff2ffffff7ddeff7ffffc98ff7fbfffffffffff7"), - sync_committee_signature: hex!("8af1a8577bba419fe054ee49b16ed28e081dda6d3ba41651634685e890992a0b675e20f8d9f2ec137fe9eb50e838aa6117f9f5410e2e1024c4b4f0e098e55144843ce90b7acde52fe7b94f2a1037342c951dc59f501c92acf7ed944cb6d2b5f7").into(), - }.hash_tree_root(); - - assert!(hash_root.is_ok()); - assert_eq!( - hash_root.unwrap(), - hex!("e6dcad4f60ce9ff8a587b110facbaf94721f06cd810b6d8bf6cffa641272808d").into() - ); - } - - #[test] - pub fn test_hash_execution_payload() { - let hash_root = - ExecutionPayloadHeader{ - parent_hash: hex!("eadee5ab098dde64e9fd02ae5858064bad67064070679625b09f8d82dec183f7").into(), - fee_recipient: hex!("f97e180c050e5ab072211ad2c213eb5aee4df134").into(), - state_root: hex!("564fa064c2a324c2b5978d7fdfc5d4224d4f421a45388af1ed405a399c845dff").into(), - receipts_root: hex!("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").into(), - logs_bloom: hex!("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").to_vec(), - prev_randao: hex!("6bf538bdfbdf1c96ff528726a40658a91d0bda0f1351448c4c4f3604db2a0ccf").into(), - block_number: 477434, - gas_limit: 8154925, - gas_used: 0, - timestamp: 1652816940, - extra_data: vec![], - base_fee_per_gas: U256::from(7_i16), - block_hash: hex!("cd8df91b4503adb8f2f1c7a4f60e07a1f1a2cbdfa2a95bceba581f3ff65c1968").into(), - transactions_root: hex!("7ffe241ea60187fdb0187bfa22de35d1f9bed7ab061d9401fd47e34a54fbede1").into(), - withdrawals_root: hex!("28ba1834a3a7b657460ce79fa3a1d909ab8828fd557659d4d0554a9bdbc0ec30").into(), - }.hash_tree_root(); - assert!(hash_root.is_ok()); - } -} - -/// Operating modes for beacon client -#[derive(Encode, Decode, Copy, Clone, PartialEq, RuntimeDebug, TypeInfo)] -pub enum Mode { - Active, - Blocked, -} diff --git a/snowbridge/parachain/primitives/beacon/src/updates.rs b/snowbridge/parachain/primitives/beacon/src/updates.rs deleted file mode 100644 index 9a78b4f1e2d..00000000000 --- a/snowbridge/parachain/primitives/beacon/src/updates.rs +++ /dev/null @@ -1,110 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use codec::{Decode, Encode}; -use frame_support::{CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound}; -use scale_info::TypeInfo; -use sp_core::H256; -use sp_std::prelude::*; - -use crate::types::{BeaconHeader, ExecutionPayloadHeader, SyncAggregate, SyncCommittee}; - -#[derive(Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo)] -#[cfg_attr( - feature = "std", - derive(serde::Serialize, serde::Deserialize), - serde(deny_unknown_fields, bound(serialize = ""), bound(deserialize = "")) -)] -pub struct CheckpointUpdate { - pub header: BeaconHeader, - pub current_sync_committee: SyncCommittee, - pub current_sync_committee_branch: Vec, - pub validators_root: H256, - pub block_roots_root: H256, - pub block_roots_branch: Vec, -} - -impl Default for CheckpointUpdate { - fn default() -> Self { - CheckpointUpdate { - header: Default::default(), - current_sync_committee: Default::default(), - current_sync_committee_branch: Default::default(), - validators_root: Default::default(), - block_roots_root: Default::default(), - block_roots_branch: Default::default(), - } - } -} - -#[derive( - Default, Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo, -)] -#[cfg_attr( - feature = "std", - derive(serde::Deserialize), - serde(deny_unknown_fields, bound(serialize = ""), bound(deserialize = "")) -)] -pub struct Update { - /// A recent header attesting to the finalized header, using its `state_root`. - pub attested_header: BeaconHeader, - /// The signing data that the sync committee produced for this attested header, including - /// who participated in the vote and the resulting signature. - pub sync_aggregate: SyncAggregate, - /// The slot at which the sync aggregate can be found, typically attested_header.slot + 1, if - /// the next slot block was not missed. - pub signature_slot: u64, - /// The next sync committee for the next sync committee period, if present. - pub next_sync_committee_update: Option>, - /// The latest finalized header. - pub finalized_header: BeaconHeader, - /// The merkle proof testifying to the finalized header, using the `attested_header.state_root` - /// as tree root. - pub finality_branch: Vec, - /// The finalized_header's `block_roots` root in the beacon state, used for ancestry proofs. - pub block_roots_root: H256, - /// The merkle path to prove the `block_roots_root` value. - pub block_roots_branch: Vec, -} - -#[derive( - Default, Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo, -)] -#[cfg_attr( - feature = "std", - derive(serde::Deserialize), - serde(deny_unknown_fields, bound(serialize = ""), bound(deserialize = "")) -)] -pub struct NextSyncCommitteeUpdate { - pub next_sync_committee: SyncCommittee, - pub next_sync_committee_branch: Vec, -} - -#[derive(Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo)] -#[cfg_attr( - feature = "std", - derive(serde::Deserialize), - serde(deny_unknown_fields, bound(serialize = ""), bound(deserialize = "")) -)] -pub struct ExecutionHeaderUpdate { - /// Header for the beacon block containing the execution payload - pub header: BeaconHeader, - /// Proof that `header` is an ancestor of a finalized header - pub ancestry_proof: Option, - /// Execution header to be imported - pub execution_header: ExecutionPayloadHeader, - /// Merkle proof that execution payload is contained within `header` - pub execution_branch: Vec, -} - -#[derive(Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo)] -#[cfg_attr( - feature = "std", - derive(serde::Deserialize), - serde(deny_unknown_fields, bound(serialize = ""), bound(deserialize = "")) -)] -pub struct AncestryProof { - /// Merkle proof that `header` is an ancestor of `finalized_header` - pub header_branch: Vec, - /// Root of a finalized block that has already been imported into the light client - pub finalized_block_root: H256, -} diff --git a/snowbridge/parachain/primitives/core/Cargo.toml b/snowbridge/parachain/primitives/core/Cargo.toml deleted file mode 100644 index 1cb28eb3e50..00000000000 --- a/snowbridge/parachain/primitives/core/Cargo.toml +++ /dev/null @@ -1,65 +0,0 @@ -[package] -name = "snowbridge-core" -description = "Snowbridge Core" -version = "0.9.0" -authors = ["Snowfork "] -edition.workspace = true -repository.workspace = true -license = "Apache-2.0" -categories = ["cryptography::cryptocurrencies"] - -[lints] -workspace = true - -[dependencies] -serde = { version = "1.0.195", optional = true, features = ["alloc", "derive"], default-features = false } -codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } -scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } -hex-literal = { version = "0.4.1" } - -polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false } -xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } -xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false } - -frame-support = { path = "../../../../../substrate/frame/support", default-features = false } -frame-system = { path = "../../../../../substrate/frame/system", default-features = false } -sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } -sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } -sp-io = { path = "../../../../../substrate/primitives/io", default-features = false } -sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } -sp-arithmetic = { path = "../../../../../substrate/primitives/arithmetic", 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 } - -[dev-dependencies] -hex = { version = "0.4.3" } - -[features] -default = ["std"] -std = [ - "codec/std", - "ethabi/std", - "frame-support/std", - "frame-system/std", - "polkadot-parachain-primitives/std", - "scale-info/std", - "serde/std", - "snowbridge-beacon-primitives/std", - "sp-arithmetic/std", - "sp-core/std", - "sp-io/std", - "sp-runtime/std", - "sp-std/std", - "xcm-builder/std", - "xcm/std", -] -serde = ["dep:serde", "scale-info/serde"] -runtime-benchmarks = [ - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "polkadot-parachain-primitives/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", -] diff --git a/snowbridge/parachain/primitives/core/README.md b/snowbridge/parachain/primitives/core/README.md deleted file mode 100644 index 0126be63aeb..00000000000 --- a/snowbridge/parachain/primitives/core/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Core Primitives - -Contains common code core to Snowbridge, such as inbound and outbound queue types, pricing structs, ringbuffer data -types (used in the beacon client). diff --git a/snowbridge/parachain/primitives/core/src/inbound.rs b/snowbridge/parachain/primitives/core/src/inbound.rs deleted file mode 100644 index 4b04470ad02..00000000000 --- a/snowbridge/parachain/primitives/core/src/inbound.rs +++ /dev/null @@ -1,74 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! Types for representing inbound messages - -use codec::{Decode, Encode}; -use frame_support::PalletError; -use scale_info::TypeInfo; -use sp_core::{H160, H256}; -use sp_runtime::RuntimeDebug; -use sp_std::vec::Vec; - -/// A trait for verifying inbound messages from Ethereum. -pub trait Verifier { - fn verify(event: &Log, proof: &Proof) -> Result<(), VerificationError>; -} - -#[derive(Clone, Encode, Decode, RuntimeDebug, PalletError, TypeInfo)] -#[cfg_attr(feature = "std", derive(PartialEq))] -pub enum VerificationError { - /// Execution header is missing - HeaderNotFound, - /// Event log was not found in the verified transaction receipt - LogNotFound, - /// Event log has an invalid format - InvalidLog, - /// Unable to verify the transaction receipt with the provided proof - InvalidProof, -} - -pub type MessageNonce = u64; - -/// A bridge message from the Gateway contract on Ethereum -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] -pub struct Message { - /// Event log emitted by Gateway contract - pub event_log: Log, - /// Inclusion proof for a transaction receipt containing the event log - pub proof: Proof, -} - -const MAX_TOPICS: usize = 4; - -#[derive(Clone, RuntimeDebug)] -pub enum LogValidationError { - TooManyTopics, -} - -/// Event log -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] -pub struct Log { - pub address: H160, - pub topics: Vec, - pub data: Vec, -} - -impl Log { - pub fn validate(&self) -> Result<(), LogValidationError> { - if self.topics.len() > MAX_TOPICS { - return Err(LogValidationError::TooManyTopics) - } - Ok(()) - } -} - -/// Inclusion proof for a transaction receipt -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] -pub struct Proof { - // The block hash of the block in which the receipt was included. - pub block_hash: H256, - // The index of the transaction (and receipt) within the block. - pub tx_index: u32, - // Proof keys and values (receipts tree) - pub data: (Vec>, Vec>), -} diff --git a/snowbridge/parachain/primitives/core/src/lib.rs b/snowbridge/parachain/primitives/core/src/lib.rs deleted file mode 100644 index a464557a72b..00000000000 --- a/snowbridge/parachain/primitives/core/src/lib.rs +++ /dev/null @@ -1,170 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! # Core -//! -//! Common traits and types -#![cfg_attr(not(feature = "std"), no_std)] - -#[cfg(test)] -mod tests; - -pub mod inbound; -pub mod operating_mode; -pub mod outbound; -pub mod pricing; -pub mod ringbuffer; - -pub use polkadot_parachain_primitives::primitives::{ - Id as ParaId, IsSystem, Sibling as SiblingParaId, -}; -pub use ringbuffer::{RingBufferMap, RingBufferMapImpl}; -pub use sp_core::U256; - -use codec::{Decode, Encode, MaxEncodedLen}; -use frame_support::traits::Contains; -use hex_literal::hex; -use scale_info::TypeInfo; -use sp_core::H256; -use sp_io::hashing::keccak_256; -use sp_runtime::{traits::AccountIdConversion, RuntimeDebug}; -use sp_std::prelude::*; -use xcm::prelude::{Junction::Parachain, Location}; -use xcm_builder::{DescribeAllTerminal, DescribeFamily, DescribeLocation, HashedDescription}; - -/// The ID of an agent contract -pub type AgentId = H256; -pub use operating_mode::BasicOperatingMode; - -pub use pricing::{PricingParameters, Rewards}; - -pub fn sibling_sovereign_account(para_id: ParaId) -> T::AccountId -where - T: frame_system::Config, -{ - SiblingParaId::from(para_id).into_account_truncating() -} - -pub fn sibling_sovereign_account_raw(para_id: ParaId) -> [u8; 32] { - SiblingParaId::from(para_id).into_account_truncating() -} - -pub struct AllowSiblingsOnly; -impl Contains for AllowSiblingsOnly { - fn contains(location: &Location) -> bool { - matches!(location.unpack(), (1, [Parachain(_)])) - } -} - -pub fn gwei(x: u128) -> U256 { - U256::from(1_000_000_000u128).saturating_mul(x.into()) -} - -pub fn meth(x: u128) -> U256 { - U256::from(1_000_000_000_000_000u128).saturating_mul(x.into()) -} - -pub fn eth(x: u128) -> U256 { - U256::from(1_000_000_000_000_000_000u128).saturating_mul(x.into()) -} - -pub const ROC: u128 = 1_000_000_000_000; - -/// Identifier for a message channel -#[derive( - Clone, Copy, Encode, Decode, PartialEq, Eq, Default, RuntimeDebug, MaxEncodedLen, TypeInfo, -)] -pub struct ChannelId([u8; 32]); - -/// Deterministically derive a ChannelId for a sibling parachain -/// Generator: keccak256("para" + big_endian_bytes(para_id)) -/// -/// The equivalent generator on the Solidity side is in -/// contracts/src/Types.sol:into(). -fn derive_channel_id_for_sibling(para_id: ParaId) -> ChannelId { - let para_id: u32 = para_id.into(); - let para_id_bytes: [u8; 4] = para_id.to_be_bytes(); - let prefix: [u8; 4] = *b"para"; - let preimage: Vec = prefix.into_iter().chain(para_id_bytes).collect(); - keccak_256(&preimage).into() -} - -impl ChannelId { - pub const fn new(id: [u8; 32]) -> Self { - ChannelId(id) - } -} - -impl From for ChannelId { - fn from(value: ParaId) -> Self { - derive_channel_id_for_sibling(value) - } -} - -impl From<[u8; 32]> for ChannelId { - fn from(value: [u8; 32]) -> Self { - ChannelId(value) - } -} - -impl From for [u8; 32] { - fn from(value: ChannelId) -> Self { - value.0 - } -} - -impl<'a> From<&'a [u8; 32]> for ChannelId { - fn from(value: &'a [u8; 32]) -> Self { - ChannelId(*value) - } -} - -impl From for ChannelId { - fn from(value: H256) -> Self { - ChannelId(value.into()) - } -} - -impl AsRef<[u8]> for ChannelId { - fn as_ref(&self) -> &[u8] { - &self.0 - } -} - -#[derive(Clone, Encode, Decode, RuntimeDebug, MaxEncodedLen, TypeInfo)] -pub struct Channel { - /// ID of the agent contract deployed on Ethereum - pub agent_id: AgentId, - /// ID of the parachain who will receive or send messages using this channel - pub para_id: ParaId, -} - -pub trait StaticLookup { - /// Type to lookup from. - type Source; - /// Type to lookup into. - type Target; - /// Attempt a lookup. - fn lookup(s: Self::Source) -> Option; -} - -/// Channel for high-priority governance commands -pub const PRIMARY_GOVERNANCE_CHANNEL: ChannelId = - ChannelId::new(hex!("0000000000000000000000000000000000000000000000000000000000000001")); - -/// Channel for lower-priority governance commands -pub const SECONDARY_GOVERNANCE_CHANNEL: ChannelId = - ChannelId::new(hex!("0000000000000000000000000000000000000000000000000000000000000002")); - -pub struct DescribeHere; -impl DescribeLocation for DescribeHere { - fn describe_location(l: &Location) -> Option> { - match l.unpack() { - (0, []) => Some(Vec::::new().encode()), - _ => None, - } - } -} - -/// Creates an AgentId from a Location. An AgentId is a unique mapping to a Agent contract on -/// Ethereum which acts as the sovereign account for the Location. -pub type AgentIdOf = HashedDescription)>; diff --git a/snowbridge/parachain/primitives/core/src/operating_mode.rs b/snowbridge/parachain/primitives/core/src/operating_mode.rs deleted file mode 100644 index 9894e587ef5..00000000000 --- a/snowbridge/parachain/primitives/core/src/operating_mode.rs +++ /dev/null @@ -1,25 +0,0 @@ -use codec::{Decode, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; -use sp_runtime::RuntimeDebug; - -/// Basic operating modes for a bridges module (Normal/Halted). -#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub enum BasicOperatingMode { - /// Normal mode, when all operations are allowed. - Normal, - /// The pallet is halted. All non-governance operations are disabled. - Halted, -} - -impl Default for BasicOperatingMode { - fn default() -> Self { - Self::Normal - } -} - -impl BasicOperatingMode { - pub fn is_halted(&self) -> bool { - *self == BasicOperatingMode::Halted - } -} diff --git a/snowbridge/parachain/primitives/core/src/outbound.rs b/snowbridge/parachain/primitives/core/src/outbound.rs deleted file mode 100644 index bce123878d3..00000000000 --- a/snowbridge/parachain/primitives/core/src/outbound.rs +++ /dev/null @@ -1,413 +0,0 @@ -use codec::{Decode, Encode}; -use frame_support::PalletError; -use scale_info::TypeInfo; -use sp_arithmetic::traits::{BaseArithmetic, Unsigned}; -use sp_core::{RuntimeDebug, H256}; -pub use v1::{AgentExecuteCommand, Command, Initializer, Message, OperatingMode, QueuedMessage}; - -/// Enqueued outbound messages need to be versioned to prevent data corruption -/// or loss after forkless runtime upgrades -#[derive(Encode, Decode, TypeInfo, Clone, RuntimeDebug)] -#[cfg_attr(feature = "std", derive(PartialEq))] -pub enum VersionedQueuedMessage { - V1(QueuedMessage), -} - -impl TryFrom for QueuedMessage { - type Error = (); - fn try_from(x: VersionedQueuedMessage) -> Result { - use VersionedQueuedMessage::*; - match x { - V1(x) => Ok(x), - } - } -} - -impl> From for VersionedQueuedMessage { - fn from(x: T) -> Self { - VersionedQueuedMessage::V1(x.into()) - } -} - -mod v1 { - use crate::{pricing::UD60x18, ChannelId}; - use codec::{Decode, Encode}; - use ethabi::Token; - use scale_info::TypeInfo; - use sp_core::{RuntimeDebug, H160, H256, U256}; - use sp_std::{borrow::ToOwned, vec, vec::Vec}; - - /// A message which can be accepted by implementations of `/[`SendMessage`\]` - #[derive(Encode, Decode, TypeInfo, Clone, RuntimeDebug)] - #[cfg_attr(feature = "std", derive(PartialEq))] - pub struct Message { - /// ID for this message. One will be automatically generated if not provided. - /// - /// When this message is created from an XCM message, the ID should be extracted - /// from the `SetTopic` instruction. - /// - /// The ID plays no role in bridge consensus, and is purely meant for message tracing. - pub id: Option, - /// The message channel ID - pub channel_id: ChannelId, - /// The stable ID for a receiving gateway contract - pub command: Command, - } - - /// The operating mode of Channels and Gateway contract on Ethereum. - #[derive(Copy, Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, TypeInfo)] - pub enum OperatingMode { - /// Normal operations. Allow sending and receiving messages. - Normal, - /// Reject outbound messages. This allows receiving governance messages but does now allow - /// enqueuing of new messages from the Ethereum side. This can be used to close off an - /// deprecated channel or pause the bridge for upgrade operations. - RejectingOutboundMessages, - } - - /// A command which is executable by the Gateway contract on Ethereum - #[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] - #[cfg_attr(feature = "std", derive(PartialEq))] - pub enum Command { - /// Execute a sub-command within an agent for a consensus system in Polkadot - AgentExecute { - /// The ID of the agent - agent_id: H256, - /// The sub-command to be executed - command: AgentExecuteCommand, - }, - /// Upgrade the Gateway contract - Upgrade { - /// Address of the new implementation contract - impl_address: H160, - /// Codehash of the implementation contract - impl_code_hash: H256, - /// Optionally invoke an initializer in the implementation contract - initializer: Option, - }, - /// Create an agent representing a consensus system on Polkadot - CreateAgent { - /// The ID of the agent, derived from the `MultiLocation` of the consensus system on - /// Polkadot - agent_id: H256, - }, - /// Create bidirectional messaging channel to a parachain - CreateChannel { - /// The ID of the channel - channel_id: ChannelId, - /// The agent ID of the parachain - agent_id: H256, - /// Initial operating mode - mode: OperatingMode, - }, - /// Update the configuration of a channel - UpdateChannel { - /// The ID of the channel - channel_id: ChannelId, - /// The new operating mode - mode: OperatingMode, - }, - /// Set the global operating mode of the Gateway contract - SetOperatingMode { - /// The new operating mode - mode: OperatingMode, - }, - /// Transfer ether from an agent contract to a recipient account - TransferNativeFromAgent { - /// The agent ID - agent_id: H256, - /// The recipient of the ether - recipient: H160, - /// The amount to transfer - amount: u128, - }, - /// Set token fees of the Gateway contract - SetTokenTransferFees { - /// The fee(DOT) for the cost of creating asset on AssetHub - create_asset_xcm: u128, - /// The fee(DOT) for the cost of sending asset on AssetHub - transfer_asset_xcm: u128, - /// The fee(Ether) for register token to discourage spamming - register_token: U256, - }, - /// Set pricing parameters - SetPricingParameters { - // ETH/DOT exchange rate - exchange_rate: UD60x18, - // Cost of delivering a message from Ethereum to BridgeHub, in ROC/KSM/DOT - delivery_cost: u128, - }, - } - - impl Command { - /// Compute the enum variant index - pub fn index(&self) -> u8 { - match self { - Command::AgentExecute { .. } => 0, - Command::Upgrade { .. } => 1, - Command::CreateAgent { .. } => 2, - Command::CreateChannel { .. } => 3, - Command::UpdateChannel { .. } => 4, - Command::SetOperatingMode { .. } => 5, - Command::TransferNativeFromAgent { .. } => 6, - Command::SetTokenTransferFees { .. } => 7, - Command::SetPricingParameters { .. } => 8, - } - } - - /// ABI-encode the Command. - pub fn abi_encode(&self) -> Vec { - match self { - Command::AgentExecute { agent_id, command } => - ethabi::encode(&[Token::Tuple(vec![ - Token::FixedBytes(agent_id.as_bytes().to_owned()), - Token::Bytes(command.abi_encode()), - ])]), - Command::Upgrade { impl_address, impl_code_hash, initializer, .. } => - ethabi::encode(&[Token::Tuple(vec![ - Token::Address(*impl_address), - Token::FixedBytes(impl_code_hash.as_bytes().to_owned()), - initializer - .clone() - .map_or(Token::Bytes(vec![]), |i| Token::Bytes(i.params)), - ])]), - Command::CreateAgent { agent_id } => - ethabi::encode(&[Token::Tuple(vec![Token::FixedBytes( - agent_id.as_bytes().to_owned(), - )])]), - Command::CreateChannel { channel_id, agent_id, mode } => - ethabi::encode(&[Token::Tuple(vec![ - Token::FixedBytes(channel_id.as_ref().to_owned()), - Token::FixedBytes(agent_id.as_bytes().to_owned()), - Token::Uint(U256::from((*mode) as u64)), - ])]), - Command::UpdateChannel { channel_id, mode } => - ethabi::encode(&[Token::Tuple(vec![ - Token::FixedBytes(channel_id.as_ref().to_owned()), - Token::Uint(U256::from((*mode) as u64)), - ])]), - Command::SetOperatingMode { mode } => - ethabi::encode(&[Token::Tuple(vec![Token::Uint(U256::from((*mode) as u64))])]), - Command::TransferNativeFromAgent { agent_id, recipient, amount } => - ethabi::encode(&[Token::Tuple(vec![ - Token::FixedBytes(agent_id.as_bytes().to_owned()), - Token::Address(*recipient), - Token::Uint(U256::from(*amount)), - ])]), - Command::SetTokenTransferFees { - create_asset_xcm, - transfer_asset_xcm, - register_token, - } => ethabi::encode(&[Token::Tuple(vec![ - Token::Uint(U256::from(*create_asset_xcm)), - Token::Uint(U256::from(*transfer_asset_xcm)), - Token::Uint(*register_token), - ])]), - Command::SetPricingParameters { exchange_rate, delivery_cost } => - ethabi::encode(&[Token::Tuple(vec![ - Token::Uint(exchange_rate.clone().into_inner()), - Token::Uint(U256::from(*delivery_cost)), - ])]), - } - } - } - - /// Representation of a call to the initializer of an implementation contract. - /// The initializer has the following ABI signature: `initialize(bytes)`. - #[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] - pub struct Initializer { - /// ABI-encoded params of type `bytes` to pass to the initializer - pub params: Vec, - /// The initializer is allowed to consume this much gas at most. - pub maximum_required_gas: u64, - } - - /// A Sub-command executable within an agent - #[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] - #[cfg_attr(feature = "std", derive(PartialEq))] - pub enum AgentExecuteCommand { - /// Transfer ERC20 tokens - TransferToken { - /// Address of the ERC20 token - token: H160, - /// The recipient of the tokens - recipient: H160, - /// The amount of tokens to transfer - amount: u128, - }, - } - - impl AgentExecuteCommand { - fn index(&self) -> u8 { - match self { - AgentExecuteCommand::TransferToken { .. } => 0, - } - } - - /// ABI-encode the sub-command - pub fn abi_encode(&self) -> Vec { - match self { - AgentExecuteCommand::TransferToken { token, recipient, amount } => - ethabi::encode(&[ - Token::Uint(self.index().into()), - Token::Bytes(ethabi::encode(&[ - Token::Address(*token), - Token::Address(*recipient), - Token::Uint(U256::from(*amount)), - ])), - ]), - } - } - } - - /// Message which is awaiting processing in the MessageQueue pallet - #[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] - #[cfg_attr(feature = "std", derive(PartialEq))] - pub struct QueuedMessage { - /// Message ID - pub id: H256, - /// Channel ID - pub channel_id: ChannelId, - /// Command to execute in the Gateway contract - pub command: Command, - } -} - -#[cfg_attr(feature = "std", derive(PartialEq, Debug))] -/// Fee for delivering message -pub struct Fee -where - Balance: BaseArithmetic + Unsigned + Copy, -{ - /// Fee to cover cost of processing the message locally - pub local: Balance, - /// Fee to cover cost processing the message remotely - pub remote: Balance, -} - -impl Fee -where - Balance: BaseArithmetic + Unsigned + Copy, -{ - pub fn total(&self) -> Balance { - self.local.saturating_add(self.remote) - } -} - -impl From<(Balance, Balance)> for Fee -where - Balance: BaseArithmetic + Unsigned + Copy, -{ - fn from((local, remote): (Balance, Balance)) -> Self { - Self { local, remote } - } -} - -/// A trait for sending messages to Ethereum -pub trait SendMessage: SendMessageFeeProvider { - type Ticket: Clone + Encode + Decode; - - /// Validate an outbound message and return a tuple: - /// 1. Ticket for submitting the message - /// 2. Delivery fee - fn validate( - message: &Message, - ) -> Result<(Self::Ticket, Fee<::Balance>), SendError>; - - /// Submit the message ticket for eventual delivery to Ethereum - fn deliver(ticket: Self::Ticket) -> Result; -} - -pub trait Ticket: Encode + Decode + Clone { - fn message_id(&self) -> H256; -} - -/// A trait for getting the local costs associated with sending a message. -pub trait SendMessageFeeProvider { - type Balance: BaseArithmetic + Unsigned + Copy; - - /// The local component of the message processing fees in native currency - fn local_fee() -> Self::Balance; -} - -/// Reasons why sending to Ethereum could not be initiated -#[derive(Copy, Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, PalletError, TypeInfo)] -pub enum SendError { - /// Message is too large to be safely executed on Ethereum - MessageTooLarge, - /// The bridge has been halted for maintenance - Halted, - /// Invalid Channel - InvalidChannel, -} - -pub trait GasMeter { - /// All the gas used for submitting a message to Ethereum, minus the cost of dispatching - /// the command within the message - const MAXIMUM_BASE_GAS: u64; - - fn maximum_gas_used_at_most(command: &Command) -> u64 { - Self::MAXIMUM_BASE_GAS + Self::maximum_dispatch_gas_used_at_most(command) - } - - /// Measures the maximum amount of gas a command payload will require to dispatch, AFTER - /// validation & verification. - fn maximum_dispatch_gas_used_at_most(command: &Command) -> u64; -} - -/// A meter that assigns a constant amount of gas for the execution of a command -/// -/// The gas figures are extracted from this report: -/// > forge test --match-path test/Gateway.t.sol --gas-report -/// -/// A healthy buffer is added on top of these figures to account for: -/// * The EIP-150 63/64 rule -/// * Future EVM upgrades that may increase gas cost -pub struct ConstantGasMeter; - -impl GasMeter for ConstantGasMeter { - // The base transaction cost, which includes: - // 21_000 transaction cost, roughly worst case 64_000 for calldata, and 100_000 - // for message verification - const MAXIMUM_BASE_GAS: u64 = 185_000; - - fn maximum_dispatch_gas_used_at_most(command: &Command) -> u64 { - match command { - Command::CreateAgent { .. } => 275_000, - Command::CreateChannel { .. } => 100_000, - Command::UpdateChannel { .. } => 50_000, - Command::TransferNativeFromAgent { .. } => 60_000, - Command::SetOperatingMode { .. } => 40_000, - Command::AgentExecute { command, .. } => match command { - // Execute IERC20.transferFrom - // - // Worst-case assumptions are important: - // * No gas refund for clearing storage slot of source account in ERC20 contract - // * Assume dest account in ERC20 contract does not yet have a storage slot - // * ERC20.transferFrom possibly does other business logic besides updating balances - AgentExecuteCommand::TransferToken { .. } => 100_000, - }, - Command::Upgrade { initializer, .. } => { - let initializer_max_gas = match *initializer { - Some(Initializer { maximum_required_gas, .. }) => maximum_required_gas, - None => 0, - }; - // total maximum gas must also include the gas used for updating the proxy before - // the the initializer is called. - 50_000 + initializer_max_gas - }, - Command::SetTokenTransferFees { .. } => 60_000, - Command::SetPricingParameters { .. } => 60_000, - } - } -} - -impl GasMeter for () { - const MAXIMUM_BASE_GAS: u64 = 1; - - fn maximum_dispatch_gas_used_at_most(_: &Command) -> u64 { - 1 - } -} - -pub const ETHER_DECIMALS: u8 = 18; diff --git a/snowbridge/parachain/primitives/core/src/pricing.rs b/snowbridge/parachain/primitives/core/src/pricing.rs deleted file mode 100644 index 33aeda6d15c..00000000000 --- a/snowbridge/parachain/primitives/core/src/pricing.rs +++ /dev/null @@ -1,67 +0,0 @@ -use codec::{Decode, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; -use sp_arithmetic::traits::{BaseArithmetic, Unsigned, Zero}; -use sp_core::U256; -use sp_runtime::{FixedU128, RuntimeDebug}; -use sp_std::prelude::*; - -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)] -pub struct PricingParameters { - /// ETH/DOT exchange rate - pub exchange_rate: FixedU128, - /// Relayer rewards - pub rewards: Rewards, - /// Ether (wei) fee per gas unit - pub fee_per_gas: U256, -} - -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)] -pub struct Rewards { - /// Local reward in DOT - pub local: Balance, - /// Remote reward in ETH (wei) - pub remote: U256, -} - -#[derive(RuntimeDebug)] -pub struct InvalidPricingParameters; - -impl PricingParameters -where - Balance: BaseArithmetic + Unsigned + Copy, -{ - pub fn validate(&self) -> Result<(), InvalidPricingParameters> { - if self.exchange_rate == FixedU128::zero() { - return Err(InvalidPricingParameters) - } - if self.fee_per_gas == U256::zero() { - return Err(InvalidPricingParameters) - } - if self.rewards.local.is_zero() { - return Err(InvalidPricingParameters) - } - if self.rewards.remote.is_zero() { - return Err(InvalidPricingParameters) - } - Ok(()) - } -} - -/// Holder for fixed point number implemented in -#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] -#[cfg_attr(feature = "std", derive(PartialEq))] -pub struct UD60x18(U256); - -impl From for UD60x18 { - fn from(value: FixedU128) -> Self { - // Both FixedU128 and UD60x18 have 18 decimal places - let inner: u128 = value.into_inner(); - UD60x18(inner.into()) - } -} - -impl UD60x18 { - pub fn into_inner(self) -> U256 { - self.0 - } -} diff --git a/snowbridge/parachain/primitives/core/src/ringbuffer.rs b/snowbridge/parachain/primitives/core/src/ringbuffer.rs deleted file mode 100644 index dcee20359a7..00000000000 --- a/snowbridge/parachain/primitives/core/src/ringbuffer.rs +++ /dev/null @@ -1,76 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use codec::FullCodec; -use core::{cmp::Ord, marker::PhantomData, ops::Add}; -use frame_support::storage::{types::QueryKindTrait, StorageMap, StorageValue}; -use sp_core::{Get, GetDefault}; -use sp_runtime::traits::{One, Zero}; - -/// Trait object presenting the ringbuffer interface. -pub trait RingBufferMap -where - Key: FullCodec, - Value: FullCodec, - QueryKind: QueryKindTrait, -{ - /// Insert a map entry. - fn insert(k: Key, v: Value); - - /// Check if map contains a key - fn contains_key(k: Key) -> bool; - - /// Get the value of the key - fn get(k: Key) -> QueryKind::Query; -} - -pub struct RingBufferMapImpl( - PhantomData<(Index, B, CurrentIndex, Intermediate, M, QueryKind)>, -); - -/// Ringbuffer implementation based on `RingBufferTransient` -impl - RingBufferMap - for RingBufferMapImpl -where - Key: FullCodec + Clone, - Value: FullCodec, - Index: Ord + One + Zero + Add + Copy + FullCodec + Eq, - B: Get, - CurrentIndex: StorageValue, - Intermediate: StorageMap, - M: StorageMap, - QueryKind: QueryKindTrait, -{ - /// Insert a map entry. - fn insert(k: Key, v: Value) { - let bound = B::get(); - let mut current_index = CurrentIndex::get(); - - // Adding one here as bound denotes number of items but our index starts with zero. - if (current_index + Index::one()) >= bound { - current_index = Index::zero(); - } else { - current_index = current_index + Index::one(); - } - - // Deleting earlier entry if it exists - if Intermediate::contains_key(current_index) { - let older_key = Intermediate::get(current_index); - M::remove(older_key); - } - - Intermediate::insert(current_index, k.clone()); - CurrentIndex::set(current_index); - M::insert(k, v); - } - - /// Check if map contains a key - fn contains_key(k: Key) -> bool { - M::contains_key(k) - } - - /// Get the value associated with key - fn get(k: Key) -> M::Query { - M::get(k) - } -} diff --git a/snowbridge/parachain/primitives/core/src/tests.rs b/snowbridge/parachain/primitives/core/src/tests.rs deleted file mode 100644 index 725fff1a9c9..00000000000 --- a/snowbridge/parachain/primitives/core/src/tests.rs +++ /dev/null @@ -1,13 +0,0 @@ -use crate::{ChannelId, ParaId}; -use hex_literal::hex; - -const EXPECT_CHANNEL_ID: [u8; 32] = - hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539"); - -// The Solidity equivalent code is tested in Gateway.t.sol:testDeriveChannelID -#[test] -fn generate_channel_id() { - let para_id: ParaId = 1000.into(); - let channel_id: ChannelId = para_id.into(); - assert_eq!(channel_id, EXPECT_CHANNEL_ID.into()); -} diff --git a/snowbridge/parachain/primitives/core/tests/fixtures/packet.scale b/snowbridge/parachain/primitives/core/tests/fixtures/packet.scale deleted file mode 100644 index d5f6696ea69fffd243e7b5b8eb5cef9a7943802c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 386 zcmey$@{`eO3a|PGwn>f$OiR<|zm;Bl`pg~PD;FOw$X>r+c>lSjPtL_$Twtw|kh$jl zS?;w<-}_0i&Ng4rqdapbBLjuNfq?!6$nxj^t@@rJ)2R`gdVXI+cf(Vr%+%t(^(>-d z?ZwGzC;u(1Q~eXvo@h4tq|k&po77ghPx+MPfvlelHWvXs+^mce@x_gJwk~)F6RXwch5{*^j}NN-C3"] -edition.workspace = true -repository.workspace = true -license = "Apache-2.0" -categories = ["cryptography::cryptocurrencies"] - -[lints] -workspace = true - -[dependencies] -serde = { version = "1.0.195", optional = true, features = ["derive"] } -serde-big-array = { version = "0.3.2", optional = true, features = ["const-generics"] } -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 } -hex-literal = { version = "0.4.1", default-features = false } -parity-bytes = { version = "0.1.2", default-features = false } -rlp = { version = "0.5.2", default-features = false } - -sp-io = { path = "../../../../../substrate/primitives/io", default-features = false } -sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } -sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } -sp-runtime = { path = "../../../../../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_json = "1.0.111" - -[features] -default = ["std"] -expensive_tests = [] -std = [ - "codec/std", - "ethabi/std", - "ethbloom/std", - "ethereum-types/std", - "hex/std", - "parity-bytes/std", - "rlp/std", - "scale-info/std", - "serde", - "serde-big-array", - "sp-core/std", - "sp-io/std", - "sp-runtime/std", - "sp-std/std", -] diff --git a/snowbridge/parachain/primitives/ethereum/README.md b/snowbridge/parachain/primitives/ethereum/README.md deleted file mode 100644 index c295aad9040..00000000000 --- a/snowbridge/parachain/primitives/ethereum/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Ethereum Primitives - -Contains code necessary to decode RLP encoded data (like the Ethereum log), structs for Ethereum execution headers. The -code in this crate relates to the Ethereum execution chain. diff --git a/snowbridge/parachain/primitives/ethereum/src/header.rs b/snowbridge/parachain/primitives/ethereum/src/header.rs deleted file mode 100644 index f0b51f8c79d..00000000000 --- a/snowbridge/parachain/primitives/ethereum/src/header.rs +++ /dev/null @@ -1,414 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use codec::{Decode, Encode}; -use ethbloom::Bloom as EthBloom; -use hex_literal::hex; -use parity_bytes::Bytes; -use rlp::RlpStream; -use scale_info::TypeInfo; -use sp_io::hashing::keccak_256; -use sp_runtime::RuntimeDebug; -use sp_std::{convert::TryInto, prelude::*}; - -#[cfg(feature = "std")] -use serde::{Deserialize, Serialize}; - -#[cfg(feature = "std")] -use serde_big_array::BigArray; - -use ethereum_types::{Address, H256, H64, U256}; - -use crate::{mpt, receipt}; - -/// Complete block header id. -#[derive(Clone, Copy, Default, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] -pub struct HeaderId { - /// Header number. - pub number: u64, - /// Header hash. - pub hash: H256, -} - -const EMPTY_OMMERS_HASH: [u8; 32] = - hex!("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"); - -/// An Ethereum block header. -#[derive(Clone, Default, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub struct Header { - /// Parent block hash. - pub parent_hash: H256, - /// Block timestamp. - pub timestamp: u64, - /// Block number. - pub number: u64, - /// Block author. - pub author: Address, - - /// Transactions root. - pub transactions_root: H256, - /// Block ommers hash. - pub ommers_hash: H256, - /// Block extra data. - pub extra_data: Bytes, - - /// State root. - pub state_root: H256, - /// Block receipts root. - pub receipts_root: H256, - /// Block bloom. - pub logs_bloom: Bloom, - /// Gas used for contracts execution. - pub gas_used: U256, - /// Block gas limit. - pub gas_limit: U256, - - /// Block difficulty. - pub difficulty: U256, - /// Vector of post-RLP-encoded fields. - pub seal: Vec, - - // Base fee per gas (EIP-1559), only in headers from the London hardfork onwards. - pub base_fee: Option, -} - -impl Header { - /// Compute hash of this header (keccak of the RLP with seal). - pub fn compute_hash(&self) -> H256 { - keccak_256(&self.rlp(true)).into() - } - - /// Compute hash of the truncated header i.e. excluding seal. - pub fn compute_partial_hash(&self) -> H256 { - keccak_256(&self.rlp(false)).into() - } - - pub fn check_receipt_proof( - &self, - proof: &[Vec], - ) -> Option> { - match self.apply_merkle_proof(proof) { - Some((root, data)) if root == self.receipts_root => Some(rlp::decode(&data)), - Some((_, _)) => None, - None => None, - } - } - - pub fn apply_merkle_proof(&self, proof: &[Vec]) -> Option<(H256, Vec)> { - let mut iter = proof.iter().rev(); - let first_bytes = match iter.next() { - Some(b) => b, - None => return None, - }; - let item_to_prove: mpt::ShortNode = rlp::decode(first_bytes).ok()?; - - let final_hash: Option<[u8; 32]> = iter.try_fold(keccak_256(first_bytes), |acc, x| { - let node: Box = x.as_slice().try_into().ok()?; - if (*node).contains_hash(acc.into()) { - return Some(keccak_256(x)) - } - None - }); - - final_hash.map(|hash| (hash.into(), item_to_prove.value)) - } - - pub fn mix_hash(&self) -> Option { - let bytes: Bytes = self.decoded_seal_field(0, 32)?; - let size = bytes.len(); - let mut mix_hash = [0u8; 32]; - for i in 0..size { - mix_hash[31 - i] = bytes[size - 1 - i]; - } - Some(mix_hash.into()) - } - - pub fn nonce(&self) -> Option { - let bytes: Bytes = self.decoded_seal_field(1, 8)?; - let size = bytes.len(); - let mut nonce = [0u8; 8]; - for i in 0..size { - nonce[7 - i] = bytes[size - 1 - i]; - } - Some(nonce.into()) - } - - pub fn has_ommers(&self) -> bool { - self.ommers_hash != EMPTY_OMMERS_HASH.into() - } - - fn decoded_seal_field(&self, index: usize, max_len: usize) -> Option { - let bytes: Bytes = rlp::decode(self.seal.get(index)?).ok()?; - if bytes.len() > max_len { - return None - } - Some(bytes) - } - - /// Returns header RLP with or without seals. - /// For EIP-1559 baseFee addition refer to: - /// - fn rlp(&self, with_seal: bool) -> Bytes { - let mut s = RlpStream::new(); - - let stream_length_without_seal = if self.base_fee.is_some() { 14 } else { 13 }; - - if with_seal { - s.begin_list(stream_length_without_seal + self.seal.len()); - } else { - s.begin_list(stream_length_without_seal); - } - - s.append(&self.parent_hash); - s.append(&self.ommers_hash); - s.append(&self.author); - s.append(&self.state_root); - s.append(&self.transactions_root); - s.append(&self.receipts_root); - s.append(&EthBloom::from(self.logs_bloom.0)); - s.append(&self.difficulty); - s.append(&self.number); - s.append(&self.gas_limit); - s.append(&self.gas_used); - s.append(&self.timestamp); - s.append(&self.extra_data); - - if with_seal { - for b in &self.seal { - s.append_raw(b, 1); - } - } - - if let Some(base_fee) = self.base_fee { - s.append(&base_fee); - } - - s.out().to_vec() - } -} - -/// Logs bloom. -#[derive(Clone, Debug, Encode, Decode, TypeInfo)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub struct Bloom(#[cfg_attr(feature = "std", serde(with = "BigArray"))] [u8; 256]); - -impl<'a> From<&'a [u8; 256]> for Bloom { - fn from(buffer: &'a [u8; 256]) -> Bloom { - Bloom(*buffer) - } -} - -impl PartialEq for Bloom { - fn eq(&self, other: &Bloom) -> bool { - self.0.iter().zip(other.0.iter()).all(|(l, r)| l == r) - } -} - -impl Default for Bloom { - fn default() -> Self { - Bloom([0; 256]) - } -} - -impl rlp::Decodable for Bloom { - fn decode(rlp: &rlp::Rlp) -> Result { - let v: Vec = rlp.as_val()?; - match v.len() { - 256 => { - let mut bytes = [0u8; 256]; - bytes.copy_from_slice(&v); - Ok(Self(bytes)) - }, - _ => Err(rlp::DecoderError::Custom("Expected 256 bytes")), - } - } -} - -#[cfg(test)] -mod tests { - - use super::*; - - #[test] - fn bloom_decode_rlp() { - let raw_bloom = hex!( - " - b901000420000000000000000000008002000000000001000000000001000000000000000000 - 0000000000000000000000000002000000080000000000000000200000000000000000000000 - 0000080000002200000000004000100000000000000000000000000000000000000000000000 - 0000000000000004000000001000010000000000080000000000400000000000000000000000 - 0000080000004000000000020000000000020000000000000000000000000000000000000000 - 0000040000000000020000000001000000000000000000000000000010000000020000200000 - 10200000000000010000000000000000000000000000000000000010000000 - " - ); - let expected_bytes = &raw_bloom[3..]; - let bloom: Bloom = rlp::decode(&raw_bloom).unwrap(); - assert_eq!(bloom.0, expected_bytes); - } - - #[test] - fn header_compute_hash_poa() { - // PoA header - let header = Header { - parent_hash: Default::default(), - timestamp: 0, - number: 0, - author: Default::default(), - transactions_root: hex!( - "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" - ) - .into(), - ommers_hash: hex!("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347") - .into(), - extra_data: vec![], - state_root: hex!("eccf6b74c2bcbe115c71116a23fe963c54406010c244d9650526028ad3e32cce") - .into(), - receipts_root: hex!("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421") - .into(), - logs_bloom: Default::default(), - gas_used: Default::default(), - gas_limit: 0x222222.into(), - difficulty: 0x20000.into(), - seal: vec![vec![0x80], { - let mut vec = vec![0xb8, 0x41]; - vec.resize(67, 0); - vec - }], - base_fee: None, - }; - assert_eq!( - header.compute_hash().as_bytes(), - hex!("9ff57c7fa155853586382022f0982b71c51fa313a0942f8c456300896643e890"), - ); - } - - #[test] - fn header_compute_hash_pow() { - // - let nonce = hex!("6935bbe7b63c4f8e").to_vec(); - let mix_hash = - hex!("be3adfb0087be62b28b716e2cdf3c79329df5caa04c9eee035d35b5d52102815").to_vec(); - let header = Header { - parent_hash: hex!("bede0bddd6f32c895fc505ffe0c39d9bde58e9a5272f31a3dee448b796edcbe3") - .into(), - timestamp: 1603160977, - number: 11090290, - author: hex!("ea674fdde714fd979de3edf0f56aa9716b898ec8").into(), - transactions_root: hex!( - "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" - ) - .into(), - ommers_hash: hex!("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347") - .into(), - extra_data: hex!("65746865726d696e652d61736961312d33").to_vec(), - state_root: hex!("7dcb8aca872b712bad81df34a89d4efedc293566ffc3eeeb5cbcafcc703e42c9") - .into(), - receipts_root: hex!("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421") - .into(), - logs_bloom: Default::default(), - gas_used: 0.into(), - gas_limit: 0xbe8c19.into(), - difficulty: 0xbc140caa61087i64.into(), - seal: vec![rlp::encode(&mix_hash).to_vec(), rlp::encode(&nonce).to_vec()], - base_fee: None, - }; - assert_eq!( - header.compute_hash().as_bytes(), - hex!("0f9bdc91c2e0140acb873330742bda8c8181fa3add91fe7ae046251679cedef7"), - ); - } - - #[test] - fn header_pow_seal_fields_extracted_correctly() { - let nonce: H64 = hex!("6935bbe7b63c4f8e").into(); - let mix_hash: H256 = - hex!("be3adfb0087be62b28b716e2cdf3c79329df5caa04c9eee035d35b5d52102815").into(); - let header = Header { - seal: vec![ - rlp::encode(&mix_hash.0.to_vec()).to_vec(), - rlp::encode(&nonce.0.to_vec()).to_vec(), - ], - ..Default::default() - }; - - assert_eq!(header.nonce().unwrap(), nonce); - assert_eq!(header.mix_hash().unwrap(), mix_hash); - } - - #[test] - fn header_pow_seal_fields_return_none_for_invalid_values() { - let nonce = hex!("696935bbe7b63c4f8e").to_vec(); - let mix_hash = - hex!("bebe3adfb0087be62b28b716e2cdf3c79329df5caa04c9eee035d35b5d52102815").to_vec(); - let mut header = Header { - seal: vec![rlp::encode(&mix_hash).to_vec(), rlp::encode(&nonce).to_vec()], - ..Default::default() - }; - assert_eq!(header.nonce(), None); - assert_eq!(header.mix_hash(), None); - - header.seal = Vec::new(); - assert_eq!(header.nonce(), None); - assert_eq!(header.mix_hash(), None); - } - - #[test] - fn header_check_receipt_proof() { - let header = Header { - receipts_root: hex!("fd5e397a84884641f53c496804f24b5276cbb8c5c9cfc2342246be8e3ce5ad02") - .into(), - ..Default::default() - }; - - // Valid proof - let proof_receipt5 = vec!( - hex!("f90131a0b5ba404eb5a6a88e56579f4d37ef9813b5ad7f86f0823ff3b407ac5a6bb465eca0398ead2655e78e03c127ce22c5830e90f18b1601ec055f938336c084feb915a9a026d322c26e46c50942c1aabde50e36df5cde572aed650ce73ea3182c6e90a02ca00600a356135f4db1db0d9842264cdff2652676f881669e91e316c0b6dd783011a0837f1deb4075336da320388c1edfffc56c448a43f4a5ba031300d32a7b509fc5a01c3ac82fd65b4aba7f9afaf604d9c82ec7e2deb573a091ae235751bc5c0c288da05d454159d9071b0f68b6e0503d290f23ac7602c1db0c569dee4605d8f5298f09a00bbed10350ec954448df795f6fd46e3faefc800ede061b3840eedc6e2b07a74da0acb02d26a3650f2064c14a435fdf1f668d8655daf455ebdf671713a7c089b3898080808080808080").to_vec(), - hex!("f901f180a00046a08d4f0bdbdc6b31903086ce323182bce6725e7d9415f7ff91ee8f4820bda0e7cd26ad5f3d2771e4b5ab788e268a14a10209f94ee918eb6c829d21d3d11c1da00d4a56d9e9a6751874fd86c7e3cb1c6ad5a848da62751325f478978a00ea966ea064b81920c8f04a8a1e21f53a8280e739fbb7b00b2ab92493ca3f610b70e8ac85a0b1040ed4c55a73178b76abb16f946ce5bebd6b93ab873c83327df54047d12c27a0de6485e9ac58dc6e2b04b4bb38f562684f0b1a2ee586cc11079e7d9a9dc40b32a0d394f4d3532c3124a65fa36e69147e04fd20453a72ee9c50660f17e13ce9df48a066501003fc3e3478efd2803cd0eded6bbe9243ca01ba754d6327071ddbcbc649a0b2684e518f325fee39fc8ea81b68f3f5c785be00d087f3bed8857ae2ee8da26ea071060a5c52042e8d7ce21092f8ecf06053beb9a0b773a6f91a30c4220aa276b2a0fc22436632574ccf6043d0986dede27ea94c9ca9a3bb5ec03ce776a4ddef24a9a05a8a1d6698c4e7d8cc3a2506cb9b12ea9a079c9c7099bc919dc804033cc556e4a0170c468b0716fd36d161f0bf05875f15756a2976de92f9efe7716320509d79c9a0182f909a90cab169f3efb62387f9cccdd61440acc4deec42f68a4f7ca58075c7a055cf0e9202ac75689b76318f1171f3a44465eddc06aae0713bfb6b34fdd27b7980").to_vec(), - hex!("f904de20b904daf904d701830652f0b9010004200000000000000000000080020000000000010000000000010000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000000000008000000220000000000400010000000000000000000000000000000000000000000000000000000000000040000000010000100000000000800000000004000000000000000000000000000080000004000000000020000000000020000000000000000000000000000000000000000000004000000000002000000000100000000000000000000000000001000000002000020000010200000000000010000000000000000000000000000000000000010000000f903ccf89b9421130f34829b4c343142047a28ce96ec07814b15f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa00000000000000000000000007d843005c7433c16b27ff939cb37471541561ebda0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a000000000000000000000000000000000000000000000000000000005d09b7380f89b9421130f34829b4c343142047a28ce96ec07814b15f863a08c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a00000000000000000000000007d843005c7433c16b27ff939cb37471541561ebda00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da0ffffffffffffffffffffffffffffffffffffffffffffffffffffffcc840c6920f89b94c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da000000000000000000000000000000000000000000000000003e973b5a5d1078ef87994e9c1281aae66801fa35ec404d5f2aea393ff6988e1a01c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1b840000000000000000000000000000000000000000000000000000001f1420ad1d40000000000000000000000000000000000000000000000014ad400879d159a38f8fc94e9c1281aae66801fa35ec404d5f2aea393ff6988f863a0d78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488db88000000000000000000000000000000000000000000000000000000005d415f3320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e973b5a5d1078ef87a94c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f842a07fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da000000000000000000000000000000000000000000000000003e973b5a5d1078e").to_vec(), - ); - assert!(header.check_receipt_proof(&proof_receipt5).is_some()); - - // Various invalid proofs - let proof_empty: Vec> = vec![]; - let proof_missing_full_node = vec![proof_receipt5[0].clone(), proof_receipt5[2].clone()]; - let proof_missing_short_node1 = vec![proof_receipt5[0].clone(), proof_receipt5[1].clone()]; - let proof_missing_short_node2 = vec![proof_receipt5[0].clone()]; - let proof_invalid_encoding = vec![proof_receipt5[2][2..].to_vec()]; - let proof_no_full_node = vec![proof_receipt5[2].clone(), proof_receipt5[2].clone()]; - assert!(header.check_receipt_proof(&proof_empty).is_none()); - assert!(header.check_receipt_proof(&proof_missing_full_node).is_none()); - - assert_eq!( - header.check_receipt_proof(&proof_missing_short_node1), - Some(Err(rlp::DecoderError::Custom("Unsupported receipt type"))) - ); - - assert_eq!( - header.check_receipt_proof(&proof_missing_short_node2), - Some(Err(rlp::DecoderError::Custom("Unsupported receipt type"))) - ); - - assert!(header.check_receipt_proof(&proof_invalid_encoding).is_none()); - assert!(header.check_receipt_proof(&proof_no_full_node).is_none()); - } - - #[test] - fn header_check_receipt_proof_with_intermediate_short_node() { - let header = Header { - receipts_root: hex!("d128e3a57142d2bf15bc0cbcac7ad54f40750d571b5c3097e425882c10c9ba66") - .into(), - ..Default::default() - }; - - let proof_receipt263 = vec![ - hex!("f90131a00d3cb8d3f57ac1c0e12918a2ebe0cafed8c273577b9dd73e7ed1079b403ef494a0678b9835b834f8a287c0dd33a8fca9146e456ca688555ed4ec1361a2180b778da0fe42da181a46677a043b3d9d4b8bb05a6a17b7b5c010c17e7c1d31cfb7c4f911a0c89f0e2c53241cdb578e1f2b4caf6ba36e00500bdc57fecd66b84a6a58394c19a086c3c1fae5a0575940b5d38e111c469d07883106c26856f3ef608469a2081f13a06c5992ff00aab6226a70a032fd2f571ba22f797321f45e2daa73020d638d21b0a050861e9503ef68728f6c90a44f7fe1bceb2a9bdab6957bbe7136166bd849561ea006aa6eaca8a07e57176e9aa41e6a09edfb7678d1a112404e0ec779d7e567e82ea0bb0b430d303ba21b0af11c487b8a218bd75db54c98940b3f11bad8ff47cad3ef8080808080808080").to_vec(), - hex!("f871a0246de222036ee6a03329b0105da0a6b3f916fc95a9ed5a403a581a0c4d74242ca0ac108a49a88b57a05ac34a108b39f1e45f6f167f2b9fbc8d52fb58e2e5a6af1ea0fcfe07ac2ccd3c28b6eab68d1bce112f6f6dbd9023e4ec3c05b96615aa803d798080808080808080808080808080").to_vec(), - hex!("e4820001a04fff54398cad4d05ea6abfd8b0f3b4fe14c04d7ff5f5211c5b927d9cf72ac1d8").to_vec(), - hex!("f851a096d010643ca2d47412ca66898286b5f2412963b9ec051b33e570d575914c9c5ca028cd24c652989542fe89479ec6388eac4592432242af5ba97563b3ac7c71c019808080808080808080808080808080").to_vec(), - hex!("f90211a0bb35a84c5b1dcb78ec9d32614912c696e62df77bebf9ab326ee55b5d3acdde46a01084b30dac8df0accfcd0fd6330b7f6fc72a4651246d0694be9162151686a620a03eed50afdce7909d784c6157c445a444c806b5f23d31f3b63786f600c84a95b2a0af5232f1df6c6d41879804d081abe867002abe26ba3e5f8e0254a83a54769831a0607915fb13dd5da594256389a45007a67a7f7a86e95d38d8462792b6c98a722ea00e1260fda1730f2738c650ce2bfba83857bc10f8fb119ebc4fb39acba24e6fbaa0d11de17e417327457812675ca3b84ae8e1b64827abfe01420953697c8313d5b1a05fcaf2f7a88f76336a0c32ffc78acb87ae2005454bd25d658035331be3173b46a03f94f4952ab9e650f83cfd0e7f367b1bcc493aacf39a06f16c4a2e1b5605da48a0bdb4ec79785ca8ae22d60f1bbd42d707b4d7ec4aff231a3ebab755e315b35053a043a67c3f2bcef37c8f47a673adcb7061007a553696d1092408601c11b2e6846aa0c519d5af48cae87c7f4538845417c9735813bee892a6fe2dda79f5c414e8576aa0f7058256e09589501d7c231d739e61c84a850e139690989d24fda6058b432e98a081a52faab520978cb19ce14400dba0cd5bcdc4e5a3c0740678aa8f97ee0e5c56a0bcecc61cadeae52518e3b68a48af4b11603dfd9d99d99d7985efa6d2de44f904a02cba4accfc6f39bc5adb6d4440eb6358b4a5103ef93298e4e694f1f940f8b48280").to_vec(), - hex!("f901ae20b901aaf901a70183bb444eb9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000001000000000000000000000000000100000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000010000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000002000000000000000000081000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000f89df89b94dac17f958d2ee523a2206206994597c13d831ec7f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa00000000000000000000000002e514404ff6823f1b46a8318a709251db414e5e1a000000000000000000000000055021c55847c00d764357a352e5803237d328954a0000000000000000000000000000000000000000000000000000000000201c370").to_vec(), - ]; - assert!(header.check_receipt_proof(&proof_receipt263).is_some()); - } -} diff --git a/snowbridge/parachain/primitives/ethereum/src/lib.rs b/snowbridge/parachain/primitives/ethereum/src/lib.rs deleted file mode 100644 index 1a10ea9abb7..00000000000 --- a/snowbridge/parachain/primitives/ethereum/src/lib.rs +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -#![cfg_attr(not(feature = "std"), no_std)] - -pub mod header; -pub mod log; -pub mod mpt; -pub mod receipt; - -pub use ethereum_types::{Address, H160, H256, H64, U256}; - -pub use header::{Bloom, Header, HeaderId}; -pub use log::Log; -pub use receipt::Receipt; - -#[derive(Debug)] -pub enum DecodeError { - // Unexpected RLP data - InvalidRLP(rlp::DecoderError), - // Data does not match expected ABI - InvalidABI(ethabi::Error), - // Invalid message payload - InvalidPayload, -} - -impl From for DecodeError { - fn from(err: rlp::DecoderError) -> Self { - DecodeError::InvalidRLP(err) - } -} - -impl From for DecodeError { - fn from(err: ethabi::Error) -> Self { - DecodeError::InvalidABI(err) - } -} diff --git a/snowbridge/parachain/primitives/ethereum/src/log.rs b/snowbridge/parachain/primitives/ethereum/src/log.rs deleted file mode 100644 index 7b8e35bb113..00000000000 --- a/snowbridge/parachain/primitives/ethereum/src/log.rs +++ /dev/null @@ -1,75 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use codec::{Decode, Encode}; -use ethereum_types::{H160, H256}; -use sp_std::prelude::*; - -#[derive(Clone, Debug, Encode, Decode, PartialEq, Eq)] -pub struct Log { - pub address: H160, - pub topics: Vec, - pub data: Vec, -} - -impl rlp::Decodable for Log { - /// We need to implement rlp::Decodable manually as the derive macro RlpDecodable - /// didn't seem to generate the correct code for parsing our logs. - fn decode(rlp: &rlp::Rlp) -> Result { - let mut iter = rlp.iter(); - - let address: H160 = match iter.next() { - Some(data) => data.as_val()?, - None => return Err(rlp::DecoderError::Custom("Expected log address")), - }; - - let topics: Vec = match iter.next() { - Some(data) => data.as_list()?, - None => return Err(rlp::DecoderError::Custom("Expected log topics")), - }; - - let data: Vec = match iter.next() { - Some(data) => data.data()?.to_vec(), - None => return Err(rlp::DecoderError::Custom("Expected log data")), - }; - - Ok(Self { address, topics, data }) - } -} - -#[cfg(test)] -mod tests { - - use super::Log; - use hex_literal::hex; - - const RAW_LOG: [u8; 605] = hex!( - " - f9025a941cfd66659d44cfe2e627c5742ba7477a3284cffae1a0266413be5700ce8dd5ac6b9a7dfb - abe99b3e45cae9a68ac2757858710b401a38b9022000000000000000000000000000000000000000 - 00000000000000000000000060000000000000000000000000000000000000000000000000000000 - 00000000c00000000000000000000000000000000000000000000000000000000000000100000000 - 00000000000000000000000000000000000000000000000000000000283163466436363635394434 - 34636665324536323763353734324261373437376133323834634666410000000000000000000000 - 00000000000000000000000000000000000000000000000000000000000000000000000000000000 - 000000000773656e6445544800000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000000000000001000000000000000000000000 - 00cffeaaf7681c89285d65cfbe808b80e50269657300000000000000000000000000000000000000 - 000000000000000000000000a0000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000000000000a000000 - 00000000000000000000000000000000000000000000000000000000020000000000000000000000 - 00000000000000000000000000000000000000002f3146524d4d3850456957585961783772705336 - 5834585a5831614141785357783143724b5479725659685632346667000000000000000000000000 - 0000000000 - " - ); - - #[test] - fn decode_log() { - let log: Log = rlp::decode(&RAW_LOG).unwrap(); - assert_eq!(log.address.as_bytes(), hex!["1cfd66659d44cfe2e627c5742ba7477a3284cffa"]); - assert_eq!( - log.topics[0].as_bytes(), - hex!["266413be5700ce8dd5ac6b9a7dfbabe99b3e45cae9a68ac2757858710b401a38"] - ); - } -} diff --git a/snowbridge/parachain/primitives/ethereum/src/mpt.rs b/snowbridge/parachain/primitives/ethereum/src/mpt.rs deleted file mode 100644 index 9a2dae486dc..00000000000 --- a/snowbridge/parachain/primitives/ethereum/src/mpt.rs +++ /dev/null @@ -1,142 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! Helper types to work with Ethereum's Merkle Patricia Trie nodes - -use ethereum_types::H256; -use sp_std::{convert::TryFrom, prelude::*}; - -pub trait Node { - fn contains_hash(&self, hash: H256) -> bool; -} - -impl TryFrom<&[u8]> for Box { - type Error = rlp::DecoderError; - - fn try_from(bytes: &[u8]) -> Result, Self::Error> { - let rlp = rlp::Rlp::new(bytes); - match rlp.item_count()? { - 2 => { - let node: ShortNode = rlp.as_val()?; - Ok(Box::new(node)) - }, - 17 => { - let node: FullNode = rlp.as_val()?; - Ok(Box::new(node)) - }, - _ => Err(rlp::DecoderError::Custom("Invalid number of list elements")), - } - } -} - -/// Intermediate trie node with children (refers to node with same name in Geth). -/// This struct only handles the proof representation, i.e. a child is either empty -/// or a 32-byte hash of its subtree. -pub struct FullNode { - pub children: Vec>, -} - -impl rlp::Decodable for FullNode { - fn decode(rlp: &rlp::Rlp) -> Result { - let children: Vec> = rlp - .iter() - .map(|item| { - let v: Vec = item.as_val()?; - match v.len() { - 0 => Ok(None), - 32 => { - let mut bytes = [0u8; 32]; - bytes.copy_from_slice(&v); - Ok(Some(bytes.into())) - }, - _ => Err(rlp::DecoderError::Custom("Expected 32-byte hash or empty child")), - } - }) - .collect::>()?; - - Ok(Self { children }) - } -} - -impl Node for FullNode { - fn contains_hash(&self, hash: H256) -> bool { - self.children.iter().any(|h| Some(hash) == *h) - } -} - -/// Trie node where `value` is either the RLP-encoded item we're -/// proving or an intermediate hash (refers to node with same name in Geth) -/// Proof verification should return `value`. `key` is an implementation -/// detail of the trie. -pub struct ShortNode { - pub key: Vec, - pub value: Vec, -} - -impl rlp::Decodable for ShortNode { - fn decode(rlp: &rlp::Rlp) -> Result { - let mut iter = rlp.iter(); - - let key: Vec = match iter.next() { - Some(data) => data.as_val()?, - None => return Err(rlp::DecoderError::Custom("Expected key bytes")), - }; - - let value: Vec = match iter.next() { - Some(data) => data.as_val()?, - None => return Err(rlp::DecoderError::Custom("Expected value bytes")), - }; - - Ok(Self { key, value }) - } -} - -impl Node for ShortNode { - fn contains_hash(&self, hash: H256) -> bool { - self.value == hash.0 - } -} - -#[cfg(test)] -mod tests { - - use super::*; - use hex_literal::hex; - - const RAW_PROOF: [&[u8]; 3] = [ - &hex!("f90131a0b5ba404eb5a6a88e56579f4d37ef9813b5ad7f86f0823ff3b407ac5a6bb465eca0398ead2655e78e03c127ce22c5830e90f18b1601ec055f938336c084feb915a9a026d322c26e46c50942c1aabde50e36df5cde572aed650ce73ea3182c6e90a02ca00600a356135f4db1db0d9842264cdff2652676f881669e91e316c0b6dd783011a0837f1deb4075336da320388c1edfffc56c448a43f4a5ba031300d32a7b509fc5a01c3ac82fd65b4aba7f9afaf604d9c82ec7e2deb573a091ae235751bc5c0c288da05d454159d9071b0f68b6e0503d290f23ac7602c1db0c569dee4605d8f5298f09a00bbed10350ec954448df795f6fd46e3faefc800ede061b3840eedc6e2b07a74da0acb02d26a3650f2064c14a435fdf1f668d8655daf455ebdf671713a7c089b3898080808080808080"), - &hex!("f901f180a00046a08d4f0bdbdc6b31903086ce323182bce6725e7d9415f7ff91ee8f4820bda0e7cd26ad5f3d2771e4b5ab788e268a14a10209f94ee918eb6c829d21d3d11c1da00d4a56d9e9a6751874fd86c7e3cb1c6ad5a848da62751325f478978a00ea966ea064b81920c8f04a8a1e21f53a8280e739fbb7b00b2ab92493ca3f610b70e8ac85a0b1040ed4c55a73178b76abb16f946ce5bebd6b93ab873c83327df54047d12c27a0de6485e9ac58dc6e2b04b4bb38f562684f0b1a2ee586cc11079e7d9a9dc40b32a0d394f4d3532c3124a65fa36e69147e04fd20453a72ee9c50660f17e13ce9df48a066501003fc3e3478efd2803cd0eded6bbe9243ca01ba754d6327071ddbcbc649a0b2684e518f325fee39fc8ea81b68f3f5c785be00d087f3bed8857ae2ee8da26ea071060a5c52042e8d7ce21092f8ecf06053beb9a0b773a6f91a30c4220aa276b2a0fc22436632574ccf6043d0986dede27ea94c9ca9a3bb5ec03ce776a4ddef24a9a05a8a1d6698c4e7d8cc3a2506cb9b12ea9a079c9c7099bc919dc804033cc556e4a0170c468b0716fd36d161f0bf05875f15756a2976de92f9efe7716320509d79c9a0182f909a90cab169f3efb62387f9cccdd61440acc4deec42f68a4f7ca58075c7a055cf0e9202ac75689b76318f1171f3a44465eddc06aae0713bfb6b34fdd27b7980"), - &hex!("f904de20b904daf904d701830652f0b9010004200000000000000000000080020000000000010000000000010000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000000000008000000220000000000400010000000000000000000000000000000000000000000000000000000000000040000000010000100000000000800000000004000000000000000000000000000080000004000000000020000000000020000000000000000000000000000000000000000000004000000000002000000000100000000000000000000000000001000000002000020000010200000000000010000000000000000000000000000000000000010000000f903ccf89b9421130f34829b4c343142047a28ce96ec07814b15f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa00000000000000000000000007d843005c7433c16b27ff939cb37471541561ebda0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a000000000000000000000000000000000000000000000000000000005d09b7380f89b9421130f34829b4c343142047a28ce96ec07814b15f863a08c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a00000000000000000000000007d843005c7433c16b27ff939cb37471541561ebda00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da0ffffffffffffffffffffffffffffffffffffffffffffffffffffffcc840c6920f89b94c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da000000000000000000000000000000000000000000000000003e973b5a5d1078ef87994e9c1281aae66801fa35ec404d5f2aea393ff6988e1a01c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1b840000000000000000000000000000000000000000000000000000001f1420ad1d40000000000000000000000000000000000000000000000014ad400879d159a38f8fc94e9c1281aae66801fa35ec404d5f2aea393ff6988f863a0d78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488db88000000000000000000000000000000000000000000000000000000005d415f3320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e973b5a5d1078ef87a94c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f842a07fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da000000000000000000000000000000000000000000000000003e973b5a5d1078e"), - ]; - - #[test] - fn decode_full_node() { - let node1: FullNode = rlp::decode(RAW_PROOF[0]).unwrap(); - let node2: FullNode = rlp::decode(RAW_PROOF[1]).unwrap(); - assert_eq!(node1.children.len(), 17); - assert_eq!(node2.children.len(), 17); - assert_eq!(node1.children.iter().filter(|c| c.is_none()).count(), 8); - assert_eq!(node2.children.iter().filter(|c| c.is_none()).count(), 2); - - let result: Result = rlp::decode(RAW_PROOF[2]); - assert!(result.is_err()); - } - - #[test] - fn decode_short_node() { - // key + item value - let node: ShortNode = rlp::decode(RAW_PROOF[2]).unwrap(); - assert_eq!(node.key, vec![32]); - assert!(!node.value.is_empty()); - - // key + item hash - let node: ShortNode = rlp::decode(&hex!( - "e4820001a04fff54398cad4d05ea6abfd8b0f3b4fe14c04d7ff5f5211c5b927d9cf72ac1d8" - )) - .unwrap(); - assert_eq!(node.key, vec![0, 1]); - assert_eq!( - node.value, - hex!("4fff54398cad4d05ea6abfd8b0f3b4fe14c04d7ff5f5211c5b927d9cf72ac1d8").to_vec() - ); - } -} diff --git a/snowbridge/parachain/primitives/ethereum/src/receipt.rs b/snowbridge/parachain/primitives/ethereum/src/receipt.rs deleted file mode 100644 index 665a93dbb1e..00000000000 --- a/snowbridge/parachain/primitives/ethereum/src/receipt.rs +++ /dev/null @@ -1,139 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -use crate::{Bloom, Log}; -use codec::{Decode, Encode}; -use sp_runtime::RuntimeDebug; -use sp_std::prelude::*; - -#[derive(Clone, Default, Encode, Decode, PartialEq, RuntimeDebug)] -pub struct Receipt { - pub post_state_or_status: Vec, - pub cumulative_gas_used: u64, - pub bloom: Bloom, - pub logs: Vec, -} - -impl Receipt { - pub fn contains_log(&self, log: &Log) -> bool { - self.logs.iter().any(|l| l == log) - } - - fn decode_list(rlp: &rlp::Rlp) -> Result { - let mut iter = rlp.iter(); - - let post_state_or_status: Vec = match iter.next() { - Some(data) => data.as_val()?, - None => return Err(rlp::DecoderError::Custom("Expected receipt post state or status")), - }; - - let cumulative_gas_used: u64 = match iter.next() { - Some(data) => data.as_val()?, - None => return Err(rlp::DecoderError::Custom("Expected receipt cumulative gas used")), - }; - - let bloom: Bloom = match iter.next() { - Some(data) => data.as_val()?, - None => return Err(rlp::DecoderError::Custom("Expected receipt bloom")), - }; - - let logs: Vec = match iter.next() { - Some(data) => data.as_list()?, - None => return Err(rlp::DecoderError::Custom("Expected receipt logs")), - }; - - Ok(Self { post_state_or_status, cumulative_gas_used, bloom, logs }) - } -} - -impl rlp::Decodable for Receipt { - fn decode(rlp: &rlp::Rlp) -> Result { - if rlp.is_data() { - // Typed receipt - let data = rlp.as_raw(); - match data[0] { - // 1 = EIP-2930, 2 = EIP-1559 - 1 | 2 => { - let receipt_rlp = &rlp::Rlp::new(&data[1..]); - if !receipt_rlp.is_list() { - return Err(rlp::DecoderError::RlpExpectedToBeList) - } - Self::decode_list(&rlp::Rlp::new(&data[1..])) - }, - _ => Err(rlp::DecoderError::Custom("Unsupported receipt type")), - } - } else if rlp.is_list() { - // Legacy receipt - Self::decode_list(rlp) - } else { - Err(rlp::DecoderError::RlpExpectedToBeList) - } - } -} - -#[cfg(test)] -mod tests { - - use super::Receipt; - use hex_literal::hex; - - const RAW_RECEIPT: [u8; 1242] = hex!( - " - f904d701830652f0b901000420000000000000000000008002000000000001000000000001000000 - 00000000000000000000000000000000000000020000000800000000000000002000000000000000 - 00000000000008000000220000000000400010000000000000000000000000000000000000000000 - 00000000000000000004000000001000010000000000080000000000400000000000000000000000 - 00000800000040000000000200000000000200000000000000000000000000000000000000000000 - 04000000000002000000000100000000000000000000000000001000000002000020000010200000 - 000000010000000000000000000000000000000000000010000000f903ccf89b9421130f34829b4c - 343142047a28ce96ec07814b15f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a116 - 28f55a4df523b3efa00000000000000000000000007d843005c7433c16b27ff939cb37471541561e - bda0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a00000000000 - 0000000000000000000000000000000000000000000005d09b7380f89b9421130f34829b4c343142 - 047a28ce96ec07814b15f863a08c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200a - c8c7c3b925a00000000000000000000000007d843005c7433c16b27ff939cb37471541561ebda000 - 00000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da0ffffffffffffffff - ffffffffffffffffffffffffffffffffffffffcc840c6920f89b94c02aaa39b223fe8d0a0e5c4f27 - ead9083c756cc2f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523 - b3efa0000000000000000000000000e9c1281aae66801fa35ec404d5f2aea393ff6988a000000000 - 00000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da00000000000000000000000 - 0000000000000000000000000003e973b5a5d1078ef87994e9c1281aae66801fa35ec404d5f2aea3 - 93ff6988e1a01c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1b840 - 000000000000000000000000000000000000000000000000000001f1420ad1d40000000000000000 - 000000000000000000000000000000014ad400879d159a38f8fc94e9c1281aae66801fa35ec404d5 - f2aea393ff6988f863a0d78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159 - d822a00000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488da000000000 - 00000000000000007a250d5630b4cf539739df2c5dacb4c659f2488db88000000000000000000000 - 000000000000000000000000000000000005d415f332000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000000000000000000003e973b5a5d1078ef87a - 94c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f842a07fcf532c15f0a6db0bd6d0e038bea71d - 30d808c7d98cb3bf7268a95bf5081b65a00000000000000000000000007a250d5630b4cf539739df - 2c5dacb4c659f2488da000000000000000000000000000000000000000000000000003e973b5a5d1 - 078e - " - ); - - #[test] - fn decode_legacy_receipt() { - let receipt: Receipt = rlp::decode(&RAW_RECEIPT).unwrap(); - assert_eq!(receipt.post_state_or_status, vec!(1)); - assert_eq!(receipt.cumulative_gas_used, 414448); - assert_eq!( - receipt.bloom, - (&hex!( - " - 042000000000000000000000800200000000000100000000000100000000000000000000 - 000000000000000000000000020000000800000000000000002000000000000000000000 - 000000080000002200000000004000100000000000000000000000000000000000000000 - 000000000000000000000400000000100001000000000008000000000040000000000000 - 000000000000000800000040000000000200000000000200000000000000000000000000 - 000000000000000000040000000000020000000001000000000000000000000000000010 - 000000020000200000102000000000000100000000000000000000000000000000000000 - 10000000 - " - )) - .into(), - ); - assert_eq!(receipt.logs.len(), 6); - } -} diff --git a/snowbridge/parachain/primitives/router/Cargo.toml b/snowbridge/parachain/primitives/router/Cargo.toml deleted file mode 100644 index 65133128ef4..00000000000 --- a/snowbridge/parachain/primitives/router/Cargo.toml +++ /dev/null @@ -1,66 +0,0 @@ -[package] -name = "snowbridge-router-primitives" -description = "Snowbridge Router Primitives" -version = "0.9.0" -authors = ["Snowfork "] -edition.workspace = true -repository.workspace = true -license = "Apache-2.0" -categories = ["cryptography::cryptocurrencies"] - -[lints] -workspace = true - -[dependencies] -serde = { version = "1.0.195", 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 = "../../../../../substrate/frame/support", default-features = false } -frame-system = { path = "../../../../../substrate/frame/system", default-features = false } -sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } -sp-io = { path = "../../../../../substrate/primitives/io", default-features = false } -sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } -sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } - -xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } -xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false } -xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false } - -snowbridge-core = { path = "../../primitives/core", default-features = false } - -ethabi = { git = "https://github.com/Snowfork/ethabi-decode.git", package = "ethabi-decode", branch = "master", default-features = false } - -hex-literal = { version = "0.4.1" } - -[dev-dependencies] -hex = { package = "rustc-hex", version = "2.1.0" } - -[features] -default = ["std"] -std = [ - "codec/std", - "ethabi/std", - "frame-support/std", - "frame-system/std", - "log/std", - "scale-info/std", - "serde", - "snowbridge-core/std", - "sp-core/std", - "sp-io/std", - "sp-runtime/std", - "sp-std/std", - "xcm-builder/std", - "xcm-executor/std", - "xcm/std", -] -runtime-benchmarks = [ - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "snowbridge-core/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", - "xcm-executor/runtime-benchmarks", -] diff --git a/snowbridge/parachain/primitives/router/README.md b/snowbridge/parachain/primitives/router/README.md deleted file mode 100644 index 45967cbf76c..00000000000 --- a/snowbridge/parachain/primitives/router/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Router Primitives - -Inbound and outbound router logic. Does XCM conversion to a lowered, simpler format the Ethereum contracts can -understand. diff --git a/snowbridge/parachain/primitives/router/src/inbound/mod.rs b/snowbridge/parachain/primitives/router/src/inbound/mod.rs deleted file mode 100644 index c20554c6d18..00000000000 --- a/snowbridge/parachain/primitives/router/src/inbound/mod.rs +++ /dev/null @@ -1,312 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! Converts messages from Ethereum to XCM messages - -#[cfg(test)] -mod tests; - -use codec::{Decode, Encode}; -use core::marker::PhantomData; -use frame_support::{traits::tokens::Balance as BalanceT, weights::Weight, PalletError}; -use scale_info::TypeInfo; -use sp_core::{Get, RuntimeDebug, H160}; -use sp_io::hashing::blake2_256; -use sp_runtime::MultiAddress; -use sp_std::prelude::*; -use xcm::prelude::{Junction::AccountKey20, *}; -use xcm_executor::traits::ConvertLocation; - -const MINIMUM_DEPOSIT: u128 = 1; - -/// Messages from Ethereum are versioned. This is because in future, -/// we may want to evolve the protocol so that the ethereum side sends XCM messages directly. -/// Instead having BridgeHub transcode the messages into XCM. -#[derive(Clone, Encode, Decode, RuntimeDebug)] -pub enum VersionedMessage { - V1(MessageV1), -} - -/// For V1, the ethereum side sends messages which are transcoded into XCM. These messages are -/// self-contained, in that they can be transcoded using only information in the message. -#[derive(Clone, Encode, Decode, RuntimeDebug)] -pub struct MessageV1 { - /// EIP-155 chain id of the origin Ethereum network - pub chain_id: u64, - /// The command originating from the Gateway contract - pub command: Command, -} - -#[derive(Clone, Encode, Decode, RuntimeDebug)] -pub enum Command { - /// Register a wrapped token on the AssetHub `ForeignAssets` pallet - RegisterToken { - /// The address of the ERC20 token to be bridged over to AssetHub - token: H160, - /// XCM execution fee on AssetHub - fee: u128, - }, - /// Send a token to AssetHub or another parachain - SendToken { - /// The address of the ERC20 token to be bridged over to AssetHub - token: H160, - /// The destination for the transfer - destination: Destination, - /// Amount to transfer - amount: u128, - /// XCM execution fee on AssetHub - fee: u128, - }, -} - -/// Destination for bridged tokens -#[derive(Clone, Encode, Decode, RuntimeDebug)] -pub enum Destination { - /// The funds will be deposited into account `id` on AssetHub - AccountId32 { id: [u8; 32] }, - /// The funds will deposited into the sovereign account of destination parachain `para_id` on - /// AssetHub, Account `id` on the destination parachain will receive the funds via a - /// reserve-backed transfer. See - ForeignAccountId32 { - para_id: u32, - id: [u8; 32], - /// XCM execution fee on final destination - fee: u128, - }, - /// The funds will deposited into the sovereign account of destination parachain `para_id` on - /// AssetHub, Account `id` on the destination parachain will receive the funds via a - /// reserve-backed transfer. See - ForeignAccountId20 { - para_id: u32, - id: [u8; 20], - /// XCM execution fee on final destination - fee: u128, - }, -} - -pub struct MessageToXcm< - CreateAssetCall, - CreateAssetDeposit, - InboundQueuePalletInstance, - AccountId, - Balance, -> where - CreateAssetCall: Get, - CreateAssetDeposit: Get, - Balance: BalanceT, -{ - _phantom: PhantomData<( - CreateAssetCall, - CreateAssetDeposit, - InboundQueuePalletInstance, - AccountId, - Balance, - )>, -} - -/// Reason why a message conversion failed. -#[derive(Copy, Clone, TypeInfo, PalletError, Encode, Decode, RuntimeDebug)] -pub enum ConvertMessageError { - /// The message version is not supported for conversion. - UnsupportedVersion, -} - -/// convert the inbound message to xcm which will be forwarded to the destination chain -pub trait ConvertMessage { - type Balance: BalanceT + From; - type AccountId; - /// Converts a versioned message into an XCM message and an optional topicID - fn convert(message: VersionedMessage) -> Result<(Xcm<()>, Self::Balance), ConvertMessageError>; -} - -pub type CallIndex = [u8; 2]; - -impl - ConvertMessage - for MessageToXcm< - CreateAssetCall, - CreateAssetDeposit, - InboundQueuePalletInstance, - AccountId, - Balance, - > where - CreateAssetCall: Get, - CreateAssetDeposit: Get, - InboundQueuePalletInstance: Get, - Balance: BalanceT + From, - AccountId: Into<[u8; 32]>, -{ - type Balance = Balance; - type AccountId = AccountId; - - fn convert(message: VersionedMessage) -> Result<(Xcm<()>, Self::Balance), ConvertMessageError> { - use Command::*; - use VersionedMessage::*; - match message { - V1(MessageV1 { chain_id, command: RegisterToken { token, fee } }) => - Ok(Self::convert_register_token(chain_id, token, fee)), - V1(MessageV1 { chain_id, command: SendToken { token, destination, amount, fee } }) => - Ok(Self::convert_send_token(chain_id, token, destination, amount, fee)), - } - } -} - -impl - MessageToXcm -where - CreateAssetCall: Get, - CreateAssetDeposit: Get, - InboundQueuePalletInstance: Get, - Balance: BalanceT + From, - AccountId: Into<[u8; 32]>, -{ - fn convert_register_token(chain_id: u64, token: H160, fee: u128) -> (Xcm<()>, Balance) { - let network = Ethereum { chain_id }; - let xcm_fee: Asset = (Location::parent(), fee).into(); - let deposit: Asset = (Location::parent(), CreateAssetDeposit::get()).into(); - - let total_amount = fee + CreateAssetDeposit::get(); - let total: Asset = (Location::parent(), total_amount).into(); - - let bridge_location: Location = (Parent, Parent, GlobalConsensus(network)).into(); - - let owner = GlobalConsensusEthereumConvertsFor::<[u8; 32]>::from_chain_id(&chain_id); - let asset_id = Self::convert_token_address(network, token); - let create_call_index: [u8; 2] = CreateAssetCall::get(); - let inbound_queue_pallet_index = InboundQueuePalletInstance::get(); - - let xcm: Xcm<()> = vec![ - // Teleport required fees. - ReceiveTeleportedAsset(total.into()), - // Pay for execution. - BuyExecution { fees: xcm_fee, weight_limit: Unlimited }, - // Fund the snowbridge sovereign with the required deposit for creation. - DepositAsset { assets: Definite(deposit.into()), beneficiary: bridge_location }, - // Only our inbound-queue pallet is allowed to invoke `UniversalOrigin` - DescendOrigin(PalletInstance(inbound_queue_pallet_index).into()), - // Change origin to the bridge. - UniversalOrigin(GlobalConsensus(network)), - // Call create_asset on foreign assets pallet. - Transact { - origin_kind: OriginKind::Xcm, - require_weight_at_most: Weight::from_parts(400_000_000, 8_000), - call: ( - create_call_index, - asset_id, - MultiAddress::<[u8; 32], ()>::Id(owner), - MINIMUM_DEPOSIT, - ) - .encode() - .into(), - }, - RefundSurplus, - // Clear the origin so that remaining assets in holding - // are claimable by the physical origin (BridgeHub) - ClearOrigin, - ] - .into(); - - (xcm, total_amount.into()) - } - - fn convert_send_token( - chain_id: u64, - token: H160, - destination: Destination, - amount: u128, - asset_hub_fee: u128, - ) -> (Xcm<()>, Balance) { - let network = Ethereum { chain_id }; - let asset_hub_fee_asset: Asset = (Location::parent(), asset_hub_fee).into(); - let asset: Asset = (Self::convert_token_address(network, token), amount).into(); - - let (dest_para_id, beneficiary, dest_para_fee) = match destination { - // Final destination is a 32-byte account on AssetHub - Destination::AccountId32 { id } => - (None, Location::new(0, [AccountId32 { network: None, id }]), 0), - // Final destination is a 32-byte account on a sibling of AssetHub - Destination::ForeignAccountId32 { para_id, id, fee } => ( - Some(para_id), - Location::new(0, [AccountId32 { network: None, id }]), - // Total fee needs to cover execution on AssetHub and Sibling - fee, - ), - // Final destination is a 20-byte account on a sibling of AssetHub - Destination::ForeignAccountId20 { para_id, id, fee } => ( - Some(para_id), - Location::new(0, [AccountKey20 { network: None, key: id }]), - // Total fee needs to cover execution on AssetHub and Sibling - fee, - ), - }; - - let total_fees = asset_hub_fee.saturating_add(dest_para_fee); - let total_fee_asset: Asset = (Location::parent(), total_fees).into(); - let inbound_queue_pallet_index = InboundQueuePalletInstance::get(); - - let mut instructions = vec![ - ReceiveTeleportedAsset(total_fee_asset.into()), - BuyExecution { fees: asset_hub_fee_asset, weight_limit: Unlimited }, - DescendOrigin(PalletInstance(inbound_queue_pallet_index).into()), - UniversalOrigin(GlobalConsensus(network)), - ReserveAssetDeposited(asset.clone().into()), - ClearOrigin, - ]; - - match dest_para_id { - Some(dest_para_id) => { - let dest_para_fee_asset: Asset = (Location::parent(), dest_para_fee).into(); - - instructions.extend(vec![ - // Perform a deposit reserve to send to destination chain. - DepositReserveAsset { - assets: Definite(vec![dest_para_fee_asset.clone(), asset.clone()].into()), - dest: Location::new(1, [Parachain(dest_para_id)]), - xcm: vec![ - // Buy execution on target. - BuyExecution { fees: dest_para_fee_asset, weight_limit: Unlimited }, - // Deposit asset to beneficiary. - DepositAsset { assets: Definite(asset.into()), beneficiary }, - ] - .into(), - }, - ]); - }, - None => { - instructions.extend(vec![ - // Deposit asset to beneficiary. - DepositAsset { assets: Definite(asset.into()), beneficiary }, - ]); - }, - } - - (instructions.into(), total_fees.into()) - } - - // Convert ERC20 token address to a location that can be understood by Assets Hub. - fn convert_token_address(network: NetworkId, token: H160) -> Location { - Location::new( - 2, - [GlobalConsensus(network), AccountKey20 { network: None, key: token.into() }], - ) - } -} - -pub struct GlobalConsensusEthereumConvertsFor(PhantomData); -impl ConvertLocation for GlobalConsensusEthereumConvertsFor -where - AccountId: From<[u8; 32]> + Clone, -{ - fn convert_location(location: &Location) -> Option { - match location.unpack() { - (_, [GlobalConsensus(Ethereum { chain_id })]) => - Some(Self::from_chain_id(chain_id).into()), - _ => None, - } - } -} - -impl GlobalConsensusEthereumConvertsFor { - pub fn from_chain_id(chain_id: &u64) -> [u8; 32] { - (b"ethereum-chain", chain_id).using_encoded(blake2_256) - } -} diff --git a/snowbridge/parachain/primitives/router/src/inbound/tests.rs b/snowbridge/parachain/primitives/router/src/inbound/tests.rs deleted file mode 100644 index c46b88a84a4..00000000000 --- a/snowbridge/parachain/primitives/router/src/inbound/tests.rs +++ /dev/null @@ -1,40 +0,0 @@ -use super::GlobalConsensusEthereumConvertsFor; -use crate::inbound::CallIndex; -use frame_support::parameter_types; -use hex_literal::hex; -use xcm::v4::prelude::*; -use xcm_executor::traits::ConvertLocation; - -const NETWORK: NetworkId = Ethereum { chain_id: 11155111 }; - -parameter_types! { - pub EthereumNetwork: NetworkId = NETWORK; - - pub const CreateAssetCall: CallIndex = [1, 1]; - pub const CreateAssetExecutionFee: u128 = 123; - pub const CreateAssetDeposit: u128 = 891; - pub const SendTokenExecutionFee: u128 = 592; -} - -#[test] -fn test_contract_location_with_network_converts_successfully() { - let expected_account: [u8; 32] = - hex!("ce796ae65569a670d0c1cc1ac12515a3ce21b5fbf729d63d7b289baad070139d"); - let contract_location = Location::new(2, [GlobalConsensus(NETWORK)]); - - let account = - GlobalConsensusEthereumConvertsFor::<[u8; 32]>::convert_location(&contract_location) - .unwrap(); - - assert_eq!(account, expected_account); -} - -#[test] -fn test_contract_location_with_incorrect_location_fails_convert() { - let contract_location = Location::new(2, [GlobalConsensus(Polkadot), Parachain(1000)]); - - assert_eq!( - GlobalConsensusEthereumConvertsFor::<[u8; 32]>::convert_location(&contract_location), - None, - ); -} diff --git a/snowbridge/parachain/primitives/router/src/lib.rs b/snowbridge/parachain/primitives/router/src/lib.rs deleted file mode 100644 index d9031c69b22..00000000000 --- a/snowbridge/parachain/primitives/router/src/lib.rs +++ /dev/null @@ -1,6 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -#![cfg_attr(not(feature = "std"), no_std)] - -pub mod inbound; -pub mod outbound; diff --git a/snowbridge/parachain/primitives/router/src/outbound/mod.rs b/snowbridge/parachain/primitives/router/src/outbound/mod.rs deleted file mode 100644 index 21823992db7..00000000000 --- a/snowbridge/parachain/primitives/router/src/outbound/mod.rs +++ /dev/null @@ -1,283 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! Converts XCM messages into simpler commands that can be processed by the Gateway contract - -#[cfg(test)] -mod tests; - -use core::slice::Iter; - -use codec::{Decode, Encode}; - -use frame_support::{ensure, traits::Get}; -use snowbridge_core::{ - outbound::{AgentExecuteCommand, Command, Message, SendMessage}, - ChannelId, ParaId, -}; -use sp_core::{H160, H256}; -use sp_std::{iter::Peekable, marker::PhantomData, prelude::*}; -use xcm::v4::prelude::*; -use xcm_executor::traits::{ConvertLocation, ExportXcm}; - -pub struct EthereumBlobExporter< - UniversalLocation, - EthereumNetwork, - OutboundQueue, - AgentHashedDescription, ->(PhantomData<(UniversalLocation, EthereumNetwork, OutboundQueue, AgentHashedDescription)>); - -impl ExportXcm - for EthereumBlobExporter -where - UniversalLocation: Get, - EthereumNetwork: Get, - OutboundQueue: SendMessage, - AgentHashedDescription: ConvertLocation, -{ - type Ticket = (Vec, XcmHash); - - fn validate( - network: NetworkId, - _channel: u32, - universal_source: &mut Option, - destination: &mut Option, - message: &mut Option>, - ) -> SendResult { - let expected_network = EthereumNetwork::get(); - let universal_location = UniversalLocation::get(); - - if network != expected_network { - log::trace!(target: "xcm::ethereum_blob_exporter", "skipped due to unmatched bridge network {network:?}."); - return Err(SendError::NotApplicable) - } - - let dest = destination.take().ok_or(SendError::MissingArgument)?; - if dest != Here { - log::trace!(target: "xcm::ethereum_blob_exporter", "skipped due to unmatched remote destination {dest:?}."); - return Err(SendError::NotApplicable) - } - - let (local_net, local_sub) = universal_source - .take() - .ok_or_else(|| { - log::error!(target: "xcm::ethereum_blob_exporter", "universal source not provided."); - SendError::MissingArgument - })? - .split_global() - .map_err(|()| { - log::error!(target: "xcm::ethereum_blob_exporter", "could not get global consensus from universal source '{universal_source:?}'."); - SendError::Unroutable - })?; - - if Ok(local_net) != universal_location.global_consensus() { - log::trace!(target: "xcm::ethereum_blob_exporter", "skipped due to unmatched relay network {local_net:?}."); - return Err(SendError::NotApplicable) - } - - let para_id = match local_sub.as_slice() { - [Parachain(para_id)] => *para_id, - _ => { - log::error!(target: "xcm::ethereum_blob_exporter", "could not get parachain id from universal source '{local_sub:?}'."); - return Err(SendError::MissingArgument) - }, - }; - - let message = message.take().ok_or_else(|| { - log::error!(target: "xcm::ethereum_blob_exporter", "xcm message not provided."); - SendError::MissingArgument - })?; - - let mut converter = XcmConverter::new(&message, &expected_network); - let (agent_execute_command, message_id) = converter.convert().map_err(|err|{ - log::error!(target: "xcm::ethereum_blob_exporter", "unroutable due to pattern matching error '{err:?}'."); - SendError::Unroutable - })?; - - let source_location = Location::new(1, local_sub.clone()); - let agent_id = match AgentHashedDescription::convert_location(&source_location) { - Some(id) => id, - None => { - log::error!(target: "xcm::ethereum_blob_exporter", "unroutable due to not being able to create agent id. '{source_location:?}'"); - return Err(SendError::Unroutable) - }, - }; - - let channel_id: ChannelId = ParaId::from(para_id).into(); - - let outbound_message = Message { - id: Some(message_id.into()), - channel_id, - command: Command::AgentExecute { agent_id, command: agent_execute_command }, - }; - - // validate the message - let (ticket, fee) = OutboundQueue::validate(&outbound_message).map_err(|err| { - log::error!(target: "xcm::ethereum_blob_exporter", "OutboundQueue validation of message failed. {err:?}"); - SendError::Unroutable - })?; - - // convert fee to Asset - let fee = Asset::from((Location::parent(), fee.total())).into(); - - Ok(((ticket.encode(), message_id), fee)) - } - - fn deliver(blob: (Vec, XcmHash)) -> Result { - let ticket: OutboundQueue::Ticket = OutboundQueue::Ticket::decode(&mut blob.0.as_ref()) - .map_err(|_| { - log::trace!(target: "xcm::ethereum_blob_exporter", "undeliverable due to decoding error"); - SendError::NotApplicable - })?; - - let message_id = OutboundQueue::deliver(ticket).map_err(|_| { - log::error!(target: "xcm::ethereum_blob_exporter", "OutboundQueue submit of message failed"); - SendError::Transport("other transport error") - })?; - - log::info!(target: "xcm::ethereum_blob_exporter", "message delivered {message_id:#?}."); - Ok(message_id.into()) - } -} - -/// Errors that can be thrown to the pattern matching step. -#[derive(PartialEq, Debug)] -enum XcmConverterError { - UnexpectedEndOfXcm, - EndOfXcmMessageExpected, - WithdrawAssetExpected, - DepositAssetExpected, - NoReserveAssets, - FilterDoesNotConsumeAllAssets, - TooManyAssets, - ZeroAssetTransfer, - BeneficiaryResolutionFailed, - AssetResolutionFailed, - InvalidFeeAsset, - SetTopicExpected, -} - -macro_rules! match_expression { - ($expression:expr, $(|)? $( $pattern:pat_param )|+ $( if $guard: expr )?, $value:expr $(,)?) => { - match $expression { - $( $pattern )|+ $( if $guard )? => Some($value), - _ => None, - } - }; -} - -struct XcmConverter<'a, Call> { - iter: Peekable>>, - ethereum_network: &'a NetworkId, -} -impl<'a, Call> XcmConverter<'a, Call> { - fn new(message: &'a Xcm, ethereum_network: &'a NetworkId) -> Self { - Self { iter: message.inner().iter().peekable(), ethereum_network } - } - - fn convert(&mut self) -> Result<(AgentExecuteCommand, [u8; 32]), XcmConverterError> { - // Get withdraw/deposit and make native tokens create message. - let result = self.native_tokens_unlock_message()?; - - // All xcm instructions must be consumed before exit. - if self.next().is_ok() { - return Err(XcmConverterError::EndOfXcmMessageExpected) - } - - Ok(result) - } - - fn native_tokens_unlock_message( - &mut self, - ) -> Result<(AgentExecuteCommand, [u8; 32]), XcmConverterError> { - use XcmConverterError::*; - - // Get the reserve assets from WithdrawAsset. - let reserve_assets = - match_expression!(self.next()?, WithdrawAsset(reserve_assets), reserve_assets) - .ok_or(WithdrawAssetExpected)?; - - // Check if clear origin exists and skip over it. - if match_expression!(self.peek(), Ok(ClearOrigin), ()).is_some() { - let _ = self.next(); - } - - // Get the fee asset item from BuyExecution or continue parsing. - let fee_asset = match_expression!(self.peek(), Ok(BuyExecution { fees, .. }), fees); - if fee_asset.is_some() { - let _ = self.next(); - } - - let (deposit_assets, beneficiary) = match_expression!( - self.next()?, - DepositAsset { assets, beneficiary }, - (assets, beneficiary) - ) - .ok_or(DepositAssetExpected)?; - - // assert that the beneficiary is AccountKey20. - let recipient = match_expression!( - beneficiary.unpack(), - (0, [AccountKey20 { network, key }]) - if self.network_matches(network), - H160(*key) - ) - .ok_or(BeneficiaryResolutionFailed)?; - - // Make sure there are reserved assets. - if reserve_assets.len() == 0 { - return Err(NoReserveAssets) - } - - // Check the the deposit asset filter matches what was reserved. - if reserve_assets.inner().iter().any(|asset| !deposit_assets.matches(asset)) { - return Err(FilterDoesNotConsumeAllAssets) - } - - // We only support a single asset at a time. - ensure!(reserve_assets.len() == 1, TooManyAssets); - let reserve_asset = reserve_assets.get(0).ok_or(AssetResolutionFailed)?; - - // If there was a fee specified verify it. - if let Some(fee_asset) = fee_asset { - // The fee asset must be the same as the reserve asset. - if fee_asset.id != reserve_asset.id || fee_asset.fun > reserve_asset.fun { - return Err(InvalidFeeAsset) - } - } - - let (token, amount) = match reserve_asset { - Asset { id: AssetId(inner_location), fun: Fungible(amount) } => - match inner_location.unpack() { - (0, [AccountKey20 { network, key }]) if self.network_matches(network) => - Some((H160(*key), *amount)), - _ => None, - }, - _ => None, - } - .ok_or(AssetResolutionFailed)?; - - // transfer amount must be greater than 0. - ensure!(amount > 0, ZeroAssetTransfer); - - // Check if there is a SetTopic and skip over it if found. - let topic_id = match_expression!(self.next()?, SetTopic(id), id).ok_or(SetTopicExpected)?; - - Ok((AgentExecuteCommand::TransferToken { token, recipient, amount }, *topic_id)) - } - - fn next(&mut self) -> Result<&'a Instruction, XcmConverterError> { - self.iter.next().ok_or(XcmConverterError::UnexpectedEndOfXcm) - } - - fn peek(&mut self) -> Result<&&'a Instruction, XcmConverterError> { - self.iter.peek().ok_or(XcmConverterError::UnexpectedEndOfXcm) - } - - fn network_matches(&self, network: &Option) -> bool { - if let Some(network) = network { - network == self.ethereum_network - } else { - true - } - } -} diff --git a/snowbridge/parachain/primitives/router/src/outbound/tests.rs b/snowbridge/parachain/primitives/router/src/outbound/tests.rs deleted file mode 100644 index 111243bb45a..00000000000 --- a/snowbridge/parachain/primitives/router/src/outbound/tests.rs +++ /dev/null @@ -1,1058 +0,0 @@ -use frame_support::parameter_types; -use hex_literal::hex; -use snowbridge_core::{ - outbound::{Fee, SendError, SendMessageFeeProvider}, - AgentIdOf, -}; -use xcm::v3::prelude::SendError as XcmSendError; - -use super::*; - -parameter_types! { - const MaxMessageSize: u32 = u32::MAX; - const RelayNetwork: NetworkId = Polkadot; - UniversalLocation: InteriorLocation = [GlobalConsensus(RelayNetwork::get()), Parachain(1013)].into(); - const BridgedNetwork: NetworkId = Ethereum{ chain_id: 1 }; - const NonBridgedNetwork: NetworkId = Ethereum{ chain_id: 2 }; -} - -struct MockOkOutboundQueue; -impl SendMessage for MockOkOutboundQueue { - type Ticket = (); - - fn validate(_: &Message) -> Result<(Self::Ticket, Fee), SendError> { - Ok(((), Fee { local: 1, remote: 1 })) - } - - fn deliver(_: Self::Ticket) -> Result { - Ok(H256::zero()) - } -} - -impl SendMessageFeeProvider for MockOkOutboundQueue { - type Balance = u128; - - fn local_fee() -> Self::Balance { - 1 - } -} -struct MockErrOutboundQueue; -impl SendMessage for MockErrOutboundQueue { - type Ticket = (); - - fn validate(_: &Message) -> Result<(Self::Ticket, Fee), SendError> { - Err(SendError::MessageTooLarge) - } - - fn deliver(_: Self::Ticket) -> Result { - Err(SendError::MessageTooLarge) - } -} - -impl SendMessageFeeProvider for MockErrOutboundQueue { - type Balance = u128; - - fn local_fee() -> Self::Balance { - 1 - } -} - -#[test] -fn exporter_validate_with_unknown_network_yields_not_applicable() { - let network = Ethereum { chain_id: 1337 }; - let channel: u32 = 0; - let mut universal_source: Option = None; - let mut destination: Option = None; - let mut message: Option> = None; - - let result = EthereumBlobExporter::< - UniversalLocation, - BridgedNetwork, - MockOkOutboundQueue, - AgentIdOf, - >::validate( - network, channel, &mut universal_source, &mut destination, &mut message - ); - assert_eq!(result, Err(XcmSendError::NotApplicable)); -} - -#[test] -fn exporter_validate_with_invalid_destination_yields_missing_argument() { - let network = BridgedNetwork::get(); - let channel: u32 = 0; - let mut universal_source: Option = None; - let mut destination: Option = None; - let mut message: Option> = None; - - let result = EthereumBlobExporter::< - UniversalLocation, - BridgedNetwork, - MockOkOutboundQueue, - AgentIdOf, - >::validate( - network, channel, &mut universal_source, &mut destination, &mut message - ); - assert_eq!(result, Err(XcmSendError::MissingArgument)); -} - -#[test] -fn exporter_validate_with_x8_destination_yields_not_applicable() { - let network = BridgedNetwork::get(); - let channel: u32 = 0; - let mut universal_source: Option = None; - let mut destination: Option = Some( - [OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild, OnlyChild] - .into(), - ); - let mut message: Option> = None; - - let result = EthereumBlobExporter::< - UniversalLocation, - BridgedNetwork, - MockOkOutboundQueue, - AgentIdOf, - >::validate( - network, channel, &mut universal_source, &mut destination, &mut message - ); - assert_eq!(result, Err(XcmSendError::NotApplicable)); -} - -#[test] -fn exporter_validate_without_universal_source_yields_missing_argument() { - let network = BridgedNetwork::get(); - let channel: u32 = 0; - let mut universal_source: Option = None; - let mut destination: Option = Here.into(); - let mut message: Option> = None; - - let result = EthereumBlobExporter::< - UniversalLocation, - BridgedNetwork, - MockOkOutboundQueue, - AgentIdOf, - >::validate( - network, channel, &mut universal_source, &mut destination, &mut message - ); - assert_eq!(result, Err(XcmSendError::MissingArgument)); -} - -#[test] -fn exporter_validate_without_global_universal_location_yields_unroutable() { - let network = BridgedNetwork::get(); - let channel: u32 = 0; - let mut universal_source: Option = Here.into(); - let mut destination: Option = Here.into(); - let mut message: Option> = None; - - let result = EthereumBlobExporter::< - UniversalLocation, - BridgedNetwork, - MockOkOutboundQueue, - AgentIdOf, - >::validate( - network, channel, &mut universal_source, &mut destination, &mut message - ); - assert_eq!(result, Err(XcmSendError::Unroutable)); -} - -#[test] -fn exporter_validate_without_global_bridge_location_yields_not_applicable() { - let network = NonBridgedNetwork::get(); - let channel: u32 = 0; - let mut universal_source: Option = Here.into(); - let mut destination: Option = Here.into(); - let mut message: Option> = None; - - let result = EthereumBlobExporter::< - UniversalLocation, - BridgedNetwork, - MockOkOutboundQueue, - AgentIdOf, - >::validate( - network, channel, &mut universal_source, &mut destination, &mut message - ); - assert_eq!(result, Err(XcmSendError::NotApplicable)); -} - -#[test] -fn exporter_validate_with_remote_universal_source_yields_not_applicable() { - let network = BridgedNetwork::get(); - let channel: u32 = 0; - let mut universal_source: Option = - Some([GlobalConsensus(Kusama), Parachain(1000)].into()); - let mut destination: Option = Here.into(); - let mut message: Option> = None; - - let result = EthereumBlobExporter::< - UniversalLocation, - BridgedNetwork, - MockOkOutboundQueue, - AgentIdOf, - >::validate( - network, channel, &mut universal_source, &mut destination, &mut message - ); - assert_eq!(result, Err(XcmSendError::NotApplicable)); -} - -#[test] -fn exporter_validate_without_para_id_in_source_yields_missing_argument() { - let network = BridgedNetwork::get(); - let channel: u32 = 0; - let mut universal_source: Option = Some(GlobalConsensus(Polkadot).into()); - let mut destination: Option = Here.into(); - let mut message: Option> = None; - - let result = EthereumBlobExporter::< - UniversalLocation, - BridgedNetwork, - MockOkOutboundQueue, - AgentIdOf, - >::validate( - network, channel, &mut universal_source, &mut destination, &mut message - ); - assert_eq!(result, Err(XcmSendError::MissingArgument)); -} - -#[test] -fn exporter_validate_complex_para_id_in_source_yields_missing_argument() { - let network = BridgedNetwork::get(); - let channel: u32 = 0; - let mut universal_source: Option = - Some([GlobalConsensus(Polkadot), Parachain(1000), PalletInstance(12)].into()); - let mut destination: Option = Here.into(); - let mut message: Option> = None; - - let result = EthereumBlobExporter::< - UniversalLocation, - BridgedNetwork, - MockOkOutboundQueue, - AgentIdOf, - >::validate( - network, channel, &mut universal_source, &mut destination, &mut message - ); - assert_eq!(result, Err(XcmSendError::MissingArgument)); -} - -#[test] -fn exporter_validate_without_xcm_message_yields_missing_argument() { - let network = BridgedNetwork::get(); - let channel: u32 = 0; - let mut universal_source: Option = - Some([GlobalConsensus(Polkadot), Parachain(1000)].into()); - let mut destination: Option = Here.into(); - let mut message: Option> = None; - - let result = EthereumBlobExporter::< - UniversalLocation, - BridgedNetwork, - MockOkOutboundQueue, - AgentIdOf, - >::validate( - network, channel, &mut universal_source, &mut destination, &mut message - ); - assert_eq!(result, Err(XcmSendError::MissingArgument)); -} - -#[test] -fn exporter_validate_with_max_target_fee_yields_unroutable() { - let network = BridgedNetwork::get(); - let mut destination: Option = Here.into(); - - let mut universal_source: Option = - Some([GlobalConsensus(Polkadot), Parachain(1000)].into()); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let channel: u32 = 0; - let fee = Asset { id: AssetId(Here.into()), fun: Fungible(1000) }; - let fees: Assets = vec![fee.clone()].into(); - let assets: Assets = vec![Asset { - id: AssetId(AccountKey20 { network: None, key: token_address }.into()), - fun: Fungible(1000), - }] - .into(); - let filter: AssetFilter = assets.clone().into(); - - let mut message: Option> = Some( - vec![ - WithdrawAsset(fees), - BuyExecution { fees: fee, weight_limit: Unlimited }, - WithdrawAsset(assets), - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: Some(network), key: beneficiary_address } - .into(), - }, - SetTopic([0; 32]), - ] - .into(), - ); - - let result = EthereumBlobExporter::< - UniversalLocation, - BridgedNetwork, - MockOkOutboundQueue, - AgentIdOf, - >::validate( - network, channel, &mut universal_source, &mut destination, &mut message - ); - - assert_eq!(result, Err(XcmSendError::Unroutable)); -} - -#[test] -fn exporter_validate_with_unparsable_xcm_yields_unroutable() { - let network = BridgedNetwork::get(); - let mut destination: Option = Here.into(); - - let mut universal_source: Option = - Some([GlobalConsensus(Polkadot), Parachain(1000)].into()); - - let channel: u32 = 0; - let fee = Asset { id: AssetId(Here.into()), fun: Fungible(1000) }; - let fees: Assets = vec![fee.clone()].into(); - - let mut message: Option> = - Some(vec![WithdrawAsset(fees), BuyExecution { fees: fee, weight_limit: Unlimited }].into()); - - let result = EthereumBlobExporter::< - UniversalLocation, - BridgedNetwork, - MockOkOutboundQueue, - AgentIdOf, - >::validate( - network, channel, &mut universal_source, &mut destination, &mut message - ); - - assert_eq!(result, Err(XcmSendError::Unroutable)); -} - -#[test] -fn exporter_validate_xcm_success_case_1() { - let network = BridgedNetwork::get(); - let mut destination: Option = Here.into(); - - let mut universal_source: Option = - Some([GlobalConsensus(Polkadot), Parachain(1000)].into()); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let channel: u32 = 0; - let assets: Assets = vec![Asset { - id: AssetId([AccountKey20 { network: None, key: token_address }].into()), - fun: Fungible(1000), - }] - .into(); - let fee = assets.clone().get(0).unwrap().clone(); - let filter: AssetFilter = assets.clone().into(); - - let mut message: Option> = Some( - vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: fee, weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ] - .into(), - ); - - let result = EthereumBlobExporter::< - UniversalLocation, - BridgedNetwork, - MockOkOutboundQueue, - AgentIdOf, - >::validate( - network, channel, &mut universal_source, &mut destination, &mut message - ); - - assert!(result.is_ok()); -} - -#[test] -fn exporter_deliver_with_submit_failure_yields_unroutable() { - let result = EthereumBlobExporter::< - UniversalLocation, - BridgedNetwork, - MockErrOutboundQueue, - AgentIdOf, - >::deliver((hex!("deadbeef").to_vec(), XcmHash::default())); - assert_eq!(result, Err(XcmSendError::Transport("other transport error"))) -} - -#[test] -fn xcm_converter_convert_success() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let assets: Assets = vec![Asset { - id: AssetId([AccountKey20 { network: None, key: token_address }].into()), - fun: Fungible(1000), - }] - .into(); - let filter: AssetFilter = assets.clone().into(); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - let expected_payload = AgentExecuteCommand::TransferToken { - token: token_address.into(), - recipient: beneficiary_address.into(), - amount: 1000, - }; - let result = converter.convert(); - assert_eq!(result, Ok((expected_payload, [0; 32]))); -} - -#[test] -fn xcm_converter_convert_without_buy_execution_yields_success() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let assets: Assets = vec![Asset { - id: AssetId([AccountKey20 { network: None, key: token_address }].into()), - fun: Fungible(1000), - }] - .into(); - let filter: AssetFilter = assets.clone().into(); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - let expected_payload = AgentExecuteCommand::TransferToken { - token: token_address.into(), - recipient: beneficiary_address.into(), - amount: 1000, - }; - let result = converter.convert(); - assert_eq!(result, Ok((expected_payload, [0; 32]))); -} - -#[test] -fn xcm_converter_convert_with_wildcard_all_asset_filter_succeeds() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let assets: Assets = vec![Asset { - id: AssetId([AccountKey20 { network: None, key: token_address }].into()), - fun: Fungible(1000), - }] - .into(); - let filter: AssetFilter = Wild(All); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - let expected_payload = AgentExecuteCommand::TransferToken { - token: token_address.into(), - recipient: beneficiary_address.into(), - amount: 1000, - }; - let result = converter.convert(); - assert_eq!(result, Ok((expected_payload, [0; 32]))); -} - -#[test] -fn xcm_converter_convert_with_fees_less_than_reserve_yields_success() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let asset_location: Location = [AccountKey20 { network: None, key: token_address }].into(); - let fee_asset = Asset { id: AssetId(asset_location.clone()), fun: Fungible(500) }; - - let assets: Assets = vec![Asset { id: AssetId(asset_location), fun: Fungible(1000) }].into(); - - let filter: AssetFilter = assets.clone().into(); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: fee_asset, weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - let expected_payload = AgentExecuteCommand::TransferToken { - token: token_address.into(), - recipient: beneficiary_address.into(), - amount: 1000, - }; - let result = converter.convert(); - assert_eq!(result, Ok((expected_payload, [0; 32]))); -} - -#[test] -fn xcm_converter_convert_without_set_topic_yields_set_topic_expected() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let assets: Assets = vec![Asset { - id: AssetId([AccountKey20 { network: None, key: token_address }].into()), - fun: Fungible(1000), - }] - .into(); - let filter: AssetFilter = assets.clone().into(); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - ClearTopic, - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::SetTopicExpected)); -} - -#[test] -fn xcm_converter_convert_with_partial_message_yields_unexpected_end_of_xcm() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let assets: Assets = vec![Asset { - id: AssetId([AccountKey20 { network: None, key: token_address }].into()), - fun: Fungible(1000), - }] - .into(); - let message: Xcm<()> = vec![WithdrawAsset(assets)].into(); - - let mut converter = XcmConverter::new(&message, &network); - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::UnexpectedEndOfXcm)); -} - -#[test] -fn xcm_converter_with_different_fee_asset_fails() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let asset_location = [AccountKey20 { network: None, key: token_address }].into(); - let fee_asset = - Asset { id: AssetId(Location { parents: 0, interior: Here }), fun: Fungible(1000) }; - - let assets: Assets = vec![Asset { id: AssetId(asset_location), fun: Fungible(1000) }].into(); - - let filter: AssetFilter = assets.clone().into(); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: fee_asset, weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::InvalidFeeAsset)); -} - -#[test] -fn xcm_converter_with_fees_greater_than_reserve_fails() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let asset_location: Location = [AccountKey20 { network: None, key: token_address }].into(); - let fee_asset = Asset { id: AssetId(asset_location.clone()), fun: Fungible(1001) }; - - let assets: Assets = vec![Asset { id: AssetId(asset_location), fun: Fungible(1000) }].into(); - - let filter: AssetFilter = assets.clone().into(); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: fee_asset, weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::InvalidFeeAsset)); -} - -#[test] -fn xcm_converter_convert_with_empty_xcm_yields_unexpected_end_of_xcm() { - let network = BridgedNetwork::get(); - - let message: Xcm<()> = vec![].into(); - - let mut converter = XcmConverter::new(&message, &network); - - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::UnexpectedEndOfXcm)); -} - -#[test] -fn xcm_converter_convert_with_extra_instructions_yields_end_of_xcm_message_expected() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let assets: Assets = vec![Asset { - id: AssetId([AccountKey20 { network: None, key: token_address }].into()), - fun: Fungible(1000), - }] - .into(); - let filter: AssetFilter = assets.clone().into(); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ClearError, - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::EndOfXcmMessageExpected)); -} - -#[test] -fn xcm_converter_convert_without_withdraw_asset_yields_withdraw_expected() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let assets: Assets = vec![Asset { - id: AssetId([AccountKey20 { network: None, key: token_address }].into()), - fun: Fungible(1000), - }] - .into(); - let filter: AssetFilter = assets.clone().into(); - - let message: Xcm<()> = vec![ - ClearOrigin, - BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::WithdrawAssetExpected)); -} - -#[test] -fn xcm_converter_convert_without_withdraw_asset_yields_deposit_expected() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - - let assets: Assets = vec![Asset { - id: AssetId(AccountKey20 { network: None, key: token_address }.into()), - fun: Fungible(1000), - }] - .into(); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::DepositAssetExpected)); -} - -#[test] -fn xcm_converter_convert_without_assets_yields_no_reserve_assets() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let assets: Assets = vec![].into(); - let filter: AssetFilter = assets.clone().into(); - - let fee = Asset { - id: AssetId(AccountKey20 { network: None, key: token_address }.into()), - fun: Fungible(1000), - }; - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: fee, weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::NoReserveAssets)); -} - -#[test] -fn xcm_converter_convert_with_two_assets_yields_too_many_assets() { - let network = BridgedNetwork::get(); - - let token_address_1: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let token_address_2: [u8; 20] = hex!("1100000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let assets: Assets = vec![ - Asset { - id: AssetId(AccountKey20 { network: None, key: token_address_1 }.into()), - fun: Fungible(1000), - }, - Asset { - id: AssetId(AccountKey20 { network: None, key: token_address_2 }.into()), - fun: Fungible(500), - }, - ] - .into(); - let filter: AssetFilter = assets.clone().into(); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::TooManyAssets)); -} - -#[test] -fn xcm_converter_convert_without_consuming_filter_yields_filter_does_not_consume_all_assets() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let assets: Assets = vec![Asset { - id: AssetId(AccountKey20 { network: None, key: token_address }.into()), - fun: Fungible(1000), - }] - .into(); - let filter: AssetFilter = Wild(WildAsset::AllCounted(0)); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::FilterDoesNotConsumeAllAssets)); -} - -#[test] -fn xcm_converter_convert_with_zero_amount_asset_yields_zero_asset_transfer() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let assets: Assets = vec![Asset { - id: AssetId(AccountKey20 { network: None, key: token_address }.into()), - fun: Fungible(0), - }] - .into(); - let filter: AssetFilter = Wild(WildAsset::AllCounted(1)); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::ZeroAssetTransfer)); -} - -#[test] -fn xcm_converter_convert_non_ethereum_asset_yields_asset_resolution_failed() { - let network = BridgedNetwork::get(); - - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let assets: Assets = vec![Asset { - id: AssetId([GlobalConsensus(Polkadot), Parachain(1000), GeneralIndex(0)].into()), - fun: Fungible(1000), - }] - .into(); - let filter: AssetFilter = Wild(WildAsset::AllCounted(1)); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::AssetResolutionFailed)); -} - -#[test] -fn xcm_converter_convert_non_ethereum_chain_asset_yields_asset_resolution_failed() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let assets: Assets = vec![Asset { - id: AssetId( - AccountKey20 { network: Some(Ethereum { chain_id: 2 }), key: token_address }.into(), - ), - fun: Fungible(1000), - }] - .into(); - let filter: AssetFilter = Wild(WildAsset::AllCounted(1)); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::AssetResolutionFailed)); -} - -#[test] -fn xcm_converter_convert_non_ethereum_chain_yields_asset_resolution_failed() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let assets: Assets = vec![Asset { - id: AssetId( - [AccountKey20 { network: Some(NonBridgedNetwork::get()), key: token_address }].into(), - ), - fun: Fungible(1000), - }] - .into(); - let filter: AssetFilter = Wild(WildAsset::AllCounted(1)); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { network: None, key: beneficiary_address }.into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::AssetResolutionFailed)); -} - -#[test] -fn xcm_converter_convert_with_non_ethereum_beneficiary_yields_beneficiary_resolution_failed() { - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - - let beneficiary_address: [u8; 32] = - hex!("2000000000000000000000000000000000000000000000000000000000000000"); - - let assets: Assets = vec![Asset { - id: AssetId(AccountKey20 { network: None, key: token_address }.into()), - fun: Fungible(1000), - }] - .into(); - let filter: AssetFilter = Wild(WildAsset::AllCounted(1)); - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: [ - GlobalConsensus(Polkadot), - Parachain(1000), - AccountId32 { network: Some(Polkadot), id: beneficiary_address }, - ] - .into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::BeneficiaryResolutionFailed)); -} - -#[test] -fn xcm_converter_convert_with_non_ethereum_chain_beneficiary_yields_beneficiary_resolution_failed() -{ - let network = BridgedNetwork::get(); - - let token_address: [u8; 20] = hex!("1000000000000000000000000000000000000000"); - let beneficiary_address: [u8; 20] = hex!("2000000000000000000000000000000000000000"); - - let assets: Assets = vec![Asset { - id: AssetId(AccountKey20 { network: None, key: token_address }.into()), - fun: Fungible(1000), - }] - .into(); - let filter: AssetFilter = Wild(WildAsset::AllCounted(1)); - - let message: Xcm<()> = vec![ - WithdrawAsset(assets.clone()), - ClearOrigin, - BuyExecution { fees: assets.get(0).unwrap().clone(), weight_limit: Unlimited }, - DepositAsset { - assets: filter, - beneficiary: AccountKey20 { - network: Some(Ethereum { chain_id: 2 }), - key: beneficiary_address, - } - .into(), - }, - SetTopic([0; 32]), - ] - .into(); - let mut converter = XcmConverter::new(&message, &network); - - let result = converter.convert(); - assert_eq!(result.err(), Some(XcmConverterError::BeneficiaryResolutionFailed)); -} - -#[test] -fn test_describe_asset_hub() { - let legacy_location: Location = Location::new(0, [Parachain(1000)]); - let legacy_agent_id = AgentIdOf::convert_location(&legacy_location).unwrap(); - assert_eq!( - legacy_agent_id, - hex!("72456f48efed08af20e5b317abf8648ac66e86bb90a411d9b0b713f7364b75b4").into() - ); - let location: Location = Location::new(1, [Parachain(1000)]); - let agent_id = AgentIdOf::convert_location(&location).unwrap(); - assert_eq!( - agent_id, - hex!("81c5ab2571199e3188135178f3c2c8e2d268be1313d029b30f534fa579b69b79").into() - ) -} - -#[test] -fn test_describe_here() { - let location: Location = Location::new(0, []); - let agent_id = AgentIdOf::convert_location(&location).unwrap(); - assert_eq!( - agent_id, - hex!("03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314").into() - ) -} diff --git a/snowbridge/parachain/runtime/runtime-common/Cargo.toml b/snowbridge/parachain/runtime/runtime-common/Cargo.toml deleted file mode 100644 index b81c5d496e8..00000000000 --- a/snowbridge/parachain/runtime/runtime-common/Cargo.toml +++ /dev/null @@ -1,46 +0,0 @@ -[package] -name = "snowbridge-runtime-common" -description = "Snowbridge Runtime Common" -version = "0.9.0" -authors = ["Snowfork "] -edition.workspace = true -repository.workspace = true -license = "Apache-2.0" -categories = ["cryptography::cryptocurrencies"] - -[lints] -workspace = true - -[dependencies] -log = { version = "0.4.20", default-features = false } - -frame-support = { path = "../../../../../substrate/frame/support", default-features = false } -frame-system = { path = "../../../../../substrate/frame/system", default-features = false } -sp-arithmetic = { path = "../../../../../substrate/primitives/arithmetic", default-features = false } -xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } -xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false } -xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false } - -snowbridge-core = { path = "../../primitives/core", default-features = false } - -[dev-dependencies] - -[features] -default = ["std"] -std = [ - "frame-support/std", - "frame-system/std", - "log/std", - "snowbridge-core/std", - "sp-arithmetic/std", - "xcm-builder/std", - "xcm-executor/std", - "xcm/std", -] -runtime-benchmarks = [ - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "snowbridge-core/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", - "xcm-executor/runtime-benchmarks", -] diff --git a/snowbridge/parachain/runtime/runtime-common/README.md b/snowbridge/parachain/runtime/runtime-common/README.md deleted file mode 100644 index 57d178ea2d2..00000000000 --- a/snowbridge/parachain/runtime/runtime-common/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Snowbridge Runtime Common - -Common crate to contain runtime related structs and implementations for Snowbridge. diff --git a/snowbridge/parachain/runtime/runtime-common/src/lib.rs b/snowbridge/parachain/runtime/runtime-common/src/lib.rs deleted file mode 100644 index 1a9b704f356..00000000000 --- a/snowbridge/parachain/runtime/runtime-common/src/lib.rs +++ /dev/null @@ -1,124 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork -//! # Runtime Common -//! -//! Common traits and types shared by runtimes. -#![cfg_attr(not(feature = "std"), no_std)] - -use core::marker::PhantomData; -use frame_support::traits::Get; -use snowbridge_core::{outbound::SendMessageFeeProvider, sibling_sovereign_account_raw}; -use sp_arithmetic::traits::{BaseArithmetic, Unsigned}; -use xcm::prelude::*; -use xcm_builder::{deposit_or_burn_fee, HandleFee}; -use xcm_executor::traits::{FeeReason, TransactAsset}; - -/// A `HandleFee` implementation that takes fees from `ExportMessage` XCM instructions -/// to Snowbridge and splits off the remote fee and deposits it to the origin -/// parachain sovereign account. The local fee is then returned back to be handled by -/// the next fee handler in the chain. Most likely the treasury account. -pub struct XcmExportFeeToSibling< - Balance, - AccountId, - FeeAssetLocation, - EthereumNetwork, - AssetTransactor, - FeeProvider, ->( - PhantomData<( - Balance, - AccountId, - FeeAssetLocation, - EthereumNetwork, - AssetTransactor, - FeeProvider, - )>, -); - -impl HandleFee - for XcmExportFeeToSibling< - Balance, - AccountId, - FeeAssetLocation, - EthereumNetwork, - AssetTransactor, - FeeProvider, - > where - Balance: BaseArithmetic + Unsigned + Copy + From + Into, - AccountId: Clone + Into<[u8; 32]> + From<[u8; 32]>, - FeeAssetLocation: Get, - EthereumNetwork: Get, - AssetTransactor: TransactAsset, - FeeProvider: SendMessageFeeProvider, -{ - fn handle_fee(fees: Assets, context: Option<&XcmContext>, reason: FeeReason) -> Assets { - let token_location = FeeAssetLocation::get(); - - // Check the reason to see if this export is for snowbridge. - if !matches!( - reason, - FeeReason::Export { network: bridged_network, ref destination } - if bridged_network == EthereumNetwork::get() && destination == &Here - ) { - return fees - } - - // Get the parachain sovereign from the `context`. - let para_sovereign = - if let Some(XcmContext { origin: Some(Location { parents: 1, interior }), .. }) = - context - { - if let Some(Parachain(sibling_para_id)) = interior.first() { - let account: AccountId = - sibling_sovereign_account_raw((*sibling_para_id).into()).into(); - account - } else { - return fees - } - } else { - return fees - }; - - // Get the total fee offered by export message. - let maybe_total_supplied_fee: Option<(usize, Balance)> = fees - .inner() - .iter() - .enumerate() - .filter_map(|(index, asset)| { - if let Asset { id: location, fun: Fungible(amount) } = asset { - if location.0 == token_location { - return Some((index, (*amount).into())) - } - } - None - }) - .next(); - - if let Some((fee_index, total_fee)) = maybe_total_supplied_fee { - let remote_fee = total_fee.saturating_sub(FeeProvider::local_fee()); - if remote_fee > (0u128).into() { - // Refund remote component of fee to physical origin - deposit_or_burn_fee::( - Asset { id: AssetId(token_location.clone()), fun: Fungible(remote_fee.into()) } - .into(), - context, - para_sovereign, - ); - // Return remaining fee to the next fee handler in the chain. - let mut modified_fees = fees.inner().clone(); - modified_fees.remove(fee_index); - modified_fees.push(Asset { - id: AssetId(token_location), - fun: Fungible((total_fee - remote_fee).into()), - }); - return modified_fees.into() - } - } - - log::info!( - target: "xcm::fees", - "XcmExportFeeToSibling skipped: {fees:?}, context: {context:?}, reason: {reason:?}", - ); - fees - } -} diff --git a/snowbridge/parachain/runtime/test-common/Cargo.toml b/snowbridge/parachain/runtime/test-common/Cargo.toml deleted file mode 100644 index ae72de406fc..00000000000 --- a/snowbridge/parachain/runtime/test-common/Cargo.toml +++ /dev/null @@ -1,199 +0,0 @@ -[package] -name = "snowbridge-runtime-test-common" -description = "Snowbridge Runtime Tests" -version = "0.9.0" -authors = ["Snowfork "] -edition = "2021" -license = "Apache-2.0" -categories = ["cryptography::cryptocurrencies"] - -[lints] -workspace = true - -[dependencies] -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -hex-literal = { version = "0.4.1" } -log = { version = "0.4.20", default-features = false } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.195", optional = true, features = ["derive"] } -smallvec = "1.11.0" - -# Substrate -frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking", default-features = false, optional = true } -frame-executive = { path = "../../../../../substrate/frame/executive", default-features = false } -frame-support = { path = "../../../../../substrate/frame/support", default-features = false } -frame-system = { path = "../../../../../substrate/frame/system", default-features = false } -frame-system-benchmarking = { path = "../../../../../substrate/frame/system/benchmarking", default-features = false, optional = true } -frame-system-rpc-runtime-api = { path = "../../../../../substrate/frame/system/rpc/runtime-api", default-features = false } -frame-try-runtime = { path = "../../../../../substrate/frame/try-runtime", default-features = false, optional = true } -pallet-aura = { path = "../../../../../substrate/frame/aura", default-features = false } -pallet-authorship = { path = "../../../../../substrate/frame/authorship", default-features = false } -pallet-balances = { path = "../../../../../substrate/frame/balances", default-features = false } -pallet-session = { path = "../../../../../substrate/frame/session", default-features = false } -pallet-multisig = { path = "../../../../../substrate/frame/multisig", default-features = false } -pallet-message-queue = { path = "../../../../../substrate/frame/message-queue", default-features = false } -pallet-timestamp = { path = "../../../../../substrate/frame/timestamp", default-features = false } -pallet-transaction-payment = { path = "../../../../../substrate/frame/transaction-payment", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { path = "../../../../../substrate/frame/transaction-payment/rpc/runtime-api", default-features = false } -pallet-utility = { path = "../../../../../substrate/frame/utility", default-features = false } -sp-api = { path = "../../../../../substrate/primitives/api", default-features = false } -sp-block-builder = { path = "../../../../../substrate/primitives/block-builder", default-features = false } -sp-consensus-aura = { path = "../../../../../substrate/primitives/consensus/aura", default-features = false } -sp-core = { path = "../../../../../substrate/primitives/core", default-features = false } -sp-genesis-builder = { path = "../../../../../substrate/primitives/genesis-builder", default-features = false } -sp-inherents = { path = "../../../../../substrate/primitives/inherents", default-features = false } -sp-io = { path = "../../../../../substrate/primitives/io", default-features = false } -sp-offchain = { path = "../../../../../substrate/primitives/offchain", default-features = false } -sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false } -sp-session = { path = "../../../../../substrate/primitives/session", default-features = false } -sp-std = { path = "../../../../../substrate/primitives/std", default-features = false } -sp-storage = { path = "../../../../../substrate/primitives/storage", default-features = false } -sp-transaction-pool = { path = "../../../../../substrate/primitives/transaction-pool", default-features = false } -sp-version = { path = "../../../../../substrate/primitives/version", default-features = false } - -# Polkadot -pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false } -pallet-xcm-benchmarks = { path = "../../../../../polkadot/xcm/pallet-xcm-benchmarks", default-features = false, optional = true } -polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false } -polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false } -polkadot-runtime-common = { path = "../../../../../polkadot/runtime/common", default-features = false } -xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false } -xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false } -xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false } - -# Cumulus -cumulus-pallet-aura-ext = { path = "../../../../../cumulus/pallets/aura-ext", default-features = false } -cumulus-pallet-dmp-queue = { path = "../../../../../cumulus/pallets/dmp-queue", default-features = false } -cumulus-pallet-parachain-system = { path = "../../../../../cumulus/pallets/parachain-system", default-features = false, features = ["parameterized-consensus-hook"] } -cumulus-pallet-session-benchmarking = { path = "../../../../../cumulus/pallets/session-benchmarking", default-features = false } -cumulus-pallet-xcm = { path = "../../../../../cumulus/pallets/xcm", default-features = false } -cumulus-pallet-xcmp-queue = { path = "../../../../../cumulus/pallets/xcmp-queue", default-features = false, features = ["bridging"] } -cumulus-primitives-core = { path = "../../../../../cumulus/primitives/core", default-features = false } -cumulus-primitives-utility = { path = "../../../../../cumulus/primitives/utility", default-features = false } -pallet-collator-selection = { path = "../../../../../cumulus/pallets/collator-selection", default-features = false } -parachain-info = { package = "staging-parachain-info", path = "../../../../../cumulus/parachains/pallets/parachain-info", default-features = false } -parachains-common = { path = "../../../../../cumulus/parachains/common", default-features = false } -parachains-runtimes-test-utils = { path = "../../../../../cumulus/parachains/runtimes/test-utils", default-features = false } -assets-common = { path = "../../../../../cumulus/parachains/runtimes/assets/common", default-features = false } - -# Ethereum Bridge (Snowbridge) -snowbridge-core = { path = "../../primitives/core", default-features = false } -snowbridge-beacon-primitives = { path = "../../primitives/beacon", default-features = false } -snowbridge-router-primitives = { path = "../../primitives/router", default-features = false } -snowbridge-pallet-ethereum-client = { path = "../../pallets/ethereum-client", default-features = false } -snowbridge-pallet-inbound-queue = { path = "../../pallets/inbound-queue", default-features = false } -snowbridge-pallet-outbound-queue = { path = "../../pallets/outbound-queue", default-features = false } -snowbridge-outbound-queue-runtime-api = { path = "../../pallets/outbound-queue/runtime-api", default-features = false } -snowbridge-pallet-system = { path = "../../pallets/system", default-features = false } -snowbridge-system-runtime-api = { path = "../../pallets/system/runtime-api", default-features = false } - -[dev-dependencies] -static_assertions = "1.1" -bridge-hub-test-utils = { path = "../../../../../cumulus/parachains/runtimes/bridge-hubs/test-utils" } -bridge-runtime-common = { path = "../../../../../bridges/bin/runtime-common", features = ["integrity-test"] } -sp-keyring = { path = "../../../../../substrate/primitives/keyring" } - -[features] -default = ["std"] -std = [ - "assets-common/std", - "codec/std", - "cumulus-pallet-aura-ext/std", - "cumulus-pallet-dmp-queue/std", - "cumulus-pallet-parachain-system/std", - "cumulus-pallet-session-benchmarking/std", - "cumulus-pallet-xcm/std", - "cumulus-pallet-xcmp-queue/std", - "cumulus-primitives-core/std", - "cumulus-primitives-utility/std", - "frame-benchmarking/std", - "frame-executive/std", - "frame-support/std", - "frame-system-benchmarking?/std", - "frame-system-rpc-runtime-api/std", - "frame-system/std", - "frame-try-runtime?/std", - "log/std", - "pallet-aura/std", - "pallet-authorship/std", - "pallet-balances/std", - "pallet-collator-selection/std", - "pallet-message-queue/std", - "pallet-multisig/std", - "pallet-session/std", - "pallet-timestamp/std", - "pallet-transaction-payment-rpc-runtime-api/std", - "pallet-transaction-payment/std", - "pallet-utility/std", - "pallet-xcm-benchmarks?/std", - "pallet-xcm/std", - "parachain-info/std", - "parachains-common/std", - "parachains-runtimes-test-utils/std", - "polkadot-core-primitives/std", - "polkadot-parachain-primitives/std", - "polkadot-runtime-common/std", - "scale-info/std", - "serde", - "snowbridge-beacon-primitives/std", - "snowbridge-core/std", - "snowbridge-outbound-queue-runtime-api/std", - "snowbridge-pallet-ethereum-client/std", - "snowbridge-pallet-inbound-queue/std", - "snowbridge-pallet-outbound-queue/std", - "snowbridge-pallet-system/std", - "snowbridge-router-primitives/std", - "snowbridge-system-runtime-api/std", - "sp-api/std", - "sp-block-builder/std", - "sp-consensus-aura/std", - "sp-core/std", - "sp-genesis-builder/std", - "sp-inherents/std", - "sp-io/std", - "sp-offchain/std", - "sp-runtime/std", - "sp-session/std", - "sp-std/std", - "sp-storage/std", - "sp-transaction-pool/std", - "sp-version/std", - "xcm-builder/std", - "xcm-executor/std", - "xcm/std", -] - -runtime-benchmarks = [ - "assets-common/runtime-benchmarks", - "bridge-runtime-common/runtime-benchmarks", - "cumulus-pallet-dmp-queue/runtime-benchmarks", - "cumulus-pallet-parachain-system/runtime-benchmarks", - "cumulus-pallet-session-benchmarking/runtime-benchmarks", - "cumulus-pallet-xcmp-queue/runtime-benchmarks", - "cumulus-primitives-core/runtime-benchmarks", - "cumulus-primitives-utility/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system-benchmarking/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-collator-selection/runtime-benchmarks", - "pallet-message-queue/runtime-benchmarks", - "pallet-multisig/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks", - "pallet-utility/runtime-benchmarks", - "pallet-xcm-benchmarks/runtime-benchmarks", - "pallet-xcm/runtime-benchmarks", - "parachains-common/runtime-benchmarks", - "polkadot-parachain-primitives/runtime-benchmarks", - "polkadot-runtime-common/runtime-benchmarks", - "snowbridge-core/runtime-benchmarks", - "snowbridge-pallet-ethereum-client/runtime-benchmarks", - "snowbridge-pallet-inbound-queue/runtime-benchmarks", - "snowbridge-pallet-outbound-queue/runtime-benchmarks", - "snowbridge-pallet-system/runtime-benchmarks", - "snowbridge-router-primitives/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", - "xcm-executor/runtime-benchmarks", -] diff --git a/snowbridge/parachain/runtime/test-common/README.md b/snowbridge/parachain/runtime/test-common/README.md deleted file mode 100644 index d582f87142b..00000000000 --- a/snowbridge/parachain/runtime/test-common/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Runtime Tests - -Tests runtime config and bridge functionality in the boundaries of a runtime. diff --git a/snowbridge/parachain/runtime/test-common/src/lib.rs b/snowbridge/parachain/runtime/test-common/src/lib.rs deleted file mode 100644 index 7935a779523..00000000000 --- a/snowbridge/parachain/runtime/test-common/src/lib.rs +++ /dev/null @@ -1,291 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2023 Snowfork - -use codec::Encode; -use frame_support::{assert_err, assert_ok, traits::fungible::Mutate}; -pub use parachains_runtimes_test_utils::test_cases::change_storage_constant_by_governance_works; -use parachains_runtimes_test_utils::{ - AccountIdOf, BalanceOf, CollatorSessionKeys, ExtBuilder, ValidatorIdOf, XcmReceivedFrom, -}; -use sp_core::H160; -use sp_runtime::SaturatedConversion; -use xcm::{ - latest::prelude::*, - v3::Error::{self, Barrier}, -}; -use xcm_executor::XcmExecutor; - -type RuntimeHelper = - parachains_runtimes_test_utils::RuntimeHelper; - -pub fn initial_fund(assethub_parachain_id: u32, initial_amount: u128) -where - Runtime: frame_system::Config + pallet_balances::Config, -{ - // fund asset hub sovereign account enough so it can pay fees - let asset_hub_sovereign_account = - snowbridge_core::sibling_sovereign_account::(assethub_parachain_id.into()); - >::mint_into( - &asset_hub_sovereign_account, - initial_amount.saturated_into::>(), - ) - .unwrap(); -} - -pub fn send_transfer_token_message( - assethub_parachain_id: u32, - weth_contract_address: H160, - destination_address: H160, - fee_amount: u128, -) -> Outcome -where - Runtime: frame_system::Config - + pallet_balances::Config - + pallet_session::Config - + pallet_xcm::Config - + parachain_info::Config - + pallet_collator_selection::Config - + cumulus_pallet_parachain_system::Config - + snowbridge_pallet_outbound_queue::Config, - XcmConfig: xcm_executor::Config, -{ - let assethub_parachain_location = Location::new(1, Parachain(assethub_parachain_id)); - let asset = Asset { - id: AssetId(Location::new( - 0, - [AccountKey20 { network: None, key: weth_contract_address.into() }], - )), - fun: Fungible(1000000000), - }; - let assets = vec![asset.clone()]; - - let inner_xcm = Xcm(vec![ - WithdrawAsset(Assets::from(assets.clone())), - ClearOrigin, - BuyExecution { fees: asset, weight_limit: Unlimited }, - DepositAsset { - assets: Wild(All), - beneficiary: Location::new( - 0, - [AccountKey20 { network: None, key: destination_address.into() }], - ), - }, - SetTopic([0; 32]), - ]); - - let fee = - Asset { id: AssetId(Location { parents: 1, interior: Here }), fun: Fungible(fee_amount) }; - - // prepare transfer token message - let xcm = Xcm(vec![ - WithdrawAsset(Assets::from(vec![fee.clone()])), - BuyExecution { fees: fee, weight_limit: Unlimited }, - ExportMessage { - network: Ethereum { chain_id: 11155111 }, - destination: Here, - xcm: inner_xcm, - }, - ]); - - // execute XCM - let mut hash = xcm.using_encoded(sp_io::hashing::blake2_256); - XcmExecutor::::prepare_and_execute( - assethub_parachain_location, - xcm, - &mut hash, - RuntimeHelper::::xcm_max_weight(XcmReceivedFrom::Sibling), - Weight::zero(), - ) -} - -pub fn send_transfer_token_message_success( - collator_session_key: CollatorSessionKeys, - runtime_para_id: u32, - assethub_parachain_id: u32, - weth_contract_address: H160, - destination_address: H160, - fee_amount: u128, - snowbridge_pallet_outbound_queue: Box< - dyn Fn(Vec) -> Option>, - >, -) where - Runtime: frame_system::Config - + pallet_balances::Config - + pallet_session::Config - + pallet_xcm::Config - + parachain_info::Config - + pallet_collator_selection::Config - + cumulus_pallet_parachain_system::Config - + snowbridge_pallet_outbound_queue::Config - + snowbridge_pallet_system::Config, - XcmConfig: xcm_executor::Config, - ValidatorIdOf: From>, -{ - ExtBuilder::::default() - .with_collators(collator_session_key.collators()) - .with_session_keys(collator_session_key.session_keys()) - .with_para_id(runtime_para_id.into()) - .with_tracing() - .build() - .execute_with(|| { - >::initialize( - runtime_para_id.into(), - assethub_parachain_id.into(), - ) - .unwrap(); - - // fund asset hub sovereign account enough so it can pay fees - initial_fund::(assethub_parachain_id, 5_000_000_000_000); - - let outcome = send_transfer_token_message::( - assethub_parachain_id, - weth_contract_address, - destination_address, - fee_amount, - ); - - assert_ok!(outcome.ensure_complete()); - - // check events - let mut events = >::events() - .into_iter() - .filter_map(|e| snowbridge_pallet_outbound_queue(e.event.encode())); - assert!(events.any(|e| matches!( - e, - snowbridge_pallet_outbound_queue::Event::MessageQueued { .. } - ))); - }); -} - -pub fn send_unpaid_transfer_token_message( - collator_session_key: CollatorSessionKeys, - runtime_para_id: u32, - assethub_parachain_id: u32, - weth_contract_address: H160, - destination_contract: H160, -) where - Runtime: frame_system::Config - + pallet_balances::Config - + pallet_session::Config - + pallet_xcm::Config - + parachain_info::Config - + pallet_collator_selection::Config - + cumulus_pallet_parachain_system::Config - + snowbridge_pallet_outbound_queue::Config, - XcmConfig: xcm_executor::Config, - ValidatorIdOf: From>, -{ - let assethub_parachain_location = Location::new(1, Parachain(assethub_parachain_id)); - - ExtBuilder::::default() - .with_collators(collator_session_key.collators()) - .with_session_keys(collator_session_key.session_keys()) - .with_para_id(runtime_para_id.into()) - .with_tracing() - .build() - .execute_with(|| { - let asset_hub_sovereign_account = - snowbridge_core::sibling_sovereign_account::(assethub_parachain_id.into()); - - >::mint_into( - &asset_hub_sovereign_account, - 4000000000u32.into(), - ) - .unwrap(); - - let asset = Asset { - id: AssetId(Location::new( - 0, - [AccountKey20 { network: None, key: weth_contract_address.into() }], - )), - fun: Fungible(1000000000), - }; - let assets = vec![asset.clone()]; - - let inner_xcm = Xcm(vec![ - WithdrawAsset(Assets::from(assets.clone())), - ClearOrigin, - BuyExecution { fees: asset, weight_limit: Unlimited }, - DepositAsset { - assets: Wild(AllCounted(1)), - beneficiary: Location::new( - 0, - [AccountKey20 { network: None, key: destination_contract.into() }], - ), - }, - SetTopic([0; 32]), - ]); - - // prepare transfer token message - let xcm = Xcm(vec![ - UnpaidExecution { weight_limit: Unlimited, check_origin: None }, - ExportMessage { - network: Ethereum { chain_id: 11155111 }, - destination: Here, - xcm: inner_xcm, - }, - ]); - - // execute XCM - let mut hash = xcm.using_encoded(sp_io::hashing::blake2_256); - let outcome = XcmExecutor::::prepare_and_execute( - assethub_parachain_location, - xcm, - &mut hash, - RuntimeHelper::::xcm_max_weight(XcmReceivedFrom::Sibling), - Weight::zero(), - ); - // check error is barrier - assert_err!(outcome.ensure_complete(), Barrier); - }); -} - -#[allow(clippy::too_many_arguments)] -pub fn send_transfer_token_message_failure( - collator_session_key: CollatorSessionKeys, - runtime_para_id: u32, - assethub_parachain_id: u32, - initial_amount: u128, - weth_contract_address: H160, - destination_address: H160, - fee_amount: u128, - expected_error: Error, -) where - Runtime: frame_system::Config - + pallet_balances::Config - + pallet_session::Config - + pallet_xcm::Config - + parachain_info::Config - + pallet_collator_selection::Config - + cumulus_pallet_parachain_system::Config - + snowbridge_pallet_outbound_queue::Config - + snowbridge_pallet_system::Config, - XcmConfig: xcm_executor::Config, - ValidatorIdOf: From>, -{ - ExtBuilder::::default() - .with_collators(collator_session_key.collators()) - .with_session_keys(collator_session_key.session_keys()) - .with_para_id(runtime_para_id.into()) - .with_tracing() - .build() - .execute_with(|| { - >::initialize( - runtime_para_id.into(), - assethub_parachain_id.into(), - ) - .unwrap(); - - // fund asset hub sovereign account enough so it can pay fees - initial_fund::(assethub_parachain_id, initial_amount); - - let outcome = send_transfer_token_message::( - assethub_parachain_id, - weth_contract_address, - destination_address, - fee_amount, - ); - // check err is NotHoldingFees - assert_err!(outcome.ensure_complete(), expected_error); - }); -} diff --git a/snowbridge/parachain/scripts/benchmark.sh b/snowbridge/parachain/scripts/benchmark.sh deleted file mode 100755 index c9a561b33c4..00000000000 --- a/snowbridge/parachain/scripts/benchmark.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -# Example command for updating pallet benchmarking -pushd ../cumulus -cargo run --release --bin polkadot-parachain \ ---features runtime-benchmarks \ --- \ -benchmark pallet \ ---chain=bridge-hub-rococo-dev \ ---pallet=snowbridge_pallet_ethereum_client \ ---extrinsic="*" \ ---execution=wasm --wasm-execution=compiled \ ---steps 50 --repeat 20 \ ---output ./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs -popd diff --git a/snowbridge/parachain/scripts/hexliteral.sh b/snowbridge/parachain/scripts/hexliteral.sh deleted file mode 100755 index e34a2b9b515..00000000000 --- a/snowbridge/parachain/scripts/hexliteral.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# Creates a string constant from STDIN -echo "const DATA: &'static str = concat!(" -cat - | fold | sed 's/^.*/\t"&",/' -echo ");" \ No newline at end of file diff --git a/snowbridge/parachain/scripts/init.sh b/snowbridge/parachain/scripts/init.sh deleted file mode 100755 index 1405a41ef33..00000000000 --- a/snowbridge/parachain/scripts/init.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e - -echo "*** Initializing WASM build environment" - -if [ -z $CI_PROJECT_NAME ] ; then - rustup update nightly - rustup update stable -fi - -rustup target add wasm32-unknown-unknown --toolchain nightly diff --git a/snowbridge/parachain/scripts/make-build-config.sh b/snowbridge/parachain/scripts/make-build-config.sh deleted file mode 100755 index a1b116a5dd0..00000000000 --- a/snowbridge/parachain/scripts/make-build-config.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -cd ../ethereum - -truffle exec scripts/dumpParachainConfig.js | sed '/^Using/d;/^$/d' diff --git a/snowbridge/parachain/scripts/verify-pallets-build.sh b/snowbridge/parachain/scripts/verify-pallets-build.sh deleted file mode 100755 index a62f48c84d4..00000000000 --- a/snowbridge/parachain/scripts/verify-pallets-build.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash - -# A script to remove everything from snowbridge repository/subtree, except: -# -# - parachain -# - readme -# - license - -set -eu - -# show CLI help -function show_help() { - set +x - echo " " - echo Error: $1 - echo "Usage:" - echo " ./scripts/verify-pallets-build.sh Exit with code 0 if pallets code is well decoupled from the other code in the repo" - echo "Options:" - echo " --no-revert Leaves only runtime code on exit" - echo " --ignore-git-state Ignores git actual state" - exit 1 -} - -# parse CLI args -NO_REVERT= -IGNORE_GIT_STATE= -for i in "$@" -do - case $i in - --no-revert) - NO_REVERT=true - shift - ;; - --ignore-git-state) - IGNORE_GIT_STATE=true - shift - ;; - *) - show_help "Unknown option: $i" - ;; - esac -done - -# the script is able to work only on clean git copy, unless we want to ignore this check -[[ ! -z "${IGNORE_GIT_STATE}" ]] || [[ -z "$(git status --porcelain)" ]] || { echo >&2 "The git copy must be clean"; exit 1; } - -# let's avoid any restrictions on where this script can be called for - snowbridge repo may be -# plugged into any other repo folder. So the script (and other stuff that needs to be removed) -# may be located either in call dir, or one of it subdirs. -SNOWBRIDGE_FOLDER="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/../.." - -# remove everything we think is not required for our needs -rm -rf $SNOWBRIDGE_FOLDER/.cargo -rm -rf $SNOWBRIDGE_FOLDER/.github -rm -rf $SNOWBRIDGE_FOLDER/contracts -rm -rf $SNOWBRIDGE_FOLDER/codecov.yml -rm -rf $SNOWBRIDGE_FOLDER/docs -rm -rf $SNOWBRIDGE_FOLDER/hooks -rm -rf $SNOWBRIDGE_FOLDER/relayer -rm -rf $SNOWBRIDGE_FOLDER/scripts -rm -rf $SNOWBRIDGE_FOLDER/SECURITY.md -rm -rf $SNOWBRIDGE_FOLDER/smoketest -rm -rf $SNOWBRIDGE_FOLDER/web -rm -rf $SNOWBRIDGE_FOLDER/.envrc-example -rm -rf $SNOWBRIDGE_FOLDER/.gitbook.yaml -rm -rf $SNOWBRIDGE_FOLDER/.gitignore -rm -rf $SNOWBRIDGE_FOLDER/.gitmodules -rm -rf $SNOWBRIDGE_FOLDER/_typos.toml -rm -rf $SNOWBRIDGE_FOLDER/_codecov.yml -rm -rf $SNOWBRIDGE_FOLDER/flake.lock -rm -rf $SNOWBRIDGE_FOLDER/flake.nix -rm -rf $SNOWBRIDGE_FOLDER/go.work -rm -rf $SNOWBRIDGE_FOLDER/go.work.sum -rm -rf $SNOWBRIDGE_FOLDER/polkadot-sdk -rm -rf $SNOWBRIDGE_FOLDER/rust-toolchain.toml -rm -rf $SNOWBRIDGE_FOLDER/parachain/rustfmt.toml -rm -rf $SNOWBRIDGE_FOLDER/parachain/.gitignore -rm -rf $SNOWBRIDGE_FOLDER/parachain/templates -rm -rf $SNOWBRIDGE_FOLDER/parachain/.cargo -rm -rf $SNOWBRIDGE_FOLDER/parachain/.config -rm -rf $SNOWBRIDGE_FOLDER/parachain/pallets/ethereum-client/fuzz - -cd bridges/snowbridge/parachain - -# fix polkadot-sdk paths in Cargo.toml files -find "." -name 'Cargo.toml' | while read -r file; do - replace=$(printf '../../' ) - if [[ "$(uname)" = "Darwin" ]] || [[ "$(uname)" = *BSD ]]; then - sed -i '' "s|polkadot-sdk/|$replace|g" "$file" - else - sed -i "s|polkadot-sdk/|$replace|g" "$file" - fi -done - -# let's test if everything we need compiles -cargo check -p snowbridge-pallet-ethereum-client -cargo check -p snowbridge-pallet-ethereum-client --features runtime-benchmarks -cargo check -p snowbridge-pallet-ethereum-client --features try-runtime -cargo check -p snowbridge-pallet-inbound-queue -cargo check -p snowbridge-pallet-inbound-queue --features runtime-benchmarks -cargo check -p snowbridge-pallet-inbound-queue --features try-runtime -cargo check -p snowbridge-pallet-outbound-queue -cargo check -p snowbridge-pallet-outbound-queue --features runtime-benchmarks -cargo check -p snowbridge-pallet-outbound-queue --features try-runtime -cargo check -p snowbridge-pallet-system -cargo check -p snowbridge-pallet-system --features runtime-benchmarks -cargo check -p snowbridge-pallet-system --features try-runtime - -cd - - -# we're removing lock file after all checks are done. Otherwise we may use different -# Substrate/Polkadot/Cumulus commits and our checks will fail -rm -f $SNOWBRIDGE_FOLDER/parachain/Cargo.toml -rm -f $SNOWBRIDGE_FOLDER/parachain/Cargo.lock - -echo "OK" From 20c311f410cfe1b13b918cd64ad894bb30b880ea Mon Sep 17 00:00:00 2001 From: Muharem Date: Thu, 18 Jan 2024 22:04:13 +0800 Subject: [PATCH 15/15] Westend/Rococo Asset Hub: pay xcm fees with sufficient assets (#2978) Set up the `TakeFirstAssetTrader` trader for Westend and Rococo Asset Hubs to cover XCM fees with sufficient assets. This PR reintroduces previously [removed](https://github.com/paritytech/polkadot-sdk/pull/1845) trader setups, as it was decided to keep both traders, `TakeFirstAssetTrader` and `SwapFirstAssetTrader`, during the transition period. --------- Co-authored-by: Svyatoslav Nikolsky --- .../tests/0001-asset-transfer-works-rococo-to-westend.zndsl | 4 ++-- .../tests/0001-asset-transfer-works-westend-to-rococo.zndsl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zombienet/tests/0001-asset-transfer-works-rococo-to-westend.zndsl b/zombienet/tests/0001-asset-transfer-works-rococo-to-westend.zndsl index a61f1e039f4..fe7dc26b001 100644 --- a/zombienet/tests/0001-asset-transfer-works-rococo-to-westend.zndsl +++ b/zombienet/tests/0001-asset-transfer-works-rococo-to-westend.zndsl @@ -14,7 +14,7 @@ bridge-hub-westend-collator1: js-script ../helpers/best-finalized-header-at-brid # step 4: send WND to //Alice on Rococo AH # (that's a required part of a sibling 0001-asset-transfer-works-westend-to-rococo.zndsl test) -asset-hub-westend-collator1: run ../scripts/invoke-script.sh with "reserve-transfer-assets-from-asset-hub-westend-local" within 60 seconds +asset-hub-westend-collator1: run ../scripts/invoke-script.sh with "reserve-transfer-assets-from-asset-hub-westend-local" within 120 seconds # step 5: elsewhere Rococo has sent ROC to //Alice - let's wait for it asset-hub-westend-collator1: js-script ../helpers/wrapped-assets-balance.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,0,Rococo" within 600 seconds @@ -24,7 +24,7 @@ bridge-hub-westend-collator1: js-script ../helpers/relayer-rewards.js with "5FLS bridge-hub-westend-collator1: js-script ../helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000002,0x6268726F,ThisChain,0" within 300 seconds # step 7: send wROC back to Alice at Rococo AH -asset-hub-westend-collator1: run ../scripts/invoke-script.sh with "withdraw-reserve-assets-from-asset-hub-westend-local" within 60 seconds +asset-hub-westend-collator1: run ../scripts/invoke-script.sh with "withdraw-reserve-assets-from-asset-hub-westend-local" within 120 seconds # step 8: elsewhere Rococo has sent wWND to //Alice - let's wait for it # (we wait until //Alice account increases here - there are no other transactionc that may increase it) diff --git a/zombienet/tests/0001-asset-transfer-works-westend-to-rococo.zndsl b/zombienet/tests/0001-asset-transfer-works-westend-to-rococo.zndsl index 2da5b7a772a..610b4ca7acd 100644 --- a/zombienet/tests/0001-asset-transfer-works-westend-to-rococo.zndsl +++ b/zombienet/tests/0001-asset-transfer-works-westend-to-rococo.zndsl @@ -14,7 +14,7 @@ bridge-hub-rococo-collator1: js-script ../helpers/best-finalized-header-at-bridg # step 4: send ROC to //Alice on Westend AH # (that's a required part of a sibling 0001-asset-transfer-works-rococo-to-westend.zndsl test) -asset-hub-rococo-collator1: run ../scripts/invoke-script.sh with "reserve-transfer-assets-from-asset-hub-rococo-local" within 60 seconds +asset-hub-rococo-collator1: run ../scripts/invoke-script.sh with "reserve-transfer-assets-from-asset-hub-rococo-local" within 120 seconds # step 5: elsewhere Westend has sent WND to //Alice - let's wait for it asset-hub-rococo-collator1: js-script ../helpers/wrapped-assets-balance.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,0,Westend" within 600 seconds @@ -24,7 +24,7 @@ bridge-hub-rococo-collator1: js-script ../helpers/relayer-rewards.js with "5FLSi bridge-hub-rococo-collator1: js-script ../helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000002,0x62687764,ThisChain,0" within 300 seconds # step 7: send wWND back to Alice at Westend AH -asset-hub-rococo-collator1: run ../scripts/invoke-script.sh with "withdraw-reserve-assets-from-asset-hub-rococo-local" within 60 seconds +asset-hub-rococo-collator1: run ../scripts/invoke-script.sh with "withdraw-reserve-assets-from-asset-hub-rococo-local" within 120 seconds # step 8: elsewhere Westend has sent wROC to //Alice - let's wait for it # (we wait until //Alice account increases here - there are no other transactionc that may increase it)
Release notes

Sourced from serde's releases.

v1.0.194

  • Update proc-macro2 to fix caching issue when using a rustc-wrapper such as sccache